From 72908b7de9054ee0d8277373173cb05f61c7133f Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 23 Jun 2023 13:17:27 +1000 Subject: [PATCH 01/10] feat: add typescript support --- .github/workflows/ci.yml | 1 + package-lock.json | 1592 ++++++++++++++++++++++++++++ package.json | 6 +- types/index.d.ts | 2010 +++++++++++++++++++++++++++++++++++ types/node.d.ts | 3 + types/react-native.d.ts | 3 + types/tests.ts | 2175 ++++++++++++++++++++++++++++++++++++++ types/tsconfig.json | 26 + types/tslint.json | 8 + 9 files changed, 5823 insertions(+), 1 deletion(-) create mode 100644 types/index.d.ts create mode 100644 types/node.d.ts create mode 100644 types/react-native.d.ts create mode 100644 types/tests.ts create mode 100644 types/tsconfig.json create mode 100644 types/tslint.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74ef1f029..3923740a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,7 @@ jobs: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}- - run: npm ci - run: npm run lint + - run: npm run test:types - run: npm test -- --maxWorkers=4 - run: npm run test:mongodb env: diff --git a/package-lock.json b/package-lock.json index 86db573b9..1860eb606 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,6 +41,7 @@ "codecov": "3.8.3", "core-js": "3.30.2", "cross-env": "7.0.2", + "dtslint": "4.1.3", "eslint": "8.40.0", "eslint-plugin-flowtype": "8.0.3", "eslint-plugin-jsdoc": "43.0.7", @@ -2215,6 +2216,77 @@ "kuler": "^2.0.0" } }, + "node_modules/@definitelytyped/header-parser": { + "version": "0.0.163", + "resolved": "https://registry.npmjs.org/@definitelytyped/header-parser/-/header-parser-0.0.163.tgz", + "integrity": "sha512-Jr+/q+ESfc7uWldz/j11BfpjIN/gB4WmwhFENhWaMwM0W/9p0ShF+OiUqGhk2Q3Iz8v/oyWzSsxyxgasg9kCxQ==", + "dev": true, + "dependencies": { + "@definitelytyped/typescript-versions": "^0.0.163", + "@types/parsimmon": "^1.10.1", + "parsimmon": "^1.13.0" + } + }, + "node_modules/@definitelytyped/typescript-versions": { + "version": "0.0.163", + "resolved": "https://registry.npmjs.org/@definitelytyped/typescript-versions/-/typescript-versions-0.0.163.tgz", + "integrity": "sha512-+GWtJhC+7UaCUnJ+ZkA7bfGuPd6ZbJKEjbHqh76/gOXsqAUOMEa49ufsLlIPUbkEeQlnDNoTHCegE5X/Q+u+/A==", + "dev": true + }, + "node_modules/@definitelytyped/utils": { + "version": "0.0.163", + "resolved": "https://registry.npmjs.org/@definitelytyped/utils/-/utils-0.0.163.tgz", + "integrity": "sha512-6MX5TxaQbG/j2RkCWbcbLvv+YNipKqY0eQJafDhwC/RprUocpg+uYVNlH8XzdKRWOGJ0pq7SZOsJD4C3A01ZXg==", + "dev": true, + "dependencies": { + "@definitelytyped/typescript-versions": "^0.0.163", + "@qiwi/npm-registry-client": "^8.9.1", + "@types/node": "^14.14.35", + "charm": "^1.0.2", + "fs-extra": "^8.1.0", + "fstream": "^1.0.12", + "tar": "^6.1.11", + "tar-stream": "^2.1.4" + } + }, + "node_modules/@definitelytyped/utils/node_modules/@types/node": { + "version": "14.18.51", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.51.tgz", + "integrity": "sha512-P9bsdGFPpVtofEKlhWMVS2qqx1A/rt9QBfihWlklfHHpUpjtYse5AzFz6j4DWrARLYh6gRnw9+5+DJcrq3KvBA==", + "dev": true + }, + "node_modules/@definitelytyped/utils/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/@definitelytyped/utils/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@definitelytyped/utils/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/@envelop/core": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/@envelop/core/-/core-2.6.0.tgz", @@ -4237,6 +4309,72 @@ "node": ">=12" } }, + "node_modules/@qiwi/npm-registry-client": { + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@qiwi/npm-registry-client/-/npm-registry-client-8.9.1.tgz", + "integrity": "sha512-rZF+mG+NfijR0SHphhTLHRr4aM4gtfdwoAMY6we2VGQam8vkN1cxGG1Lg/Llrj8Dd0Mu6VjdFQRyMMRZxtZR2A==", + "dev": true, + "dependencies": { + "concat-stream": "^2.0.0", + "graceful-fs": "^4.2.4", + "normalize-package-data": "~1.0.1 || ^2.0.0 || ^3.0.0", + "npm-package-arg": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^8.0.0", + "once": "^1.4.0", + "request": "^2.88.2", + "retry": "^0.12.0", + "safe-buffer": "^5.2.1", + "semver": "2 >=2.2.1 || 3.x || 4 || 5 || 7", + "slide": "^1.1.6", + "ssri": "^8.0.0" + }, + "optionalDependencies": { + "npmlog": "2 || ^3.1.0 || ^4.0.0" + } + }, + "node_modules/@qiwi/npm-registry-client/node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "dev": true, + "engines": [ + "node >= 6.0" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/@qiwi/npm-registry-client/node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/@qiwi/npm-registry-client/node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/@repeaterjs/repeater": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@repeaterjs/repeater/-/repeater-3.0.4.tgz", @@ -4656,6 +4794,12 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "node_modules/@types/parsimmon": { + "version": "1.10.6", + "resolved": "https://registry.npmjs.org/@types/parsimmon/-/parsimmon-1.10.6.tgz", + "integrity": "sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA==", + "dev": true + }, "node_modules/@types/prettier": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", @@ -5649,6 +5793,78 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, + "node_modules/babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==", + "dev": true, + "dependencies": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "node_modules/babel-code-frame/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-code-frame/node_modules/ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-code-frame/node_modules/chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-code-frame/node_modules/js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==", + "dev": true + }, + "node_modules/babel-code-frame/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/babel-code-frame/node_modules/supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/babel-helper-evaluate-path": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz", @@ -6627,12 +6843,27 @@ "node": ">=8.12.0" } }, + "node_modules/builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", "dev": true }, + "node_modules/builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==", + "dev": true + }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -6813,6 +7044,15 @@ "node": ">=10" } }, + "node_modules/charm": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/charm/-/charm-1.0.2.tgz", + "integrity": "sha512-wqW3VdPnlSWT4eRiYX+hcs+C6ViBPUWk1qTCd+37qw9kEm/a5n2qcyQDMBWvSYKN/ctqZzeXNQaeBjOetJJUkw==", + "dev": true, + "dependencies": { + "inherits": "^2.0.1" + } + }, "node_modules/cheerio": { "version": "0.22.0", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", @@ -7560,6 +7800,12 @@ "node": ">= 0.8" } }, + "node_modules/command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "dev": true + }, "node_modules/commander": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.0.tgz", @@ -9102,6 +9348,15 @@ "integrity": "sha512-39fCpE3Z78IaIPChJsP6Lhmkbf4dWXOmzLk/KFTdRkNk/0JymRIfUynDVRndV9HoDz8PyalK1UH21ST/ivwW5Q==", "dev": true }, + "node_modules/diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/diff-sequences": { "version": "29.4.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", @@ -9342,6 +9597,301 @@ "node": ">=4" } }, + "node_modules/dts-critic": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/dts-critic/-/dts-critic-3.3.11.tgz", + "integrity": "sha512-HMO2f9AO7ge44YO8OK18f+cxm/IaE1CFuyNFbfJRCEbyazWj5X5wWDF6W4CGdo5Ax0ILYVfJ7L/rOwuUN1fzWw==", + "dev": true, + "dependencies": { + "@definitelytyped/header-parser": "latest", + "command-exists": "^1.2.8", + "rimraf": "^3.0.2", + "semver": "^6.2.0", + "tmp": "^0.2.1", + "yargs": "^15.3.1" + }, + "engines": { + "node": ">=10.17.0" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/dts-critic/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/dts-critic/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/dts-critic/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/dts-critic/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/dts-critic/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/dts-critic/node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true + }, + "node_modules/dts-critic/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dts-critic/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "node_modules/dts-critic/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dts-critic/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/dtslint": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/dtslint/-/dtslint-4.1.3.tgz", + "integrity": "sha512-UHW14DNpWnE5GkmORiDP0f4pc3AvgV7N0grB0skamXyExGOsbsHtNIe+8xeuAkPCrsf10O+Ph3W6+UgXvE4fiA==", + "dev": true, + "dependencies": { + "@definitelytyped/header-parser": "latest", + "@definitelytyped/typescript-versions": "latest", + "@definitelytyped/utils": "latest", + "dts-critic": "latest", + "fs-extra": "^6.0.1", + "json-stable-stringify": "^1.0.1", + "strip-json-comments": "^2.0.1", + "tslint": "5.14.0", + "tsutils": "^2.29.0", + "yargs": "^15.1.0" + }, + "bin": { + "dtslint": "bin/index.js" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "typescript": ">= 3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.7.0-dev || >= 3.8.0-dev || >= 3.9.0-dev || >= 4.0.0-dev" + } + }, + "node_modules/dtslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/dtslint/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/dtslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/dtslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/dtslint/node_modules/fs-extra": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", + "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "node_modules/dtslint/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/dtslint/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/dtslint/node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true + }, + "node_modules/dtslint/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dtslint/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "node_modules/dtslint/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dtslint/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", @@ -11589,6 +12139,30 @@ "node": ">=14.14" } }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/fs-mkdirp-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", @@ -11661,6 +12235,33 @@ "node": ">= 4.0" } }, + "node_modules/fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + }, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/fstream/node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -13113,6 +13714,27 @@ "node": ">= 0.4.0" } }, + "node_modules/has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dev": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-ansi/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -16620,6 +17242,18 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "node_modules/json-stable-stringify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz", + "integrity": "sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g==", + "dev": true, + "dependencies": { + "jsonify": "^0.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -16656,6 +17290,15 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", @@ -18325,6 +18968,31 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/mitt": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.0.tgz", @@ -19392,6 +20060,35 @@ "node": ">=4" } }, + "node_modules/npm-package-arg": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz", + "integrity": "sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q==", + "dev": true, + "dependencies": { + "hosted-git-info": "^4.0.1", + "semver": "^7.3.4", + "validate-npm-package-name": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/npm-package-arg/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -22811,6 +23508,12 @@ "node": ">= 0.8" } }, + "node_modules/parsimmon": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.18.1.tgz", + "integrity": "sha512-u7p959wLfGAhJpSDJVYXoyMCXWYwHia78HhRBWqk7AIbxdmlrfdp5wX0l3xv/iTSH5HvhN9K7o26hwwpgS5Nmw==", + "dev": true + }, "node_modules/pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", @@ -25192,6 +25895,15 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -25591,6 +26303,30 @@ "node": ">=0.10.0" } }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "dev": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/ssri/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", @@ -26161,6 +26897,23 @@ "connected-domain": "^1.0.0" } }, + "node_modules/tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "dev": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/tar-fs": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", @@ -26189,6 +26942,36 @@ "node": ">=6" } }, + "node_modules/tar/node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/teeny-request": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-7.1.1.tgz", @@ -26420,6 +27203,18 @@ "next-tick": "1" } }, + "node_modules/tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, + "dependencies": { + "rimraf": "^3.0.0" + }, + "engines": { + "node": ">=8.17.0" + } + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -26630,6 +27425,66 @@ "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", "dev": true }, + "node_modules/tslint": { + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", + "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", + "dev": true, + "dependencies": { + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" + }, + "bin": { + "tslint": "bin/tslint" + }, + "engines": { + "node": ">=4.8.0" + }, + "peerDependencies": { + "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev" + } + }, + "node_modules/tslint/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/tslint/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "peerDependencies": { + "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev" + } + }, + "node_modules/tsutils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/tty-browserify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", @@ -26721,6 +27576,20 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "node_modules/typescript": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", + "dev": true, + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", @@ -27199,6 +28068,15 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==", + "dev": true, + "dependencies": { + "builtins": "^1.0.3" + } + }, "node_modules/value-or-function": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", @@ -29472,6 +30350,73 @@ "kuler": "^2.0.0" } }, + "@definitelytyped/header-parser": { + "version": "0.0.163", + "resolved": "https://registry.npmjs.org/@definitelytyped/header-parser/-/header-parser-0.0.163.tgz", + "integrity": "sha512-Jr+/q+ESfc7uWldz/j11BfpjIN/gB4WmwhFENhWaMwM0W/9p0ShF+OiUqGhk2Q3Iz8v/oyWzSsxyxgasg9kCxQ==", + "dev": true, + "requires": { + "@definitelytyped/typescript-versions": "^0.0.163", + "@types/parsimmon": "^1.10.1", + "parsimmon": "^1.13.0" + } + }, + "@definitelytyped/typescript-versions": { + "version": "0.0.163", + "resolved": "https://registry.npmjs.org/@definitelytyped/typescript-versions/-/typescript-versions-0.0.163.tgz", + "integrity": "sha512-+GWtJhC+7UaCUnJ+ZkA7bfGuPd6ZbJKEjbHqh76/gOXsqAUOMEa49ufsLlIPUbkEeQlnDNoTHCegE5X/Q+u+/A==", + "dev": true + }, + "@definitelytyped/utils": { + "version": "0.0.163", + "resolved": "https://registry.npmjs.org/@definitelytyped/utils/-/utils-0.0.163.tgz", + "integrity": "sha512-6MX5TxaQbG/j2RkCWbcbLvv+YNipKqY0eQJafDhwC/RprUocpg+uYVNlH8XzdKRWOGJ0pq7SZOsJD4C3A01ZXg==", + "dev": true, + "requires": { + "@definitelytyped/typescript-versions": "^0.0.163", + "@qiwi/npm-registry-client": "^8.9.1", + "@types/node": "^14.14.35", + "charm": "^1.0.2", + "fs-extra": "^8.1.0", + "fstream": "^1.0.12", + "tar": "^6.1.11", + "tar-stream": "^2.1.4" + }, + "dependencies": { + "@types/node": { + "version": "14.18.51", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.51.tgz", + "integrity": "sha512-P9bsdGFPpVtofEKlhWMVS2qqx1A/rt9QBfihWlklfHHpUpjtYse5AzFz6j4DWrARLYh6gRnw9+5+DJcrq3KvBA==", + "dev": true + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + } + } + }, "@envelop/core": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/@envelop/core/-/core-2.6.0.tgz", @@ -30961,6 +31906,52 @@ } } }, + "@qiwi/npm-registry-client": { + "version": "8.9.1", + "resolved": "https://registry.npmjs.org/@qiwi/npm-registry-client/-/npm-registry-client-8.9.1.tgz", + "integrity": "sha512-rZF+mG+NfijR0SHphhTLHRr4aM4gtfdwoAMY6we2VGQam8vkN1cxGG1Lg/Llrj8Dd0Mu6VjdFQRyMMRZxtZR2A==", + "dev": true, + "requires": { + "concat-stream": "^2.0.0", + "graceful-fs": "^4.2.4", + "normalize-package-data": "~1.0.1 || ^2.0.0 || ^3.0.0", + "npm-package-arg": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^8.0.0", + "npmlog": "2 || ^3.1.0 || ^4.0.0", + "once": "^1.4.0", + "request": "^2.88.2", + "retry": "^0.12.0", + "safe-buffer": "^5.2.1", + "semver": "2 >=2.2.1 || 3.x || 4 || 5 || 7", + "slide": "^1.1.6", + "ssri": "^8.0.0" + }, + "dependencies": { + "concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "dev": true + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + } + } + }, "@repeaterjs/repeater": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@repeaterjs/repeater/-/repeater-3.0.4.tgz", @@ -31331,6 +32322,12 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "@types/parsimmon": { + "version": "1.10.6", + "resolved": "https://registry.npmjs.org/@types/parsimmon/-/parsimmon-1.10.6.tgz", + "integrity": "sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA==", + "dev": true + }, "@types/prettier": { "version": "2.7.2", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", @@ -32166,6 +33163,65 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", "dev": true }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", + "dev": true + } + } + }, "babel-helper-evaluate-path": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/babel-helper-evaluate-path/-/babel-helper-evaluate-path-0.5.0.tgz", @@ -32980,12 +34036,24 @@ "readable-stream": "^3.4.0" } }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", + "dev": true + }, "builtin-status-codes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", "dev": true }, + "builtins": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", + "integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==", + "dev": true + }, "busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -33117,6 +34185,15 @@ "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", "dev": true }, + "charm": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/charm/-/charm-1.0.2.tgz", + "integrity": "sha512-wqW3VdPnlSWT4eRiYX+hcs+C6ViBPUWk1qTCd+37qw9kEm/a5n2qcyQDMBWvSYKN/ctqZzeXNQaeBjOetJJUkw==", + "dev": true, + "requires": { + "inherits": "^2.0.1" + } + }, "cheerio": { "version": "0.22.0", "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-0.22.0.tgz", @@ -33735,6 +34812,12 @@ "delayed-stream": "~1.0.0" } }, + "command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "dev": true + }, "commander": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.0.tgz", @@ -34971,6 +36054,12 @@ "integrity": "sha512-39fCpE3Z78IaIPChJsP6Lhmkbf4dWXOmzLk/KFTdRkNk/0JymRIfUynDVRndV9HoDz8PyalK1UH21ST/ivwW5Q==", "dev": true }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, "diff-sequences": { "version": "29.4.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", @@ -35179,6 +36268,248 @@ "integrity": "sha512-g/M9sqy3oHe477Ar4voQxWtaPIFw1jTdKZuomOjhCcBx9nHUNn0pu6NopuFFrTh/TRZIKEj+76vLWFu9BNKk+Q==", "dev": true }, + "dts-critic": { + "version": "3.3.11", + "resolved": "https://registry.npmjs.org/dts-critic/-/dts-critic-3.3.11.tgz", + "integrity": "sha512-HMO2f9AO7ge44YO8OK18f+cxm/IaE1CFuyNFbfJRCEbyazWj5X5wWDF6W4CGdo5Ax0ILYVfJ7L/rOwuUN1fzWw==", + "dev": true, + "requires": { + "@definitelytyped/header-parser": "latest", + "command-exists": "^1.2.8", + "rimraf": "^3.0.2", + "semver": "^6.2.0", + "tmp": "^0.2.1", + "yargs": "^15.3.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "dtslint": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/dtslint/-/dtslint-4.1.3.tgz", + "integrity": "sha512-UHW14DNpWnE5GkmORiDP0f4pc3AvgV7N0grB0skamXyExGOsbsHtNIe+8xeuAkPCrsf10O+Ph3W6+UgXvE4fiA==", + "dev": true, + "requires": { + "@definitelytyped/header-parser": "latest", + "@definitelytyped/typescript-versions": "latest", + "@definitelytyped/utils": "latest", + "dts-critic": "latest", + "fs-extra": "^6.0.1", + "json-stable-stringify": "^1.0.1", + "strip-json-comments": "^2.0.1", + "tslint": "5.14.0", + "tsutils": "^2.29.0", + "yargs": "^15.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "fs-extra": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", + "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", @@ -36983,6 +38314,26 @@ "universalify": "^2.0.0" } }, + "fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "requires": { + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + } + } + }, "fs-mkdirp-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz", @@ -37046,6 +38397,29 @@ "nan": "^2.12.1" } }, + "fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + }, + "dependencies": { + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -38267,6 +39641,23 @@ "function-bind": "^1.1.1" } }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", + "dev": true + } + } + }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -40872,6 +42263,15 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, + "json-stable-stringify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz", + "integrity": "sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g==", + "dev": true, + "requires": { + "jsonify": "^0.0.1" + } + }, "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", @@ -40900,6 +42300,12 @@ "universalify": "^2.0.0" } }, + "jsonify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", + "dev": true + }, "jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", @@ -42250,6 +43656,27 @@ "integrity": "sha512-mvD5U4pUen1aWcjTxUgdoMg6PB98dcV0obc/OiPzls79++IpgNoO+MCbOHRlKfWIOvjIjmjUygjZmSStP7B0Og==", "dev": true }, + "minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "requires": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + } + } + }, "mitt": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.0.tgz", @@ -44775,6 +46202,28 @@ "pify": "^3.0.0" } }, + "npm-package-arg": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz", + "integrity": "sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q==", + "dev": true, + "requires": { + "hosted-git-info": "^4.0.1", + "semver": "^7.3.4", + "validate-npm-package-name": "^3.0.0" + }, + "dependencies": { + "semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, "npm-run-path": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", @@ -45551,6 +47000,12 @@ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true }, + "parsimmon": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.18.1.tgz", + "integrity": "sha512-u7p959wLfGAhJpSDJVYXoyMCXWYwHia78HhRBWqk7AIbxdmlrfdp5wX0l3xv/iTSH5HvhN9K7o26hwwpgS5Nmw==", + "dev": true + }, "pascalcase": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", @@ -47434,6 +48889,12 @@ } } }, + "slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==", + "dev": true + }, "smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -47765,6 +49226,26 @@ "tweetnacl": "~0.14.0" } }, + "ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "dev": true, + "requires": { + "minipass": "^3.1.1" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + } + } + }, "stack-trace": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", @@ -48235,6 +49716,40 @@ "connected-domain": "^1.0.0" } }, + "tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "dev": true, + "requires": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "dependencies": { + "chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true + }, + "minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + } + } + }, "tar-fs": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", @@ -48452,6 +49967,15 @@ "next-tick": "1" } }, + "tmp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "dev": true, + "requires": { + "rimraf": "^3.0.0" + } + }, "tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -48629,6 +50153,58 @@ "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", "dev": true }, + "tslint": { + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", + "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", + "dev": true, + "requires": { + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, + "tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + } + } + }, "tty-browserify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz", @@ -48699,6 +50275,13 @@ "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", "dev": true }, + "typescript": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", + "dev": true, + "peer": true + }, "uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", @@ -49076,6 +50659,15 @@ "spdx-expression-parse": "^3.0.0" } }, + "validate-npm-package-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", + "integrity": "sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==", + "dev": true, + "requires": { + "builtins": "^1.0.3" + } + }, "value-or-function": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/value-or-function/-/value-or-function-3.0.0.tgz", diff --git a/package.json b/package.json index 8f18cd2b1..171441948 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,13 @@ "lib/", "LICENSE", "NOTICE", - "README.md" + "README.md", + "types/index.d.ts" ], "browser": { "react-native": false }, + "types": "types/index.d.ts", "dependencies": { "@babel/runtime-corejs3": "7.22.3", "idb-keyval": "6.2.1", @@ -61,6 +63,7 @@ "codecov": "3.8.3", "core-js": "3.30.2", "cross-env": "7.0.2", + "dtslint": "4.1.3", "eslint": "8.40.0", "eslint-plugin-flowtype": "8.0.3", "eslint-plugin-jsdoc": "43.0.7", @@ -99,6 +102,7 @@ "test": "cross-env PARSE_BUILD=node jest", "test:mongodb": "npm run test:mongodb:runnerstart && npm run integration", "test:mongodb:runnerstart": "mongodb-runner start", + "test:types": "dtslint types", "posttest:mongodb": "mongodb-runner stop", "lint": "eslint --cache src/ integration/", "lint:fix": "eslint --fix --cache src/ integration/", diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 000000000..2d6c95323 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,2010 @@ +/// +/// +/// + +import { EventEmitter } from 'events'; + +declare enum ErrorCode { + /** Error code indicating some error other than those enumerated here */ + OTHER_CAUSE = -1, + /** Error code indicating that something has gone wrong with the server. */ + INTERNAL_SERVER_ERROR = 1, + /** Error code indicating the connection to the Parse servers failed. */ + CONNECTION_FAILED = 100, + /** Error code indicating the specified object doesn't exist. */ + OBJECT_NOT_FOUND = 101, + /** + * Error code indicating you tried to query with a datatype that doesn't + * support it, like exact matching an array or object. + */ + INVALID_QUERY = 102, + /* + * Error code indicating a missing or invalid classname. Classnames are + * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the + * only valid characters. + */ + INVALID_CLASS_NAME = 103, + /** Error code indicating an unspecified object id. */ + MISSING_OBJECT_ID = 104, + /** + * Error code indicating an invalid key name. Keys are case-sensitive. They + * must start with a letter, and a-zA-Z0-9_ are the only valid characters. + */ + INVALID_KEY_NAME = 105, + /** + * Error code indicating a malformed pointer. You should not see this unless + * you have been mucking about changing internal Parse code. + */ + INVALID_POINTER = 106, + /* + * Error code indicating that badly formed JSON was received upstream. This + * either indicates you have done something unusual with modifying how + * things encode to JSON, or the network is failing badly. + */ + INVALID_JSON = 107, + /** + * Error code indicating that the feature you tried to access is only + * available internally for testing purposes. + */ + COMMAND_UNAVAILABLE = 108, + /** You must call Parse.initialize before using the Parse library. */ + NOT_INITIALIZED = 109, + /** Error code indicating that a field was set to an inconsistent type. */ + INCORRECT_TYPE = 111, + /** + * Error code indicating an invalid channel name. A channel name is either + * an empty string (the broadcast channel) or contains only a-zA-Z0-9_ + * characters and starts with a letter. + */ + INVALID_CHANNEL_NAME = 112, + /** Error code indicating that push is misconfigured. */ + PUSH_MISCONFIGURED = 115, + /** Error code indicating that the object is too large. */ + OBJECT_TOO_LARGE = 116, + /** Error code indicating that the operation isn't allowed for clients. */ + OPERATION_FORBIDDEN = 119, + /** Error code indicating the result was not found in the cache. */ + CACHE_MISS = 120, + /** Error code indicating that an invalid key was used in a nested JSONObject. */ + INVALID_NESTED_KEY = 121, + /** + * Error code indicating that an invalid filename was used for ParseFile. + * A valid file name contains only a-zA-Z0-9_. characters and is between 1 + * and 128 characters. + */ + INVALID_FILE_NAME = 122, + /** Error code indicating an invalid ACL was provided. */ + INVALID_ACL = 123, + /** + * Error code indicating that the request timed out on the server. Typically + * this indicates that the request is too expensive to run. + */ + TIMEOUT = 124, + /** Error code indicating that the email address was invalid. */ + INVALID_EMAIL_ADDRESS = 125, + /** Error code indicating a missing content type. */ + MISSING_CONTENT_TYPE = 126, + /** Error code indicating a missing content length. */ + MISSING_CONTENT_LENGTH = 127, + /** Error code indicating an invalid content length. */ + INVALID_CONTENT_LENGTH = 128, + /** Error code indicating a file that was too large. */ + FILE_TOO_LARGE = 129, + /** Error code indicating an error saving a file. */ + FILE_SAVE_ERROR = 130, + /** + * Error code indicating that a unique field was given a value that is + * already taken. + */ + DUPLICATE_VALUE = 137, + /** Error code indicating that a role's name is invalid. */ + INVALID_ROLE_NAME = 139, + /** + * Error code indicating that an application quota was exceeded. + * Upgrade to resolve. + */ + EXCEEDED_QUOTA = 140, + /** Error code indicating that a Cloud Code script failed. */ + SCRIPT_FAILED = 141, + /** Error code indicating that a Cloud Code validation failed. */ + VALIDATION_ERROR = 142, + /** Error code indicating that invalid image data was provided. */ + INVALID_IMAGE_DATA = 150, + /** Error code indicating an unsaved file. */ + UNSAVED_FILE_ERROR = 151, + /** Error code indicating an invalid push time. */ + INVALID_PUSH_TIME_ERROR = 152, + /** Error code indicating an error deleting a file. */ + FILE_DELETE_ERROR = 153, + /** Error code indicating that the application has exceeded its request limit. */ + REQUEST_LIMIT_EXCEEDED = 155, + /** + * Error code indicating that the request was a duplicate and has been discarded due to + * idempotency rules. + */ + DUPLICATE_REQUEST = 159, + /** Error code indicating an invalid event name. */ + INVALID_EVENT_NAME = 160, + /** Error code indicating an error deleting an unnamed file. */ + FILE_DELETE_UNNAMED_ERROR = 161, + /** Error code indicating that the username is missing or empty. */ + USERNAME_MISSING = 200, + /** Error code indicating that the password is missing or empty. */ + PASSWORD_MISSING = 201, + /** Error code indicating that the username has already been taken. */ + USERNAME_TAKEN = 202, + /** Error code indicating that the email has already been taken. */ + EMAIL_TAKEN = 203, + /** Error code indicating that the email is missing, but must be specified. */ + EMAIL_MISSING = 204, + /** Error code indicating that a user with the specified email was not found. */ + EMAIL_NOT_FOUND = 205, + /** + * Error code indicating that a user object without a valid session could + * not be altered. + */ + SESSION_MISSING = 206, + /** Error code indicating that a user can only be created through signup. */ + MUST_CREATE_USER_THROUGH_SIGNUP = 207, + /** + * Error code indicating that an an account being linked is already linked + * to another user. + */ + ACCOUNT_ALREADY_LINKED = 208, + /** Error code indicating that the current session token is invalid. */ + INVALID_SESSION_TOKEN = 209, + /** Error code indicating an error enabling or verifying MFA */ + MFA_ERROR = 210, + /** Error code indicating that a valid MFA token must be provided */ + MFA_TOKEN_REQUIRED = 211, + /** + * Error code indicating that a user cannot be linked to an account because + * that account's id could not be found. + */ + LINKED_ID_MISSING = 250, + /** + * Error code indicating that a user with a linked (e.g. Facebook) account + * has an invalid session. + */ + INVALID_LINKED_SESSION = 251, + /** + * Error code indicating that a service being linked (e.g. Facebook or + * Twitter) is unsupported. + */ + UNSUPPORTED_SERVICE = 252, + /** Error code indicating an invalid operation occured on schema */ + INVALID_SCHEMA_OPERATION = 255, + /** + * Error code indicating that there were multiple errors. Aggregate errors + * have an "errors" property, which is an array of error objects with more + * detail about each error that occurred. + */ + AGGREGATE_ERROR = 600, + /** Error code indicating the client was unable to read an input file. */ + FILE_READ_ERROR = 601, + /* + * Error code indicating a real error code is unavailable because + * we had to use an XDomainRequest object to allow CORS requests in + * Internet Explorer, which strips the body from HTTP responses that have + * a non-2XX status code. + */ + X_DOMAIN_REQUEST = 602, +} + +declare global { + namespace Parse { + let applicationId: string; + let javaScriptKey: string | undefined; + let liveQueryServerURL: string; + let masterKey: string | undefined; + let serverAuthToken: string | undefined; + let serverAuthType: string | undefined; + let serverURL: string; + let secret: string; + let idempotency: boolean; + let encryptedUser: boolean; + + interface BatchSizeOption { + batchSize?: number | undefined; + } + + interface CascadeSaveOption { + /** If `false`, nested objects will not be saved (default is `true`). */ + cascadeSave?: boolean | undefined; + } + + interface SuccessOption { + success?: Function | undefined; + } + + interface ErrorOption { + error?: Function | undefined; + } + + interface ContextOption { + context?: { [key: string]: any }; + } + + interface FullOptions { + success?: Function | undefined; + error?: Function | undefined; + useMasterKey?: boolean | undefined; + sessionToken?: string | undefined; + installationId?: string | undefined; + progress?: Function | undefined; + /** + * logIn will default to POST instead of GET method since + * version 3.0.0 for security reasons. + * If you need to use GET set this to `false`. + */ + usePost?: boolean; + } + + interface RequestOptions { + useMasterKey?: boolean | undefined; + sessionToken?: string | undefined; + installationId?: string | undefined; + batchSize?: number | undefined; + include?: string | string[] | undefined; + progress?: Function | undefined; + } + + interface SuccessFailureOptions extends SuccessOption, ErrorOption {} + + interface SignUpOptions { + useMasterKey?: boolean | undefined; + installationId?: string | undefined; + } + + interface SessionTokenOption { + sessionToken?: string | undefined; + } + + interface WaitOption { + /** + * Set to true to wait for the server to confirm success + * before triggering an event. + */ + wait?: boolean | undefined; + } + + interface UseMasterKeyOption { + /** + * In Cloud Code and Node only, causes the Master Key to be used for this request. + */ + useMasterKey?: boolean | undefined; + } + + /** + * https://github.com/parse-community/Parse-SDK-JS/pull/1294/files + * feat: Add option to return raw json from queries + */ + interface RawJSONOptions { + /** (3.0.0+) json: Return raw json without converting to Parse.Object */ + json?: boolean; + } + interface ScopeOptions extends SessionTokenOption, UseMasterKeyOption {} + + interface SilentOption { + /** + * Set to true to avoid firing the event. + */ + silent?: boolean | undefined; + } + + interface Pointer { + __type: string; + className: string; + objectId: string; + } + + interface AuthData { + [key: string]: any; + } + + /** + * Interface declaration for Authentication Providers + * https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html + */ + interface AuthProvider { + /** + * Called when _linkWith isn't passed authData. Handle your own authentication here. + */ + authenticate: () => void; + /** + * (Optional) Called when service is unlinked. Handle any cleanup here. + */ + deauthenticate?: (() => void) | undefined; + /** + * Unique identifier for this Auth Provider. + */ + getAuthType: () => string; + /** + * Called when auth data is syncronized. Can be used to determine if authData is still valid + */ + restoreAuthentication: () => boolean; + } + + interface BaseAttributes { + createdAt: Date; + objectId: string; + updatedAt: Date; + } + + interface CommonAttributes { + ACL: ACL; + } + + interface JSONBaseAttributes { + createdAt: string; + objectId: string; + updatedAt: string; + } + + /** + * Creates a new ACL. + * If no argument is given, the ACL has no permissions for anyone. + * If the argument is a Parse.User, the ACL will have read and write + * permission for only that user. + * If the argument is any other JSON object, that object will be interpretted + * as a serialized ACL created with toJSON(). + * @see Parse.Object#setACL + * + *

An ACL, or Access Control List can be added to any + * Parse.Object to restrict access to only a subset of users + * of your application.

+ */ + class ACL { + permissionsById: any; + + constructor(arg1?: any); + + setPublicReadAccess(allowed: boolean): void; + getPublicReadAccess(): boolean; + + setPublicWriteAccess(allowed: boolean): void; + getPublicWriteAccess(): boolean; + + setReadAccess(userId: User | string, allowed: boolean): void; + getReadAccess(userId: User | string): boolean; + + setWriteAccess(userId: User | string, allowed: boolean): void; + getWriteAccess(userId: User | string): boolean; + + setRoleReadAccess(role: Role | string, allowed: boolean): void; + getRoleReadAccess(role: Role | string): boolean; + + setRoleWriteAccess(role: Role | string, allowed: boolean): void; + getRoleWriteAccess(role: Role | string): boolean; + + toJSON(): any; + } + + /** + * A Parse.File is a local representation of a file that is saved to the Parse + * cloud. + * @param name The file's name. This will be prefixed by a unique + * value once the file has finished saving. The file name must begin with + * an alphanumeric character, and consist of alphanumeric characters, + * periods, spaces, underscores, or dashes. + * @param data The data for the file, as either: + * 1. an Array of byte value Numbers, or + * 2. an Object like { base64: "..." } with a base64-encoded String. + * 3. a File object selected with a file upload control. (3) only works + * in Firefox 3.6+, Safari 6.0.2+, Chrome 7+, and IE 10+. + * For example:
+         * var fileUploadControl = $("#profilePhotoFileUpload")[0];
+         * if (fileUploadControl.files.length > 0) {
+         *   var file = fileUploadControl.files[0];
+         *   var name = "photo.jpg";
+         *   var parseFile = new Parse.File(name, file);
+         *   parseFile.save().then(function() {
+         *     // The file has been saved to Parse.
+         *   }, function(error) {
+         *     // The file either could not be read, or could not be saved to Parse.
+         *   });
+         * }
+ * @param type Optional Content-Type header to use for the file. If + * this is omitted, the content type will be inferred from the name's + * extension. + */ + class File { + constructor( + name: string, + data: number[] | { base64: string } | { size: number; type: string } | { uri: string }, + type?: string, + ); + /** + * Return the data for the file, downloading it if not already present. + * Data is present if initialized with Byte Array, Base64 or Saved with Uri. + * Data is cleared if saved with File object selected with a file upload control + * + * @returns Promise that is resolved with base64 data + */ + getData(): Promise; + url(options?: { forceSecure?: boolean | undefined }): string; + metadata(): Record; + tags(): Record; + name(): string; + save(options?: FullOptions): Promise; + cancel(): void; + destroy(options?: FullOptions): Promise; + toJSON(): { __type: string; name: string; url: string }; + equals(other: File): boolean; + setMetadata(metadata: Record): void; + addMetadata(key: string, value: any): void; + setTags(tags: Record): void; + addTag(key: string, value: any): void; + readonly _url: string; + } + + /** + * Creates a new GeoPoint with any of the following forms:
+ *
+         *   new GeoPoint(otherGeoPoint)
+         *   new GeoPoint(30, 30)
+         *   new GeoPoint([30, 30])
+         *   new GeoPoint({latitude: 30, longitude: 30})
+         *   new GeoPoint()  // defaults to (0, 0)
+         *   
+ * + *

Represents a latitude / longitude point that may be associated + * with a key in a ParseObject or used as a reference point for geo queries. + * This allows proximity-based queries on the key.

+ * + *

Only one key in a class may contain a GeoPoint.

+ * + *

Example:

+         *   var point = new Parse.GeoPoint(30.0, -20.0);
+         *   var object = new Parse.Object("PlaceObject");
+         *   object.set("location", point);
+         *   object.save();

+ */ + class GeoPoint { + latitude: number; + longitude: number; + + constructor(latitude: number, longitude: number); + constructor(coords?: { latitude: number; longitude: number } | [number, number]); + + current(options?: SuccessFailureOptions): GeoPoint; + radiansTo(point: GeoPoint): number; + kilometersTo(point: GeoPoint): number; + milesTo(point: GeoPoint): number; + toJSON(): any; + } + + /** + * A class that is used to access all of the children of a many-to-many relationship. + * Each instance of Parse.Relation is associated with a particular parent object and key. + */ + class Relation { + parent: S; + key: string; + targetClassName: string; + + constructor(parent?: S, key?: string); + + // Adds a Parse.Object or an array of Parse.Objects to the relation. + add(object: T | T[]): void; + + // Returns a Parse.Query that is limited to objects in this relation. + query(): Query; + + // Removes a Parse.Object or an array of Parse.Objects from this relation. + remove(object: T | T[]): void; + + toJSON(): any; + } + + interface Attributes { + [key: string]: any; + } + + /** + * Creates a new model with defined attributes. A client id (cid) is + * automatically generated and assigned for you. + * + *

You won't normally call this method directly. It is recommended that + * you use a subclass of Parse.Object instead, created by calling + * extend.

+ * + *

However, if you don't want to use a subclass, or aren't sure which + * subclass is appropriate, you can use this form:

+         *     var object = new Parse.Object("ClassName");
+         * 
+ * That is basically equivalent to:
+         *     var MyClass = Parse.Object.extend("ClassName");
+         *     var object = new MyClass();
+         * 

+ * + * @param attributes The initial set of data to store in the object. + * @param options The options for this object instance. + * @see Parse.Object.extend + * + * + * Creates a new model with defined attributes. + */ + interface Object { + id: string; + createdAt: Date; + updatedAt: Date; + attributes: T; + className: string; + + add extends any[] ? K : never }[keyof T]>( + attr: K, + item: NonNullable[number], + ): this | false; + addAll extends any[] ? K : never }[keyof T]>( + attr: K, + items: NonNullable, + ): this | false; + addAllUnique: this['addAll']; + addUnique: this['add']; + clear(options: any): any; + clone(): this; + destroy(options?: Object.DestroyOptions): Promise; + /** EventuallyQueue API; added in version 3.0.0 */ + destroyEventually(options?: Object.DestroyOptions): Promise; + dirty(attr?: Extract): boolean; + dirtyKeys(): string[]; + equals(other: T): boolean; + escape(attr: Extract): string; + existed(): boolean; + exists(options?: RequestOptions): Promise; + fetch(options?: Object.FetchOptions): Promise; + fetchFromLocalDatastore(): Promise; + fetchWithInclude>( + keys: K | Array, + options?: RequestOptions, + ): Promise; + get>(attr: K): T[K]; + getACL(): ACL | undefined; + has(attr: Extract): boolean; + increment(attr: Extract, amount?: number): this | false; + decrement(attr: Extract, amount?: number): this | false; + initialize(): void; + isDataAvailable(): boolean; + isNew(): boolean; + isPinned(): Promise; + isValid(): boolean; + newInstance(): this; + op(attr: Extract): any; + pin(): Promise; + pinWithName(name: string): Promise; + relation = Extract>( + attr: T[K] extends Relation ? K : never, + ): Relation; + remove: this['add']; + removeAll: this['addAll']; + revert(...keys: Array>): void; + // "Pick | T" is a trick to keep IntelliSense working, see: + // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/3bdadbf9583c2335197c7e999b9a30880e055f62/types/react/index.d.ts#L482 + save>( + attrs?: Pick | T | null, + options?: Object.SaveOptions, + ): Promise; + save>( + key: K, + value: T[K] extends undefined ? never : T[K], + options?: Object.SaveOptions, + ): Promise; + /** EventuallyQueue API; added in version 3.0.0 */ + saveEventually(options?: Object.SaveOptions): Promise; + set>(attrs: Pick | T, options?: Object.SetOptions): this | false; + set>( + key: K, + value: T[K] extends undefined ? never : T[K], + options?: Object.SetOptions, + ): this | false; + setACL(acl: ACL, options?: SuccessFailureOptions): this | false; + toJSON(): Object.ToJSON & JSONBaseAttributes; + toPointer(): Pointer; + unPin(): Promise; + unPinWithName(name: string): Promise; + unset(attr: Extract, options?: any): this | false; + validate(attrs: Attributes, options?: SuccessFailureOptions): Error | false; + } + interface ObjectStatic { + createWithoutData(id: string): T; + destroyAll(list: T[], options?: Object.DestroyAllOptions): Promise; + extend(className: string | { className: string }, protoProps?: any, classProps?: any): any; + fetchAll(list: T[], options: Object.FetchAllOptions): Promise; + fetchAllIfNeeded(list: T[], options?: Object.FetchAllOptions): Promise; + fetchAllIfNeededWithInclude( + list: T[], + keys: keyof T['attributes'] | Array, + options?: RequestOptions, + ): Promise; + fetchAllWithInclude( + list: T[], + keys: keyof T['attributes'] | Array, + options?: RequestOptions, + ): Promise; + fromJSON(json: any, override?: boolean): T; + pinAll(objects: Object[]): Promise; + pinAllWithName(name: string, objects: Object[]): Promise; + registerSubclass(className: string, clazz: new (options?: any) => T): void; + saveAll(list: T, options?: Object.SaveAllOptions): Promise; + unPinAll(objects: Object[]): Promise; + unPinAllObjects(): Promise; + unPinAllObjectsWithName(name: string): Promise; + unPinAllWithName(name: string, objects: Object[]): Promise; + } + interface ObjectConstructor extends ObjectStatic { + new (className: string, attributes: T, options?: any): Object; + new (className?: string, attributes?: Attributes, options?: any): Object; + } + const Object: ObjectConstructor; + + namespace Object { + interface DestroyOptions extends SuccessFailureOptions, WaitOption, ScopeOptions {} + + interface DestroyAllOptions extends BatchSizeOption, ScopeOptions {} + + interface FetchAllOptions extends SuccessFailureOptions, ScopeOptions {} + + interface FetchOptions extends SuccessFailureOptions, ScopeOptions {} + + interface SaveOptions + extends CascadeSaveOption, + SuccessFailureOptions, + SilentOption, + ScopeOptions, + ContextOption, + WaitOption {} + + interface SaveAllOptions extends BatchSizeOption, ScopeOptions {} + + interface SetOptions extends ErrorOption, SilentOption { + promise?: any; + } + + // From https://github.com/parse-community/Parse-SDK-JS/blob/master/src/encode.js + type Encode = T extends Object + ? ReturnType | Pointer + : T extends ACL | GeoPoint | Polygon | Relation | File + ? ReturnType + : T extends Date + ? { __type: 'Date'; iso: string } + : T extends RegExp + ? string + : T extends Array + ? // This recursion is unsupported in <=3.6 + Array> + : T extends object + ? ToJSON + : T; + + type ToJSON = { + [K in keyof T]: Encode; + }; + } + + class Polygon { + constructor(arg1: GeoPoint[] | number[][]); + containsPoint(point: GeoPoint): boolean; + equals(other: any): boolean; + toJSON(): any; + } + + /** + * Every Parse application installed on a device registered for + * push notifications has an associated Installation object. + */ + interface Installation extends Object { + badge: any; + channels: string[]; + timeZone: any; + deviceType: string; + pushType: string; + installationId: string; + deviceToken: string; + channelUris: string; + appName: string; + appVersion: string; + parseVersion: string; + appIdentifier: string; + } + interface InstallationConstructor extends ObjectStatic { + new (attributes: T): Installation; + new (): Installation; + } + const Installation: InstallationConstructor; + + /** + * Creates a new parse Parse.Query for the given Parse.Object subclass. + * @param objectClass - + * An instance of a subclass of Parse.Object, or a Parse className string. + * + *

Parse.Query defines a query that is used to fetch Parse.Objects. The + * most common use case is finding all objects that match a query through the + * find method. For example, this sample code fetches all objects + * of class MyClass. It calls a different function depending on + * whether the fetch succeeded or not. + * + *

+         * var query = new Parse.Query(MyClass);
+         * query.find({
+         *   success: function(results) {
+         *     // results is an array of Parse.Object.
+         *   },
+         *
+         *   error: function(error) {
+         *     // error is an instance of Parse.Error.
+         *   }
+         * });

+ * + *

A Parse.Query can also be used to retrieve a single object whose id is + * known, through the get method. For example, this sample code fetches an + * object of class MyClass and id myId. It calls a + * different function depending on whether the fetch succeeded or not. + * + *

+         * var query = new Parse.Query(MyClass);
+         * query.get(myId, {
+         *   success: function(object) {
+         *     // object is an instance of Parse.Object.
+         *   },
+         *
+         *   error: function(object, error) {
+         *     // error is an instance of Parse.Error.
+         *   }
+         * });

+ * + *

A Parse.Query can also be used to count the number of objects that match + * the query without retrieving all of those objects. For example, this + * sample code counts the number of objects of the class MyClass + *

+         * var query = new Parse.Query(MyClass);
+         * query.count({
+         *   success: function(number) {
+         *     // There are number instances of MyClass.
+         *   },
+         *
+         *   error: function(error) {
+         *     // error is an instance of Parse.Error.
+         *   }
+         * });

+ */ + class Query { + objectClass: any; + className: string; + + constructor(objectClass: string | (new (...args: any[]) => T | Object)); + + static and(...args: Array>): Query; + static fromJSON(className: string | (new () => U), json: any): Query; + static nor(...args: Array>): Query; + static or(...var_args: Array>): Query; + + addAscending(key: K | K[]): this; + addDescending(key: K | K[]): this; + ascending(key: K | K[]): this; + aggregate(pipeline: Query.AggregationOptions | Query.AggregationOptions[]): Promise; + containedBy( + key: K, + values: Array, + ): this; + containedIn( + key: K, + values: Array, + ): this; + contains(key: K, substring: string): this; + containsAll(key: K, values: any[]): this; + containsAllStartingWith( + key: K, + values: any[], + ): this; + count(options?: Query.CountOptions): Promise; + descending(key: K | K[]): this; + doesNotExist(key: K): this; + doesNotMatchKeyInQuery< + U extends Object, + K extends keyof T['attributes'] | keyof BaseAttributes, + X extends Extract, + >(key: K, queryKey: X, query: Query): this; + doesNotMatchQuery(key: K, query: Query): this; + distinct(key: K): Promise; + eachBatch(callback: (objs: T[]) => PromiseLike | void, options?: Query.BatchOptions): Promise; + each(callback: (obj: T) => PromiseLike | void, options?: Query.BatchOptions): Promise; + hint(value: string | object): this; + explain(explain: boolean): this; + map( + callback: (currentObject: T, index: number, query: Query) => PromiseLike | U, + options?: Query.BatchOptions, + ): Promise; + reduce( + callback: (accumulator: T, currentObject: T, index: number) => PromiseLike | T, + initialValue?: undefined, + options?: Query.BatchOptions, + ): Promise; + reduce( + callback: (accumulator: U, currentObject: T, index: number) => PromiseLike | U, + initialValue: U, + options?: Query.BatchOptions, + ): Promise; + filter( + callback: (currentObject: T, index: number, query: Query) => PromiseLike | boolean, + options?: Query.BatchOptions, + ): Promise; + endsWith(key: K, suffix: string): this; + equalTo( + key: K, + value: + | T['attributes'][K] + | (T['attributes'][K] extends Object + ? Pointer + : T['attributes'][K] extends Array + ? E + : never), + ): this; + exclude(...keys: K[]): this; + exists(key: K): this; + find(options?: Query.FindOptions): Promise; + findAll(options?: Query.BatchOptions): Promise; + first(options?: Query.FirstOptions): Promise; + fromNetwork(): this; + fromLocalDatastore(): this; + fromPin(): this; + fromPinWithName(name: string): this; + cancel(): this; + fullText( + key: K, + value: string, + options?: Query.FullTextOptions, + ): this; + get(objectId: string, options?: Query.GetOptions): Promise; + greaterThan( + key: K, + value: T['attributes'][K], + ): this; + greaterThanOrEqualTo( + key: K, + value: T['attributes'][K], + ): this; + include(...key: K[]): this; + include(key: K[]): this; + includeAll(): Query; + lessThan(key: K, value: T['attributes'][K]): this; + lessThanOrEqualTo( + key: K, + value: T['attributes'][K], + ): this; + limit(n: number): Query; + matches( + key: K, + regex: RegExp, + modifiers?: string, + ): this; + matchesKeyInQuery< + U extends Object, + K extends keyof T['attributes'], + X extends Extract, + >(key: K, queryKey: X, query: Query): this; + matchesQuery(key: K, query: Query): this; + near(key: K, point: GeoPoint): this; + notContainedIn( + key: K, + values: Array, + ): this; + notEqualTo( + key: K, + value: + | T['attributes'][K] + | (T['attributes'][K] extends Object + ? Pointer + : T['attributes'][K] extends Array + ? E + : never), + ): this; + polygonContains(key: K, point: GeoPoint): this; + select(...keys: K[]): this; + select(keys: K[]): this; + skip(n: number): Query; + sortByTextScore(): this; + startsWith(key: K, prefix: string): this; + subscribe(sessionToken?: string): Promise; + toJSON(): any; + withJSON(json: any): this; + withCount(includeCount?: boolean): this; + withinGeoBox( + key: K, + southwest: GeoPoint, + northeast: GeoPoint, + ): this; + withinKilometers( + key: K, + point: GeoPoint, + maxDistance: number, + sorted?: boolean, + ): this; + withinMiles( + key: K, + point: GeoPoint, + maxDistance: number, + sorted?: boolean, + ): this; + withinPolygon(key: K, points: number[][]): this; + withinRadians( + key: K, + point: GeoPoint, + maxDistance: number, + ): this; + } + + namespace Query { + interface EachOptions extends SuccessFailureOptions, ScopeOptions {} + interface CountOptions extends SuccessFailureOptions, ScopeOptions {} + interface FindOptions extends SuccessFailureOptions, ScopeOptions, RawJSONOptions {} + interface FirstOptions extends SuccessFailureOptions, ScopeOptions, RawJSONOptions {} + interface GetOptions extends SuccessFailureOptions, ScopeOptions, RawJSONOptions {} + + // According to http://docs.parseplatform.org/rest/guide/#aggregate-queries + interface AggregationOptions { + group?: (Record & { objectId?: string }) | undefined; + match?: Record | undefined; + project?: Record | undefined; + limit?: number | undefined; + skip?: number | undefined; + // Sort documentation https://docs.mongodb.com/v3.2/reference/operator/aggregation/sort/#pipe._S_sort + sort?: Record | undefined; + // Sample documentation: https://docs.mongodb.com/v3.2/reference/operator/aggregation/sample/ + sample?: { size: number } | undefined; + // Count documentation: https://docs.mongodb.com/manual/reference/operator/aggregation/count/ + count?: string | undefined; + // Lookup documentation: https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/ + lookup?: + | { + from: string; + localField: string; + foreignField: string; + as: string; + } + | { + from: string; + let?: Record; + pipeline: Record; + as: string; + } + | undefined; + // Graph Lookup documentation: https://docs.mongodb.com/manual/reference/operator/aggregation/graphLookup/ + graphLookup?: + | { + from: string; + startWith?: string; + connectFromField: string; + connectToField: string; + as: string; + maxDepth?: number; + depthField?: string; + restrictSearchWithMatch?: Record; + } + | undefined; + // Facet documentation: https://docs.mongodb.com/manual/reference/operator/aggregation/facet/ + facet?: Record>> | undefined; + // Unwind documentation: https://www.mongodb.com/docs/manual/reference/operator/aggregation/unwind/ + unwind?: + | { + path: string; + includeArrayIndex?: string; + preserveNullAndEmptyArrays?: boolean; + } + | string + | undefined; + } + + // According to https://parseplatform.org/Parse-SDK-JS/api/2.1.0/Parse.Query.html#fullText + interface FullTextOptions { + language?: string | undefined; + caseSensitive?: boolean | undefined; + diacriticSensitive?: boolean | undefined; + } + + interface BatchOptions extends FullOptions { + batchSize?: number | undefined; + } + } + + /** + * Represents a LiveQuery Subscription. + * + * @see https://docs.parseplatform.org/js/guide/#live-queries + * @see NodeJS.EventEmitter + * + * Events list + * --- + * `open` - when you call `query.subscribe()`, we send a subscribe request to + * the LiveQuery server, when we get the confirmation from the LiveQuery server, + * this event will be emitted. When the client loses WebSocket connection to the + * LiveQuery server, we will try to auto reconnect the LiveQuery server. If we + * reconnect the LiveQuery server and successfully resubscribe the ParseQuery, + * you'll also get this event. + * + * ``` + * subscription.on('open', () => {}); + * ``` + * --- + * `create` - when a new ParseObject is created and it fulfills the ParseQuery you subscribe, + * you'll get this event. The object is the ParseObject which is created. + * + * ``` + * subscription.on('create', (object: Parse.Object) => {}); + * ``` + * --- + * `update` event - when an existing ParseObject which fulfills the ParseQuery you subscribe + * is updated (The ParseObject fulfills the ParseQuery before and after changes), + * you'll get this event. The object is the ParseObject which is updated. + * Its content is the latest value of the ParseObject. + * + * ``` + * subscription.on('update', (object: Parse.Object) => {}); + * ``` + * --- + * `enter` event - when an existing ParseObject's old value doesn't fulfill the ParseQuery + * but its new value fulfills the ParseQuery, you'll get this event. The object is the + * ParseObject which enters the ParseQuery. Its content is the latest value of the ParseObject. + * + * ``` + * subscription.on('enter', (object: Parse.Object) => {}); + * ``` + * --- + * `update` event - when an existing ParseObject's old value fulfills the ParseQuery but its new value + * doesn't fulfill the ParseQuery, you'll get this event. The object is the ParseObject + * which leaves the ParseQuery. Its content is the latest value of the ParseObject. + * + * ``` + * subscription.on('leave', (object: Parse.Object) => {}); + * ``` + * --- + * `delete` event - when an existing ParseObject which fulfills the ParseQuery is deleted, you'll + * get this event. The object is the ParseObject which is deleted. + * + * ``` + * subscription.on('delete', (object: Parse.Object) => {}); + * ``` + * --- + * `close` event - when the client loses the WebSocket connection to the LiveQuery + * server and we stop receiving events, you'll get this event. + * + * ``` + * subscription.on('close', () => {}); + * ``` + */ + class LiveQuerySubscription extends EventEmitter { + /** + * Creates an instance of LiveQuerySubscription. + * + * @param id + * @param query + * @param [sessionToken] + */ + constructor(id: string, query: string, sessionToken?: string); + + on( + event: 'open' | 'create' | 'update' | 'enter' | 'leave' | 'delete' | 'close', + listener: (object: Object) => void, + ): this; + + /** + * Closes the subscription. + * + */ + unsubscribe(): void; + } + + /** + * The LiveQuery namespace is basically an EventEmitter + * (source : https://github.com/parse-community/Parse-SDK-JS/blob/8115e959533d1676fe5e5551bc81888b21fc12ef/src/ParseLiveQuery.js) + * https://docs.parseplatform.org/js/guide/#websocket-status + */ + namespace LiveQuery { + function on( + event: 'open' | 'close', + /** When we establish ('open') or lose the WebSocket connection to the LiveQuery server, you’ll get this event */ + listener: () => void, + ): void; + function on( + event: 'error', + /** When some network error or LiveQuery server error happens, you’ll get this event. */ + listener: (error: any) => void, + ): void; + } + + /** + * Represents a Role on the Parse server. Roles represent groupings of + * Users for the purposes of granting permissions (e.g. specifying an ACL + * for an Object). Roles are specified by their sets of child users and + * child roles, all of which are granted any permissions that the parent + * role has. + * + *

Roles must have a name (which cannot be changed after creation of the + * role), and must specify an ACL.

+ * A Parse.Role is a local representation of a role persisted to the Parse + * cloud. + */ + interface Role extends Object { + getRoles(): Relation; + getUsers(): Relation; + getName(): string; + setName(name: string, options?: SuccessFailureOptions): any; + } + interface RoleConstructor extends ObjectStatic { + new (name: string, acl: ACL): Role>; + new (name: string, acl: ACL): Role; + } + const Role: RoleConstructor; + + class Config { + static get(options?: UseMasterKeyOption): Promise; + static current(): Config; + static save(attr: any, options?: { [attr: string]: boolean }): Promise; + + get(attr: string): any; + escape(attr: string): any; + } + + interface Session extends Object { + getSessionToken(): string; + isCurrentSessionRevocable(): boolean; + } + interface SessionConstructor extends ObjectStatic { + new (attributes: T): Session; + new (): Session; + + current(): Promise; + } + const Session: SessionConstructor; + + /** + * + *

A Parse.User object is a local representation of a user persisted to the + * Parse cloud. This class is a subclass of a Parse.Object, and retains the + * same functionality of a Parse.Object, but also extends it with various + * user specific methods, like authentication, signing up, and validation of + * uniqueness.

+ */ + interface User extends Object { + signUp(attrs?: any, options?: SignUpOptions): Promise; + logIn(options?: FullOptions): Promise; + authenticated(): boolean; + isCurrent(): boolean; + /** Since version 3.0.0, Returns true if `current` would return this user */ + isCurrentAsync(): Promise; + + getEmail(): string | undefined; + setEmail(email: string, options?: SuccessFailureOptions): boolean; + + getUsername(): string | undefined; + setUsername(username: string, options?: SuccessFailureOptions): boolean; + + setPassword(password: string, options?: SuccessFailureOptions): boolean; + getSessionToken(): string; + + linkWith: ( + provider: string | AuthProvider, + options: { authData?: AuthData | undefined }, + saveOpts?: FullOptions, + ) => Promise; + _isLinked: (provider: string | AuthProvider) => boolean; + _unlinkFrom: (provider: string | AuthProvider, options?: FullOptions) => Promise; + } + interface UserConstructor extends ObjectStatic { + new (attributes: T): User; + new (attributes?: Attributes): User; + + allowCustomUserClass(isAllowed: boolean): void; + become(sessionToken: string, options?: UseMasterKeyOption): Promise; + current(): T | undefined; + currentAsync(): Promise; + signUp(username: string, password: string, attrs: any, options?: SignUpOptions): Promise; + logIn(username: string, password: string, options?: FullOptions): Promise; + logOut(): Promise; + requestPasswordReset(email: string, options?: SuccessFailureOptions): Promise; + requestEmailVerification(email: string, options?: UseMasterKeyOption): Promise; + extend(protoProps?: any, classProps?: any): any; + hydrate(userJSON: any): Promise; + enableUnsafeCurrentUser(): void; + disableUnsafeCurrentUser(): void; + logInWith( + provider: string | AuthProvider, + options: { authData?: AuthData | undefined }, + saveOpts?: FullOptions, + ): Promise; + _registerAuthenticationProvider: (provider: AuthProvider) => void; + } + const User: UserConstructor; + + /** + * The raw schema response returned from the `GET /parse/schemas` endpoint. + * This is defined here: https://docs.parseplatform.org/js/guide/#schema. + * Unfortunately, `Schema.all()` and `Schema.prototype.get()` return this rather + * than a `Schema`. It is also the only object which provides introspection on + * the schema - such as `className` and `fields`. + */ + interface RestSchema { + className: string; + fields: { + [key: string]: { + type: string; + targetClass?: string; + required?: boolean; + defaultValue?: string; + }; + }; + classLevelPermissions: Schema.CLP; + indexes?: { + [key: string]: { + [key: string]: any; + }; + }; + } + + /** + * A Parse.Schema object is for handling schema data from Parse. + * All the schemas methods require MasterKey. + * + * @param className Parse Class string + * + * https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html + * + * ``` + * const schema = new Parse.Schema('MyClass'); + * schema.addString('field'); + * schema.addIndex('index_name', { field: 1 }); + * schema.save(); + * ``` + */ + class Schema { + constructor(className: string); + + /** + * Static method to get all schemas + * + * @return A promise that is resolved with the result when + * the query completes. + */ + static all(): Promise; + + addArray(key: Schema.AttrType, options?: Schema.FieldOptions): this; + addBoolean(key: Schema.AttrType, options?: Schema.FieldOptions): this; + addDate(key: Schema.AttrType, options?: Schema.FieldOptions): this; + addField(name: string, type?: T, options?: Schema.FieldOptions): this; + addFile(key: Schema.AttrType, options?: Schema.FieldOptions): this; + addGeoPoint(key: Schema.AttrType, options?: Schema.FieldOptions): this; + + /** + * Adding an Index to Create / Update a Schema + * @param name Name of the field that will be created on Parse + * @param index `{ 'field': value }` where `field` should exist in the schema before using addIndex. + * @return Returns the schema, so you can chain this call. + * @example + * ``` + * schema.addIndex('index_name', {'field': 1}); + * ``` + */ + addIndex(name: string, index: Schema.Index): this; + + addNumber(key: Schema.AttrType, options?: Schema.FieldOptions): this; + + addObject(key: Schema.AttrType, options?: Schema.FieldOptions): this; + + /** + * Adding Pointer Field + * @param name Name of the field that will be created on Parse + * @param targetClass Name of the target Pointer Class + * @return Returns the schema, so you can chain this call. + */ + addPointer( + key: Schema.AttrType, + targetClass: string, + options?: Schema.FieldOptions, + ): this; + + addPolygon(key: Schema.AttrType, options?: Schema.FieldOptions): this; + + /** + * Adding Relation Field + * @param name Name of the field that will be created on Parse + * @param targetClass Name of the target Pointer Class + * @return Returns the schema, so you can chain this call. + */ + addRelation( + key: Schema.AttrType, + targetClass: string, + options?: Schema.FieldOptions, + ): this; + + addString(key: Schema.AttrType, options?: Schema.FieldOptions): this; + + /** + * Removing a Schema from Parse Can only be used on Schema without objects + * @returns A promise that is resolved with the result when the query completes. + */ + // @TODO Fix Promise + delete(): Promise; + + /** + * Deleting a Field to Update on a Schema + * @param name Name of the field + * @return Returns the schema, so you can chain this call. + */ + deleteField(name: string): this; + + /** + * Deleting a Index Field to Update on a Schema + * @param name Name of the index field + * @return Returns the schema, so you can chain this call. + */ + deleteIndex(name: string): this; + + /** + * Get the Schema from Parse + */ + get(): Promise; + + /** + * Removes all objects from a Schema (class) in EXERCISE CAUTION, running this will delete all objects for this schema and cannot be reversed + */ + // TODO Fix Promise + purge(): Promise; + + /** + * Create a new Schema on Parse + */ + save(): Promise; + + /** + * Sets Class Level Permissions when creating / updating a Schema. + * EXERCISE CAUTION, running this may override CLP for this schema and cannot be reversed + */ + setCLP(clp: Schema.CLP): this; + + /** + * Update a Schema on Parse + */ + update(): Promise; + } + + namespace Schema { + type TYPE = + | 'String' + | 'Number' + | 'Boolean' + | 'Date' + | 'File' + | 'GeoPoint' + | 'Polygon' + | 'Array' + | 'Object' + | 'Pointer' + | 'Relation'; + type FieldType = + | string + | number + | boolean + | Date + | File + | GeoPoint + | Polygon + | any[] + | object + | Pointer + | Relation; + type AttrType = Extract< + { [K in keyof T['attributes']]: T['attributes'][K] extends V ? K : never }[keyof T['attributes']], + string + >; + + interface FieldOptions< + T extends + | string + | number + | boolean + | Date + | File + | GeoPoint + | Polygon + | any[] + | object + | Pointer + | Relation = any, + > { + required?: boolean | undefined; + defaultValue?: T | undefined; + } + + interface Index { + [fieldName: string]: number | string; + } + + /** + * The id of a `_User` object or a role name prefixed by `'role:'`. + * @example + * '*': false, // public + * requiresAuthentication: false, + * 'role:Admin': true, + * 'idOfASpecificUser': true + */ + interface CLPField { + '*'?: boolean | undefined; + requiresAuthentication?: boolean | undefined; + /** `role:Admin` */ + [userIdOrRoleName: string]: boolean | undefined; + } + + interface CLP { + find?: CLPField | undefined; + get?: CLPField | undefined; + count?: CLPField | undefined; + create?: CLPField | undefined; + update?: CLPField | undefined; + delete?: CLPField | undefined; + addField?: CLPField | undefined; + /** Array of fields that point to a `_User` object's ID or a `Role` object's name */ + readUserFields?: string[] | undefined; + /** Array of fields that point to a `_User` object's ID or a `Role` object's name */ + writeUserFields?: string[] | undefined; + protectedFields?: { + /** '*', user id, or role: followed by a list of fields. */ + [userIdOrRoleName: string]: string[]; + }; + } + } + + namespace Analytics { + function track(name: string, dimensions: any): Promise; + } + + /** + * Provides utility functions for working with Anonymously logged-in users. + */ + namespace AnonymousUtils { + function isLinked(user: User): boolean; + function link(user: User, options?: ScopeOptions): Promise; + function logIn(options?: ScopeOptions): Promise; + } + + /** + * Provides a set of utilities for using Parse with Facebook. + * Provides a set of utilities for using Parse with Facebook. + */ + namespace FacebookUtils { + function init(options?: any): void; + function isLinked(user: User): boolean; + function link(user: User, permissions: any, options?: SuccessFailureOptions): void; + function logIn(permissions: any, options?: FullOptions): void; + function unlink(user: User, options?: SuccessFailureOptions): void; + } + + /** + * Contains functions for calling and declaring + * cloud functions. + *

+ * Some functions are only available from Cloud Code. + *

+ */ + namespace Cloud { + interface CookieOptions { + domain?: string | undefined; + expires?: Date | undefined; + httpOnly?: boolean | undefined; + maxAge?: number | undefined; + path?: string | undefined; + secure?: boolean | undefined; + } + + interface HttpResponse { + buffer?: Buffer | undefined; + cookies?: any; + data?: any; + headers?: any; + status?: number | undefined; + text?: string | undefined; + } + + interface JobRequest { + params: T; + message: (response: any) => void; + } + + interface Params { + [key: string]: any; + } + + interface FunctionRequest { + installationId?: string | undefined; + master?: boolean | undefined; + params: T; + user?: User | undefined; + } + + interface ValidatorField { + type?: any; + constant?: boolean | undefined; + default?: any; + options?: any[] | Function | undefined; + error?: String | undefined; + required?: boolean; + } + interface ValidatorFields { + [field: string]: ValidatorField; + } + interface Validator { + requireUser?: boolean | undefined; + requireMaster?: boolean | undefined; + validateMasterKey?: boolean | undefined; + skipWithMasterKey?: boolean | undefined; + requireAnyUserRoles?: String[] | Function | undefined; + requireAllUserRoles?: String[] | Function | undefined; + fields?: ValidatorFields | String[] | undefined; + requireUserKeys?: ValidatorFields | String[] | undefined; + } + + interface Cookie { + name?: string | undefined; + options?: CookieOptions | undefined; + value?: string | undefined; + } + + interface TriggerRequest { + installationId?: string | undefined; + master?: boolean | undefined; + user?: User | undefined; + ip: string; + headers: any; + triggerName: string; + log: any; + object: T; + original?: T | undefined; + } + + interface AfterSaveRequest extends TriggerRequest { + context: Record; + } + interface AfterDeleteRequest extends TriggerRequest {} // tslint:disable-line no-empty-interface + interface BeforeDeleteRequest extends TriggerRequest {} // tslint:disable-line no-empty-interface + interface BeforeSaveRequest extends TriggerRequest { + context: Record; + } + + interface FileTriggerRequest extends TriggerRequest { + file: File; + fileSize: number; + contentLength: number; + } + + // Read preference describes how MongoDB driver route read operations to the members of a replica set. + enum ReadPreferenceOption { + Primary = 'PRIMARY', + PrimaryPreferred = 'PRIMARY_PREFERRED', + Secondary = 'SECONDARY', + SecondaryPreferred = 'SECONDARY_PREFERRED', + Nearest = 'NEAREST', + } + + interface BeforeFindRequest extends TriggerRequest { + query: Query; + count: boolean; + isGet: boolean; + readPreference?: ReadPreferenceOption | undefined; + } + + interface AfterFindRequest extends TriggerRequest { + objects: T[]; + } + + function afterDelete( + arg1: { new (): T } | string, + func?: (request: AfterDeleteRequest) => Promise | void, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + function afterSave( + arg1: { new (): T } | string, + func?: (request: AfterSaveRequest) => Promise | void, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + function beforeDelete( + arg1: { new (): T } | string, + func?: (request: BeforeDeleteRequest) => Promise | void, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + function beforeSave( + arg1: { new (): T } | string, + func?: (request: BeforeSaveRequest) => Promise | void, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + function beforeFind( + arg1: { new (): T } | string, + func?: (request: BeforeFindRequest) => Promise> | Promise | Query | void, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + function afterFind( + arg1: { new (): T } | string, + func?: (request: AfterFindRequest) => any, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + + function beforeLogin(func?: (request: TriggerRequest) => PromiseLike | void): void; + function afterLogin( + func?: (request: TriggerRequest) => PromiseLike | void, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + function afterLogout( + func?: (request: TriggerRequest) => PromiseLike | void, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + + function beforeSaveFile( + func?: (request: FileTriggerRequest) => PromiseLike | void, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + function afterSaveFile( + func?: (request: FileTriggerRequest) => PromiseLike | void, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + function beforeDeleteFile( + func?: (request: FileTriggerRequest) => PromiseLike | void, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + function afterDeleteFile( + func?: (request: FileTriggerRequest) => PromiseLike | void, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + + function define( + name: string, + func: (request: FunctionRequest) => any, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + function define any>( + name: string, + func: (request: FunctionRequest<{}>) => Promise> | ReturnType, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + function define[0]]: Parameters[0][P] }) => any>( + name: string, + func: (request: FunctionRequest[0]>) => Promise> | ReturnType, + validator?: Validator | ((request: FunctionRequest) => any), + ): void; + /** + * Gets data for the current set of cloud jobs. + * @returns A promise that will be resolved with the result of the function. + */ + function getJobsData(): Promise; + /** + * Gets job status by Id + * @param jobStatusId The Id of Job Status. + * @returns Status of Job. + */ + function getJobStatus(jobStatusId: string): Promise; + function httpRequest(options: HTTPOptions): Promise; + function job(name: string, func?: (request: JobRequest) => Promise | void): HttpResponse; + function run(name: string, data?: Params, options?: RunOptions): Promise; + function run any>(name: string, data?: null, options?: RunOptions): Promise>; + function run[0]]: Parameters[0][P] }) => any>( + name: string, + data: Parameters[0], + options?: RunOptions, + ): Promise>; + /** + * Starts a given cloud job, which will process asynchronously. + * @param jobName The function name. + * @param data The parameters to send to the cloud function. + * @returns A promise that will be resolved with the jobStatusId of the job. + */ + function startJob(jobName: string, data: any): Promise; + function useMasterKey(): void; + + interface RunOptions extends SuccessFailureOptions, ScopeOptions {} + + /** + * To use this Cloud Module in Cloud Code, you must require 'buffer' in your JavaScript file. + * + * import Buffer = require("buffer").Buffer; + */ + let HTTPOptions: new () => HTTPOptions; + interface HTTPOptions { + /** + * The body of the request. + * If it is a JSON object, then the Content-Type set in the headers must be application/x-www-form-urlencoded or application/json. + * You can also set this to a Buffer object to send raw bytes. + * If you use a Buffer, you should also set the Content-Type header explicitly to describe what these bytes represent. + */ + body?: string | Buffer | object | undefined; + /** + * Defaults to 'false'. + */ + followRedirects?: boolean | undefined; + /** + * The headers for the request. + */ + headers?: + | { + [headerName: string]: string | number | boolean; + } + | undefined; + /** + * The method of the request (i.e GET, POST, etc). + */ + method?: string | undefined; + /** + * The query portion of the url. + */ + params?: any; + /** + * The url to send the request to. + */ + url: string; + + success?: ((response: any) => void) | undefined; + error?: ((response: any) => void) | undefined; + } + } + + namespace EventuallyQueue { + interface QueueObject { + queueId: string; + action: string; + object: Object; + serverOptions: Object.SaveOptions | RequestOptions; + id: string; + className: string; + hash: string; + createdAt: Date; + } + type Queue = QueueObject[]; + /** + * Add object to queue with save operation. + * + * @param object Parse.Object to be saved eventually + * @param serverOptions See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#save Parse.Object.save} options. + * @returns A promise that is fulfilled if object is added to queue. + * @see Parse.Object#saveEventually + */ + function save(object: Object, serverOptions?: Object.SaveOptions): Promise; + /** + * Add object to queue with save operation. + * + * @param object Parse.Object to be destroyed eventually + * @param serverOptions See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#destroy Parse.Object.destroy} options + * @returns A promise that is fulfilled if object is added to queue. + * @see Parse.Object#destroyEventually + */ + function destroy(object: Object, serverOptions?: RequestOptions): Promise; + // function store(data: any): Promise; + // function load(): Promise; + /** + * Sets the in-memory queue from local storage and returns. + */ + function getQueue(): Promise; + /** + * Removes all objects from queue. + * @returns A promise that is fulfilled when queue is cleared. + */ + function clear(): Promise; + /** + * Return the number of objects in the queue. + */ + function length(): Promise; + /** + * Sends the queue to the server. + * @returns Returns true if queue was sent successfully. + */ + function sendQueue(): Promise; + /** + * Start polling server for network connection. + * Will send queue if connection is established. + * + * @param [ms] Milliseconds to ping the server. Default 2000ms + */ + function poll(ms?: number): void; + /** + * Turns off polling. + */ + function stopPoll(): void; + /** + * Return true if pinging the server. + */ + function isPolling(): boolean; + } + + class Error { + static OTHER_CAUSE: ErrorCode.OTHER_CAUSE; + static INTERNAL_SERVER_ERROR: ErrorCode.INTERNAL_SERVER_ERROR; + static CONNECTION_FAILED: ErrorCode.CONNECTION_FAILED; + static OBJECT_NOT_FOUND: ErrorCode.OBJECT_NOT_FOUND; + static INVALID_QUERY: ErrorCode.INVALID_QUERY; + static INVALID_CLASS_NAME: ErrorCode.INVALID_CLASS_NAME; + static MISSING_OBJECT_ID: ErrorCode.MISSING_OBJECT_ID; + static INVALID_KEY_NAME: ErrorCode.INVALID_KEY_NAME; + static INVALID_POINTER: ErrorCode.INVALID_POINTER; + static INVALID_JSON: ErrorCode.INVALID_JSON; + static COMMAND_UNAVAILABLE: ErrorCode.COMMAND_UNAVAILABLE; + static NOT_INITIALIZED: ErrorCode.NOT_INITIALIZED; + static INCORRECT_TYPE: ErrorCode.INCORRECT_TYPE; + static INVALID_CHANNEL_NAME: ErrorCode.INVALID_CHANNEL_NAME; + static PUSH_MISCONFIGURED: ErrorCode.PUSH_MISCONFIGURED; + static OBJECT_TOO_LARGE: ErrorCode.OBJECT_TOO_LARGE; + static OPERATION_FORBIDDEN: ErrorCode.OPERATION_FORBIDDEN; + static CACHE_MISS: ErrorCode.CACHE_MISS; + static INVALID_NESTED_KEY: ErrorCode.INVALID_NESTED_KEY; + static INVALID_FILE_NAME: ErrorCode.INVALID_FILE_NAME; + static INVALID_ACL: ErrorCode.INVALID_ACL; + static TIMEOUT: ErrorCode.TIMEOUT; + static INVALID_EMAIL_ADDRESS: ErrorCode.INVALID_EMAIL_ADDRESS; + static MISSING_CONTENT_TYPE: ErrorCode.MISSING_CONTENT_TYPE; + static MISSING_CONTENT_LENGTH: ErrorCode.MISSING_CONTENT_LENGTH; + static INVALID_CONTENT_LENGTH: ErrorCode.INVALID_CONTENT_LENGTH; + static FILE_TOO_LARGE: ErrorCode.FILE_TOO_LARGE; + static FILE_SAVE_ERROR: ErrorCode.FILE_SAVE_ERROR; + static DUPLICATE_VALUE: ErrorCode.DUPLICATE_VALUE; + static INVALID_ROLE_NAME: ErrorCode.INVALID_ROLE_NAME; + static EXCEEDED_QUOTA: ErrorCode.EXCEEDED_QUOTA; + static SCRIPT_FAILED: ErrorCode.SCRIPT_FAILED; + static VALIDATION_ERROR: ErrorCode.VALIDATION_ERROR; + static INVALID_IMAGE_DATA: ErrorCode.INVALID_IMAGE_DATA; + static UNSAVED_FILE_ERROR: ErrorCode.UNSAVED_FILE_ERROR; + static INVALID_PUSH_TIME_ERROR: ErrorCode.INVALID_PUSH_TIME_ERROR; + static FILE_DELETE_ERROR: ErrorCode.FILE_DELETE_ERROR; + static REQUEST_LIMIT_EXCEEDED: ErrorCode.REQUEST_LIMIT_EXCEEDED; + static INVALID_EVENT_NAME: ErrorCode.INVALID_EVENT_NAME; + static USERNAME_MISSING: ErrorCode.USERNAME_MISSING; + static PASSWORD_MISSING: ErrorCode.PASSWORD_MISSING; + static USERNAME_TAKEN: ErrorCode.USERNAME_TAKEN; + static EMAIL_TAKEN: ErrorCode.EMAIL_TAKEN; + static EMAIL_MISSING: ErrorCode.EMAIL_MISSING; + static EMAIL_NOT_FOUND: ErrorCode.EMAIL_NOT_FOUND; + static SESSION_MISSING: ErrorCode.SESSION_MISSING; + static MUST_CREATE_USER_THROUGH_SIGNUP: ErrorCode.MUST_CREATE_USER_THROUGH_SIGNUP; + static ACCOUNT_ALREADY_LINKED: ErrorCode.ACCOUNT_ALREADY_LINKED; + static INVALID_SESSION_TOKEN: ErrorCode.INVALID_SESSION_TOKEN; + static LINKED_ID_MISSING: ErrorCode.LINKED_ID_MISSING; + static INVALID_LINKED_SESSION: ErrorCode.INVALID_LINKED_SESSION; + static UNSUPPORTED_SERVICE: ErrorCode.UNSUPPORTED_SERVICE; + static AGGREGATE_ERROR: ErrorCode.AGGREGATE_ERROR; + static FILE_READ_ERROR: ErrorCode.FILE_READ_ERROR; + static X_DOMAIN_REQUEST: ErrorCode.X_DOMAIN_REQUEST; + + code: ErrorCode; + message: string; + + constructor(code: ErrorCode, message: string); + } + + /** + * A Parse.Op is an atomic operation that can be applied to a field in a + * Parse.Object. For example, calling object.set("foo", "bar") + * is an example of a Parse.Op.Set. Calling object.unset("foo") + * is a Parse.Op.Unset. These operations are stored in a Parse.Object and + * sent to the server as part of object.save() operations. + * Instances of Parse.Op should be immutable. + * + * You should not create subclasses of Parse.Op or instantiate Parse.Op + * directly. + */ + namespace Op { + interface BaseOperation { + objects(): any[]; + } + + interface Add extends BaseOperation { + toJSON(): any; + } + + interface AddUnique extends BaseOperation { + toJSON(): any; + } + + interface Increment { + amount: number; + toJSON(): any; + } + + interface Relation { + added(): Object[]; + removed: Object[]; + toJSON(): any; + } + + interface Set { + value(): any; + toJSON(): any; + } + + interface Unset { + toJSON(): any; + } + } + + /** + * Contains functions to deal with Push in Parse + */ + namespace Push { + function send(data: PushData, options?: SendOptions): Promise; + + interface PushData { + channels?: string[] | undefined; + push_time?: Date | undefined; + expiration_time?: Date | undefined; + expiration_interval?: number | undefined; + where?: Query | undefined; + data?: any; + alert?: string | undefined; + badge?: string | undefined; + sound?: string | undefined; + title?: string | undefined; + notification?: any; + content_available?: any; + } + + interface SendOptions extends UseMasterKeyOption { + success?: (() => void) | undefined; + error?: ((error: Error) => void) | undefined; + } + } + + /** + * Call this method first to set up your authentication tokens for Parse. + * You can get your keys from the Data Browser on parse.com. + * @param applicationId Your Parse Application ID. + * @param javaScriptKey (optional) Your Parse JavaScript Key (Not needed for parse-server) + * @param masterKey (optional) Your Parse Master Key. (Node.js only!) + */ + function initialize(applicationId: string, javaScriptKey?: string, masterKey?: string): void; + + /** + * Use this to set custom headers + * The headers will be sent with every parse request + */ + namespace CoreManager { + function set(key: string, value: any): void; + function get(key: string): void; + } + + /** + * Additionally on React-Native / Expo environments, add AsyncStorage from 'react-native' package + * @param AsyncStorage AsyncStorage from 'react-native' package + */ + function setAsyncStorage(AsyncStorage: any): void; + + /** + * Gets all contents from Local Datastore. + */ + function dumpLocalDatastore(): Promise<{ [key: string]: any }>; + + /** + * Enable pinning in your application. + * This must be called before your application can use pinning. + */ + function enableLocalDatastore(): void; + + /** + * Flag that indicates whether Local Datastore is enabled. + */ + function isLocalDatastoreEnabled(): boolean; + + function setLocalDatastoreController(controller: any): void; + + /** + * Call this method to set your LocalDatastoreStorage engine + * If using React-Native use {@link Parse.setAsyncStorage Parse.setAsyncStorage()} + * @param controller a data storage. + */ + function setLocalDatastoreController(controller: any): void; + + /** + * Enable the current user encryption. + * This must be called before login any user. + */ + function enableEncryptedUser(): void; + + /** + * Flag that indicates whether Encrypted User is enabled. + */ + function isEncryptedUserEnabled(): boolean; + } +} + +export = Parse; diff --git a/types/node.d.ts b/types/node.d.ts new file mode 100644 index 000000000..d4bbf2ccf --- /dev/null +++ b/types/node.d.ts @@ -0,0 +1,3 @@ +import * as parse from "./index"; + +export = parse; diff --git a/types/react-native.d.ts b/types/react-native.d.ts new file mode 100644 index 000000000..d4bbf2ccf --- /dev/null +++ b/types/react-native.d.ts @@ -0,0 +1,3 @@ +import * as parse from "./index"; + +export = parse; diff --git a/types/tests.ts b/types/tests.ts new file mode 100644 index 000000000..1a55f98ff --- /dev/null +++ b/types/tests.ts @@ -0,0 +1,2175 @@ +// Parse is a global type, but it can also be imported +class GameScore extends Parse.Object { + constructor(options?: any) { + super('GameScore', options); + } +} + +class Game extends Parse.Object<{ gameScore: GameScore; score: string }> { + constructor(options?: any) { + super('Game', options); + } +} + +function test_config() { + Parse.Config.save({ foo: 'bar' }, { foo: true }); + Parse.Config.get({ useMasterKey: true }); +} + +function test_object() { + const game = new Game(); + + game.save(null, { + useMasterKey: true, + sessionToken: 'sometoken', + cascadeSave: false, + }).then(result => result); + + if (!game.isNew()) { + console.error('Game should be new'); + } + + if (game.toPointer().className !== 'Game') { + console.log("Class name should be 'Game"); + } + + game.fetch({ + success(g: Game) {}, + }); + + // Create a new instance of that class. + const gameScore = new GameScore(); + + gameScore.set('score', 1337); + gameScore.set('playerName', 'Sean Plott'); + gameScore.set('cheatMode', false); + + // Setting attrs using object + gameScore.set({ + level: '10', + difficult: 15, + }); + + const score = gameScore.get('score'); + const playerName = gameScore.get('playerName'); + const cheatMode = gameScore.get('cheatMode'); + + gameScore.increment('score'); + gameScore.addUnique('skills', 'flying'); + gameScore.addUnique('skills', 'kungfu'); + gameScore.addAll('skills', ['kungfu']); + gameScore.addAllUnique('skills', ['kungfu']); + gameScore.remove('skills', 'flying'); + gameScore.removeAll('skills', ['kungFu']); + game.set('gameScore', gameScore); + + const gameCopy = Game.fromJSON(JSON.parse(JSON.stringify(game)), true); + + const object = new Parse.Object('TestObject'); + object.equals(gameScore); + object.fetchWithInclude(['key1', 'key2']); +} + +function test_errors() { + try { + throw new Parse.Error(Parse.Error.INTERNAL_SERVER_ERROR, 'sdfds'); + } catch (error) { + if (error.code !== 1) { + console.error('Error code did not match expected number.'); + } + } +} + +function test_query() { + const gameScore = new GameScore(); + + const query = new Parse.Query(GameScore); + query.equalTo('playerName', 'Dan Stemkoski'); + query.notEqualTo('playerName', 'Michael Yabuti'); + query.fullText('playerName', 'dan', { language: 'en', caseSensitive: false, diacriticSensitive: true }); + query.greaterThan('playerAge', 18); + query.eachBatch(objs => Promise.resolve(), { batchSize: 10 }); + query.each(score => Promise.resolve()); + query.hint('_id_'); + query.explain(true); + query.limit(10); + query.skip(10); + + // Sorts the results in ascending order by the score field + query.ascending('score'); + + // Sorts the results in descending order by the score field + query.descending('score'); + + // Restricts to wins < 50 + query.lessThan('wins', 50); + + // Restricts to wins <= 50 + query.lessThanOrEqualTo('wins', 50); + + // Restricts to wins > 50 + query.greaterThan('wins', 50); + + // Restricts to wins >= 50 + query.greaterThanOrEqualTo('wins', 50); + + query.containedBy('place', ['1', '2']); + // Finds scores from any of Jonathan, Dario, or Shawn + query.containedIn('playerName', ['Jonathan Walsh', 'Dario Wunsch', 'Shawn Simon']); + + // Finds scores from anyone who is neither Jonathan, Dario, nor Shawn + query.notContainedIn('playerName', ['Jonathan Walsh', 'Dario Wunsch', 'Shawn Simon']); + + // Finds objects that have the score set + query.exists('score'); + + // Finds objects that don't have the score set + query.doesNotExist('score'); + query.matchesKeyInQuery('hometown', 'city', query); + query.doesNotMatchKeyInQuery('hometown', 'city', query); + query.select('score', 'playerName'); + + // Find objects where the array in arrayKey contains 2. + query.equalTo('arrayKey', 2); + + // Find objects where the array in arrayKey contains all of the elements 2, 3, and 4. + query.containsAll('arrayKey', [2, 3, 4]); + query.containsAllStartingWith('arrayKey', [2, 3, 4]); + + query.startsWith('name', "Big Daddy's"); + query.equalTo('score', gameScore); + query.exists('score'); + query.include('score'); + query.include(['score.team']); + query.includeAll(); + query.sortByTextScore(); + // Find objects that match the aggregation pipeline + query.aggregate({ + group: { + objectId: '$name', + }, + }); + + query.aggregate({ + count: 'total', + }); + + query.aggregate({ + lookup: { + from: 'Collection', + foreignField: 'id', + localField: 'id', + as: 'result', + }, + }); + query.aggregate({ + lookup: { + from: 'Target', + let: { foo: 'bar', baz: 123 }, + pipeline: [], + as: 'result', + }, + }); + + query.aggregate({ + graphLookup: { + from: 'Target', + connectFromField: 'objectId', + connectToField: 'newId', + as: 'result', + }, + }); + + query.aggregate({ + facet: { + foo: [ + { + count: 'total', + }, + ], + bar: [ + { + group: { + objectId: '$name', + }, + }, + ], + }, + }); + + query.aggregate({ + unwind: '$field', + }); + + query.aggregate({ + unwind: { + path: '$field', + includeArrayIndex: 'newIndex', + preserveNullAndEmptyArrays: true, + }, + }); + + // Find objects with distinct key + query.distinct('name'); + + const testQuery = Parse.Query.or(query, query); +} + +function test_query_exclude() { + const gameScore = new GameScore(); + + const query = new Parse.Query(GameScore); + + // Show all keys, except the specified key. + query.exclude('place'); + + const testQuery = Parse.Query.or(query, query); +} + +async function test_query_promise() { + // Test promise with a query + const findQuery = new Parse.Query('Test'); + findQuery + .find() + .then(() => { + // success + }) + .catch(() => { + // error + }); + + const getQuery = new Parse.Query('Test'); + try { + await getQuery.get('objectId'); + } catch (error) { + // noop + } + + await getQuery.map((score, index) => score.increment('score', index)); + await getQuery.reduce((accum, score, index) => (accum += score.get('score')), 0); + await getQuery.reduce((accum, score, index) => (accum += score.get('score')), 0, { batchSize: 200 }); + await getQuery.filter(scores => scores.get('score') > 0); + await getQuery.filter(scores => scores.get('score') > 0, { batchSize: 10 }); +} + +async function test_live_query() { + const subscription = await new Parse.Query('Test').subscribe(); + subscription.on('close', object => { + // $ExpectType Object + object; + }); + subscription.on('create', object => { + // $ExpectType Object + object; + }); + subscription.on('delete', object => { + // $ExpectType Object + object; + }); + subscription.on('enter', object => { + // $ExpectType Object + object; + }); + subscription.on('leave', object => { + // $ExpectType Object + object; + }); + subscription.on('open', object => { + // $ExpectType Object + object; + }); + subscription.on('update', object => { + // $ExpectType Object + object; + }); +} + +function return_a_generic_query(): Parse.Query { + return new Parse.Query(Game); +} + +function test_anonymous_utils() { + // $ExpectType boolean + Parse.AnonymousUtils.isLinked(new Parse.User()); + // $ExpectType Promise> + Parse.AnonymousUtils.link(new Parse.User(), { useMasterKey: true, sessionToken: '' }); + // $ExpectType Promise> + Parse.AnonymousUtils.logIn({ useMasterKey: true, sessionToken: '' }); +} + +function return_a_query(): Parse.Query { + return new Parse.Query(Game); +} + +function test_each() { + new Parse.Query(Game).each(game => { + // $ExpectType Game + game; + }); +} + +function test_file() { + const base64 = 'V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE='; + let file = new Parse.File('myfile.txt', { base64 }); + + file = new Parse.File('nana', { uri: 'http://example.com/image.jps' }); + + const bytes = [0xbe, 0xef, 0xca, 0xfe]; + file = new Parse.File('myfile.txt', bytes); + + file = new Parse.File('myfile.zzz', new Blob(), 'image/png'); + + const src = file.url(); + const secure = file.url({ forceSecure: true }); + + file.save().then( + () => { + // The file has been saved to Parse. + }, + error => { + // The file either could n ot be read, or could not be saved to Parse. + }, + ); + + Parse.Cloud.httpRequest({ url: file.url() }).then((response: Parse.Cloud.HttpResponse) => { + // result + }); + + // TODO: Check + + file.cancel(); + file.destroy(); +} + +function test_file_tags_and_metadata() { + const base64 = 'V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE='; + const file = new Parse.File('myfile.txt', { base64 }); + file.setTags({ ownerId: 42, status: 'okay' }); + file.addTag('labes', ['one', 'two', 'three']); + file.setMetadata({ contentType: 'plain/text', contentLength: 579 }); + file.addMetadata('author', 'John Doe'); + + const tags = file.tags(); + const ownerId = tags['ownerId']; + + const metadata = file.metadata(); + const contentType = metadata['contentType']; +} + +function test_analytics() { + const dimensions = { + // Define ranges to bucket data points into meaningful segments + priceRange: '1000-1500', + // Did the user filter the query? + source: 'craigslist', + // Do searches happen more often on weekdays or weekends? + dayType: 'weekday', + }; + // Send the dimensions to Parse along with the 'search' event + Parse.Analytics.track('search', dimensions); + + const codeString = '404'; + Parse.Analytics.track('error', { code: codeString }); +} + +function test_relation() { + const game1 = new Game(); + const game2 = new Game(); + + new Parse.User() + .relation('games') + .query() + .find() + .then((g: Game[]) => {}); + new Parse.User().relation('games').add(game1); + new Parse.User().relation('games').add([game1, game2]); + + new Parse.User().relation('games').remove(game1); + new Parse.User().relation('games').remove([game1, game2]); +} + +function test_user() { + const user = new Parse.User(); + user.set('username', 'my name'); + user.set('password', 'my pass'); + user.set('email', 'email@example.com'); + user.signUp(null, { useMasterKey: true }); + + const anotherUser: Parse.User = Parse.User.fromJSON({}); + anotherUser.set('email', 'email@example.com'); +} + +async function test_user_currentAsync() { + const asyncUser = await Parse.User.currentAsync(); + if (asyncUser) { + asyncUser.set('email', 'email@example.com'); + } else if (asyncUser === null) { + Parse.User.logIn('email@example.com', 'my pass'); + } +} + +function test_user_acl_roles() { + const user = new Parse.User(); + user.set('username', 'my name'); + user.set('password', 'my pass'); + user.set('email', 'email@example.com'); + + // other fields can be set just like with Parse.Object + user.set('phone', '415-392-0202'); + + const currentUser = Parse.User.current(); + if (currentUser) { + // do stuff with the user + } else { + // show the signup or login page + } + + Parse.User.become('session-token-here').then( + user => { + // The current user is now set to user. + }, + error => { + // The token could not be validated. + }, + ); + + Parse.User.hydrate({}).then( + user => { + // The current user is now set to user. + }, + error => { + // The token could not be validated. + }, + ); + + const game = new Game(); + game.set('gameScore', new GameScore()); + game.setACL(new Parse.ACL(Parse.User.current())); + game.save().then((game: Game) => {}); + game.save(null, { useMasterKey: true }); + game.save({ score: '10' }, { useMasterKey: true }).then( + game => { + // Update game then revert it to the last saved state. + game.set('score', '20'); + game.revert('score'); + game.revert('score', 'ACL'); + game.revert(); + }, + error => { + // The save failed + }, + ); + + const groupACL = new Parse.ACL(); + + const userList: Parse.User[] = [Parse.User.current()!]; + // userList is an array with the users we are sending this message to. + for (const userListItem of userList) { + groupACL.setReadAccess(userListItem, true); + groupACL.setWriteAccess(userListItem, true); + } + + groupACL.setPublicReadAccess(true); + + game.setACL(groupACL); + + Parse.User.requestPasswordReset('email@example.com').then( + data => { + // The current user is now set to user. + }, + error => { + // The token could not be validated. + }, + ); + + Parse.User.requestEmailVerification('email@example.com').then( + data => { + // The current user is now set to user. + }, + error => { + // The token could not be validated. + }, + ); + + // By specifying no write privileges for the ACL, we can ensure the role cannot be altered. + const role = new Parse.Role('Administrator', groupACL); + role.getUsers().add(userList[0]); + role.getRoles().add(role); + role.save(); + + Parse.User.logOut().then(data => { + // logged out + }); +} + +function test_facebook_util() { + Parse.FacebookUtils.init({ + appId: 'YOUR_APP_ID', // Facebook App ID + channelUrl: '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File + cookie: true, // enable cookies to allow Parse to access the session + xfbml: true, // parse XFBML + }); + + Parse.FacebookUtils.logIn(null, { + success: (user: Parse.User) => { + if (!user.existed()) { + alert('User signed up and logged in through Facebook!'); + } else { + alert('User logged in through Facebook!'); + } + }, + error: (user: Parse.User, error: any) => { + alert('User cancelled the Facebook login or did not fully authorize.'); + }, + }); + + const user = Parse.User.current()!; + + if (!Parse.FacebookUtils.isLinked(user)) { + Parse.FacebookUtils.link(user, null, { + success: (user: any) => { + alert('Woohoo, user logged in with Facebook!'); + }, + error: (user: any, error: any) => { + alert('User cancelled the Facebook login or did not fully authorize.'); + }, + }); + } + + Parse.FacebookUtils.unlink(user, { + success: (user: Parse.User) => { + alert('The user is no longer associated with their Facebook account.'); + }, + }); +} + +async function test_cloud_functions() { + Parse.Cloud.run( + 'hello', + {}, + { + success: (result: any) => { + // result + }, + error: (error: any) => {}, + }, + ); + + // $ExpectType any + await Parse.Cloud.run('SomeFunction'); + + // $ExpectType any + await Parse.Cloud.run('SomeFunction', { something: 'whatever' }); + + // $ExpectType any + await Parse.Cloud.run('SomeFunction', null, { useMasterKey: true }); + + // ExpectType boolean + await Parse.Cloud.run<() => boolean>('SomeFunction'); + + // $ExpectType boolean + await Parse.Cloud.run<() => boolean>('SomeFunction', null); + + // $ExpectType boolean + await Parse.Cloud.run<() => boolean>('SomeFunction', null, { useMasterKey: true }); + + // $ExpectType number + await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction', { paramA: 'hello' }); + + // @ts-expect-error + await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction'); + + // @ts-expect-error + await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction', { paramZ: 'hello' }); + + // @ts-expect-error + await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction', null, { useMasterKey: true }); + + // @ts-expect-error + await Parse.Cloud.run<(params: string) => any>('SomeFunction', 'hello'); + + Parse.Cloud.afterDelete('MyCustomClass', (request: Parse.Cloud.AfterDeleteRequest) => { + // result + }); + + Parse.Cloud.afterSave('MyCustomClass', (request: Parse.Cloud.AfterSaveRequest) => { + if (!request.context) { + throw new Error('Request context should be defined'); + } + // result + }); + + Parse.Cloud.beforeDelete('MyCustomClass', (request: Parse.Cloud.BeforeDeleteRequest) => { + // result + }); + + Parse.Cloud.beforeDelete('MyCustomClass', async (request: Parse.Cloud.BeforeDeleteRequest) => { + // result + }); + + interface BeforeSaveObject { + immutable: boolean; + } + + Parse.Cloud.beforeSave('MyCustomClass', async request => { + if (request.object.isNew()) { + if (!request.object.has('immutable')) throw new Error('Field immutable is required'); + } else { + const original = request.original; + if (original == null) { + // When the object is not new, request.original must be defined + throw new Error('Original must me defined for an existing object'); + } + + if (original.get('immutable') !== request.object.get('immutable')) { + throw new Error('This field cannot be changed'); + } + } + if (!request.context) { + throw new Error('Request context should be defined'); + } + }); + + Parse.Cloud.beforeFind('MyCustomClass', (request: Parse.Cloud.BeforeFindRequest) => { + const query = request.query; // the Parse.Query + const user = request.user; // the user + const isMaster = request.master; // if the query is run with masterKey + const isCount = request.count; // if the query is a count operation (available on parse-server 2.4.0 or up) + const isGet = request.isGet; // if the query is a get operation + + // All possible read preferences + request.readPreference = Parse.Cloud.ReadPreferenceOption.Primary; + request.readPreference = Parse.Cloud.ReadPreferenceOption.PrimaryPreferred; + request.readPreference = Parse.Cloud.ReadPreferenceOption.Secondary; + request.readPreference = Parse.Cloud.ReadPreferenceOption.SecondaryPreferred; + request.readPreference = Parse.Cloud.ReadPreferenceOption.Nearest; + }); + + Parse.Cloud.beforeFind('MyCustomClass', (request: Parse.Cloud.BeforeFindRequest) => { + const query = request.query; // the Parse.Query + + return new Parse.Query('QueryMe!'); + }); + + Parse.Cloud.beforeFind('MyCustomClass', async (request: Parse.Cloud.BeforeFindRequest) => { + const query = request.query; // the Parse.Query + + return new Parse.Query('QueryMe, IN THE FUTURE!'); + }); + + Parse.Cloud.afterFind('MyCustomClass', async (request: Parse.Cloud.AfterFindRequest) => { + return new Parse.Object('MyCustomClass'); + }); + + Parse.Cloud.beforeLogin((request: Parse.Cloud.TriggerRequest) => { + return Promise.resolve(); + }); + + Parse.Cloud.afterLogin((request: Parse.Cloud.TriggerRequest) => { + return Promise.resolve(); + }); + + Parse.Cloud.afterLogout((request: Parse.Cloud.TriggerRequest) => { + return Promise.resolve(); + }); + + Parse.Cloud.beforeSaveFile((request: Parse.Cloud.FileTriggerRequest) => { + return Promise.resolve(new Parse.File('myFile.txt', { base64: '' })); + }); + + Parse.Cloud.beforeSaveFile((request: Parse.Cloud.FileTriggerRequest) => {}); + + Parse.Cloud.beforeDeleteFile((request: Parse.Cloud.FileTriggerRequest) => {}); + + Parse.Cloud.afterDeleteFile((request: Parse.Cloud.FileTriggerRequest) => {}); + + Parse.Cloud.define('AFunc', (request: Parse.Cloud.FunctionRequest) => { + return 'Some result'; + }); + + Parse.Cloud.define( + 'AFunc', + (request: Parse.Cloud.FunctionRequest) => { + return 'Some result'; + }, + { + requireUser: true, + requireMaster: true, + validateMasterKey: true, + skipWithMasterKey: true, + requireAnyUserRoles: ['a'], + requireAllUserRoles: ['a'], + fields: { + name: { + type: String, + constant: true, + default: true, + options: [], + error: 'invalid field.', + }, + }, + requireUserKeys: { + name: { + type: String, + constant: true, + default: true, + options: [], + error: 'invalid field.', + }, + }, + }, + ); + + Parse.Cloud.define('AFunc', request => { + // $ExpectType Params + request.params; + + // $ExpectType any + request.params.anything; + }); + + Parse.Cloud.define<() => void>('AFunc', request => { + // $ExpectType {} + request.params; + }); + + Parse.Cloud.define<(params: { something: string }) => number>('AFunc', request => { + // $ExpectType { something: string; } + request.params; + + // @ts-expect-error + request.params.somethingElse; + + return 123; + }); + + // @ts-expect-error + Parse.Cloud.define('AFunc'); + + // @ts-expect-error + Parse.Cloud.define<() => string>('AFunc', () => 123); + + // @ts-expect-error + Parse.Cloud.define<(params: string) => number>('AFunc', () => 123); + + Parse.Cloud.job('AJob', (request: Parse.Cloud.JobRequest) => { + request.message('Message to associate with this job run'); + }); + + Parse.Cloud.startJob('AJob', {}).then(v => v); + + Parse.Cloud.getJobStatus('AJob').then(v => v); + + Parse.Cloud.getJobsData().then(v => v); +} + +class PlaceObject extends Parse.Object {} + +function test_geo_points() { + let point = new Parse.GeoPoint(); + // @ts-expect-error + point = new Parse.GeoPoint('40.0'); + // @ts-expect-error + point = new Parse.GeoPoint(40.0); + // @ts-expect-error + point = new Parse.GeoPoint([40.0, -30.0, 20.0]); + point = new Parse.GeoPoint([40.0, -30.0]); + point = new Parse.GeoPoint(40.0, -30.0); + point = new Parse.GeoPoint({ latitude: 40.0, longitude: -30.0 }); + + const userObject = Parse.User.current>()!; + + // User's location + const userGeoPoint = userObject.get('location'); + + // Create a query for places + const query = new Parse.Query(Parse.User); + // Interested in locations near user. + query.near('location', userGeoPoint); + // Limit what could be a lot of points. + query.limit(10); + + const southwestOfSF = new Parse.GeoPoint(37.708813, -122.526398); + const northeastOfSF = new Parse.GeoPoint(37.822802, -122.373962); + + const query2 = new Parse.Query(PlaceObject); + query2.withinGeoBox('location', southwestOfSF, northeastOfSF); + + const query3 = new Parse.Query('PlaceObject').find().then((o: Parse.Object[]) => {}); +} + +function test_push() { + Parse.Push.send( + { + channels: ['Gia nts', 'Mets'], + data: { + alert: 'The Giants won against the Mets 2-3.', + }, + }, + { + success: () => { + // Push was successful + }, + error: (error: any) => { + // Handle error + }, + }, + ); + + const query = new Parse.Query(Parse.Installation); + query.equalTo('injuryReports', true); + + Parse.Push.send( + { + where: query, // Set our Installation query + data: { + alert: 'Willie Hayes injured by own pop fly.', + }, + }, + { + success() { + // Push was successful + }, + error(error: any) { + // Handle error + }, + }, + ); +} + +function test_batch_operations() { + const game1 = new Game(); + const game2 = new Game(); + const games = [game1, game2]; + + // Master key + Parse.Object.saveAll(games, { useMasterKey: true }); + Parse.Object.destroyAll(games, { useMasterKey: true }); + Parse.Object.fetchAll(games, { useMasterKey: true }); + Parse.Object.fetchAllIfNeeded(games, { useMasterKey: true }); + + // Session token + Parse.Object.saveAll(games, { sessionToken: '' }); + Parse.Object.destroyAll(games, { sessionToken: '' }); + Parse.Object.fetchAll(games, { sessionToken: '' }); + Parse.Object.fetchAllIfNeeded(games, { sessionToken: '' }); +} + +async function test_query_subscribe() { + // create new query from Game object type + const query = new Parse.Query(Game); + + // create subscription to Game object + // Without a token + // $ExpectType LiveQuerySubscription + let subscription = await query.subscribe(); + + // With a session token + // $ExpectType LiveQuerySubscription + subscription = await query.subscribe(new Parse.User().getSessionToken()); + + // listen for new Game objects created on Parse server + subscription.on('create', (game: any) => { + console.log(game); + }); + + // unsubscribe + subscription.unsubscribe(); +} + +function test_serverURL() { + Parse.serverURL = 'http://localhost:1337/parse'; +} +function test_polygon() { + const point = new Parse.GeoPoint(1, 2); + const polygon1 = new Parse.Polygon([ + [0, 0], + [1, 0], + [1, 1], + [0, 1], + ]); + const polygon2 = new Parse.Polygon([point, point, point]); + polygon1.equals(polygon2); + polygon1.containsPoint(point); + + const query = new Parse.Query('TestObject'); + query.polygonContains('key', point); + query.withinPolygon('key', [ + [0, 0], + [1, 0], + [1, 1], + [0, 1], + ]); +} + +async function test_local_datastore() { + Parse.enableLocalDatastore(); + const name = 'test_pin'; + const obj = new Parse.Object('TestObject'); + await obj.pin(); + await obj.unPin(); + await obj.isPinned(); + await obj.pinWithName(name); + await obj.unPinWithName(name); + await obj.fetchFromLocalDatastore(); + + await Parse.Object.pinAll([obj]); + await Parse.Object.unPinAll([obj]); + await Parse.Object.pinAllWithName(name, [obj]); + await Parse.Object.unPinAllWithName(name, [obj]); + await Parse.Object.unPinAllObjects(); + await Parse.Object.unPinAllObjectsWithName(name); + + const flag = Parse.isLocalDatastoreEnabled(); + const LDS = await Parse.dumpLocalDatastore(); + + const query = new Parse.Query('TestObject'); + query.fromPin(); + query.fromPinWithName(name); + query.fromLocalDatastore(); + + Parse.setLocalDatastoreController({}); +} + +async function test_from_network() { + const obj = new Parse.Object('TestObject'); + await obj.save(); + + const query = new Parse.Query('TestObject'); + query.fromNetwork(); +} + +async function test_cancel_query() { + const obj = new Parse.Object('TestObject'); + await obj.save(); + + const query = new Parse.Query('TestObject'); + query.fromNetwork().find(); + query.cancel(); +} + +type FieldType = + | string + | number + | boolean + | Date + | Parse.File + | Parse.GeoPoint + | any[] + | object + | Parse.Pointer + | Parse.Polygon + | Parse.Relation; +async function test_schema( + anyField: FieldType, + notString: Exclude, + notNumber: Exclude, + notboolean: Exclude, + notDate: Exclude, + notFile: Exclude, + notGeopoint: Exclude, + notArray: Exclude, + notObject: Exclude, + notPointer: Exclude, + notPolygon: Exclude, +) { + // $ExpectType RestSchema[] + await Parse.Schema.all(); + + const schema = new Parse.Schema('TestSchema'); + + schema.addArray('arrayField'); + schema.addArray('arrayField', { defaultValue: [1, 2, 3, 4] }); + // @ts-expect-error + schema.addArray('arrayField', { defaultValue: notArray }); + + /** + * @todo Enable type check for default value + */ + schema.addField('defaultFieldString'); + schema.addField('defaultFieldString', 'String', { defaultValue: anyField }); + schema.addField('defaultFieldString', 'Number'); + schema.addField('defaultFieldString', 'Relation'); + // @ts-expect-error + schema.addField('defaultFieldString', 'String', 'Invalid Options'); + + schema.addString('field'); + schema.addString('field', { defaultValue: 'some string', required: true }); + // @ts-expect-error + schema.addString('field', { defaultValue: notString }); + + schema.addNumber('field'); + schema.addNumber('field', { defaultValue: 0, required: true }); + // @ts-expect-error + schema.addNumber('field', { defaultValue: notNumber }); + + schema.addBoolean('field'); + schema.addBoolean('field', { defaultValue: true, required: true }); + // @ts-expect-error + schema.addBoolean('field', { defaultValue: notboolean }); + + schema.addDate('field'); + schema.addDate('field', { defaultValue: new Date(), required: true }); + // @ts-expect-error + schema.addDate('field', { defaultValue: notDate }); + + schema.addFile('field'); + schema.addFile('field', { defaultValue: new Parse.File('myfile', []), required: true }); + // @ts-expect-error + schema.addFile('field', { defaultValue: notFile }); + + schema.addGeoPoint('field'); + schema.addGeoPoint('field', { defaultValue: new Parse.GeoPoint(), required: true }); + // @ts-expect-error + schema.addGeoPoint('field', { defaultValue: notGeopoint }); + + schema.addPolygon('field'); + schema.addPolygon('field', { defaultValue: new Parse.Polygon([]), required: true }); + // @ts-expect-error + schema.addPolygon('field', { defaultValue: notPolygon }); + + schema.addObject('field'); + schema.addObject('field', { defaultValue: {}, required: true }); + schema.addObject('field', { defaultValue: { abc: 'def' } }); + // @ts-expect-error + schema.addObject('field', { defaultValue: notObject }); + + schema.addPointer('field', 'SomeClass'); + // @ts-expect-error + schema.addPointer('field'); + /** + * @todo Infer defaultValue type from targetClass + */ + schema.addPointer('field', '_User', { defaultValue: new Parse.User().toPointer(), required: true }); + // @ts-expect-error + schema.addPointer('field', { defaultValue: notPointer }); + + schema.addRelation('field', 'SomeClass'); + // @ts-expect-error + schema.addRelation('field'); + // @ts-expect-error + schema.addRelation('field', 'SomeClass', 'anything'); + + schema.addIndex('testIndex', { stringField: 'text' }); + schema.addIndex('testIndex', { stringField: 1 }); + schema.addIndex('testIndex', { stringField: -1 }); + // @ts-expect-error + schema.addIndex('testIndex', { stringField: true }); + + schema.deleteField('defaultFieldString'); + schema.deleteIndex('testIndex'); + schema.delete().then(results => {}); + // $ExpectType RestSchema + await schema.get(); + schema.purge().then(results => {}); + schema.save().then(results => {}); + schema.update().then(results => {}); + + function testGenericType() { + interface iTestAttributes { + arrField: any[]; + boolField: boolean; + stringField: string; + numField: number; + dateField: Date; + fileField: Parse.File; + geoPointField: Parse.GeoPoint; + polygonField: Parse.Polygon; + objectField: object; + relationField: Parse.Relation; + pointerField: Parse.Pointer | Parse.Object; + } + class TestObject extends Parse.Object {} + + const schema = new Parse.Schema('TestObject'); + schema.addArray('arrField'); + schema.addBoolean('boolField'); + schema.addDate('dateField'); + schema.addFile('fileField'); + schema.addGeoPoint('geoPointField'); + schema.addNumber('numField'); + schema.addObject('objectField'); + schema.addPointer('pointerField', 'FooClass'); + schema.addPolygon('polygonField'); + schema.addRelation('relationField', 'FooClass'); + schema.addString('stringField'); + + // @ts-expect-error + schema.addArray('wrong'); + // @ts-expect-error + schema.addBoolean('wrong'); + // @ts-expect-error + schema.addDate('wrong'); + // @ts-expect-error + schema.addFile('wrong'); + // @ts-expect-error + schema.addGeoPoint('wrong'); + // @ts-expect-error + schema.addNumber('wrong'); + // @ts-expect-error + schema.addObject('wrong'); + // @ts-expect-error + schema.addPointer('wrong', 'FooClass'); + // @ts-expect-error + schema.addPolygon('wrong'); + // @ts-expect-error + schema.addRelation('wrong', 'FooClass'); + // @ts-expect-error + schema.addString('wrong'); + } +} + +function testObject() { + function testConstructor() { + // $ExpectType Object + new Parse.Object(); + + // $ExpectType Object + new Parse.Object('TestObject'); + + // $ExpectType Object<{ example: number; }> + new Parse.Object('TestObject', { example: 100 }); + + // $ExpectType Object<{ example: boolean; }> + new Parse.Object<{ example: boolean }>('TestObject', { example: true }); + + // $ExpectType Object<{ example: string; }> + new Parse.Object('TestObject', { example: 'hello' }, { ignoreValidation: true }); + + // @ts-expect-error + new Parse.Object<{ example: string }>('TestObject'); + + // @ts-expect-error + new Parse.Object<{ example: boolean }>('TestObject', { example: 'hello' }); + } + + function testStaticMethods() { + async function testSaveAll(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { + // $ExpectType Object[] + await Parse.Object.saveAll([objUntyped]); + + // $ExpectType Object<{ example: string; }>[] + await Parse.Object.saveAll([objTyped]); + + // $ExpectType [Object, Object<{ example: string; }>] + await Parse.Object.saveAll<[typeof objUntyped, typeof objTyped]>([objUntyped, objTyped]); + + // @ts-expect-error + await Parse.Object.saveAll([123]); + } + } + + function testAttributes(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { + // $ExpectType any + objUntyped.attributes.whatever; + + // $ExpectType string + objTyped.attributes.example; + + // @ts-expect-error + objTyped.attributes.other; + } + + function testAdd(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { + // $ExpectType false | Object + objUntyped.add('whatever', 'hello'); + + // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> + objTyped.add('stringList', 'hello'); + + // @ts-expect-error + objTyped.add('stringList', 100); + + // @ts-expect-error + objTyped.add('thing', true); + + // @ts-expect-error + objTyped.add('whatever', 'hello'); + } + + function testAddAll(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { + // $ExpectType false | Object + objUntyped.addAll('whatever', ['hello', 100]); + + // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> + objTyped.addAll('stringList', ['hello']); + + // @ts-expect-error + objTyped.addAll('stringList', [100]); + + // @ts-expect-error + objTyped.addAll('thing', [true]); + + // @ts-expect-error + objTyped.addAll('whatever', ['hello']); + } + + function testAddAllUnique( + objUntyped: Parse.Object, + objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>, + ) { + // $ExpectType false | Object + objUntyped.addAllUnique('whatever', ['hello', 100]); + + // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> + objTyped.addAllUnique('stringList', ['hello']); + + // @ts-expect-error + objTyped.addAllUnique('stringList', [100]); + + // @ts-expect-error + objTyped.addAllUnique('thing', [true]); + + // @ts-expect-error + objTyped.addAllUnique('whatever', ['hello']); + } + + function testAddUnique(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { + // $ExpectType false | Object + objUntyped.addUnique('whatever', 'hello'); + + // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> + objTyped.addUnique('stringList', 'hello'); + + // @ts-expect-error + objTyped.addUnique('stringList', 100); + + // @ts-expect-error + objTyped.addUnique('thing', true); + + // @ts-expect-error + objTyped.addUnique('whatever', 'hello'); + } + + function testDirty(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { + // $ExpectType boolean + objUntyped.dirty(); + + // $ExpectType boolean + objUntyped.dirty('whatever'); + + // $ExpectType boolean + objTyped.dirty(); + + // $ExpectType boolean + objTyped.dirty('example'); + + // @ts-expect-error + objTyped.dirty('other'); + } + + function testEquals(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { + // $ExpectType boolean + objUntyped.equals(objTyped); + + // $ExpectType boolean + objTyped.equals(objUntyped); + + // @ts-expect-error + objUntyped.equals('blah'); + } + + function testEscape(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { + // $ExpectType string + objUntyped.escape('whatever'); + + // $ExpectType string + objTyped.escape('example'); + + // @ts-expect-error + objTyped.escape('other'); + } + + function testFetchWithInclude(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { + // $ExpectType Promise> + objUntyped.fetchWithInclude('whatever'); + + // $ExpectType Promise> + objUntyped.fetchWithInclude(['whatever']); + + // $ExpectType Promise> + objUntyped.fetchWithInclude([['whatever']]); + + // @ts-expect-error + objUntyped.fetchWithInclude([[['whatever']]]); + + // $ExpectType Promise> + objTyped.fetchWithInclude('example'); + + // $ExpectType Promise> + objTyped.fetchWithInclude(['example']); + + // $ExpectType Promise> + objTyped.fetchWithInclude([['example']]); + + // @ts-expect-error + objTyped.fetchWithInclude([[['example']]]); + + // $ExpectType Promise[]> + Parse.Object.fetchAllIfNeededWithInclude([objTyped], 'example'); + + // @ts-expect-error + Parse.Object.fetchAllIfNeededWithInclude([objTyped], 'notAnAttribute'); + + // $ExpectType Promise[]> + Parse.Object.fetchAllWithInclude([objTyped], 'example'); + + // @ts-expect-error + Parse.Object.fetchAllWithInclude([objTyped], 'notAnAttribute'); + } + + function testGet(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { + // $ExpectType any + objUntyped.get('whatever'); + + // $ExpectType number + objTyped.get('example'); + + // @ts-expect-error + objTyped.get('other'); + } + + function testHas(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { + // $ExpectType boolean + objUntyped.has('whatever'); + + // $ExpectType boolean + objTyped.has('example'); + + // @ts-expect-error + objTyped.has('other'); + } + + function testIncrement(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { + // $ExpectType false | Object + objUntyped.increment('whatever'); + + // $ExpectType false | Object + objUntyped.increment('whatever', 10); + + // $ExpectType false | Object<{ example: number; }> + objTyped.increment('example'); + + // $ExpectType false | Object<{ example: number; }> + objTyped.increment('example', 20); + + // @ts-expect-error + objTyped.increment('example', true); + + // @ts-expect-error + objTyped.increment('other'); + } + + function testDecrement(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { + // $ExpectType false | Object + objUntyped.decrement('whatever'); + + // $ExpectType false | Object + objUntyped.decrement('whatever', 10); + + // $ExpectType false | Object<{ example: number; }> + objTyped.decrement('example'); + + // $ExpectType false | Object<{ example: number; }> + objTyped.decrement('example', 20); + + // @ts-expect-error + objTyped.decrement('example', true); + + // @ts-expect-error + objTyped.decrement('other'); + } + + function testNewInstance(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { + // $ExpectType Object + objUntyped.newInstance(); + + // $ExpectType Object<{ example: number; }> + objTyped.newInstance(); + } + + function testOp(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { + // $ExpectType any + objUntyped.op('whatever'); + + // $ExpectType any + objTyped.op('example'); + + // @ts-expect-error + objTyped.op('other'); + } + + function testRelation(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number; rel: Parse.Relation }>) { + // $ExpectType Relation, Object> + objUntyped.relation('whatever'); + + // $ExpectType Relation, Object>; }>, Object> + objTyped.relation('rel'); + + // @ts-expect-error + objTyped.relation('example'); + + // @ts-expect-error + objTyped.relation('other'); + } + + function testRemove(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { + // $ExpectType false | Object + objUntyped.remove('whatever', 'hello'); + + // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> + objTyped.remove('stringList', 'hello'); + + // @ts-expect-error + objTyped.remove('stringList', 100); + + // @ts-expect-error + objTyped.remove('thing', true); + + // @ts-expect-error + objTyped.remove('whatever', 'hello'); + } + + function testRemoveAll(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { + // $ExpectType false | Object + objUntyped.removeAll('whatever', ['hello', 100]); + + // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> + objTyped.removeAll('stringList', ['hello']); + + // @ts-expect-error + objTyped.removeAll('stringList', [100]); + + // @ts-expect-error + objTyped.removeAll('thing', [true]); + + // @ts-expect-error + objTyped.removeAll('whatever', ['hello']); + } + + function testRevert(objUntyped: Parse.Object, objTyped: Parse.Object<{ thingOne: number; thingTwo: boolean }>) { + // $ExpectType void + objUntyped.revert(); + + // $ExpectType void + objUntyped.revert('whatever', 'more whatever'); + + // $ExpectType void + objTyped.revert(); + + // $ExpectType void + objTyped.revert('thingOne', 'thingTwo'); + + // @ts-expect-error + objTyped.revert('other'); + } + interface ObjectAttributes { + example: boolean; + someString: string; + } + interface OptionalObjectAttributes { + example?: boolean | undefined; + another?: string | undefined; + } + + async function testSave( + objUntyped: Parse.Object, + objTyped: Parse.Object, + objTypedOptional: Parse.Object, + ) { + // $ExpectType Object + await objUntyped.save({ whatever: 100 }); + + // $ExpectType Object + await objUntyped.save('whatever', 100); + + // $ExpectType Object + await objTyped.save({ example: true }); + + // $ExpectType Object + await objTyped.save({ example: true, someString: 'hello' }); + + // @ts-expect-error + await objTyped.save({ example: 'hello', someString: true }); + + // $ExpectType Object + await objTyped.save('example', true); + + // @ts-expect-error + await objTyped.save({ example: 'hello' }); + + // @ts-expect-error + await objTyped.save({ wrongProp: 5 }); + + // @ts-expect-error + await objTyped.save('example', 10); + + // @ts-expect-error + await objTyped.save('wrongProp', true); + + // @ts-expect-error + await objTyped.save({ example: undefined }); + + // @ts-expect-error + await objTyped.save('example', undefined); + + // $ExpectType Object + await objTyped.save({}); + + // $ExpectType Object + await objTypedOptional.save({ example: undefined }); + + // $ExpectType Object + await objTypedOptional.save('example', undefined); + + // $ExpectType Object + await objTypedOptional.save({}); + + // $ExpectType Object + await objTypedOptional.saveEventually({}); + + // $ExpectType Object + await objTypedOptional.destroyEventually({}); + } + + function testSet( + objUntyped: Parse.Object, + objTyped: Parse.Object, + objTypedOptional: Parse.Object, + ) { + // $ExpectType false | Object + objUntyped.set('propA', 'some value'); + + // $ExpectType false | Object + objUntyped.set({ propA: undefined }); + + // $ExpectType false | Object + objTyped.set({ example: false }); + + // $ExpectType false | Object + objTyped.set({ example: true, someString: 'abc' }); + + // @ts-expect-error + objTyped.set({ example: 123, someString: 'abc' }); + + // $ExpectType false | Object + objTyped.set('example', true); + + // @ts-expect-error + objTyped.set({ example: 100 }); + + // @ts-expect-error + objTyped.set({ other: 'something' }); + + // @ts-expect-error + objTyped.set('example', 100); + + // @ts-expect-error + objTyped.set('other', 100); + + // @ts-expect-error + objTyped.set({ example: undefined }); + + // $ExpectType false | Object + objTyped.set({}); + + // @ts-expect-error + objTyped.set('example', undefined); + + // $ExpectType false | Object + objTypedOptional.set({ example: undefined }); + + // $ExpectType false | Object + objTypedOptional.set('example', undefined); + + // $ExpectType false | Object + objTypedOptional.set({}); + } + + interface AttributesAllTypes { + someString: string; + someNumber: number; + someBoolean: boolean; + someDate: Date; + someJSONObject: AttributesAllTypes; + someJSONArray: AttributesAllTypes[]; + someRegExp: RegExp; + someUndefined: undefined; + someNull: null; + someParseObjectUntyped: Parse.Object; + someParseObjectTyped: Parse.Object; + someParseACL: Parse.ACL; + someParseGeoPoint: Parse.GeoPoint; + someParsePolygon: Parse.Polygon; + someParseRelation: Parse.Relation; + someParseFile: Parse.File; + } + + function testToJSON(objUntyped: Parse.Object, objTyped: Parse.Object) { + // $ExpectType ToJSON & JSONBaseAttributes + const JSONUntyped = objUntyped.toJSON(); + // $ExpectType string + JSONUntyped.objectId; + // $ExpectType string + JSONUntyped.createdAt; + // $ExpectType string + JSONUntyped.updatedAt; + // $ExpectType any + JSONUntyped.anything; + + // $ExpectType ToJSON & JSONBaseAttributes + const JSONTyped = objTyped.toJSON(); + // $ExpectType string + JSONTyped.objectId; + // $ExpectType string + JSONTyped.createdAt; + // $ExpectType string + JSONTyped.updatedAt; + // $ExpectType string + JSONTyped.someString; + // $ExpectType number + JSONTyped.someNumber; + // $ExpectType boolean + JSONTyped.someBoolean; + // $ExpectType { __type: "Date"; iso: string; } + JSONTyped.someDate; + // $ExpectType ToJSON + JSONTyped.someJSONObject; + // $ExpectType ToJSON[] + JSONTyped.someJSONArray; + // $ExpectType string + JSONTyped.someRegExp; + // $ExpectType undefined + JSONTyped.someUndefined; + // $ExpectType null + JSONTyped.someNull; + // $ExpectType Pointer | (ToJSON & JSONBaseAttributes) + JSONTyped.someParseObjectUntyped; + // $ExpectType Pointer | (ToJSON & JSONBaseAttributes) + JSONTyped.someParseObjectTyped; + // $ExpectType any + JSONTyped.someParseACL; + // $ExpectType any + JSONTyped.someParseGeoPoint; + // $ExpectType any + JSONTyped.someParsePolygon; + // $ExpectType any + JSONTyped.someParseRelation; + // $ExpectType { __type: string; name: string; url: string; } + JSONTyped.someParseFile; + } + + function testUnset(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { + // $ExpectType false | Object + objUntyped.unset('whatever'); + + // $ExpectType false | Object<{ example: string; }> + objTyped.unset('example'); + + // @ts-expect-error + objTyped.unset('other'); + } + + function testValidate(obj: Parse.Object<{}>) { + // Note: The attributes being validated don't necessarily have to match the current object's attributes + + // $ExpectType false | Error + obj.validate({ someAttrToValidate: 'hello' }); + } + + function testNullableArrays( + objTyped: Parse.Object<{ stringList?: string[] | null }> + ) { + // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> + objTyped.add('stringList', 'foo'); + + // @ts-expect-error + objTyped.add('stringList', 4); + + // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> + objTyped.addAll('stringList', ['foo']); + + // @ts-expect-error + objTyped.addAll('stringList', [4]); + + // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> + objTyped.addAllUnique('stringList', ['foo', 'bar']); + + // @ts-expect-error + objTyped.addAllUnique('stringList', [4]); + + // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> + objTyped.addUnique('stringList', 'foo'); + + // @ts-expect-error + objTyped.addUnique('stringList', 4); + + // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> + objTyped.remove('stringList', 'bar'); + + // @ts-expect-error + objTyped.remove('stringList', 4); + + // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> + objTyped.removeAll('stringList', ['bar']); + + // @ts-expect-error + objTyped.removeAll('stringList', [4]); + } +} + +function testInstallation() { + function testConstructor() { + // $ExpectType Installation + new Parse.Installation(); + + // $ExpectType Installation<{ example: number; }> + new Parse.Installation({ example: 100 }); + + // @ts-expect-error + new Parse.Installation<{ example: number }>(); + + // @ts-expect-error + new Parse.Installation<{ example: number }>({ example: 'hello' }); + } +} + +function testQuery() { + function testConstructor() { + // $ExpectType Query> + new Parse.Query('TestObject'); + + // $ExpectType Query> + new Parse.Query(Parse.Role); + + // $ExpectType Query> + new Parse.Query(Parse.User); + + // $ExpectType Query> + new Parse.Query>('TestObject'); + + // $ExpectType Query> + new Parse.Query>(Parse.Role); + + // $ExpectType Query> + new Parse.Query>(Parse.User); + } + + async function testQueryMethodTypes() { + class AnotherSubClass extends Parse.Object<{ x: any }> { + constructor() { + super('Another', { x: 'example' }); + } + } + class MySubClass extends Parse.Object<{ + attribute1: string; + attribute2: number; + attribute3: AnotherSubClass; + attribute4: string[]; + }> {} + const query = new Parse.Query(MySubClass); + + // $ExpectType Query + query.addAscending(['attribute1', 'attribute2', 'updatedAt']); + // @ts-expect-error + query.addAscending(['attribute1', 'unexistenProp']); + + // $ExpectType Query + query.addDescending(['attribute1', 'attribute2', 'createdAt']); + // @ts-expect-error + query.addDescending(['attribute1', 'unexistenProp']); + + // $ExpectType Query + query.ascending(['attribute1', 'attribute2', 'objectId']); + // @ts-expect-error + query.ascending(['attribute1', 'nonexistentProp']); + + // $ExpectType Query + query.containedBy('attribute1', ['a', 'b', 'c']); + // $ExpectType Query + query.containedBy('attribute3', ['objectId1', 'objectId2', 'objectId3']); + // @ts-expect-error + query.containedBy('attribute2', ['a', 'b', 'c']); + // @ts-expect-error + query.containedBy('attribute1', [1, 2, 3]); + // @ts-expect-error + query.containedBy('nonexistentProp', ['a', 'b', 'c']); + + // $ExpectType Query + query.containedIn('attribute1', ['a', 'b', 'c']); + // $ExpectType Query + query.containedIn('attribute3', ['objectId1', 'objectId2', 'objectId3']); + // @ts-expect-error + query.containedIn('attribute2', ['a', 'b', 'c']); + // @ts-expect-error + query.containedIn('attribute1', [1, 2, 3]); + // @ts-expect-error + query.containedIn('nonexistentProp', ['a', 'b', 'c']); + + // $ExpectType Query + query.contains('attribute1', 'a substring'); + // @ts-expect-error + query.contains('nonexistentProp', 'a substring'); + + // $ExpectType Query + query.containsAll('attribute1', ['a', 'b', 'c']); + // @ts-expect-error + query.containsAll('nonexistentProp', ['a', 'b', 'c']); + + // $ExpectType Query + query.containsAllStartingWith('attribute1', ['a', 'b', 'c']); + // @ts-expect-error + query.containsAllStartingWith('nonexistentProp', ['a', 'b', 'c']); + + // $ExpectType Query + query.descending(['attribute1', 'attribute2', 'objectId']); + // @ts-expect-error + query.descending(['attribute1', 'nonexistentProp']); + + // $ExpectType Query + query.doesNotExist('attribute1'); + // @ts-expect-error + query.doesNotExist('nonexistentProp'); + + // $ExpectType Query + query.doesNotMatchKeyInQuery('attribute1', 'x', new Parse.Query(AnotherSubClass)); + // @ts-expect-error + query.doesNotMatchKeyInQuery('unexistenProp', 'x', new Parse.Query(AnotherSubClass)); + // @ts-expect-error + query.doesNotMatchKeyInQuery('attribute1', 'unknownKey', new Parse.Query(AnotherSubClass)); + // $ExpectType Query + query.doesNotMatchKeyInQuery('objectId', 'x', new Parse.Query(AnotherSubClass)); + // $ExpectType Query + query.doesNotMatchKeyInQuery('updatedAt', 'x', new Parse.Query(AnotherSubClass)); + + // $ExpectType Query + query.doesNotMatchQuery('attribute1', new Parse.Query('Example')); + // @ts-expect-error + query.doesNotMatchQuery('nonexistentProp', new Parse.Query('Example')); + + // $ExpectType Query + query.endsWith('attribute1', 'asuffixstring'); + // @ts-expect-error + query.endsWith('nonexistentProp', 'asuffixstring'); + + // $ExpectType Query + query.equalTo('attribute2', 0); + // $ExpectType Query + query.equalTo('attribute3', new AnotherSubClass()); + // $ExpectType Query + query.equalTo('attribute3', new AnotherSubClass().toPointer()); + // @ts-expect-error + query.equalTo('attribute1', new AnotherSubClass().toPointer()); + // @ts-expect-error + query.equalTo('attribute2', 'a string value'); + // @ts-expect-error + query.equalTo('nonexistentProp', 'any value'); + + // $ExpectType Query + query.equalTo('attribute4', 'a_string_value'); // Can query contents of array + // Can query array itself if equal too (mongodb $eq matches the array exactly or the contains an element that matches the array exactly) + // $ExpectType Query + query.equalTo('attribute4', ['a_string_value']); + + // $ExpectType Query + query.notEqualTo('attribute4', 'a_string_value'); + // $ExpectType Query + query.notEqualTo('attribute4', ['a_string_value']); + + // @ts-expect-error + query.equalTo('attribute4', 5); + // @ts-expect-error + query.notEqualTo('attribute4', 5); + // @ts-expect-error + query.equalTo('attribute4', [5]); + // @ts-expect-error + query.notEqualTo('attribute4', [5]); + + // $ExpectType Query + query.exists('attribute1'); + // @ts-expect-error + query.exists('nonexistentProp'); + + // $ExpectType Query + query.fullText('attribute1', 'full text'); + // @ts-expect-error + query.fullText('nonexistentProp', 'full text'); + + // $ExpectType Query + query.greaterThan('attribute2', 1000); + // @ts-expect-error + query.greaterThan('attribute2', '1000'); + // @ts-expect-error + query.greaterThan('nonexistentProp', 1000); + + // $ExpectType Query + query.greaterThanOrEqualTo('attribute2', 1000); + // @ts-expect-error + query.greaterThanOrEqualTo('attribute2', '1000'); + // @ts-expect-error + query.greaterThanOrEqualTo('nonexistentProp', 1000); + + // $ExpectType Query + query.include(['attribute1', 'attribute2']); + // $ExpectType Query + query.include('attribute3.someProp'); + // @ts-expect-error + query.include(['attribute1', 'nonexistentProp']); + + // $ExpectType Query + query.lessThan('attribute2', 1000); + // @ts-expect-error + query.lessThan('attribute2', '1000'); + // @ts-expect-error + query.lessThan('nonexistentProp', 1000); + + // $ExpectType Query + query.lessThanOrEqualTo('attribute2', 1000); + // @ts-expect-error + query.lessThanOrEqualTo('attribute2', '1000'); + // @ts-expect-error + query.lessThanOrEqualTo('nonexistentProp', 1000); + + // $ExpectType Query + query.matches('attribute1', /a regex/); + // @ts-expect-error + query.matches('nonexistentProp', /a regex/); + + // $ExpectType Query + query.matchesKeyInQuery('attribute1', 'x', new Parse.Query(AnotherSubClass)); + // @ts-expect-error + query.matchesKeyInQuery('nonexistentProp', 'x', new Parse.Query(AnotherSubClass)); + // @ts-expect-error + query.matchesKeyInQuery('attribute1', 'unknownKey', new Parse.Query(AnotherSubClass)); + + // $ExpectType Query + query.matchesQuery('attribute1', new Parse.Query('Example')); + // @ts-expect-error + query.matchesQuery('nonexistentProp', new Parse.Query('Example')); + + // $ExpectType Query + query.near('attribute1', new Parse.GeoPoint()); + // @ts-expect-error + query.near('nonexistentProp', new Parse.GeoPoint()); + + // $ExpectType Query + query.notContainedIn('attribute2', [1, 2, 3]); + // @ts-expect-error + query.notContainedIn('attribute2', ['1', '2', '3']); + // @ts-expect-error + query.notContainedIn('nonexistentProp', [1, 2, 3]); + + // $ExpectType Query + query.notEqualTo('attribute1', '1'); + // @ts-expect-error + query.notEqualTo('attribute1', 1); + // @ts-expect-error + query.notEqualTo('nonexistentProp', 1); + + // $ExpectType Query + query.polygonContains('attribute1', new Parse.GeoPoint()); + // @ts-expect-error + query.polygonContains('nonexistentProp', new Parse.GeoPoint()); + + // $ExpectType Query + query.select('attribute1', 'attribute2'); + // @ts-expect-error + query.select('attribute1', 'nonexistentProp'); + + // $ExpectType Query + query.startsWith('attribute1', 'prefix string'); + // @ts-expect-error + query.startsWith('nonexistentProp', 'prefix string'); + + // $ExpectType Query + query.withCount(true); + + // $ExpectType Query + query.withinGeoBox('attribute1', new Parse.GeoPoint(), new Parse.GeoPoint()); + // @ts-expect-error + query.withinGeoBox('nonexistentProp', new Parse.GeoPoint(), new Parse.GeoPoint()); + + // $ExpectType Query + query.withinKilometers('attribute1', new Parse.GeoPoint(), 100); + // @ts-expect-error + query.withinKilometers('nonexistentProp', new Parse.GeoPoint(), 100); + + // $ExpectType Query + query.withinMiles('attribute1', new Parse.GeoPoint(), 100); + // @ts-expect-error + query.withinMiles('nonexistentProp', new Parse.GeoPoint(), 100); + + // $ExpectType Query + query.withinPolygon('attribute1', [ + [12.3, 45.6], + [-78.9, 10.1], + ]); + // @ts-expect-error + query.withinPolygon('nonexistentProp', [ + [12.3, 45.6], + [-78.9, 10.1], + ]); + + // $ExpectType Query + query.withinRadians('attribute1', new Parse.GeoPoint(), 100); + // @ts-expect-error + query.withinRadians('nonexistentProp', new Parse.GeoPoint(), 100); + } + + async function testQueryMethods( + queryUntyped: Parse.Query, + queryTyped: Parse.Query>, + ) { + // $ExpectType Object + await queryUntyped.get('objectId'); + + // $ExpectType Object[] + await queryUntyped.find(); + + // $ExpectType string[] + await queryTyped.distinct('example'); + + // $ExpectType Object | undefined + await queryUntyped.first(); + + // $ExpectType Object<{ example: string; }> + await queryTyped.get('objectId'); + + // $ExpectType Object<{ example: string; }>[] + await queryTyped.find(); + + // $ExpectType Object<{ example: string; }> | undefined + await queryTyped.first(); + } +} + +function testRole() { + function testConstructor(acl: Parse.ACL) { + // $ExpectType Role> + new Parse.Role<{ example: string }>('TestRole', acl); + } + + function testAttributes(roleUntyped: Parse.Role, roleTyped: Parse.Role<{ example: number }>) { + // $ExpectType Attributes + roleUntyped.attributes; + + // $ExpectType { example: number; } + roleTyped.attributes; + } +} + +function testSession() { + function testConstructor() { + // $ExpectType Session + new Parse.Session(); + + // $ExpectType Session<{ example: number; }> + new Parse.Session({ example: 100 }); + + // @ts-expect-error + new Parse.Session<{ example: number }>(); + + // @ts-expect-error + new Parse.Session<{ example: number }>({ example: 'hello' }); + } +} + +function testUser() { + function testConstructor() { + // $ExpectType User + new Parse.User(); + + // $ExpectType User<{ example: number; }> + new Parse.User({ example: 100 }); + + // @ts-expect-error + new Parse.User<{ example: number }>(); + + // @ts-expect-error + new Parse.User<{ example: number }>({ example: 'hello' }); + } + async function testAuthenticationProvider() { + const authProvider: Parse.AuthProvider = { + authenticate: () => {}, + getAuthType: () => 'customAuthorizationProvider', + restoreAuthentication: () => false, + deauthenticate: () => {}, + }; + const authData: Parse.AuthData = { + id: 'some-user-authentication-id', + access_token: 'some-access-token', + expiration_date: new Date().toISOString(), + }; + Parse.User._registerAuthenticationProvider(authProvider); + + const user = await Parse.User.logInWith( + authProvider, + { authData }, + { sessionToken: 'some-session-token', useMasterKey: true }, + ); + const isLinked = user._isLinked(authProvider); + const unlinkedUser = await user._unlinkFrom(authProvider); + const linkedUser = await user.linkWith(authProvider, { authData }); + } +} + +function testEncryptingUser() { + function testSecretKey() { + Parse.secret = 'secret!'; + } + + function testEnableEncryptedUserKey() { + Parse.encryptedUser = true; + } + + function testEnablingEncryptedUser() { + Parse.enableEncryptedUser(); + } + + function testIsEncryptedUserEnabled() { + Parse.isEncryptedUserEnabled(); + } +} + +function testEventuallyQueue() { + function test() { + const obj = new Parse.Object('TestObject'); + // $ExpectType Promise + Parse.EventuallyQueue.clear(); + // $ExpectType Promise + Parse.EventuallyQueue.getQueue(); + // $ExpectType boolean + Parse.EventuallyQueue.isPolling(); + // $ExpectType Promise + Parse.EventuallyQueue.save(obj); + // $ExpectType Promise + Parse.EventuallyQueue.save(obj, {}); + // $ExpectType Promise + Parse.EventuallyQueue.destroy(obj); + // $ExpectType Promise + Parse.EventuallyQueue.destroy(obj, {}); + // $ExpectType Promise + Parse.EventuallyQueue.length(); + // $ExpectType Promise + Parse.EventuallyQueue.sendQueue(); + // $ExpectType void + Parse.EventuallyQueue.stopPoll(); + // $ExpectType void + Parse.EventuallyQueue.poll(); + // $ExpectType void + Parse.EventuallyQueue.poll(300); + // @ts-expect-error + Parse.EventuallyQueue.poll('300'); + } +} + +function LiveQueryEvents() { + function testLiveQueryEvents() { + Parse.LiveQuery.on('open', () => { + }); + Parse.LiveQuery.on('close', () => { + }); + Parse.LiveQuery.on('error', (error) => { + }); + } +} diff --git a/types/tsconfig.json b/types/tsconfig.json new file mode 100644 index 000000000..cb4026e9d --- /dev/null +++ b/types/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "node.d.ts", + "react-native.d.ts", + "tests.ts" + ], + "exclude": [ + "node_modules" + ] + } \ No newline at end of file diff --git a/types/tslint.json b/types/tslint.json new file mode 100644 index 000000000..f0e511597 --- /dev/null +++ b/types/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "dtslint/dtslint.json", + "rules": { + "ban-types": false, + "no-unnecessary-generics": false, + "no-redundant-jsdoc": false + } +} \ No newline at end of file From 00953ab3b2f2d878965986edc32a6b4d15febe82 Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 30 Jun 2023 16:08:10 +1000 Subject: [PATCH 02/10] generate types --- .github/workflows/ci.yml | 9 +- gulpfile.js | 10 +- package-lock.json | 630 ++--- package.json | 2 + src/{Analytics.js => Analytics.ts} | 5 +- ...teMutations.js => ObjectStateMutations.ts} | 14 +- src/{ParseObject.js => ParseObject.ts} | 181 +- src/{ParseOp.js => ParseOp.ts} | 59 +- src/{ParseUser.js => ParseUser.ts} | 82 +- tsconfig.json | 18 + types/index.d.ts | 2010 --------------- types/node.d.ts | 3 - types/react-native.d.ts | 3 - types/tests.ts | 2175 ----------------- types/tsconfig.json | 26 - types/tslint.json | 8 - types/types.d.ts | 1637 +++++++++++++ 17 files changed, 2191 insertions(+), 4681 deletions(-) rename src/{Analytics.js => Analytics.ts} (95%) rename src/{ObjectStateMutations.js => ObjectStateMutations.ts} (94%) rename src/{ParseObject.js => ParseObject.ts} (94%) rename src/{ParseOp.js => ParseOp.ts} (90%) rename src/{ParseUser.js => ParseUser.ts} (94%) create mode 100644 tsconfig.json delete mode 100644 types/index.d.ts delete mode 100644 types/node.d.ts delete mode 100644 types/react-native.d.ts delete mode 100644 types/tests.ts delete mode 100644 types/tsconfig.json delete mode 100644 types/tslint.json create mode 100644 types/types.d.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3923740a6..0e866bd3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,14 @@ jobs: uses: mansona/npm-lockfile-version@v1 with: version: 2 + check-types: + name: Check types + timeout-minutes: 5 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Check types + - run: npm run test:types build: runs-on: ubuntu-latest timeout-minutes: 30 @@ -51,7 +59,6 @@ jobs: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}- - run: npm ci - run: npm run lint - - run: npm run test:types - run: npm test -- --maxWorkers=4 - run: npm run test:mongodb env: diff --git a/gulpfile.js b/gulpfile.js index e79632709..687af221f 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,16 +20,16 @@ const transformRuntime = ["@babel/plugin-transform-runtime", { }]; const PRESETS = { - 'browser': [["@babel/preset-env", { + 'browser': ["@babel/preset-typescript",["@babel/preset-env", { "targets": "> 0.25%, not dead" }]], - 'weapp': [["@babel/preset-env", { + 'weapp': ["@babel/preset-typescript",["@babel/preset-env", { "targets": "> 0.25%, not dead" }], '@babel/react'], - 'node': [["@babel/preset-env", { + 'node': ["@babel/preset-typescript",["@babel/preset-env", { "targets": { "node": "14" } }]], - 'react-native': ['module:metro-react-native-babel-preset'], + 'react-native': ["@babel/preset-typescript", 'module:metro-react-native-babel-preset'], }; const PLUGINS = { 'browser': [transformRuntime, '@babel/plugin-transform-flow-comments', '@babel/plugin-proposal-class-properties', 'inline-package-json', @@ -79,7 +79,7 @@ function compileTask(stream) { } gulp.task('compile', function() { - return compileTask(gulp.src('src/*.js')); + return compileTask(gulp.src('src/*.*(js|ts)')); }); gulp.task('browserify', function(cb) { diff --git a/package-lock.json b/package-lock.json index 1860eb606..84cdb39f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "@babel/plugin-transform-runtime": "7.21.4", "@babel/preset-env": "7.21.5", "@babel/preset-react": "7.18.6", + "@babel/preset-typescript": "^7.22.5", "@parse/minami": "1.0.0", "@saithodev/semantic-release-backmerge": "2.1.3", "@semantic-release/changelog": "6.0.3", @@ -105,12 +106,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", - "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -201,12 +202,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.0.tgz", - "integrity": "sha512-tyzR0OsH88AelgukhL2rbEUCLKBGmy2G9Th/5vpyOt0zf44Be61kvIQXjCwTSX8t+qJ/vMwZfhK6mPdrMLZXRg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", + "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", "dev": true, "dependencies": { - "@babel/types": "^7.22.0", + "@babel/types": "^7.22.5", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -216,12 +217,12 @@ } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", - "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -284,19 +285,20 @@ "dev": true }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.21.4.tgz", - "integrity": "sha512-46QrX2CQlaFRF4TkwfTt6nJD7IHq8539cCL7SDpqWSDeJKY1xylKKY5F/33mJhLZ3mFvKv2gGrVS6NkyF6qs+Q==", - "dev": true, - "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.21.0", - "@babel/helper-member-expression-to-functions": "^7.21.0", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-replace-supers": "^7.20.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/helper-split-export-declaration": "^7.18.6" + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.5.tgz", + "integrity": "sha512-xkb58MyOYIslxu3gKmVXmjTtUPvBU4odYzbiIQbWwLKIHCsx6UGZGX6F1IznMFVnDdirseUZopzN+ZRt8Xb33Q==", + "dev": true, + "dependencies": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "semver": "^6.3.0" }, "engines": { "node": ">=6.9.0" @@ -305,6 +307,15 @@ "@babel/core": "^7.0.0" } }, + "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/helper-create-regexp-features-plugin": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz", @@ -413,9 +424,9 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz", - "integrity": "sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", + "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", "dev": true, "engines": { "node": ">=6.9.0" @@ -434,89 +445,89 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", - "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, "dependencies": { - "@babel/template": "^7.20.7", - "@babel/types": "^7.21.0" + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.0.tgz", - "integrity": "sha512-Muu8cdZwNN6mRRNG6lAYErJ5X3bRevgYR2O8wN0yn7jJSnGDu6eG59RfT29JHxGUovyfrh6Pj0XzmR7drNVL3Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz", + "integrity": "sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==", "dev": true, "dependencies": { - "@babel/types": "^7.21.0" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz", - "integrity": "sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", + "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", "dev": true, "dependencies": { - "@babel/types": "^7.21.4" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.0.tgz", - "integrity": "sha512-drsR5/3eHuYs31uYLIXRK91+THB9+VAd2s3/4TY87Os5qrwr6YesM6GcNX5aEpCF6e9iKK0ZvTBTKqNyntEkvQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", + "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.21.5", - "@babel/helper-module-imports": "^7.21.4", - "@babel/helper-simple-access": "^7.21.5", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.21.9", - "@babel/traverse": "^7.22.0", - "@babel/types": "^7.22.0" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz", - "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", + "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.21.5.tgz", - "integrity": "sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "dev": true, "engines": { "node": ">=6.9.0" @@ -541,80 +552,80 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz", - "integrity": "sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.5.tgz", + "integrity": "sha512-aLdNM5I3kdI/V9xGNyKSF3X/gTyMUBohTZ+/3QdQKAA9vxIiy12E+8E2HoOP1/DjeqU+g6as35QHJNMDDYpuCg==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-member-expression-to-functions": "^7.20.7", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.21.5.tgz", - "integrity": "sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "dependencies": { - "@babel/types": "^7.21.5" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz", - "integrity": "sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", + "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", "dev": true, "dependencies": { - "@babel/types": "^7.20.0" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz", + "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz", - "integrity": "sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz", - "integrity": "sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", + "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", "dev": true, "engines": { "node": ">=6.9.0" @@ -650,12 +661,12 @@ } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -664,9 +675,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.0.tgz", - "integrity": "sha512-DA65VCJRetcFmJnt9/hEmRvXNCwk0V86dxG6p6N13hzDazaLRjGdTGPGgjxZOtLuFgWzOSRX4grybmRXwQ9bSg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz", + "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1117,12 +1128,12 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz", - "integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1234,12 +1245,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", - "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1523,14 +1534,14 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.21.5.tgz", - "integrity": "sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz", + "integrity": "sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.21.5", - "@babel/helper-plugin-utils": "^7.21.5", - "@babel/helper-simple-access": "^7.21.5" + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -1882,14 +1893,15 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.20.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.20.13.tgz", - "integrity": "sha512-O7I/THxarGcDZxkgWKMUrk7NK1/WbHAg3Xx86gqS6x9MTrNL6AwIluuZ96ms4xeDe6AVx6rjHbWHP7x26EPQBA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.5.tgz", + "integrity": "sha512-SMubA9S7Cb5sGSFFUlqxyClTA9zWJ8qGQrppNUm05LtFuN1ELRFNndkix4zUJrC9F+YivWwa1dHMSyo0e0N9dA==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.20.12", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-typescript": "^7.20.0" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-typescript": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -2117,6 +2129,25 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/preset-typescript": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.22.5.tgz", + "integrity": "sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.5", + "@babel/plugin-syntax-jsx": "^7.22.5", + "@babel/plugin-transform-modules-commonjs": "^7.22.5", + "@babel/plugin-transform-typescript": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/runtime": { "version": "7.21.5", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", @@ -2142,33 +2173,33 @@ } }, "node_modules/@babel/template": { - "version": "7.21.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.21.9.tgz", - "integrity": "sha512-MK0X5k8NKOuWRamiEfc3KEJiHMTkGZNUjzMipqCGDDc6ijRl/B7RGSKVGncu4Ro/HdyzzY6cmoXuKI2Gffk7vQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", + "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.21.4", - "@babel/parser": "^7.21.9", - "@babel/types": "^7.21.5" + "@babel/code-frame": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.0.tgz", - "integrity": "sha512-V5Zp3k0nFGWSIC7zYR8PnfdU6i6VYU4JnifdSSMlXM1GMojPAaelPsKmKPW4tWTmpX9GM+RzKl4Io0UVcHVlpw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.21.4", - "@babel/generator": "^7.22.0", - "@babel/helper-environment-visitor": "^7.21.5", - "@babel/helper-function-name": "^7.21.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.22.0", - "@babel/types": "^7.22.0", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", + "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -2177,13 +2208,13 @@ } }, "node_modules/@babel/types": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.0.tgz", - "integrity": "sha512-NtXlm3f6cNWIv003cETdlz9sss0VMNtplyatFohxWPz90AbwuhCbHbQopkGis6bG1vOunDLN0FF/4Uv5i8LFZQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", + "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.21.5", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", "to-fast-properties": "^2.0.0" }, "engines": { @@ -28878,12 +28909,12 @@ } }, "@babel/code-frame": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", - "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "requires": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" } }, "@babel/compat-data": { @@ -28949,24 +28980,24 @@ } }, "@babel/generator": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.0.tgz", - "integrity": "sha512-tyzR0OsH88AelgukhL2rbEUCLKBGmy2G9Th/5vpyOt0zf44Be61kvIQXjCwTSX8t+qJ/vMwZfhK6mPdrMLZXRg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.5.tgz", + "integrity": "sha512-+lcUbnTRhd0jOewtFSedLyiPsD5tswKkbgcezOqqWFUVNEwoUTlpPOBmvhG7OXWLR4jMdv0czPGH5XbflnD1EA==", "dev": true, "requires": { - "@babel/types": "^7.22.0", + "@babel/types": "^7.22.5", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" } }, "@babel/helper-annotate-as-pure": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz", - "integrity": "sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", + "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-builder-binary-assignment-operator-visitor": { @@ -29016,19 +29047,28 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.21.4.tgz", - "integrity": "sha512-46QrX2CQlaFRF4TkwfTt6nJD7IHq8539cCL7SDpqWSDeJKY1xylKKY5F/33mJhLZ3mFvKv2gGrVS6NkyF6qs+Q==", - "dev": true, - "requires": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.21.0", - "@babel/helper-member-expression-to-functions": "^7.21.0", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/helper-replace-supers": "^7.20.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/helper-split-export-declaration": "^7.18.6" + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.22.5.tgz", + "integrity": "sha512-xkb58MyOYIslxu3gKmVXmjTtUPvBU4odYzbiIQbWwLKIHCsx6UGZGX6F1IznMFVnDdirseUZopzN+ZRt8Xb33Q==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/helper-replace-supers": "^7.22.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, "@babel/helper-create-regexp-features-plugin": { @@ -29116,9 +29156,9 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz", - "integrity": "sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", + "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", "dev": true }, "@babel/helper-explode-assignable-expression": { @@ -29131,71 +29171,71 @@ } }, "@babel/helper-function-name": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz", - "integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", + "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", "dev": true, "requires": { - "@babel/template": "^7.20.7", - "@babel/types": "^7.21.0" + "@babel/template": "^7.22.5", + "@babel/types": "^7.22.5" } }, "@babel/helper-hoist-variables": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz", - "integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.0.tgz", - "integrity": "sha512-Muu8cdZwNN6mRRNG6lAYErJ5X3bRevgYR2O8wN0yn7jJSnGDu6eG59RfT29JHxGUovyfrh6Pj0XzmR7drNVL3Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.5.tgz", + "integrity": "sha512-aBiH1NKMG0H2cGZqspNvsaBe6wNGjbJjuLy29aU+eDZjSbbN53BaxlpB02xm9v34pLTZ1nIQPFYn2qMZoa5BQQ==", "dev": true, "requires": { - "@babel/types": "^7.21.0" + "@babel/types": "^7.22.5" } }, "@babel/helper-module-imports": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz", - "integrity": "sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz", + "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==", "dev": true, "requires": { - "@babel/types": "^7.21.4" + "@babel/types": "^7.22.5" } }, "@babel/helper-module-transforms": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.0.tgz", - "integrity": "sha512-drsR5/3eHuYs31uYLIXRK91+THB9+VAd2s3/4TY87Os5qrwr6YesM6GcNX5aEpCF6e9iKK0ZvTBTKqNyntEkvQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.5.tgz", + "integrity": "sha512-+hGKDt/Ze8GFExiVHno/2dvG5IdstpzCq0y4Qc9OJ25D4q3pKfiIP/4Vp3/JvhDkLKsDK2api3q3fpIgiIF5bw==", "dev": true, "requires": { - "@babel/helper-environment-visitor": "^7.21.5", - "@babel/helper-module-imports": "^7.21.4", - "@babel/helper-simple-access": "^7.21.5", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.21.9", - "@babel/traverse": "^7.22.0", - "@babel/types": "^7.22.0" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" } }, "@babel/helper-optimise-call-expression": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz", - "integrity": "sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.22.5.tgz", + "integrity": "sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-plugin-utils": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.21.5.tgz", - "integrity": "sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", "dev": true }, "@babel/helper-remap-async-to-generator": { @@ -29211,62 +29251,62 @@ } }, "@babel/helper-replace-supers": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz", - "integrity": "sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.22.5.tgz", + "integrity": "sha512-aLdNM5I3kdI/V9xGNyKSF3X/gTyMUBohTZ+/3QdQKAA9vxIiy12E+8E2HoOP1/DjeqU+g6as35QHJNMDDYpuCg==", "dev": true, "requires": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-member-expression-to-functions": "^7.20.7", - "@babel/helper-optimise-call-expression": "^7.18.6", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.7", - "@babel/types": "^7.20.7" + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-member-expression-to-functions": "^7.22.5", + "@babel/helper-optimise-call-expression": "^7.22.5", + "@babel/template": "^7.22.5", + "@babel/traverse": "^7.22.5", + "@babel/types": "^7.22.5" } }, "@babel/helper-simple-access": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.21.5.tgz", - "integrity": "sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "requires": { - "@babel/types": "^7.21.5" + "@babel/types": "^7.22.5" } }, "@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz", - "integrity": "sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.22.5.tgz", + "integrity": "sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==", "dev": true, "requires": { - "@babel/types": "^7.20.0" + "@babel/types": "^7.22.5" } }, "@babel/helper-split-export-declaration": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz", - "integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.5.tgz", + "integrity": "sha512-thqK5QFghPKWLhAV321lxF95yCg2K3Ob5yw+M3VHWfdia0IkPXUtoLH8x/6Fh486QUvzhb8YOWHChTVen2/PoQ==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.22.5" } }, "@babel/helper-string-parser": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz", - "integrity": "sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", "dev": true }, "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "dev": true }, "@babel/helper-validator-option": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz", - "integrity": "sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", + "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", "dev": true }, "@babel/helper-wrap-function": { @@ -29293,20 +29333,20 @@ } }, "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.0.tgz", - "integrity": "sha512-DA65VCJRetcFmJnt9/hEmRvXNCwk0V86dxG6p6N13hzDazaLRjGdTGPGgjxZOtLuFgWzOSRX4grybmRXwQ9bSg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz", + "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==", "dev": true }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { @@ -29598,12 +29638,12 @@ } }, "@babel/plugin-syntax-jsx": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz", - "integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-syntax-logical-assignment-operators": { @@ -29679,12 +29719,12 @@ } }, "@babel/plugin-syntax-typescript": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", - "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-plugin-utils": "^7.22.5" } }, "@babel/plugin-transform-arrow-functions": { @@ -29860,14 +29900,14 @@ } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.21.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.21.5.tgz", - "integrity": "sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.5.tgz", + "integrity": "sha512-B4pzOXj+ONRmuaQTg05b3y/4DuFz3WcCNAXPLb2Q0GT0TrGKGxNKV4jwsXts+StaM0LQczZbOpj8o1DLPDJIiA==", "dev": true, "requires": { - "@babel/helper-module-transforms": "^7.21.5", - "@babel/helper-plugin-utils": "^7.21.5", - "@babel/helper-simple-access": "^7.21.5" + "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-simple-access": "^7.22.5" } }, "@babel/plugin-transform-modules-systemjs": { @@ -30086,14 +30126,15 @@ } }, "@babel/plugin-transform-typescript": { - "version": "7.20.13", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.20.13.tgz", - "integrity": "sha512-O7I/THxarGcDZxkgWKMUrk7NK1/WbHAg3Xx86gqS6x9MTrNL6AwIluuZ96ms4xeDe6AVx6rjHbWHP7x26EPQBA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.22.5.tgz", + "integrity": "sha512-SMubA9S7Cb5sGSFFUlqxyClTA9zWJ8qGQrppNUm05LtFuN1ELRFNndkix4zUJrC9F+YivWwa1dHMSyo0e0N9dA==", "dev": true, "requires": { - "@babel/helper-create-class-features-plugin": "^7.20.12", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-typescript": "^7.20.0" + "@babel/helper-annotate-as-pure": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/plugin-syntax-typescript": "^7.22.5" } }, "@babel/plugin-transform-unicode-escapes": { @@ -30269,6 +30310,19 @@ "@babel/plugin-transform-react-pure-annotations": "^7.18.6" } }, + "@babel/preset-typescript": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.22.5.tgz", + "integrity": "sha512-YbPaal9LxztSGhmndR46FmAbkJ/1fAsw293tSU+I5E5h+cnJ3d4GTwyUgGYmOXJYdGA+uNePle4qbaRzj2NISQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.22.5", + "@babel/helper-validator-option": "^7.22.5", + "@babel/plugin-syntax-jsx": "^7.22.5", + "@babel/plugin-transform-modules-commonjs": "^7.22.5", + "@babel/plugin-transform-typescript": "^7.22.5" + } + }, "@babel/runtime": { "version": "7.21.5", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.21.5.tgz", @@ -30288,42 +30342,42 @@ } }, "@babel/template": { - "version": "7.21.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.21.9.tgz", - "integrity": "sha512-MK0X5k8NKOuWRamiEfc3KEJiHMTkGZNUjzMipqCGDDc6ijRl/B7RGSKVGncu4Ro/HdyzzY6cmoXuKI2Gffk7vQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", + "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", "dev": true, "requires": { - "@babel/code-frame": "^7.21.4", - "@babel/parser": "^7.21.9", - "@babel/types": "^7.21.5" + "@babel/code-frame": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5" } }, "@babel/traverse": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.0.tgz", - "integrity": "sha512-V5Zp3k0nFGWSIC7zYR8PnfdU6i6VYU4JnifdSSMlXM1GMojPAaelPsKmKPW4tWTmpX9GM+RzKl4Io0UVcHVlpw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.21.4", - "@babel/generator": "^7.22.0", - "@babel/helper-environment-visitor": "^7.21.5", - "@babel/helper-function-name": "^7.21.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.22.0", - "@babel/types": "^7.22.0", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.5.tgz", + "integrity": "sha512-7DuIjPgERaNo6r+PZwItpjCZEa5vyw4eJGufeLxrPdBXBoLcCJCIasvK6pK/9DVNrLZTLFhUGqaC6X/PA007TQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.22.5", + "@babel/generator": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-function-name": "^7.22.5", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.5", + "@babel/parser": "^7.22.5", + "@babel/types": "^7.22.5", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.0.tgz", - "integrity": "sha512-NtXlm3f6cNWIv003cETdlz9sss0VMNtplyatFohxWPz90AbwuhCbHbQopkGis6bG1vOunDLN0FF/4Uv5i8LFZQ==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz", + "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==", "dev": true, "requires": { - "@babel/helper-string-parser": "^7.21.5", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.5", "to-fast-properties": "^2.0.0" } }, diff --git a/package.json b/package.json index 171441948..a2e30b6b2 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "xmlhttprequest": "1.8.0" }, "devDependencies": { + "@babel/preset-typescript": "^7.22.5", "@babel/core": "7.22.0", "@babel/eslint-parser": "7.21.8", "@babel/plugin-proposal-class-properties": "7.18.6", @@ -98,6 +99,7 @@ }, "scripts": { "build": "node build_releases.js", + "build:types": "tsc", "release": "node build_releases.js && npm publish", "test": "cross-env PARSE_BUILD=node jest", "test:mongodb": "npm run test:mongodb:runnerstart && npm run integration", diff --git a/src/Analytics.js b/src/Analytics.ts similarity index 95% rename from src/Analytics.js rename to src/Analytics.ts index 32f4cf82f..19f0996cd 100644 --- a/src/Analytics.js +++ b/src/Analytics.ts @@ -2,6 +2,7 @@ * @flow */ +// @ts-ignore import CoreManager from './CoreManager'; /** @@ -44,7 +45,7 @@ import CoreManager from './CoreManager'; * @returns {Promise} A promise that is resolved when the round-trip * to the server completes. */ -export function track(name: string, dimensions: { [key: string]: string }): Promise { +export function track(name: string, dimensions: { [key: string]: string }): Promise { name = name || ''; name = name.replace(/^\s*/, ''); name = name.replace(/\s*$/, ''); @@ -62,7 +63,7 @@ export function track(name: string, dimensions: { [key: string]: string }): Prom } const DefaultController = { - track(name, dimensions) { + track(name: string, dimensions: { [key: string]: string }) { const path = 'events/' + name; const RESTController = CoreManager.getRESTController(); return RESTController.request('POST', path, { dimensions: dimensions }); diff --git a/src/ObjectStateMutations.js b/src/ObjectStateMutations.ts similarity index 94% rename from src/ObjectStateMutations.js rename to src/ObjectStateMutations.ts index c70531a65..1904b66f7 100644 --- a/src/ObjectStateMutations.js +++ b/src/ObjectStateMutations.ts @@ -43,7 +43,7 @@ export function setServerData(serverData: AttributeMap, attributes: AttributeMap } } -export function setPendingOp(pendingOps: Array, attr: string, op: ?Op) { +export function setPendingOp(pendingOps: Array, attr: string, op?: Op) { const last = pendingOps.length - 1; if (op) { pendingOps[last][attr] = op; @@ -56,7 +56,7 @@ export function pushPendingState(pendingOps: Array) { pendingOps.push({}); } -export function popPendingState(pendingOps: Array): OpsMap { +export function popPendingState(pendingOps: Array): OpsMap | undefined { const first = pendingOps.shift(); if (!pendingOps.length) { pendingOps[0] = {}; @@ -83,15 +83,15 @@ export function estimateAttribute( serverData: AttributeMap, pendingOps: Array, className: string, - id: ?string, + id: string | undefined, attr: string -): mixed { +): any { let value = serverData[attr]; for (let i = 0; i < pendingOps.length; i++) { if (pendingOps[i][attr]) { if (pendingOps[i][attr] instanceof RelationOp) { if (id) { - value = pendingOps[i][attr].applyTo(value, { className: className, id: id }, attr); + value = (pendingOps[i][attr] as RelationOp).applyTo(value, { className: className, id: id }, attr); } } else { value = pendingOps[i][attr].applyTo(value); @@ -105,7 +105,7 @@ export function estimateAttributes( serverData: AttributeMap, pendingOps: Array, className: string, - id: ?string + id?: string ): AttributeMap { const data = {}; let attr; @@ -116,7 +116,7 @@ export function estimateAttributes( for (attr in pendingOps[i]) { if (pendingOps[i][attr] instanceof RelationOp) { if (id) { - data[attr] = pendingOps[i][attr].applyTo( + data[attr] = (pendingOps[i][attr] as RelationOp).applyTo( data[attr], { className: className, id: id }, attr diff --git a/src/ParseObject.js b/src/ParseObject.ts similarity index 94% rename from src/ParseObject.js rename to src/ParseObject.ts index 2ce00599b..a26576607 100644 --- a/src/ParseObject.js +++ b/src/ParseObject.ts @@ -41,7 +41,8 @@ const uuidv4 = require('./uuid'); export type Pointer = { __type: string, className: string, - objectId: string, + objectId?: string, + _localId?: string }; type SaveParams = { @@ -105,16 +106,16 @@ class ParseObject { * @param {object} options The options for this object instance. */ constructor( - className: ?string | { className: string, [attr: string]: mixed }, - attributes?: { [attr: string]: mixed }, - options?: { ignoreValidation: boolean } + className?: string | { className: string, [attr: string]: any }, + attributes?: { [attr: string]: any }, + options?: { ignoreValidation: boolean } | { [attr: string]: any } ) { // Enable legacy initializers if (typeof this.initialize === 'function') { - this.initialize.apply(this, arguments); + this.initialize.apply(this, arguments as any); } - let toSet = null; + let toSet: AttributeMap | null = null; this._objCount = objectCount++; if (typeof className === 'string') { this.className = className; @@ -143,10 +144,11 @@ class ParseObject { * * @property {string} id */ - id: ?string; - _localId: ?string; + id?: string; + _localId?: string; _objCount: number; - className: string; + className: string = ''; + _initializers?: ((...args: Array) => void)[]; /* Prototype getters / setters */ @@ -161,7 +163,7 @@ class ParseObject { * @property {Date} createdAt * @returns {Date} */ - get createdAt(): ?Date { + get createdAt(): Date | null | undefined { return this._getServerData().createdAt; } @@ -171,7 +173,7 @@ class ParseObject { * @property {Date} updatedAt * @returns {Date} */ - get updatedAt(): ?Date { + get updatedAt(): Date | null | undefined { return this._getServerData().updatedAt; } @@ -280,7 +282,7 @@ class ParseObject { } _toFullJSON(seen?: Array, offline?: boolean): AttributeMap { - const json: { [key: string]: mixed } = this.toJSON(seen, offline); + const json: { [key: string]: any } = this.toJSON(seen, offline); json.__type = 'Object'; json.className = this.className; return json; @@ -346,7 +348,7 @@ class ParseObject { } const stateController = CoreManager.getObjectStateController(); stateController.initializeState(this._getStateIdentifier()); - const decoded = {}; + const decoded: AttributeMap = {}; for (const attr in serverData) { if (attr === 'ACL') { decoded[attr] = new ParseACL(serverData[attr]); @@ -395,7 +397,7 @@ class ParseObject { } _handleSaveResponse(response: AttributeMap, status: number) { - const changes = {}; + const changes: AttributeMap = {}; let attr; const stateController = CoreManager.getObjectStateController(); const pending = stateController.popPendingState(this._getStateIdentifier()); @@ -462,7 +464,7 @@ class ParseObject { toJSON(seen: Array | void, offline?: boolean): AttributeMap { const seenEntry = this.id ? this.className + ':' + this.id : this; seen = seen || [seenEntry]; - const json = {}; + const json: AttributeMap = {}; const attrs = this.attributes; for (const attr in attrs) { if ((attr === 'createdAt' || attr === 'updatedAt') && attrs[attr].toJSON) { @@ -488,7 +490,7 @@ class ParseObject { * @param {object} other - An other object ot compare * @returns {boolean} */ - equals(other: mixed): boolean { + equals(other: any): boolean { if (this === other) { return true; } @@ -602,7 +604,7 @@ class ParseObject { * @param {string} attr The string name of an attribute. * @returns {*} */ - get(attr: string): mixed { + get(attr: string): any { return this.attributes[attr]; } @@ -689,7 +691,7 @@ class ParseObject { * The only supported option is error. * @returns {(ParseObject|boolean)} true if the set succeeded. */ - set(key: mixed, value: mixed, options?: mixed): ParseObject | boolean { + set(key: any, value?: any, options?: any): ParseObject | boolean { let changes = {}; const newOps = {}; if (key && typeof key === 'object') { @@ -702,9 +704,9 @@ class ParseObject { } options = options || {}; - let readonly = []; - if (typeof this.constructor.readOnlyAttributes === 'function') { - readonly = readonly.concat(this.constructor.readOnlyAttributes()); + let readonly: string[] = []; + if (typeof (this.constructor as any).readOnlyAttributes === 'function') { + readonly = readonly.concat((this.constructor as any).readOnlyAttributes()); } for (const k in changes) { if (k === 'createdAt' || k === 'updatedAt') { @@ -787,7 +789,7 @@ class ParseObject { * @param options * @returns {(ParseObject | boolean)} */ - unset(attr: string, options?: { [opt: string]: mixed }): ParseObject | boolean { + unset(attr: string, options?: { [opt: string]: any }): ParseObject | boolean { options = options || {}; options.unset = true; return this.set(attr, null, options); @@ -837,7 +839,7 @@ class ParseObject { * @param item {} The item to add. * @returns {(ParseObject | boolean)} */ - add(attr: string, item: mixed): ParseObject | boolean { + add(attr: string, item: any): ParseObject | boolean { return this.set(attr, new AddOp([item])); } @@ -849,7 +851,7 @@ class ParseObject { * @param items {Object[]} The items to add. * @returns {(ParseObject | boolean)} */ - addAll(attr: string, items: Array): ParseObject | boolean { + addAll(attr: string, items: Array): ParseObject | boolean { return this.set(attr, new AddOp(items)); } @@ -862,7 +864,7 @@ class ParseObject { * @param item {} The object to add. * @returns {(ParseObject | boolean)} */ - addUnique(attr: string, item: mixed): ParseObject | boolean { + addUnique(attr: string, item: any): ParseObject | boolean { return this.set(attr, new AddUniqueOp([item])); } @@ -875,7 +877,7 @@ class ParseObject { * @param items {Object[]} The objects to add. * @returns {(ParseObject | boolean)} */ - addAllUnique(attr: string, items: Array): ParseObject | boolean { + addAllUnique(attr: string, items: Array): ParseObject | boolean { return this.set(attr, new AddUniqueOp(items)); } @@ -887,7 +889,7 @@ class ParseObject { * @param item {} The object to remove. * @returns {(ParseObject | boolean)} */ - remove(attr: string, item: mixed): ParseObject | boolean { + remove(attr: string, item: any): ParseObject | boolean { return this.set(attr, new RemoveOp([item])); } @@ -899,7 +901,7 @@ class ParseObject { * @param items {Object[]} The object to remove. * @returns {(ParseObject | boolean)} */ - removeAll(attr: string, items: Array): ParseObject | boolean { + removeAll(attr: string, items: Array): ParseObject | boolean { return this.set(attr, new RemoveOp(items)); } @@ -912,7 +914,7 @@ class ParseObject { * @param attr {String} The key. * @returns {Parse.Op | undefined} The operation, or undefined if none. */ - op(attr: string): ?Op { + op(attr: string): Op | null | undefined { const pending = this._getPendingOps(); for (let i = pending.length; i--;) { if (pending[i][attr]) { @@ -927,10 +929,10 @@ class ParseObject { * @returns {Parse.Object} */ clone(): any { - const clone = new this.constructor(this.className); + const clone = new (this.constructor as any)(this.className); let attributes = this.attributes; - if (typeof this.constructor.readOnlyAttributes === 'function') { - const readonly = this.constructor.readOnlyAttributes() || []; + if (typeof (this.constructor as any).readOnlyAttributes === 'function') { + const readonly = (this.constructor as any).readOnlyAttributes() || []; // Attributes are frozen, so we have to rebuild an object, // rather than delete readonly keys const copy = {}; @@ -953,7 +955,7 @@ class ParseObject { * @returns {Parse.Object} */ newInstance(): any { - const clone = new this.constructor(this.className); + const clone = new (this.constructor as any)(this.className); clone.id = this.id; if (singleInstance) { // Just return an object with the right id @@ -1015,7 +1017,7 @@ class ParseObject { const query = new ParseQuery(this.className); await query.get(this.id, options); return true; - } catch (e) { + } catch (e: ParseError) { if (e.code === ParseError.OBJECT_NOT_FOUND) { return false; } @@ -1060,7 +1062,7 @@ class ParseObject { * @returns {Parse.ACL} An instance of Parse.ACL. * @see Parse.Object#get */ - getACL(): ?ParseACL { + getACL(): ParseACL | null { const acl = this.get('ACL'); if (acl instanceof ParseACL) { return acl; @@ -1076,7 +1078,7 @@ class ParseObject { * @returns {(ParseObject | boolean)} Whether the set passed validation. * @see Parse.Object#set */ - setACL(acl: ParseACL, options?: mixed): ParseObject | boolean { + setACL(acl: ParseACL, options?: any): ParseObject | boolean { return this.set('ACL', acl, options); } @@ -1109,8 +1111,8 @@ class ParseObject { const attributes = this.attributes; const erasable = {}; let readonly = ['createdAt', 'updatedAt']; - if (typeof this.constructor.readOnlyAttributes === 'function') { - readonly = readonly.concat(this.constructor.readOnlyAttributes()); + if (typeof (this.constructor as any).readOnlyAttributes === 'function') { + readonly = readonly.concat((this.constructor as any).readOnlyAttributes()); } for (const attr in attributes) { if (readonly.indexOf(attr) < 0) { @@ -1137,9 +1139,9 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the fetch * completes. */ - fetch(options: RequestOptions): Promise { + fetch(options: RequestOptions): Promise { options = options || {}; - const fetchOptions = {}; + const fetchOptions: RequestOptions = {}; if (options.hasOwnProperty('useMasterKey')) { fetchOptions.useMasterKey = options.useMasterKey; } @@ -1185,7 +1187,7 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the fetch * completes. */ - fetchWithInclude(keys: String | Array>, options: RequestOptions): Promise { + fetchWithInclude(keys: String | Array>, options: RequestOptions): Promise { options = options || {}; options.include = keys; return this.fetch(options); @@ -1215,10 +1217,10 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the save * completes. */ - async saveEventually(options: SaveOptions): Promise { + async saveEventually(options: SaveOptions): Promise { try { await this.save(null, options); - } catch (e) { + } catch (e: ParseError) { if (e.message === 'XMLHttpRequest failed: "Unable to connect to the Parse API"') { await EventuallyQueue.save(this, options); EventuallyQueue.poll(); @@ -1291,10 +1293,10 @@ class ParseObject { * completes. */ save( - arg1: ?string | { [attr: string]: mixed }, - arg2: SaveOptions | mixed, + arg1: { [attr: string]: any } | undefined | null, + arg2: SaveOptions | any, arg3?: SaveOptions - ): Promise { + ): Promise { let attrs; let options; if (typeof arg1 === 'object' || typeof arg1 === 'undefined') { @@ -1317,7 +1319,7 @@ class ParseObject { } options = options || {}; - const saveOptions = {}; + const saveOptions: SaveOptions = {}; if (options.hasOwnProperty('useMasterKey')) { saveOptions.useMasterKey = !!options.useMasterKey; } @@ -1359,10 +1361,10 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the destroy * completes. */ - async destroyEventually(options: RequestOptions): Promise { + async destroyEventually(options: RequestOptions): Promise { try { await this.destroy(options); - } catch (e) { + } catch (e: ParseError) { if (e.message === 'XMLHttpRequest failed: "Unable to connect to the Parse API"') { await EventuallyQueue.destroy(this, options); EventuallyQueue.poll(); @@ -1385,9 +1387,9 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the destroy * completes. */ - destroy(options: RequestOptions): Promise { + destroy(options: RequestOptions): Promise { options = options || {}; - const destroyOptions = {}; + const destroyOptions: RequestOptions = {}; if (options.hasOwnProperty('useMasterKey')) { destroyOptions.useMasterKey = options.useMasterKey; } @@ -1552,7 +1554,7 @@ class ParseObject { * @returns {Parse.Object[]} */ static fetchAll(list: Array, options: RequestOptions = {}) { - const queryOptions = {}; + const queryOptions: RequestOptions = {}; if (options.hasOwnProperty('useMasterKey')) { queryOptions.useMasterKey = options.useMasterKey; } @@ -1662,10 +1664,8 @@ class ParseObject { * @static * @returns {Parse.Object[]} */ - static fetchAllIfNeeded(list: Array, options) { - options = options || {}; - - const queryOptions = {}; + static fetchAllIfNeeded(list: Array, options: RequestOptions = {}) { + const queryOptions: RequestOptions = {}; if (options.hasOwnProperty('useMasterKey')) { queryOptions.useMasterKey = options.useMasterKey; } @@ -1679,7 +1679,7 @@ class ParseObject { } static handleIncludeOptions(options) { - let include = []; + let include: string[] = []; if (Array.isArray(options.include)) { options.include.forEach(key => { if (Array.isArray(key)) { @@ -1740,8 +1740,8 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the destroyAll * completes. */ - static destroyAll(list: Array, options = {}) { - const destroyOptions = {}; + static destroyAll(list: Array, options: RequestOptions = {}) { + const destroyOptions: RequestOptions = {}; if (options.hasOwnProperty('useMasterKey')) { destroyOptions.useMasterKey = options.useMasterKey; } @@ -1776,7 +1776,7 @@ class ParseObject { * @returns {Parse.Object[]} */ static saveAll(list: Array, options: RequestOptions = {}) { - const saveOptions = {}; + const saveOptions: RequestOptions = {}; if (options.hasOwnProperty('useMasterKey')) { saveOptions.useMasterKey = options.useMasterKey; } @@ -1828,7 +1828,7 @@ class ParseObject { } const constructor = classMap[json.className]; const o = constructor ? new constructor(json.className) : new ParseObject(json.className); - const otherAttributes = {}; + const otherAttributes: any = {}; for (const attr in json) { if (attr !== 'className' && attr !== '__type') { otherAttributes[attr] = json[attr]; @@ -1950,20 +1950,21 @@ class ParseObject { } let parentProto = ParseObject.prototype; - if (this.hasOwnProperty('__super__') && this.__super__) { + if (this.hasOwnProperty('__super__') && (this as any).__super__) { parentProto = this.prototype; } - let ParseObjectSubclass = function (attributes, options) { + // + let ParseObjectSubclass = function (this: ParseObject, attributes, options) { this.className = adjustedClassName; this._objCount = objectCount++; // Enable legacy initializers if (typeof this.initialize === 'function') { - this.initialize.apply(this, arguments); + this.initialize.apply(this, arguments as any); } if (this._initializers) { for (const initializer of this._initializers) { - initializer.apply(this, arguments); + initializer.apply(this, arguments as any); } } @@ -1976,15 +1977,15 @@ class ParseObject { if (classMap[adjustedClassName]) { ParseObjectSubclass = classMap[adjustedClassName]; } else { - ParseObjectSubclass.extend = function (name, protoProps, classProps) { + (ParseObjectSubclass as any).extend = function (name, protoProps, classProps) { if (typeof name === 'string') { return ParseObject.extend.call(ParseObjectSubclass, name, protoProps, classProps); } return ParseObject.extend.call(ParseObjectSubclass, adjustedClassName, name, protoProps); }; - ParseObjectSubclass.createWithoutData = ParseObject.createWithoutData; - ParseObjectSubclass.className = adjustedClassName; - ParseObjectSubclass.__super__ = parentProto; + (ParseObjectSubclass as any).createWithoutData = ParseObject.createWithoutData; + (ParseObjectSubclass as any).className = adjustedClassName; + (ParseObjectSubclass as any).__super__ = parentProto; ParseObjectSubclass.prototype = Object.create(parentProto, { constructor: { value: ParseObjectSubclass, @@ -2195,16 +2196,16 @@ const DefaultController = { target: ParseObject | Array, forceFetch: boolean, options: RequestOptions - ): Promise | ParseObject> { + ): Promise | ParseObject | void> { const localDatastore = CoreManager.getLocalDatastore(); if (Array.isArray(target)) { if (target.length < 1) { return Promise.resolve([]); } - const objs = []; - const ids = []; - let className = null; - const results = []; + const objs: ParseObject[] = []; + const ids: string[] = []; + let className: string | null = null; + const results: any[] = []; let error = null; target.forEach(el => { if (error) { @@ -2223,7 +2224,9 @@ const DefaultController = { error = new ParseError(ParseError.MISSING_OBJECT_ID, 'All objects must have an ID'); } if (forceFetch || !el.isDataAvailable()) { - ids.push(el.id); + if (el.id) { + ids.push(el.id); + } objs.push(el); } results.push(el); @@ -2238,7 +2241,7 @@ const DefaultController = { } query._limit = ids.length; return query.find(options).then(async objects => { - const idMap = {}; + const idMap: {[key: string]: ParseObject} = {}; objects.forEach(o => { idMap[o.id] = o; }); @@ -2275,7 +2278,7 @@ const DefaultController = { ); } const RESTController = CoreManager.getRESTController(); - const params = {}; + const params: RequestOptions = {}; if (options && options.include) { params.include = options.include.join(); } @@ -2298,7 +2301,7 @@ const DefaultController = { async destroy( target: ParseObject | Array, options: RequestOptions - ): Promise | ParseObject> { + ): Promise | ParseObject[]> { const batchSize = options && options.batchSize ? options.batchSize : CoreManager.get('REQUEST_BATCH_SIZE'); const localDatastore = CoreManager.getLocalDatastore(); @@ -2308,7 +2311,7 @@ const DefaultController = { if (target.length < 1) { return Promise.resolve([]); } - const batches = [[]]; + const batches: Array = [[]]; target.forEach(obj => { if (!obj.id) { return; @@ -2323,7 +2326,7 @@ const DefaultController = { batches.pop(); } let deleteCompleted = Promise.resolve(); - const errors = []; + const errors: any[] = []; batches.forEach(batch => { deleteCompleted = deleteCompleted.then(() => { return RESTController.request( @@ -2379,7 +2382,7 @@ const DefaultController = { const batchSize = options && options.batchSize ? options.batchSize : CoreManager.get('REQUEST_BATCH_SIZE'); const localDatastore = CoreManager.getLocalDatastore(); - const mapIdForPin = {}; + const mapIdForPin: {[key: string]: string} = {}; const RESTController = CoreManager.getRESTController(); const stateController = CoreManager.getObjectStateController(); @@ -2417,8 +2420,8 @@ const DefaultController = { return pending.length > 0; }, () => { - const batch = []; - const nextPending = []; + const batch: ParseObject[] = []; + const nextPending: any[] = []; pending.forEach(el => { if (allowCustomObjectId && Object.prototype.hasOwnProperty.call(el, 'id') && !el.id) { throw new ParseError( @@ -2443,8 +2446,8 @@ const DefaultController = { // Queue up tasks for each object in the batch. // When every task is ready, the API request will execute const batchReturned = new resolvingPromise(); - const batchReady = []; - const batchTasks = []; + const batchReady: any[] = []; + const batchTasks: any[] = []; batch.forEach((obj, index) => { const ready = new resolvingPromise(); batchReady.push(ready); @@ -2455,7 +2458,9 @@ const DefaultController = { const objectId = responses[index].success.objectId; const status = responses[index]._status; delete responses[index]._status; - mapIdForPin[objectId] = obj._localId; + if (objectId && obj._localId) { + mapIdForPin[objectId] = obj._localId; + } obj._handleSaveResponse(responses[index].success, status); } else { if (!objectError && responses[index].hasOwnProperty('error')) { @@ -2501,7 +2506,9 @@ const DefaultController = { for (const object of target) { // Make sure that it is a ParseObject before updating it into the localDataStore if (object instanceof ParseObject) { - await localDatastore._updateLocalIdForObject(mapIdForPin[object.id], object); + if (object.id) { + await localDatastore._updateLocalIdForObject(mapIdForPin[object.id], object); + } await localDatastore._updateObjectIfPinned(object); } } diff --git a/src/ParseOp.js b/src/ParseOp.ts similarity index 90% rename from src/ParseOp.js rename to src/ParseOp.ts index a35485c60..7f3848055 100644 --- a/src/ParseOp.js +++ b/src/ParseOp.ts @@ -9,7 +9,7 @@ import ParseObject from './ParseObject'; import ParseRelation from './ParseRelation'; import unique from './unique'; -export function opFromJSON(json: { [key: string]: any }): ?Op { +export function opFromJSON(json: { [key: string]: any }): Op | null { if (!json || !json.__op) { return null; } @@ -56,20 +56,20 @@ export function opFromJSON(json: { [key: string]: any }): ?Op { export class Op { // Empty parent class - applyTo(value: mixed): mixed {} /* eslint-disable-line no-unused-vars */ - mergeWith(previous: Op): ?Op {} /* eslint-disable-line no-unused-vars */ - toJSON(): mixed {} + applyTo(value: any): any {} /* eslint-disable-line no-unused-vars */ + mergeWith(previous: Op): Op | void {} /* eslint-disable-line no-unused-vars */ + toJSON(offline?: boolean): any {} } export class SetOp extends Op { - _value: ?mixed; + _value?: any; - constructor(value: mixed) { + constructor(value: any) { super(); this._value = value; } - applyTo(): mixed { + applyTo(): any { return this._value; } @@ -107,7 +107,7 @@ export class IncrementOp extends Op { this._amount = amount; } - applyTo(value: ?mixed): number { + applyTo(value?: any): number { if (typeof value === 'undefined') { return this._amount; } @@ -139,14 +139,14 @@ export class IncrementOp extends Op { } export class AddOp extends Op { - _value: Array; + _value: Array; - constructor(value: mixed | Array) { + constructor(value: any | Array) { super(); this._value = Array.isArray(value) ? value : [value]; } - applyTo(value: mixed): Array { + applyTo(value: any): Array { if (value == null) { return this._value; } @@ -172,25 +172,25 @@ export class AddOp extends Op { throw new Error('Cannot merge Add Op with the previous Op'); } - toJSON(): { __op: string, objects: mixed } { + toJSON(): { __op: string, objects: any } { return { __op: 'Add', objects: encode(this._value, false, true) }; } } export class AddUniqueOp extends Op { - _value: Array; + _value: Array; - constructor(value: mixed | Array) { + constructor(value: any | Array) { super(); this._value = unique(Array.isArray(value) ? value : [value]); } - applyTo(value: mixed | Array): Array { + applyTo(value: any | Array): Array { if (value == null) { return this._value || []; } if (Array.isArray(value)) { - const toAdd = []; + const toAdd: ParseObject[] = []; this._value.forEach(v => { if (v instanceof ParseObject) { if (!arrayContainsObject(value, v)) { @@ -223,20 +223,20 @@ export class AddUniqueOp extends Op { throw new Error('Cannot merge AddUnique Op with the previous Op'); } - toJSON(): { __op: string, objects: mixed } { + toJSON(): { __op: string, objects: any } { return { __op: 'AddUnique', objects: encode(this._value, false, true) }; } } export class RemoveOp extends Op { - _value: Array; + _value: Array; - constructor(value: mixed | Array) { + constructor(value: any | Array) { super(); this._value = unique(Array.isArray(value) ? value : [value]); } - applyTo(value: mixed | Array): Array { + applyTo(value: any | Array): Array { if (value == null) { return []; } @@ -291,19 +291,18 @@ export class RemoveOp extends Op { throw new Error('Cannot merge Remove Op with the previous Op'); } - toJSON(): { __op: string, objects: mixed } { + toJSON(): { __op: string, objects: any } { return { __op: 'Remove', objects: encode(this._value, false, true) }; } } export class RelationOp extends Op { - _targetClassName: ?string; - relationsToAdd: Array; - relationsToRemove: Array; + _targetClassName?: string | null = null; + relationsToAdd: Array = []; + relationsToRemove: Array = []; constructor(adds: Array, removes: Array) { super(); - this._targetClassName = null; if (Array.isArray(adds)) { this.relationsToAdd = unique(adds.map(this._extractId, this)); @@ -336,7 +335,7 @@ export class RelationOp extends Op { return obj.id; } - applyTo(value: mixed, object?: { className: string, id: ?string }, key?: string): ?ParseRelation { + applyTo(value: any, object?: { className: string, id?: string }, key?: string): ParseRelation | undefined { if (!value) { if (!object || !key) { throw new Error( @@ -427,7 +426,7 @@ export class RelationOp extends Op { throw new Error('Cannot merge Relation Op with the previous Op'); } - toJSON(): { __op?: string, objects?: mixed, ops?: mixed } { + toJSON(): { __op?: string, objects?: any, ops?: any } { const idToPointer = id => { return { __type: 'Pointer', @@ -436,9 +435,9 @@ export class RelationOp extends Op { }; }; - let adds = null; - let removes = null; - let pointers = null; + let adds: any = null; + let removes: any = null; + let pointers: any = null; if (this.relationsToAdd.length > 0) { pointers = this.relationsToAdd.map(idToPointer); diff --git a/src/ParseUser.js b/src/ParseUser.ts similarity index 94% rename from src/ParseUser.js rename to src/ParseUser.ts index d2014f1ac..2fade6da0 100644 --- a/src/ParseUser.js +++ b/src/ParseUser.ts @@ -11,13 +11,19 @@ import Storage from './Storage'; import type { AttributeMap } from './ObjectStateMutations'; import type { RequestOptions, FullOptions } from './RESTController'; +import type { SaveOptions } from './ParseObject'; -export type AuthData = ?{ [key: string]: mixed }; +export type AuthData = { [key: string]: any } | undefined | null +export type AuthProvider = { + restoreAuthentication(authData: any): boolean, + getAuthType(): boolean, + getAuthData() : {authData: {[key: string]: any}} +} const CURRENT_USER_KEY = 'currentUser'; let canUseCurrentUser = !CoreManager.get('IS_NODE'); let currentUserCacheMatchesDisk = false; -let currentUserCache = null; +let currentUserCache: ParseUser | undefined | null = null; const authProviders = {}; @@ -35,7 +41,7 @@ class ParseUser extends ParseObject { /** * @param {object} attributes The initial set of data to store in the user. */ - constructor(attributes: ?AttributeMap) { + constructor(attributes?: AttributeMap) { super('_User'); if (attributes && typeof attributes === 'object') { if (!this.set(attributes || {})) { @@ -54,7 +60,7 @@ class ParseUser extends ParseObject { _upgradeToRevocableSession(options: RequestOptions): Promise { options = options || {}; - const upgradeOptions = {}; + const upgradeOptions: RequestOptions = {}; if (options.hasOwnProperty('useMasterKey')) { upgradeOptions.useMasterKey = options.useMasterKey; } @@ -81,7 +87,7 @@ class ParseUser extends ParseObject { linkWith( provider: any, options: { authData?: AuthData }, - saveOpts?: FullOptions = {} + saveOpts: FullOptions = {} ): Promise { saveOpts.sessionToken = saveOpts.sessionToken || this.getSessionToken() || ''; let authType; @@ -117,7 +123,7 @@ class ParseUser extends ParseObject { return new Promise((resolve, reject) => { provider.authenticate({ success: (provider, result) => { - const opts = {}; + const opts: AuthData = {}; opts.authData = result; this.linkWith(provider, opts, saveOpts).then( () => { @@ -146,7 +152,7 @@ class ParseUser extends ParseObject { _linkWith( provider: any, options: { authData?: AuthData }, - saveOpts?: FullOptions = {} + saveOpts: FullOptions = {} ): Promise { return this.linkWith(provider, options, saveOpts); } @@ -157,7 +163,7 @@ class ParseUser extends ParseObject { * * @param provider */ - _synchronizeAuthData(provider: string) { + _synchronizeAuthData(provider: string | AuthProvider) { if (!this.isCurrent() || !provider) { return; } @@ -172,7 +178,7 @@ class ParseUser extends ParseObject { if (!provider || !authData || typeof authData !== 'object') { return; } - const success = provider.restoreAuthentication(authData[authType]); + const success = (provider as AuthProvider).restoreAuthentication(authData[authType]); if (!success) { this._unlinkFrom(provider); } @@ -315,7 +321,7 @@ class ParseUser extends ParseObject { * * @returns {string} */ - getUsername(): ?string { + getUsername(): string | null | undefined { const username = this.get('username'); if (username == null || typeof username === 'string') { return username; @@ -352,7 +358,7 @@ class ParseUser extends ParseObject { * * @returns {string} User's Email */ - getEmail(): ?string { + getEmail(): string | null | undefined { const email = this.get('email'); if (email == null || typeof email === 'string') { return email; @@ -377,7 +383,7 @@ class ParseUser extends ParseObject { * * @returns {string} the session token, or undefined */ - getSessionToken(): ?string { + getSessionToken(): string | undefined | null { const token = this.get('sessionToken'); if (token == null || typeof token === 'string') { return token; @@ -411,7 +417,7 @@ class ParseUser extends ParseObject { signUp(attrs: AttributeMap, options?: FullOptions): Promise { options = options || {}; - const signupOptions = {}; + const signupOptions: FullOptions = {}; if (options.hasOwnProperty('useMasterKey')) { signupOptions.useMasterKey = options.useMasterKey; } @@ -443,7 +449,7 @@ class ParseUser extends ParseObject { logIn(options?: FullOptions): Promise { options = options || {}; - const loginOptions = { usePost: true }; + const loginOptions: FullOptions = { usePost: true }; if (options.hasOwnProperty('useMasterKey')) { loginOptions.useMasterKey = options.useMasterKey; } @@ -462,11 +468,15 @@ class ParseUser extends ParseObject { * Wrap the default save behavior with functionality to save to local * storage if this is current user. * - * @param {...any} args + * @param {...any} arg1 * @returns {Promise} */ - async save(...args: Array): Promise { - await super.save.apply(this, args); + async save( + arg1: { [attr: string]: any } | undefined | null, + arg2: SaveOptions | any, + arg3?: SaveOptions + ): Promise { + await super.save.apply(this, [arg1, arg2, arg3]); const current = await this.isCurrentAsync(); if (current) { return CoreManager.getUserController().updateUserOnDisk(this); @@ -478,11 +488,11 @@ class ParseUser extends ParseObject { * Wrap the default destroy behavior with functionality that logs out * the current user when it is destroyed * - * @param {...any} args + * @param {...any} options * @returns {Parse.User} */ - async destroy(...args: Array): Promise { - await super.destroy.apply(this, args); + async destroy(options: RequestOptions): Promise { + await super.destroy.apply(this, [options]); const current = await this.isCurrentAsync(); if (current) { return CoreManager.getUserController().removeUserFromDisk(); @@ -494,11 +504,11 @@ class ParseUser extends ParseObject { * Wrap the default fetch behavior with functionality to save to local * storage if this is current user. * - * @param {...any} args + * @param {...any} options * @returns {Parse.User} */ - async fetch(...args: Array): Promise { - await super.fetch.apply(this, args); + async fetch(options: RequestOptions): Promise { + await super.fetch.apply(this, [options]); const current = await this.isCurrentAsync(); if (current) { return CoreManager.getUserController().updateUserOnDisk(this); @@ -510,11 +520,11 @@ class ParseUser extends ParseObject { * Wrap the default fetchWithInclude behavior with functionality to save to local * storage if this is current user. * - * @param {...any} args + * @param {...any} keys * @returns {Parse.User} */ - async fetchWithInclude(...args: Array): Promise { - await super.fetchWithInclude.apply(this, args); + async fetchWithInclude(keys: String | Array>, options: RequestOptions): Promise { + await super.fetchWithInclude.apply(this, [keys, options]); const current = await this.isCurrentAsync(); if (current) { return CoreManager.getUserController().updateUserOnDisk(this); @@ -585,7 +595,7 @@ class ParseUser extends ParseObject { * @static * @returns {Parse.Object} The currently logged in Parse.User. */ - static current(): ?ParseUser { + static current(): ParseUser | null | undefined { if (!canUseCurrentUser) { return null; } @@ -600,7 +610,7 @@ class ParseUser extends ParseObject { * @returns {Promise} A Promise that is resolved with the currently * logged in Parse User */ - static currentAsync(): Promise { + static currentAsync(): Promise { if (!canUseCurrentUser) { return Promise.resolve(null); } @@ -709,7 +719,7 @@ class ParseUser extends ParseObject { * @static * @returns {Promise} A promise that is fulfilled with the user is fetched. */ - static me(sessionToken: string, options?: RequestOptions = {}) { + static me(sessionToken: string, options: RequestOptions = {}) { const controller = CoreManager.getUserController(); const meOptions: RequestOptions = { sessionToken: sessionToken, @@ -784,7 +794,7 @@ class ParseUser extends ParseObject { static requestPasswordReset(email: string, options?: RequestOptions) { options = options || {}; - const requestOptions = {}; + const requestOptions: RequestOptions = {}; if (options.hasOwnProperty('useMasterKey')) { requestOptions.useMasterKey = options.useMasterKey; } @@ -805,7 +815,7 @@ class ParseUser extends ParseObject { static requestEmailVerification(email: string, options?: RequestOptions) { options = options || {}; - const requestOptions = {}; + const requestOptions: RequestOptions = {}; if (options.hasOwnProperty('useMasterKey')) { requestOptions.useMasterKey = options.useMasterKey; } @@ -835,7 +845,7 @@ class ParseUser extends ParseObject { options = options || {}; - const verificationOption = {}; + const verificationOption: RequestOptions = {}; if (options.hasOwnProperty('useMasterKey')) { verificationOption.useMasterKey = options.useMasterKey; } @@ -945,7 +955,7 @@ class ParseUser extends ParseObject { currentUserCacheMatchesDisk = false; } - static _setCurrentUserCache(user: ParseUser) { + static _setCurrentUserCache(user: ParseUser | undefined | null) { currentUserCache = user; } } @@ -983,7 +993,7 @@ const DefaultController = { return DefaultController.updateUserOnDisk(user); }, - currentUser(): ?ParseUser { + currentUser(): ParseUser | undefined | null { if (currentUserCache) { return currentUserCache; } @@ -1027,7 +1037,7 @@ const DefaultController = { return current; }, - currentUserAsync(): Promise { + currentUserAsync(): Promise { if (currentUserCache) { return Promise.resolve(currentUserCache); } @@ -1164,7 +1174,7 @@ const DefaultController = { return DefaultController.currentUserAsync().then(currentUser => { const path = Storage.generatePath(CURRENT_USER_KEY); let promise = Storage.removeItemAsync(path); - if (currentUser !== null) { + if (currentUser) { const currentSession = currentUser.getSessionToken(); if (currentSession && isRevocableSession(currentSession)) { promise = promise.then(() => { diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..c429d8e3c --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "esnext", + // Search under node_modules for non-relative imports. + "moduleResolution": "node", + // Process & infer types from .js files. + "allowJs": false, + // Enable strictest settings like strictNullChecks & noImplicitAny. + "strict": true, + // Import non-ES modules as default imports. + "esModuleInterop": true, + "declaration": true, + "emitDeclarationOnly": true, + "outFile": "types/types.js", + "noImplicitAny": false + }, + "include": ["src"], +} diff --git a/types/index.d.ts b/types/index.d.ts deleted file mode 100644 index 2d6c95323..000000000 --- a/types/index.d.ts +++ /dev/null @@ -1,2010 +0,0 @@ -/// -/// -/// - -import { EventEmitter } from 'events'; - -declare enum ErrorCode { - /** Error code indicating some error other than those enumerated here */ - OTHER_CAUSE = -1, - /** Error code indicating that something has gone wrong with the server. */ - INTERNAL_SERVER_ERROR = 1, - /** Error code indicating the connection to the Parse servers failed. */ - CONNECTION_FAILED = 100, - /** Error code indicating the specified object doesn't exist. */ - OBJECT_NOT_FOUND = 101, - /** - * Error code indicating you tried to query with a datatype that doesn't - * support it, like exact matching an array or object. - */ - INVALID_QUERY = 102, - /* - * Error code indicating a missing or invalid classname. Classnames are - * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the - * only valid characters. - */ - INVALID_CLASS_NAME = 103, - /** Error code indicating an unspecified object id. */ - MISSING_OBJECT_ID = 104, - /** - * Error code indicating an invalid key name. Keys are case-sensitive. They - * must start with a letter, and a-zA-Z0-9_ are the only valid characters. - */ - INVALID_KEY_NAME = 105, - /** - * Error code indicating a malformed pointer. You should not see this unless - * you have been mucking about changing internal Parse code. - */ - INVALID_POINTER = 106, - /* - * Error code indicating that badly formed JSON was received upstream. This - * either indicates you have done something unusual with modifying how - * things encode to JSON, or the network is failing badly. - */ - INVALID_JSON = 107, - /** - * Error code indicating that the feature you tried to access is only - * available internally for testing purposes. - */ - COMMAND_UNAVAILABLE = 108, - /** You must call Parse.initialize before using the Parse library. */ - NOT_INITIALIZED = 109, - /** Error code indicating that a field was set to an inconsistent type. */ - INCORRECT_TYPE = 111, - /** - * Error code indicating an invalid channel name. A channel name is either - * an empty string (the broadcast channel) or contains only a-zA-Z0-9_ - * characters and starts with a letter. - */ - INVALID_CHANNEL_NAME = 112, - /** Error code indicating that push is misconfigured. */ - PUSH_MISCONFIGURED = 115, - /** Error code indicating that the object is too large. */ - OBJECT_TOO_LARGE = 116, - /** Error code indicating that the operation isn't allowed for clients. */ - OPERATION_FORBIDDEN = 119, - /** Error code indicating the result was not found in the cache. */ - CACHE_MISS = 120, - /** Error code indicating that an invalid key was used in a nested JSONObject. */ - INVALID_NESTED_KEY = 121, - /** - * Error code indicating that an invalid filename was used for ParseFile. - * A valid file name contains only a-zA-Z0-9_. characters and is between 1 - * and 128 characters. - */ - INVALID_FILE_NAME = 122, - /** Error code indicating an invalid ACL was provided. */ - INVALID_ACL = 123, - /** - * Error code indicating that the request timed out on the server. Typically - * this indicates that the request is too expensive to run. - */ - TIMEOUT = 124, - /** Error code indicating that the email address was invalid. */ - INVALID_EMAIL_ADDRESS = 125, - /** Error code indicating a missing content type. */ - MISSING_CONTENT_TYPE = 126, - /** Error code indicating a missing content length. */ - MISSING_CONTENT_LENGTH = 127, - /** Error code indicating an invalid content length. */ - INVALID_CONTENT_LENGTH = 128, - /** Error code indicating a file that was too large. */ - FILE_TOO_LARGE = 129, - /** Error code indicating an error saving a file. */ - FILE_SAVE_ERROR = 130, - /** - * Error code indicating that a unique field was given a value that is - * already taken. - */ - DUPLICATE_VALUE = 137, - /** Error code indicating that a role's name is invalid. */ - INVALID_ROLE_NAME = 139, - /** - * Error code indicating that an application quota was exceeded. - * Upgrade to resolve. - */ - EXCEEDED_QUOTA = 140, - /** Error code indicating that a Cloud Code script failed. */ - SCRIPT_FAILED = 141, - /** Error code indicating that a Cloud Code validation failed. */ - VALIDATION_ERROR = 142, - /** Error code indicating that invalid image data was provided. */ - INVALID_IMAGE_DATA = 150, - /** Error code indicating an unsaved file. */ - UNSAVED_FILE_ERROR = 151, - /** Error code indicating an invalid push time. */ - INVALID_PUSH_TIME_ERROR = 152, - /** Error code indicating an error deleting a file. */ - FILE_DELETE_ERROR = 153, - /** Error code indicating that the application has exceeded its request limit. */ - REQUEST_LIMIT_EXCEEDED = 155, - /** - * Error code indicating that the request was a duplicate and has been discarded due to - * idempotency rules. - */ - DUPLICATE_REQUEST = 159, - /** Error code indicating an invalid event name. */ - INVALID_EVENT_NAME = 160, - /** Error code indicating an error deleting an unnamed file. */ - FILE_DELETE_UNNAMED_ERROR = 161, - /** Error code indicating that the username is missing or empty. */ - USERNAME_MISSING = 200, - /** Error code indicating that the password is missing or empty. */ - PASSWORD_MISSING = 201, - /** Error code indicating that the username has already been taken. */ - USERNAME_TAKEN = 202, - /** Error code indicating that the email has already been taken. */ - EMAIL_TAKEN = 203, - /** Error code indicating that the email is missing, but must be specified. */ - EMAIL_MISSING = 204, - /** Error code indicating that a user with the specified email was not found. */ - EMAIL_NOT_FOUND = 205, - /** - * Error code indicating that a user object without a valid session could - * not be altered. - */ - SESSION_MISSING = 206, - /** Error code indicating that a user can only be created through signup. */ - MUST_CREATE_USER_THROUGH_SIGNUP = 207, - /** - * Error code indicating that an an account being linked is already linked - * to another user. - */ - ACCOUNT_ALREADY_LINKED = 208, - /** Error code indicating that the current session token is invalid. */ - INVALID_SESSION_TOKEN = 209, - /** Error code indicating an error enabling or verifying MFA */ - MFA_ERROR = 210, - /** Error code indicating that a valid MFA token must be provided */ - MFA_TOKEN_REQUIRED = 211, - /** - * Error code indicating that a user cannot be linked to an account because - * that account's id could not be found. - */ - LINKED_ID_MISSING = 250, - /** - * Error code indicating that a user with a linked (e.g. Facebook) account - * has an invalid session. - */ - INVALID_LINKED_SESSION = 251, - /** - * Error code indicating that a service being linked (e.g. Facebook or - * Twitter) is unsupported. - */ - UNSUPPORTED_SERVICE = 252, - /** Error code indicating an invalid operation occured on schema */ - INVALID_SCHEMA_OPERATION = 255, - /** - * Error code indicating that there were multiple errors. Aggregate errors - * have an "errors" property, which is an array of error objects with more - * detail about each error that occurred. - */ - AGGREGATE_ERROR = 600, - /** Error code indicating the client was unable to read an input file. */ - FILE_READ_ERROR = 601, - /* - * Error code indicating a real error code is unavailable because - * we had to use an XDomainRequest object to allow CORS requests in - * Internet Explorer, which strips the body from HTTP responses that have - * a non-2XX status code. - */ - X_DOMAIN_REQUEST = 602, -} - -declare global { - namespace Parse { - let applicationId: string; - let javaScriptKey: string | undefined; - let liveQueryServerURL: string; - let masterKey: string | undefined; - let serverAuthToken: string | undefined; - let serverAuthType: string | undefined; - let serverURL: string; - let secret: string; - let idempotency: boolean; - let encryptedUser: boolean; - - interface BatchSizeOption { - batchSize?: number | undefined; - } - - interface CascadeSaveOption { - /** If `false`, nested objects will not be saved (default is `true`). */ - cascadeSave?: boolean | undefined; - } - - interface SuccessOption { - success?: Function | undefined; - } - - interface ErrorOption { - error?: Function | undefined; - } - - interface ContextOption { - context?: { [key: string]: any }; - } - - interface FullOptions { - success?: Function | undefined; - error?: Function | undefined; - useMasterKey?: boolean | undefined; - sessionToken?: string | undefined; - installationId?: string | undefined; - progress?: Function | undefined; - /** - * logIn will default to POST instead of GET method since - * version 3.0.0 for security reasons. - * If you need to use GET set this to `false`. - */ - usePost?: boolean; - } - - interface RequestOptions { - useMasterKey?: boolean | undefined; - sessionToken?: string | undefined; - installationId?: string | undefined; - batchSize?: number | undefined; - include?: string | string[] | undefined; - progress?: Function | undefined; - } - - interface SuccessFailureOptions extends SuccessOption, ErrorOption {} - - interface SignUpOptions { - useMasterKey?: boolean | undefined; - installationId?: string | undefined; - } - - interface SessionTokenOption { - sessionToken?: string | undefined; - } - - interface WaitOption { - /** - * Set to true to wait for the server to confirm success - * before triggering an event. - */ - wait?: boolean | undefined; - } - - interface UseMasterKeyOption { - /** - * In Cloud Code and Node only, causes the Master Key to be used for this request. - */ - useMasterKey?: boolean | undefined; - } - - /** - * https://github.com/parse-community/Parse-SDK-JS/pull/1294/files - * feat: Add option to return raw json from queries - */ - interface RawJSONOptions { - /** (3.0.0+) json: Return raw json without converting to Parse.Object */ - json?: boolean; - } - interface ScopeOptions extends SessionTokenOption, UseMasterKeyOption {} - - interface SilentOption { - /** - * Set to true to avoid firing the event. - */ - silent?: boolean | undefined; - } - - interface Pointer { - __type: string; - className: string; - objectId: string; - } - - interface AuthData { - [key: string]: any; - } - - /** - * Interface declaration for Authentication Providers - * https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html - */ - interface AuthProvider { - /** - * Called when _linkWith isn't passed authData. Handle your own authentication here. - */ - authenticate: () => void; - /** - * (Optional) Called when service is unlinked. Handle any cleanup here. - */ - deauthenticate?: (() => void) | undefined; - /** - * Unique identifier for this Auth Provider. - */ - getAuthType: () => string; - /** - * Called when auth data is syncronized. Can be used to determine if authData is still valid - */ - restoreAuthentication: () => boolean; - } - - interface BaseAttributes { - createdAt: Date; - objectId: string; - updatedAt: Date; - } - - interface CommonAttributes { - ACL: ACL; - } - - interface JSONBaseAttributes { - createdAt: string; - objectId: string; - updatedAt: string; - } - - /** - * Creates a new ACL. - * If no argument is given, the ACL has no permissions for anyone. - * If the argument is a Parse.User, the ACL will have read and write - * permission for only that user. - * If the argument is any other JSON object, that object will be interpretted - * as a serialized ACL created with toJSON(). - * @see Parse.Object#setACL - * - *

An ACL, or Access Control List can be added to any - * Parse.Object to restrict access to only a subset of users - * of your application.

- */ - class ACL { - permissionsById: any; - - constructor(arg1?: any); - - setPublicReadAccess(allowed: boolean): void; - getPublicReadAccess(): boolean; - - setPublicWriteAccess(allowed: boolean): void; - getPublicWriteAccess(): boolean; - - setReadAccess(userId: User | string, allowed: boolean): void; - getReadAccess(userId: User | string): boolean; - - setWriteAccess(userId: User | string, allowed: boolean): void; - getWriteAccess(userId: User | string): boolean; - - setRoleReadAccess(role: Role | string, allowed: boolean): void; - getRoleReadAccess(role: Role | string): boolean; - - setRoleWriteAccess(role: Role | string, allowed: boolean): void; - getRoleWriteAccess(role: Role | string): boolean; - - toJSON(): any; - } - - /** - * A Parse.File is a local representation of a file that is saved to the Parse - * cloud. - * @param name The file's name. This will be prefixed by a unique - * value once the file has finished saving. The file name must begin with - * an alphanumeric character, and consist of alphanumeric characters, - * periods, spaces, underscores, or dashes. - * @param data The data for the file, as either: - * 1. an Array of byte value Numbers, or - * 2. an Object like { base64: "..." } with a base64-encoded String. - * 3. a File object selected with a file upload control. (3) only works - * in Firefox 3.6+, Safari 6.0.2+, Chrome 7+, and IE 10+. - * For example:
-         * var fileUploadControl = $("#profilePhotoFileUpload")[0];
-         * if (fileUploadControl.files.length > 0) {
-         *   var file = fileUploadControl.files[0];
-         *   var name = "photo.jpg";
-         *   var parseFile = new Parse.File(name, file);
-         *   parseFile.save().then(function() {
-         *     // The file has been saved to Parse.
-         *   }, function(error) {
-         *     // The file either could not be read, or could not be saved to Parse.
-         *   });
-         * }
- * @param type Optional Content-Type header to use for the file. If - * this is omitted, the content type will be inferred from the name's - * extension. - */ - class File { - constructor( - name: string, - data: number[] | { base64: string } | { size: number; type: string } | { uri: string }, - type?: string, - ); - /** - * Return the data for the file, downloading it if not already present. - * Data is present if initialized with Byte Array, Base64 or Saved with Uri. - * Data is cleared if saved with File object selected with a file upload control - * - * @returns Promise that is resolved with base64 data - */ - getData(): Promise; - url(options?: { forceSecure?: boolean | undefined }): string; - metadata(): Record; - tags(): Record; - name(): string; - save(options?: FullOptions): Promise; - cancel(): void; - destroy(options?: FullOptions): Promise; - toJSON(): { __type: string; name: string; url: string }; - equals(other: File): boolean; - setMetadata(metadata: Record): void; - addMetadata(key: string, value: any): void; - setTags(tags: Record): void; - addTag(key: string, value: any): void; - readonly _url: string; - } - - /** - * Creates a new GeoPoint with any of the following forms:
- *
-         *   new GeoPoint(otherGeoPoint)
-         *   new GeoPoint(30, 30)
-         *   new GeoPoint([30, 30])
-         *   new GeoPoint({latitude: 30, longitude: 30})
-         *   new GeoPoint()  // defaults to (0, 0)
-         *   
- * - *

Represents a latitude / longitude point that may be associated - * with a key in a ParseObject or used as a reference point for geo queries. - * This allows proximity-based queries on the key.

- * - *

Only one key in a class may contain a GeoPoint.

- * - *

Example:

-         *   var point = new Parse.GeoPoint(30.0, -20.0);
-         *   var object = new Parse.Object("PlaceObject");
-         *   object.set("location", point);
-         *   object.save();

- */ - class GeoPoint { - latitude: number; - longitude: number; - - constructor(latitude: number, longitude: number); - constructor(coords?: { latitude: number; longitude: number } | [number, number]); - - current(options?: SuccessFailureOptions): GeoPoint; - radiansTo(point: GeoPoint): number; - kilometersTo(point: GeoPoint): number; - milesTo(point: GeoPoint): number; - toJSON(): any; - } - - /** - * A class that is used to access all of the children of a many-to-many relationship. - * Each instance of Parse.Relation is associated with a particular parent object and key. - */ - class Relation { - parent: S; - key: string; - targetClassName: string; - - constructor(parent?: S, key?: string); - - // Adds a Parse.Object or an array of Parse.Objects to the relation. - add(object: T | T[]): void; - - // Returns a Parse.Query that is limited to objects in this relation. - query(): Query; - - // Removes a Parse.Object or an array of Parse.Objects from this relation. - remove(object: T | T[]): void; - - toJSON(): any; - } - - interface Attributes { - [key: string]: any; - } - - /** - * Creates a new model with defined attributes. A client id (cid) is - * automatically generated and assigned for you. - * - *

You won't normally call this method directly. It is recommended that - * you use a subclass of Parse.Object instead, created by calling - * extend.

- * - *

However, if you don't want to use a subclass, or aren't sure which - * subclass is appropriate, you can use this form:

-         *     var object = new Parse.Object("ClassName");
-         * 
- * That is basically equivalent to:
-         *     var MyClass = Parse.Object.extend("ClassName");
-         *     var object = new MyClass();
-         * 

- * - * @param attributes The initial set of data to store in the object. - * @param options The options for this object instance. - * @see Parse.Object.extend - * - * - * Creates a new model with defined attributes. - */ - interface Object { - id: string; - createdAt: Date; - updatedAt: Date; - attributes: T; - className: string; - - add extends any[] ? K : never }[keyof T]>( - attr: K, - item: NonNullable[number], - ): this | false; - addAll extends any[] ? K : never }[keyof T]>( - attr: K, - items: NonNullable, - ): this | false; - addAllUnique: this['addAll']; - addUnique: this['add']; - clear(options: any): any; - clone(): this; - destroy(options?: Object.DestroyOptions): Promise; - /** EventuallyQueue API; added in version 3.0.0 */ - destroyEventually(options?: Object.DestroyOptions): Promise; - dirty(attr?: Extract): boolean; - dirtyKeys(): string[]; - equals(other: T): boolean; - escape(attr: Extract): string; - existed(): boolean; - exists(options?: RequestOptions): Promise; - fetch(options?: Object.FetchOptions): Promise; - fetchFromLocalDatastore(): Promise; - fetchWithInclude>( - keys: K | Array, - options?: RequestOptions, - ): Promise; - get>(attr: K): T[K]; - getACL(): ACL | undefined; - has(attr: Extract): boolean; - increment(attr: Extract, amount?: number): this | false; - decrement(attr: Extract, amount?: number): this | false; - initialize(): void; - isDataAvailable(): boolean; - isNew(): boolean; - isPinned(): Promise; - isValid(): boolean; - newInstance(): this; - op(attr: Extract): any; - pin(): Promise; - pinWithName(name: string): Promise; - relation = Extract>( - attr: T[K] extends Relation ? K : never, - ): Relation; - remove: this['add']; - removeAll: this['addAll']; - revert(...keys: Array>): void; - // "Pick | T" is a trick to keep IntelliSense working, see: - // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/3bdadbf9583c2335197c7e999b9a30880e055f62/types/react/index.d.ts#L482 - save>( - attrs?: Pick | T | null, - options?: Object.SaveOptions, - ): Promise; - save>( - key: K, - value: T[K] extends undefined ? never : T[K], - options?: Object.SaveOptions, - ): Promise; - /** EventuallyQueue API; added in version 3.0.0 */ - saveEventually(options?: Object.SaveOptions): Promise; - set>(attrs: Pick | T, options?: Object.SetOptions): this | false; - set>( - key: K, - value: T[K] extends undefined ? never : T[K], - options?: Object.SetOptions, - ): this | false; - setACL(acl: ACL, options?: SuccessFailureOptions): this | false; - toJSON(): Object.ToJSON & JSONBaseAttributes; - toPointer(): Pointer; - unPin(): Promise; - unPinWithName(name: string): Promise; - unset(attr: Extract, options?: any): this | false; - validate(attrs: Attributes, options?: SuccessFailureOptions): Error | false; - } - interface ObjectStatic { - createWithoutData(id: string): T; - destroyAll(list: T[], options?: Object.DestroyAllOptions): Promise; - extend(className: string | { className: string }, protoProps?: any, classProps?: any): any; - fetchAll(list: T[], options: Object.FetchAllOptions): Promise; - fetchAllIfNeeded(list: T[], options?: Object.FetchAllOptions): Promise; - fetchAllIfNeededWithInclude( - list: T[], - keys: keyof T['attributes'] | Array, - options?: RequestOptions, - ): Promise; - fetchAllWithInclude( - list: T[], - keys: keyof T['attributes'] | Array, - options?: RequestOptions, - ): Promise; - fromJSON(json: any, override?: boolean): T; - pinAll(objects: Object[]): Promise; - pinAllWithName(name: string, objects: Object[]): Promise; - registerSubclass(className: string, clazz: new (options?: any) => T): void; - saveAll(list: T, options?: Object.SaveAllOptions): Promise; - unPinAll(objects: Object[]): Promise; - unPinAllObjects(): Promise; - unPinAllObjectsWithName(name: string): Promise; - unPinAllWithName(name: string, objects: Object[]): Promise; - } - interface ObjectConstructor extends ObjectStatic { - new (className: string, attributes: T, options?: any): Object; - new (className?: string, attributes?: Attributes, options?: any): Object; - } - const Object: ObjectConstructor; - - namespace Object { - interface DestroyOptions extends SuccessFailureOptions, WaitOption, ScopeOptions {} - - interface DestroyAllOptions extends BatchSizeOption, ScopeOptions {} - - interface FetchAllOptions extends SuccessFailureOptions, ScopeOptions {} - - interface FetchOptions extends SuccessFailureOptions, ScopeOptions {} - - interface SaveOptions - extends CascadeSaveOption, - SuccessFailureOptions, - SilentOption, - ScopeOptions, - ContextOption, - WaitOption {} - - interface SaveAllOptions extends BatchSizeOption, ScopeOptions {} - - interface SetOptions extends ErrorOption, SilentOption { - promise?: any; - } - - // From https://github.com/parse-community/Parse-SDK-JS/blob/master/src/encode.js - type Encode = T extends Object - ? ReturnType | Pointer - : T extends ACL | GeoPoint | Polygon | Relation | File - ? ReturnType - : T extends Date - ? { __type: 'Date'; iso: string } - : T extends RegExp - ? string - : T extends Array - ? // This recursion is unsupported in <=3.6 - Array> - : T extends object - ? ToJSON - : T; - - type ToJSON = { - [K in keyof T]: Encode; - }; - } - - class Polygon { - constructor(arg1: GeoPoint[] | number[][]); - containsPoint(point: GeoPoint): boolean; - equals(other: any): boolean; - toJSON(): any; - } - - /** - * Every Parse application installed on a device registered for - * push notifications has an associated Installation object. - */ - interface Installation extends Object { - badge: any; - channels: string[]; - timeZone: any; - deviceType: string; - pushType: string; - installationId: string; - deviceToken: string; - channelUris: string; - appName: string; - appVersion: string; - parseVersion: string; - appIdentifier: string; - } - interface InstallationConstructor extends ObjectStatic { - new (attributes: T): Installation; - new (): Installation; - } - const Installation: InstallationConstructor; - - /** - * Creates a new parse Parse.Query for the given Parse.Object subclass. - * @param objectClass - - * An instance of a subclass of Parse.Object, or a Parse className string. - * - *

Parse.Query defines a query that is used to fetch Parse.Objects. The - * most common use case is finding all objects that match a query through the - * find method. For example, this sample code fetches all objects - * of class MyClass. It calls a different function depending on - * whether the fetch succeeded or not. - * - *

-         * var query = new Parse.Query(MyClass);
-         * query.find({
-         *   success: function(results) {
-         *     // results is an array of Parse.Object.
-         *   },
-         *
-         *   error: function(error) {
-         *     // error is an instance of Parse.Error.
-         *   }
-         * });

- * - *

A Parse.Query can also be used to retrieve a single object whose id is - * known, through the get method. For example, this sample code fetches an - * object of class MyClass and id myId. It calls a - * different function depending on whether the fetch succeeded or not. - * - *

-         * var query = new Parse.Query(MyClass);
-         * query.get(myId, {
-         *   success: function(object) {
-         *     // object is an instance of Parse.Object.
-         *   },
-         *
-         *   error: function(object, error) {
-         *     // error is an instance of Parse.Error.
-         *   }
-         * });

- * - *

A Parse.Query can also be used to count the number of objects that match - * the query without retrieving all of those objects. For example, this - * sample code counts the number of objects of the class MyClass - *

-         * var query = new Parse.Query(MyClass);
-         * query.count({
-         *   success: function(number) {
-         *     // There are number instances of MyClass.
-         *   },
-         *
-         *   error: function(error) {
-         *     // error is an instance of Parse.Error.
-         *   }
-         * });

- */ - class Query { - objectClass: any; - className: string; - - constructor(objectClass: string | (new (...args: any[]) => T | Object)); - - static and(...args: Array>): Query; - static fromJSON(className: string | (new () => U), json: any): Query; - static nor(...args: Array>): Query; - static or(...var_args: Array>): Query; - - addAscending(key: K | K[]): this; - addDescending(key: K | K[]): this; - ascending(key: K | K[]): this; - aggregate(pipeline: Query.AggregationOptions | Query.AggregationOptions[]): Promise; - containedBy( - key: K, - values: Array, - ): this; - containedIn( - key: K, - values: Array, - ): this; - contains(key: K, substring: string): this; - containsAll(key: K, values: any[]): this; - containsAllStartingWith( - key: K, - values: any[], - ): this; - count(options?: Query.CountOptions): Promise; - descending(key: K | K[]): this; - doesNotExist(key: K): this; - doesNotMatchKeyInQuery< - U extends Object, - K extends keyof T['attributes'] | keyof BaseAttributes, - X extends Extract, - >(key: K, queryKey: X, query: Query): this; - doesNotMatchQuery(key: K, query: Query): this; - distinct(key: K): Promise; - eachBatch(callback: (objs: T[]) => PromiseLike | void, options?: Query.BatchOptions): Promise; - each(callback: (obj: T) => PromiseLike | void, options?: Query.BatchOptions): Promise; - hint(value: string | object): this; - explain(explain: boolean): this; - map( - callback: (currentObject: T, index: number, query: Query) => PromiseLike | U, - options?: Query.BatchOptions, - ): Promise; - reduce( - callback: (accumulator: T, currentObject: T, index: number) => PromiseLike | T, - initialValue?: undefined, - options?: Query.BatchOptions, - ): Promise; - reduce( - callback: (accumulator: U, currentObject: T, index: number) => PromiseLike | U, - initialValue: U, - options?: Query.BatchOptions, - ): Promise; - filter( - callback: (currentObject: T, index: number, query: Query) => PromiseLike | boolean, - options?: Query.BatchOptions, - ): Promise; - endsWith(key: K, suffix: string): this; - equalTo( - key: K, - value: - | T['attributes'][K] - | (T['attributes'][K] extends Object - ? Pointer - : T['attributes'][K] extends Array - ? E - : never), - ): this; - exclude(...keys: K[]): this; - exists(key: K): this; - find(options?: Query.FindOptions): Promise; - findAll(options?: Query.BatchOptions): Promise; - first(options?: Query.FirstOptions): Promise; - fromNetwork(): this; - fromLocalDatastore(): this; - fromPin(): this; - fromPinWithName(name: string): this; - cancel(): this; - fullText( - key: K, - value: string, - options?: Query.FullTextOptions, - ): this; - get(objectId: string, options?: Query.GetOptions): Promise; - greaterThan( - key: K, - value: T['attributes'][K], - ): this; - greaterThanOrEqualTo( - key: K, - value: T['attributes'][K], - ): this; - include(...key: K[]): this; - include(key: K[]): this; - includeAll(): Query; - lessThan(key: K, value: T['attributes'][K]): this; - lessThanOrEqualTo( - key: K, - value: T['attributes'][K], - ): this; - limit(n: number): Query; - matches( - key: K, - regex: RegExp, - modifiers?: string, - ): this; - matchesKeyInQuery< - U extends Object, - K extends keyof T['attributes'], - X extends Extract, - >(key: K, queryKey: X, query: Query): this; - matchesQuery(key: K, query: Query): this; - near(key: K, point: GeoPoint): this; - notContainedIn( - key: K, - values: Array, - ): this; - notEqualTo( - key: K, - value: - | T['attributes'][K] - | (T['attributes'][K] extends Object - ? Pointer - : T['attributes'][K] extends Array - ? E - : never), - ): this; - polygonContains(key: K, point: GeoPoint): this; - select(...keys: K[]): this; - select(keys: K[]): this; - skip(n: number): Query; - sortByTextScore(): this; - startsWith(key: K, prefix: string): this; - subscribe(sessionToken?: string): Promise; - toJSON(): any; - withJSON(json: any): this; - withCount(includeCount?: boolean): this; - withinGeoBox( - key: K, - southwest: GeoPoint, - northeast: GeoPoint, - ): this; - withinKilometers( - key: K, - point: GeoPoint, - maxDistance: number, - sorted?: boolean, - ): this; - withinMiles( - key: K, - point: GeoPoint, - maxDistance: number, - sorted?: boolean, - ): this; - withinPolygon(key: K, points: number[][]): this; - withinRadians( - key: K, - point: GeoPoint, - maxDistance: number, - ): this; - } - - namespace Query { - interface EachOptions extends SuccessFailureOptions, ScopeOptions {} - interface CountOptions extends SuccessFailureOptions, ScopeOptions {} - interface FindOptions extends SuccessFailureOptions, ScopeOptions, RawJSONOptions {} - interface FirstOptions extends SuccessFailureOptions, ScopeOptions, RawJSONOptions {} - interface GetOptions extends SuccessFailureOptions, ScopeOptions, RawJSONOptions {} - - // According to http://docs.parseplatform.org/rest/guide/#aggregate-queries - interface AggregationOptions { - group?: (Record & { objectId?: string }) | undefined; - match?: Record | undefined; - project?: Record | undefined; - limit?: number | undefined; - skip?: number | undefined; - // Sort documentation https://docs.mongodb.com/v3.2/reference/operator/aggregation/sort/#pipe._S_sort - sort?: Record | undefined; - // Sample documentation: https://docs.mongodb.com/v3.2/reference/operator/aggregation/sample/ - sample?: { size: number } | undefined; - // Count documentation: https://docs.mongodb.com/manual/reference/operator/aggregation/count/ - count?: string | undefined; - // Lookup documentation: https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/ - lookup?: - | { - from: string; - localField: string; - foreignField: string; - as: string; - } - | { - from: string; - let?: Record; - pipeline: Record; - as: string; - } - | undefined; - // Graph Lookup documentation: https://docs.mongodb.com/manual/reference/operator/aggregation/graphLookup/ - graphLookup?: - | { - from: string; - startWith?: string; - connectFromField: string; - connectToField: string; - as: string; - maxDepth?: number; - depthField?: string; - restrictSearchWithMatch?: Record; - } - | undefined; - // Facet documentation: https://docs.mongodb.com/manual/reference/operator/aggregation/facet/ - facet?: Record>> | undefined; - // Unwind documentation: https://www.mongodb.com/docs/manual/reference/operator/aggregation/unwind/ - unwind?: - | { - path: string; - includeArrayIndex?: string; - preserveNullAndEmptyArrays?: boolean; - } - | string - | undefined; - } - - // According to https://parseplatform.org/Parse-SDK-JS/api/2.1.0/Parse.Query.html#fullText - interface FullTextOptions { - language?: string | undefined; - caseSensitive?: boolean | undefined; - diacriticSensitive?: boolean | undefined; - } - - interface BatchOptions extends FullOptions { - batchSize?: number | undefined; - } - } - - /** - * Represents a LiveQuery Subscription. - * - * @see https://docs.parseplatform.org/js/guide/#live-queries - * @see NodeJS.EventEmitter - * - * Events list - * --- - * `open` - when you call `query.subscribe()`, we send a subscribe request to - * the LiveQuery server, when we get the confirmation from the LiveQuery server, - * this event will be emitted. When the client loses WebSocket connection to the - * LiveQuery server, we will try to auto reconnect the LiveQuery server. If we - * reconnect the LiveQuery server and successfully resubscribe the ParseQuery, - * you'll also get this event. - * - * ``` - * subscription.on('open', () => {}); - * ``` - * --- - * `create` - when a new ParseObject is created and it fulfills the ParseQuery you subscribe, - * you'll get this event. The object is the ParseObject which is created. - * - * ``` - * subscription.on('create', (object: Parse.Object) => {}); - * ``` - * --- - * `update` event - when an existing ParseObject which fulfills the ParseQuery you subscribe - * is updated (The ParseObject fulfills the ParseQuery before and after changes), - * you'll get this event. The object is the ParseObject which is updated. - * Its content is the latest value of the ParseObject. - * - * ``` - * subscription.on('update', (object: Parse.Object) => {}); - * ``` - * --- - * `enter` event - when an existing ParseObject's old value doesn't fulfill the ParseQuery - * but its new value fulfills the ParseQuery, you'll get this event. The object is the - * ParseObject which enters the ParseQuery. Its content is the latest value of the ParseObject. - * - * ``` - * subscription.on('enter', (object: Parse.Object) => {}); - * ``` - * --- - * `update` event - when an existing ParseObject's old value fulfills the ParseQuery but its new value - * doesn't fulfill the ParseQuery, you'll get this event. The object is the ParseObject - * which leaves the ParseQuery. Its content is the latest value of the ParseObject. - * - * ``` - * subscription.on('leave', (object: Parse.Object) => {}); - * ``` - * --- - * `delete` event - when an existing ParseObject which fulfills the ParseQuery is deleted, you'll - * get this event. The object is the ParseObject which is deleted. - * - * ``` - * subscription.on('delete', (object: Parse.Object) => {}); - * ``` - * --- - * `close` event - when the client loses the WebSocket connection to the LiveQuery - * server and we stop receiving events, you'll get this event. - * - * ``` - * subscription.on('close', () => {}); - * ``` - */ - class LiveQuerySubscription extends EventEmitter { - /** - * Creates an instance of LiveQuerySubscription. - * - * @param id - * @param query - * @param [sessionToken] - */ - constructor(id: string, query: string, sessionToken?: string); - - on( - event: 'open' | 'create' | 'update' | 'enter' | 'leave' | 'delete' | 'close', - listener: (object: Object) => void, - ): this; - - /** - * Closes the subscription. - * - */ - unsubscribe(): void; - } - - /** - * The LiveQuery namespace is basically an EventEmitter - * (source : https://github.com/parse-community/Parse-SDK-JS/blob/8115e959533d1676fe5e5551bc81888b21fc12ef/src/ParseLiveQuery.js) - * https://docs.parseplatform.org/js/guide/#websocket-status - */ - namespace LiveQuery { - function on( - event: 'open' | 'close', - /** When we establish ('open') or lose the WebSocket connection to the LiveQuery server, you’ll get this event */ - listener: () => void, - ): void; - function on( - event: 'error', - /** When some network error or LiveQuery server error happens, you’ll get this event. */ - listener: (error: any) => void, - ): void; - } - - /** - * Represents a Role on the Parse server. Roles represent groupings of - * Users for the purposes of granting permissions (e.g. specifying an ACL - * for an Object). Roles are specified by their sets of child users and - * child roles, all of which are granted any permissions that the parent - * role has. - * - *

Roles must have a name (which cannot be changed after creation of the - * role), and must specify an ACL.

- * A Parse.Role is a local representation of a role persisted to the Parse - * cloud. - */ - interface Role extends Object { - getRoles(): Relation; - getUsers(): Relation; - getName(): string; - setName(name: string, options?: SuccessFailureOptions): any; - } - interface RoleConstructor extends ObjectStatic { - new (name: string, acl: ACL): Role>; - new (name: string, acl: ACL): Role; - } - const Role: RoleConstructor; - - class Config { - static get(options?: UseMasterKeyOption): Promise; - static current(): Config; - static save(attr: any, options?: { [attr: string]: boolean }): Promise; - - get(attr: string): any; - escape(attr: string): any; - } - - interface Session extends Object { - getSessionToken(): string; - isCurrentSessionRevocable(): boolean; - } - interface SessionConstructor extends ObjectStatic { - new (attributes: T): Session; - new (): Session; - - current(): Promise; - } - const Session: SessionConstructor; - - /** - * - *

A Parse.User object is a local representation of a user persisted to the - * Parse cloud. This class is a subclass of a Parse.Object, and retains the - * same functionality of a Parse.Object, but also extends it with various - * user specific methods, like authentication, signing up, and validation of - * uniqueness.

- */ - interface User extends Object { - signUp(attrs?: any, options?: SignUpOptions): Promise; - logIn(options?: FullOptions): Promise; - authenticated(): boolean; - isCurrent(): boolean; - /** Since version 3.0.0, Returns true if `current` would return this user */ - isCurrentAsync(): Promise; - - getEmail(): string | undefined; - setEmail(email: string, options?: SuccessFailureOptions): boolean; - - getUsername(): string | undefined; - setUsername(username: string, options?: SuccessFailureOptions): boolean; - - setPassword(password: string, options?: SuccessFailureOptions): boolean; - getSessionToken(): string; - - linkWith: ( - provider: string | AuthProvider, - options: { authData?: AuthData | undefined }, - saveOpts?: FullOptions, - ) => Promise; - _isLinked: (provider: string | AuthProvider) => boolean; - _unlinkFrom: (provider: string | AuthProvider, options?: FullOptions) => Promise; - } - interface UserConstructor extends ObjectStatic { - new (attributes: T): User; - new (attributes?: Attributes): User; - - allowCustomUserClass(isAllowed: boolean): void; - become(sessionToken: string, options?: UseMasterKeyOption): Promise; - current(): T | undefined; - currentAsync(): Promise; - signUp(username: string, password: string, attrs: any, options?: SignUpOptions): Promise; - logIn(username: string, password: string, options?: FullOptions): Promise; - logOut(): Promise; - requestPasswordReset(email: string, options?: SuccessFailureOptions): Promise; - requestEmailVerification(email: string, options?: UseMasterKeyOption): Promise; - extend(protoProps?: any, classProps?: any): any; - hydrate(userJSON: any): Promise; - enableUnsafeCurrentUser(): void; - disableUnsafeCurrentUser(): void; - logInWith( - provider: string | AuthProvider, - options: { authData?: AuthData | undefined }, - saveOpts?: FullOptions, - ): Promise; - _registerAuthenticationProvider: (provider: AuthProvider) => void; - } - const User: UserConstructor; - - /** - * The raw schema response returned from the `GET /parse/schemas` endpoint. - * This is defined here: https://docs.parseplatform.org/js/guide/#schema. - * Unfortunately, `Schema.all()` and `Schema.prototype.get()` return this rather - * than a `Schema`. It is also the only object which provides introspection on - * the schema - such as `className` and `fields`. - */ - interface RestSchema { - className: string; - fields: { - [key: string]: { - type: string; - targetClass?: string; - required?: boolean; - defaultValue?: string; - }; - }; - classLevelPermissions: Schema.CLP; - indexes?: { - [key: string]: { - [key: string]: any; - }; - }; - } - - /** - * A Parse.Schema object is for handling schema data from Parse. - * All the schemas methods require MasterKey. - * - * @param className Parse Class string - * - * https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html - * - * ``` - * const schema = new Parse.Schema('MyClass'); - * schema.addString('field'); - * schema.addIndex('index_name', { field: 1 }); - * schema.save(); - * ``` - */ - class Schema { - constructor(className: string); - - /** - * Static method to get all schemas - * - * @return A promise that is resolved with the result when - * the query completes. - */ - static all(): Promise; - - addArray(key: Schema.AttrType, options?: Schema.FieldOptions): this; - addBoolean(key: Schema.AttrType, options?: Schema.FieldOptions): this; - addDate(key: Schema.AttrType, options?: Schema.FieldOptions): this; - addField(name: string, type?: T, options?: Schema.FieldOptions): this; - addFile(key: Schema.AttrType, options?: Schema.FieldOptions): this; - addGeoPoint(key: Schema.AttrType, options?: Schema.FieldOptions): this; - - /** - * Adding an Index to Create / Update a Schema - * @param name Name of the field that will be created on Parse - * @param index `{ 'field': value }` where `field` should exist in the schema before using addIndex. - * @return Returns the schema, so you can chain this call. - * @example - * ``` - * schema.addIndex('index_name', {'field': 1}); - * ``` - */ - addIndex(name: string, index: Schema.Index): this; - - addNumber(key: Schema.AttrType, options?: Schema.FieldOptions): this; - - addObject(key: Schema.AttrType, options?: Schema.FieldOptions): this; - - /** - * Adding Pointer Field - * @param name Name of the field that will be created on Parse - * @param targetClass Name of the target Pointer Class - * @return Returns the schema, so you can chain this call. - */ - addPointer( - key: Schema.AttrType, - targetClass: string, - options?: Schema.FieldOptions, - ): this; - - addPolygon(key: Schema.AttrType, options?: Schema.FieldOptions): this; - - /** - * Adding Relation Field - * @param name Name of the field that will be created on Parse - * @param targetClass Name of the target Pointer Class - * @return Returns the schema, so you can chain this call. - */ - addRelation( - key: Schema.AttrType, - targetClass: string, - options?: Schema.FieldOptions, - ): this; - - addString(key: Schema.AttrType, options?: Schema.FieldOptions): this; - - /** - * Removing a Schema from Parse Can only be used on Schema without objects - * @returns A promise that is resolved with the result when the query completes. - */ - // @TODO Fix Promise - delete(): Promise; - - /** - * Deleting a Field to Update on a Schema - * @param name Name of the field - * @return Returns the schema, so you can chain this call. - */ - deleteField(name: string): this; - - /** - * Deleting a Index Field to Update on a Schema - * @param name Name of the index field - * @return Returns the schema, so you can chain this call. - */ - deleteIndex(name: string): this; - - /** - * Get the Schema from Parse - */ - get(): Promise; - - /** - * Removes all objects from a Schema (class) in EXERCISE CAUTION, running this will delete all objects for this schema and cannot be reversed - */ - // TODO Fix Promise - purge(): Promise; - - /** - * Create a new Schema on Parse - */ - save(): Promise; - - /** - * Sets Class Level Permissions when creating / updating a Schema. - * EXERCISE CAUTION, running this may override CLP for this schema and cannot be reversed - */ - setCLP(clp: Schema.CLP): this; - - /** - * Update a Schema on Parse - */ - update(): Promise; - } - - namespace Schema { - type TYPE = - | 'String' - | 'Number' - | 'Boolean' - | 'Date' - | 'File' - | 'GeoPoint' - | 'Polygon' - | 'Array' - | 'Object' - | 'Pointer' - | 'Relation'; - type FieldType = - | string - | number - | boolean - | Date - | File - | GeoPoint - | Polygon - | any[] - | object - | Pointer - | Relation; - type AttrType = Extract< - { [K in keyof T['attributes']]: T['attributes'][K] extends V ? K : never }[keyof T['attributes']], - string - >; - - interface FieldOptions< - T extends - | string - | number - | boolean - | Date - | File - | GeoPoint - | Polygon - | any[] - | object - | Pointer - | Relation = any, - > { - required?: boolean | undefined; - defaultValue?: T | undefined; - } - - interface Index { - [fieldName: string]: number | string; - } - - /** - * The id of a `_User` object or a role name prefixed by `'role:'`. - * @example - * '*': false, // public - * requiresAuthentication: false, - * 'role:Admin': true, - * 'idOfASpecificUser': true - */ - interface CLPField { - '*'?: boolean | undefined; - requiresAuthentication?: boolean | undefined; - /** `role:Admin` */ - [userIdOrRoleName: string]: boolean | undefined; - } - - interface CLP { - find?: CLPField | undefined; - get?: CLPField | undefined; - count?: CLPField | undefined; - create?: CLPField | undefined; - update?: CLPField | undefined; - delete?: CLPField | undefined; - addField?: CLPField | undefined; - /** Array of fields that point to a `_User` object's ID or a `Role` object's name */ - readUserFields?: string[] | undefined; - /** Array of fields that point to a `_User` object's ID or a `Role` object's name */ - writeUserFields?: string[] | undefined; - protectedFields?: { - /** '*', user id, or role: followed by a list of fields. */ - [userIdOrRoleName: string]: string[]; - }; - } - } - - namespace Analytics { - function track(name: string, dimensions: any): Promise; - } - - /** - * Provides utility functions for working with Anonymously logged-in users. - */ - namespace AnonymousUtils { - function isLinked(user: User): boolean; - function link(user: User, options?: ScopeOptions): Promise; - function logIn(options?: ScopeOptions): Promise; - } - - /** - * Provides a set of utilities for using Parse with Facebook. - * Provides a set of utilities for using Parse with Facebook. - */ - namespace FacebookUtils { - function init(options?: any): void; - function isLinked(user: User): boolean; - function link(user: User, permissions: any, options?: SuccessFailureOptions): void; - function logIn(permissions: any, options?: FullOptions): void; - function unlink(user: User, options?: SuccessFailureOptions): void; - } - - /** - * Contains functions for calling and declaring - * cloud functions. - *

- * Some functions are only available from Cloud Code. - *

- */ - namespace Cloud { - interface CookieOptions { - domain?: string | undefined; - expires?: Date | undefined; - httpOnly?: boolean | undefined; - maxAge?: number | undefined; - path?: string | undefined; - secure?: boolean | undefined; - } - - interface HttpResponse { - buffer?: Buffer | undefined; - cookies?: any; - data?: any; - headers?: any; - status?: number | undefined; - text?: string | undefined; - } - - interface JobRequest { - params: T; - message: (response: any) => void; - } - - interface Params { - [key: string]: any; - } - - interface FunctionRequest { - installationId?: string | undefined; - master?: boolean | undefined; - params: T; - user?: User | undefined; - } - - interface ValidatorField { - type?: any; - constant?: boolean | undefined; - default?: any; - options?: any[] | Function | undefined; - error?: String | undefined; - required?: boolean; - } - interface ValidatorFields { - [field: string]: ValidatorField; - } - interface Validator { - requireUser?: boolean | undefined; - requireMaster?: boolean | undefined; - validateMasterKey?: boolean | undefined; - skipWithMasterKey?: boolean | undefined; - requireAnyUserRoles?: String[] | Function | undefined; - requireAllUserRoles?: String[] | Function | undefined; - fields?: ValidatorFields | String[] | undefined; - requireUserKeys?: ValidatorFields | String[] | undefined; - } - - interface Cookie { - name?: string | undefined; - options?: CookieOptions | undefined; - value?: string | undefined; - } - - interface TriggerRequest { - installationId?: string | undefined; - master?: boolean | undefined; - user?: User | undefined; - ip: string; - headers: any; - triggerName: string; - log: any; - object: T; - original?: T | undefined; - } - - interface AfterSaveRequest extends TriggerRequest { - context: Record; - } - interface AfterDeleteRequest extends TriggerRequest {} // tslint:disable-line no-empty-interface - interface BeforeDeleteRequest extends TriggerRequest {} // tslint:disable-line no-empty-interface - interface BeforeSaveRequest extends TriggerRequest { - context: Record; - } - - interface FileTriggerRequest extends TriggerRequest { - file: File; - fileSize: number; - contentLength: number; - } - - // Read preference describes how MongoDB driver route read operations to the members of a replica set. - enum ReadPreferenceOption { - Primary = 'PRIMARY', - PrimaryPreferred = 'PRIMARY_PREFERRED', - Secondary = 'SECONDARY', - SecondaryPreferred = 'SECONDARY_PREFERRED', - Nearest = 'NEAREST', - } - - interface BeforeFindRequest extends TriggerRequest { - query: Query; - count: boolean; - isGet: boolean; - readPreference?: ReadPreferenceOption | undefined; - } - - interface AfterFindRequest extends TriggerRequest { - objects: T[]; - } - - function afterDelete( - arg1: { new (): T } | string, - func?: (request: AfterDeleteRequest) => Promise | void, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - function afterSave( - arg1: { new (): T } | string, - func?: (request: AfterSaveRequest) => Promise | void, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - function beforeDelete( - arg1: { new (): T } | string, - func?: (request: BeforeDeleteRequest) => Promise | void, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - function beforeSave( - arg1: { new (): T } | string, - func?: (request: BeforeSaveRequest) => Promise | void, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - function beforeFind( - arg1: { new (): T } | string, - func?: (request: BeforeFindRequest) => Promise> | Promise | Query | void, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - function afterFind( - arg1: { new (): T } | string, - func?: (request: AfterFindRequest) => any, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - - function beforeLogin(func?: (request: TriggerRequest) => PromiseLike | void): void; - function afterLogin( - func?: (request: TriggerRequest) => PromiseLike | void, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - function afterLogout( - func?: (request: TriggerRequest) => PromiseLike | void, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - - function beforeSaveFile( - func?: (request: FileTriggerRequest) => PromiseLike | void, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - function afterSaveFile( - func?: (request: FileTriggerRequest) => PromiseLike | void, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - function beforeDeleteFile( - func?: (request: FileTriggerRequest) => PromiseLike | void, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - function afterDeleteFile( - func?: (request: FileTriggerRequest) => PromiseLike | void, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - - function define( - name: string, - func: (request: FunctionRequest) => any, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - function define any>( - name: string, - func: (request: FunctionRequest<{}>) => Promise> | ReturnType, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - function define[0]]: Parameters[0][P] }) => any>( - name: string, - func: (request: FunctionRequest[0]>) => Promise> | ReturnType, - validator?: Validator | ((request: FunctionRequest) => any), - ): void; - /** - * Gets data for the current set of cloud jobs. - * @returns A promise that will be resolved with the result of the function. - */ - function getJobsData(): Promise; - /** - * Gets job status by Id - * @param jobStatusId The Id of Job Status. - * @returns Status of Job. - */ - function getJobStatus(jobStatusId: string): Promise; - function httpRequest(options: HTTPOptions): Promise; - function job(name: string, func?: (request: JobRequest) => Promise | void): HttpResponse; - function run(name: string, data?: Params, options?: RunOptions): Promise; - function run any>(name: string, data?: null, options?: RunOptions): Promise>; - function run[0]]: Parameters[0][P] }) => any>( - name: string, - data: Parameters[0], - options?: RunOptions, - ): Promise>; - /** - * Starts a given cloud job, which will process asynchronously. - * @param jobName The function name. - * @param data The parameters to send to the cloud function. - * @returns A promise that will be resolved with the jobStatusId of the job. - */ - function startJob(jobName: string, data: any): Promise; - function useMasterKey(): void; - - interface RunOptions extends SuccessFailureOptions, ScopeOptions {} - - /** - * To use this Cloud Module in Cloud Code, you must require 'buffer' in your JavaScript file. - * - * import Buffer = require("buffer").Buffer; - */ - let HTTPOptions: new () => HTTPOptions; - interface HTTPOptions { - /** - * The body of the request. - * If it is a JSON object, then the Content-Type set in the headers must be application/x-www-form-urlencoded or application/json. - * You can also set this to a Buffer object to send raw bytes. - * If you use a Buffer, you should also set the Content-Type header explicitly to describe what these bytes represent. - */ - body?: string | Buffer | object | undefined; - /** - * Defaults to 'false'. - */ - followRedirects?: boolean | undefined; - /** - * The headers for the request. - */ - headers?: - | { - [headerName: string]: string | number | boolean; - } - | undefined; - /** - * The method of the request (i.e GET, POST, etc). - */ - method?: string | undefined; - /** - * The query portion of the url. - */ - params?: any; - /** - * The url to send the request to. - */ - url: string; - - success?: ((response: any) => void) | undefined; - error?: ((response: any) => void) | undefined; - } - } - - namespace EventuallyQueue { - interface QueueObject { - queueId: string; - action: string; - object: Object; - serverOptions: Object.SaveOptions | RequestOptions; - id: string; - className: string; - hash: string; - createdAt: Date; - } - type Queue = QueueObject[]; - /** - * Add object to queue with save operation. - * - * @param object Parse.Object to be saved eventually - * @param serverOptions See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#save Parse.Object.save} options. - * @returns A promise that is fulfilled if object is added to queue. - * @see Parse.Object#saveEventually - */ - function save(object: Object, serverOptions?: Object.SaveOptions): Promise; - /** - * Add object to queue with save operation. - * - * @param object Parse.Object to be destroyed eventually - * @param serverOptions See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#destroy Parse.Object.destroy} options - * @returns A promise that is fulfilled if object is added to queue. - * @see Parse.Object#destroyEventually - */ - function destroy(object: Object, serverOptions?: RequestOptions): Promise; - // function store(data: any): Promise; - // function load(): Promise; - /** - * Sets the in-memory queue from local storage and returns. - */ - function getQueue(): Promise; - /** - * Removes all objects from queue. - * @returns A promise that is fulfilled when queue is cleared. - */ - function clear(): Promise; - /** - * Return the number of objects in the queue. - */ - function length(): Promise; - /** - * Sends the queue to the server. - * @returns Returns true if queue was sent successfully. - */ - function sendQueue(): Promise; - /** - * Start polling server for network connection. - * Will send queue if connection is established. - * - * @param [ms] Milliseconds to ping the server. Default 2000ms - */ - function poll(ms?: number): void; - /** - * Turns off polling. - */ - function stopPoll(): void; - /** - * Return true if pinging the server. - */ - function isPolling(): boolean; - } - - class Error { - static OTHER_CAUSE: ErrorCode.OTHER_CAUSE; - static INTERNAL_SERVER_ERROR: ErrorCode.INTERNAL_SERVER_ERROR; - static CONNECTION_FAILED: ErrorCode.CONNECTION_FAILED; - static OBJECT_NOT_FOUND: ErrorCode.OBJECT_NOT_FOUND; - static INVALID_QUERY: ErrorCode.INVALID_QUERY; - static INVALID_CLASS_NAME: ErrorCode.INVALID_CLASS_NAME; - static MISSING_OBJECT_ID: ErrorCode.MISSING_OBJECT_ID; - static INVALID_KEY_NAME: ErrorCode.INVALID_KEY_NAME; - static INVALID_POINTER: ErrorCode.INVALID_POINTER; - static INVALID_JSON: ErrorCode.INVALID_JSON; - static COMMAND_UNAVAILABLE: ErrorCode.COMMAND_UNAVAILABLE; - static NOT_INITIALIZED: ErrorCode.NOT_INITIALIZED; - static INCORRECT_TYPE: ErrorCode.INCORRECT_TYPE; - static INVALID_CHANNEL_NAME: ErrorCode.INVALID_CHANNEL_NAME; - static PUSH_MISCONFIGURED: ErrorCode.PUSH_MISCONFIGURED; - static OBJECT_TOO_LARGE: ErrorCode.OBJECT_TOO_LARGE; - static OPERATION_FORBIDDEN: ErrorCode.OPERATION_FORBIDDEN; - static CACHE_MISS: ErrorCode.CACHE_MISS; - static INVALID_NESTED_KEY: ErrorCode.INVALID_NESTED_KEY; - static INVALID_FILE_NAME: ErrorCode.INVALID_FILE_NAME; - static INVALID_ACL: ErrorCode.INVALID_ACL; - static TIMEOUT: ErrorCode.TIMEOUT; - static INVALID_EMAIL_ADDRESS: ErrorCode.INVALID_EMAIL_ADDRESS; - static MISSING_CONTENT_TYPE: ErrorCode.MISSING_CONTENT_TYPE; - static MISSING_CONTENT_LENGTH: ErrorCode.MISSING_CONTENT_LENGTH; - static INVALID_CONTENT_LENGTH: ErrorCode.INVALID_CONTENT_LENGTH; - static FILE_TOO_LARGE: ErrorCode.FILE_TOO_LARGE; - static FILE_SAVE_ERROR: ErrorCode.FILE_SAVE_ERROR; - static DUPLICATE_VALUE: ErrorCode.DUPLICATE_VALUE; - static INVALID_ROLE_NAME: ErrorCode.INVALID_ROLE_NAME; - static EXCEEDED_QUOTA: ErrorCode.EXCEEDED_QUOTA; - static SCRIPT_FAILED: ErrorCode.SCRIPT_FAILED; - static VALIDATION_ERROR: ErrorCode.VALIDATION_ERROR; - static INVALID_IMAGE_DATA: ErrorCode.INVALID_IMAGE_DATA; - static UNSAVED_FILE_ERROR: ErrorCode.UNSAVED_FILE_ERROR; - static INVALID_PUSH_TIME_ERROR: ErrorCode.INVALID_PUSH_TIME_ERROR; - static FILE_DELETE_ERROR: ErrorCode.FILE_DELETE_ERROR; - static REQUEST_LIMIT_EXCEEDED: ErrorCode.REQUEST_LIMIT_EXCEEDED; - static INVALID_EVENT_NAME: ErrorCode.INVALID_EVENT_NAME; - static USERNAME_MISSING: ErrorCode.USERNAME_MISSING; - static PASSWORD_MISSING: ErrorCode.PASSWORD_MISSING; - static USERNAME_TAKEN: ErrorCode.USERNAME_TAKEN; - static EMAIL_TAKEN: ErrorCode.EMAIL_TAKEN; - static EMAIL_MISSING: ErrorCode.EMAIL_MISSING; - static EMAIL_NOT_FOUND: ErrorCode.EMAIL_NOT_FOUND; - static SESSION_MISSING: ErrorCode.SESSION_MISSING; - static MUST_CREATE_USER_THROUGH_SIGNUP: ErrorCode.MUST_CREATE_USER_THROUGH_SIGNUP; - static ACCOUNT_ALREADY_LINKED: ErrorCode.ACCOUNT_ALREADY_LINKED; - static INVALID_SESSION_TOKEN: ErrorCode.INVALID_SESSION_TOKEN; - static LINKED_ID_MISSING: ErrorCode.LINKED_ID_MISSING; - static INVALID_LINKED_SESSION: ErrorCode.INVALID_LINKED_SESSION; - static UNSUPPORTED_SERVICE: ErrorCode.UNSUPPORTED_SERVICE; - static AGGREGATE_ERROR: ErrorCode.AGGREGATE_ERROR; - static FILE_READ_ERROR: ErrorCode.FILE_READ_ERROR; - static X_DOMAIN_REQUEST: ErrorCode.X_DOMAIN_REQUEST; - - code: ErrorCode; - message: string; - - constructor(code: ErrorCode, message: string); - } - - /** - * A Parse.Op is an atomic operation that can be applied to a field in a - * Parse.Object. For example, calling object.set("foo", "bar") - * is an example of a Parse.Op.Set. Calling object.unset("foo") - * is a Parse.Op.Unset. These operations are stored in a Parse.Object and - * sent to the server as part of object.save() operations. - * Instances of Parse.Op should be immutable. - * - * You should not create subclasses of Parse.Op or instantiate Parse.Op - * directly. - */ - namespace Op { - interface BaseOperation { - objects(): any[]; - } - - interface Add extends BaseOperation { - toJSON(): any; - } - - interface AddUnique extends BaseOperation { - toJSON(): any; - } - - interface Increment { - amount: number; - toJSON(): any; - } - - interface Relation { - added(): Object[]; - removed: Object[]; - toJSON(): any; - } - - interface Set { - value(): any; - toJSON(): any; - } - - interface Unset { - toJSON(): any; - } - } - - /** - * Contains functions to deal with Push in Parse - */ - namespace Push { - function send(data: PushData, options?: SendOptions): Promise; - - interface PushData { - channels?: string[] | undefined; - push_time?: Date | undefined; - expiration_time?: Date | undefined; - expiration_interval?: number | undefined; - where?: Query | undefined; - data?: any; - alert?: string | undefined; - badge?: string | undefined; - sound?: string | undefined; - title?: string | undefined; - notification?: any; - content_available?: any; - } - - interface SendOptions extends UseMasterKeyOption { - success?: (() => void) | undefined; - error?: ((error: Error) => void) | undefined; - } - } - - /** - * Call this method first to set up your authentication tokens for Parse. - * You can get your keys from the Data Browser on parse.com. - * @param applicationId Your Parse Application ID. - * @param javaScriptKey (optional) Your Parse JavaScript Key (Not needed for parse-server) - * @param masterKey (optional) Your Parse Master Key. (Node.js only!) - */ - function initialize(applicationId: string, javaScriptKey?: string, masterKey?: string): void; - - /** - * Use this to set custom headers - * The headers will be sent with every parse request - */ - namespace CoreManager { - function set(key: string, value: any): void; - function get(key: string): void; - } - - /** - * Additionally on React-Native / Expo environments, add AsyncStorage from 'react-native' package - * @param AsyncStorage AsyncStorage from 'react-native' package - */ - function setAsyncStorage(AsyncStorage: any): void; - - /** - * Gets all contents from Local Datastore. - */ - function dumpLocalDatastore(): Promise<{ [key: string]: any }>; - - /** - * Enable pinning in your application. - * This must be called before your application can use pinning. - */ - function enableLocalDatastore(): void; - - /** - * Flag that indicates whether Local Datastore is enabled. - */ - function isLocalDatastoreEnabled(): boolean; - - function setLocalDatastoreController(controller: any): void; - - /** - * Call this method to set your LocalDatastoreStorage engine - * If using React-Native use {@link Parse.setAsyncStorage Parse.setAsyncStorage()} - * @param controller a data storage. - */ - function setLocalDatastoreController(controller: any): void; - - /** - * Enable the current user encryption. - * This must be called before login any user. - */ - function enableEncryptedUser(): void; - - /** - * Flag that indicates whether Encrypted User is enabled. - */ - function isEncryptedUserEnabled(): boolean; - } -} - -export = Parse; diff --git a/types/node.d.ts b/types/node.d.ts deleted file mode 100644 index d4bbf2ccf..000000000 --- a/types/node.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as parse from "./index"; - -export = parse; diff --git a/types/react-native.d.ts b/types/react-native.d.ts deleted file mode 100644 index d4bbf2ccf..000000000 --- a/types/react-native.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import * as parse from "./index"; - -export = parse; diff --git a/types/tests.ts b/types/tests.ts deleted file mode 100644 index 1a55f98ff..000000000 --- a/types/tests.ts +++ /dev/null @@ -1,2175 +0,0 @@ -// Parse is a global type, but it can also be imported -class GameScore extends Parse.Object { - constructor(options?: any) { - super('GameScore', options); - } -} - -class Game extends Parse.Object<{ gameScore: GameScore; score: string }> { - constructor(options?: any) { - super('Game', options); - } -} - -function test_config() { - Parse.Config.save({ foo: 'bar' }, { foo: true }); - Parse.Config.get({ useMasterKey: true }); -} - -function test_object() { - const game = new Game(); - - game.save(null, { - useMasterKey: true, - sessionToken: 'sometoken', - cascadeSave: false, - }).then(result => result); - - if (!game.isNew()) { - console.error('Game should be new'); - } - - if (game.toPointer().className !== 'Game') { - console.log("Class name should be 'Game"); - } - - game.fetch({ - success(g: Game) {}, - }); - - // Create a new instance of that class. - const gameScore = new GameScore(); - - gameScore.set('score', 1337); - gameScore.set('playerName', 'Sean Plott'); - gameScore.set('cheatMode', false); - - // Setting attrs using object - gameScore.set({ - level: '10', - difficult: 15, - }); - - const score = gameScore.get('score'); - const playerName = gameScore.get('playerName'); - const cheatMode = gameScore.get('cheatMode'); - - gameScore.increment('score'); - gameScore.addUnique('skills', 'flying'); - gameScore.addUnique('skills', 'kungfu'); - gameScore.addAll('skills', ['kungfu']); - gameScore.addAllUnique('skills', ['kungfu']); - gameScore.remove('skills', 'flying'); - gameScore.removeAll('skills', ['kungFu']); - game.set('gameScore', gameScore); - - const gameCopy = Game.fromJSON(JSON.parse(JSON.stringify(game)), true); - - const object = new Parse.Object('TestObject'); - object.equals(gameScore); - object.fetchWithInclude(['key1', 'key2']); -} - -function test_errors() { - try { - throw new Parse.Error(Parse.Error.INTERNAL_SERVER_ERROR, 'sdfds'); - } catch (error) { - if (error.code !== 1) { - console.error('Error code did not match expected number.'); - } - } -} - -function test_query() { - const gameScore = new GameScore(); - - const query = new Parse.Query(GameScore); - query.equalTo('playerName', 'Dan Stemkoski'); - query.notEqualTo('playerName', 'Michael Yabuti'); - query.fullText('playerName', 'dan', { language: 'en', caseSensitive: false, diacriticSensitive: true }); - query.greaterThan('playerAge', 18); - query.eachBatch(objs => Promise.resolve(), { batchSize: 10 }); - query.each(score => Promise.resolve()); - query.hint('_id_'); - query.explain(true); - query.limit(10); - query.skip(10); - - // Sorts the results in ascending order by the score field - query.ascending('score'); - - // Sorts the results in descending order by the score field - query.descending('score'); - - // Restricts to wins < 50 - query.lessThan('wins', 50); - - // Restricts to wins <= 50 - query.lessThanOrEqualTo('wins', 50); - - // Restricts to wins > 50 - query.greaterThan('wins', 50); - - // Restricts to wins >= 50 - query.greaterThanOrEqualTo('wins', 50); - - query.containedBy('place', ['1', '2']); - // Finds scores from any of Jonathan, Dario, or Shawn - query.containedIn('playerName', ['Jonathan Walsh', 'Dario Wunsch', 'Shawn Simon']); - - // Finds scores from anyone who is neither Jonathan, Dario, nor Shawn - query.notContainedIn('playerName', ['Jonathan Walsh', 'Dario Wunsch', 'Shawn Simon']); - - // Finds objects that have the score set - query.exists('score'); - - // Finds objects that don't have the score set - query.doesNotExist('score'); - query.matchesKeyInQuery('hometown', 'city', query); - query.doesNotMatchKeyInQuery('hometown', 'city', query); - query.select('score', 'playerName'); - - // Find objects where the array in arrayKey contains 2. - query.equalTo('arrayKey', 2); - - // Find objects where the array in arrayKey contains all of the elements 2, 3, and 4. - query.containsAll('arrayKey', [2, 3, 4]); - query.containsAllStartingWith('arrayKey', [2, 3, 4]); - - query.startsWith('name', "Big Daddy's"); - query.equalTo('score', gameScore); - query.exists('score'); - query.include('score'); - query.include(['score.team']); - query.includeAll(); - query.sortByTextScore(); - // Find objects that match the aggregation pipeline - query.aggregate({ - group: { - objectId: '$name', - }, - }); - - query.aggregate({ - count: 'total', - }); - - query.aggregate({ - lookup: { - from: 'Collection', - foreignField: 'id', - localField: 'id', - as: 'result', - }, - }); - query.aggregate({ - lookup: { - from: 'Target', - let: { foo: 'bar', baz: 123 }, - pipeline: [], - as: 'result', - }, - }); - - query.aggregate({ - graphLookup: { - from: 'Target', - connectFromField: 'objectId', - connectToField: 'newId', - as: 'result', - }, - }); - - query.aggregate({ - facet: { - foo: [ - { - count: 'total', - }, - ], - bar: [ - { - group: { - objectId: '$name', - }, - }, - ], - }, - }); - - query.aggregate({ - unwind: '$field', - }); - - query.aggregate({ - unwind: { - path: '$field', - includeArrayIndex: 'newIndex', - preserveNullAndEmptyArrays: true, - }, - }); - - // Find objects with distinct key - query.distinct('name'); - - const testQuery = Parse.Query.or(query, query); -} - -function test_query_exclude() { - const gameScore = new GameScore(); - - const query = new Parse.Query(GameScore); - - // Show all keys, except the specified key. - query.exclude('place'); - - const testQuery = Parse.Query.or(query, query); -} - -async function test_query_promise() { - // Test promise with a query - const findQuery = new Parse.Query('Test'); - findQuery - .find() - .then(() => { - // success - }) - .catch(() => { - // error - }); - - const getQuery = new Parse.Query('Test'); - try { - await getQuery.get('objectId'); - } catch (error) { - // noop - } - - await getQuery.map((score, index) => score.increment('score', index)); - await getQuery.reduce((accum, score, index) => (accum += score.get('score')), 0); - await getQuery.reduce((accum, score, index) => (accum += score.get('score')), 0, { batchSize: 200 }); - await getQuery.filter(scores => scores.get('score') > 0); - await getQuery.filter(scores => scores.get('score') > 0, { batchSize: 10 }); -} - -async function test_live_query() { - const subscription = await new Parse.Query('Test').subscribe(); - subscription.on('close', object => { - // $ExpectType Object - object; - }); - subscription.on('create', object => { - // $ExpectType Object - object; - }); - subscription.on('delete', object => { - // $ExpectType Object - object; - }); - subscription.on('enter', object => { - // $ExpectType Object - object; - }); - subscription.on('leave', object => { - // $ExpectType Object - object; - }); - subscription.on('open', object => { - // $ExpectType Object - object; - }); - subscription.on('update', object => { - // $ExpectType Object - object; - }); -} - -function return_a_generic_query(): Parse.Query { - return new Parse.Query(Game); -} - -function test_anonymous_utils() { - // $ExpectType boolean - Parse.AnonymousUtils.isLinked(new Parse.User()); - // $ExpectType Promise> - Parse.AnonymousUtils.link(new Parse.User(), { useMasterKey: true, sessionToken: '' }); - // $ExpectType Promise> - Parse.AnonymousUtils.logIn({ useMasterKey: true, sessionToken: '' }); -} - -function return_a_query(): Parse.Query { - return new Parse.Query(Game); -} - -function test_each() { - new Parse.Query(Game).each(game => { - // $ExpectType Game - game; - }); -} - -function test_file() { - const base64 = 'V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE='; - let file = new Parse.File('myfile.txt', { base64 }); - - file = new Parse.File('nana', { uri: 'http://example.com/image.jps' }); - - const bytes = [0xbe, 0xef, 0xca, 0xfe]; - file = new Parse.File('myfile.txt', bytes); - - file = new Parse.File('myfile.zzz', new Blob(), 'image/png'); - - const src = file.url(); - const secure = file.url({ forceSecure: true }); - - file.save().then( - () => { - // The file has been saved to Parse. - }, - error => { - // The file either could n ot be read, or could not be saved to Parse. - }, - ); - - Parse.Cloud.httpRequest({ url: file.url() }).then((response: Parse.Cloud.HttpResponse) => { - // result - }); - - // TODO: Check - - file.cancel(); - file.destroy(); -} - -function test_file_tags_and_metadata() { - const base64 = 'V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE='; - const file = new Parse.File('myfile.txt', { base64 }); - file.setTags({ ownerId: 42, status: 'okay' }); - file.addTag('labes', ['one', 'two', 'three']); - file.setMetadata({ contentType: 'plain/text', contentLength: 579 }); - file.addMetadata('author', 'John Doe'); - - const tags = file.tags(); - const ownerId = tags['ownerId']; - - const metadata = file.metadata(); - const contentType = metadata['contentType']; -} - -function test_analytics() { - const dimensions = { - // Define ranges to bucket data points into meaningful segments - priceRange: '1000-1500', - // Did the user filter the query? - source: 'craigslist', - // Do searches happen more often on weekdays or weekends? - dayType: 'weekday', - }; - // Send the dimensions to Parse along with the 'search' event - Parse.Analytics.track('search', dimensions); - - const codeString = '404'; - Parse.Analytics.track('error', { code: codeString }); -} - -function test_relation() { - const game1 = new Game(); - const game2 = new Game(); - - new Parse.User() - .relation('games') - .query() - .find() - .then((g: Game[]) => {}); - new Parse.User().relation('games').add(game1); - new Parse.User().relation('games').add([game1, game2]); - - new Parse.User().relation('games').remove(game1); - new Parse.User().relation('games').remove([game1, game2]); -} - -function test_user() { - const user = new Parse.User(); - user.set('username', 'my name'); - user.set('password', 'my pass'); - user.set('email', 'email@example.com'); - user.signUp(null, { useMasterKey: true }); - - const anotherUser: Parse.User = Parse.User.fromJSON({}); - anotherUser.set('email', 'email@example.com'); -} - -async function test_user_currentAsync() { - const asyncUser = await Parse.User.currentAsync(); - if (asyncUser) { - asyncUser.set('email', 'email@example.com'); - } else if (asyncUser === null) { - Parse.User.logIn('email@example.com', 'my pass'); - } -} - -function test_user_acl_roles() { - const user = new Parse.User(); - user.set('username', 'my name'); - user.set('password', 'my pass'); - user.set('email', 'email@example.com'); - - // other fields can be set just like with Parse.Object - user.set('phone', '415-392-0202'); - - const currentUser = Parse.User.current(); - if (currentUser) { - // do stuff with the user - } else { - // show the signup or login page - } - - Parse.User.become('session-token-here').then( - user => { - // The current user is now set to user. - }, - error => { - // The token could not be validated. - }, - ); - - Parse.User.hydrate({}).then( - user => { - // The current user is now set to user. - }, - error => { - // The token could not be validated. - }, - ); - - const game = new Game(); - game.set('gameScore', new GameScore()); - game.setACL(new Parse.ACL(Parse.User.current())); - game.save().then((game: Game) => {}); - game.save(null, { useMasterKey: true }); - game.save({ score: '10' }, { useMasterKey: true }).then( - game => { - // Update game then revert it to the last saved state. - game.set('score', '20'); - game.revert('score'); - game.revert('score', 'ACL'); - game.revert(); - }, - error => { - // The save failed - }, - ); - - const groupACL = new Parse.ACL(); - - const userList: Parse.User[] = [Parse.User.current()!]; - // userList is an array with the users we are sending this message to. - for (const userListItem of userList) { - groupACL.setReadAccess(userListItem, true); - groupACL.setWriteAccess(userListItem, true); - } - - groupACL.setPublicReadAccess(true); - - game.setACL(groupACL); - - Parse.User.requestPasswordReset('email@example.com').then( - data => { - // The current user is now set to user. - }, - error => { - // The token could not be validated. - }, - ); - - Parse.User.requestEmailVerification('email@example.com').then( - data => { - // The current user is now set to user. - }, - error => { - // The token could not be validated. - }, - ); - - // By specifying no write privileges for the ACL, we can ensure the role cannot be altered. - const role = new Parse.Role('Administrator', groupACL); - role.getUsers().add(userList[0]); - role.getRoles().add(role); - role.save(); - - Parse.User.logOut().then(data => { - // logged out - }); -} - -function test_facebook_util() { - Parse.FacebookUtils.init({ - appId: 'YOUR_APP_ID', // Facebook App ID - channelUrl: '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File - cookie: true, // enable cookies to allow Parse to access the session - xfbml: true, // parse XFBML - }); - - Parse.FacebookUtils.logIn(null, { - success: (user: Parse.User) => { - if (!user.existed()) { - alert('User signed up and logged in through Facebook!'); - } else { - alert('User logged in through Facebook!'); - } - }, - error: (user: Parse.User, error: any) => { - alert('User cancelled the Facebook login or did not fully authorize.'); - }, - }); - - const user = Parse.User.current()!; - - if (!Parse.FacebookUtils.isLinked(user)) { - Parse.FacebookUtils.link(user, null, { - success: (user: any) => { - alert('Woohoo, user logged in with Facebook!'); - }, - error: (user: any, error: any) => { - alert('User cancelled the Facebook login or did not fully authorize.'); - }, - }); - } - - Parse.FacebookUtils.unlink(user, { - success: (user: Parse.User) => { - alert('The user is no longer associated with their Facebook account.'); - }, - }); -} - -async function test_cloud_functions() { - Parse.Cloud.run( - 'hello', - {}, - { - success: (result: any) => { - // result - }, - error: (error: any) => {}, - }, - ); - - // $ExpectType any - await Parse.Cloud.run('SomeFunction'); - - // $ExpectType any - await Parse.Cloud.run('SomeFunction', { something: 'whatever' }); - - // $ExpectType any - await Parse.Cloud.run('SomeFunction', null, { useMasterKey: true }); - - // ExpectType boolean - await Parse.Cloud.run<() => boolean>('SomeFunction'); - - // $ExpectType boolean - await Parse.Cloud.run<() => boolean>('SomeFunction', null); - - // $ExpectType boolean - await Parse.Cloud.run<() => boolean>('SomeFunction', null, { useMasterKey: true }); - - // $ExpectType number - await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction', { paramA: 'hello' }); - - // @ts-expect-error - await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction'); - - // @ts-expect-error - await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction', { paramZ: 'hello' }); - - // @ts-expect-error - await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction', null, { useMasterKey: true }); - - // @ts-expect-error - await Parse.Cloud.run<(params: string) => any>('SomeFunction', 'hello'); - - Parse.Cloud.afterDelete('MyCustomClass', (request: Parse.Cloud.AfterDeleteRequest) => { - // result - }); - - Parse.Cloud.afterSave('MyCustomClass', (request: Parse.Cloud.AfterSaveRequest) => { - if (!request.context) { - throw new Error('Request context should be defined'); - } - // result - }); - - Parse.Cloud.beforeDelete('MyCustomClass', (request: Parse.Cloud.BeforeDeleteRequest) => { - // result - }); - - Parse.Cloud.beforeDelete('MyCustomClass', async (request: Parse.Cloud.BeforeDeleteRequest) => { - // result - }); - - interface BeforeSaveObject { - immutable: boolean; - } - - Parse.Cloud.beforeSave('MyCustomClass', async request => { - if (request.object.isNew()) { - if (!request.object.has('immutable')) throw new Error('Field immutable is required'); - } else { - const original = request.original; - if (original == null) { - // When the object is not new, request.original must be defined - throw new Error('Original must me defined for an existing object'); - } - - if (original.get('immutable') !== request.object.get('immutable')) { - throw new Error('This field cannot be changed'); - } - } - if (!request.context) { - throw new Error('Request context should be defined'); - } - }); - - Parse.Cloud.beforeFind('MyCustomClass', (request: Parse.Cloud.BeforeFindRequest) => { - const query = request.query; // the Parse.Query - const user = request.user; // the user - const isMaster = request.master; // if the query is run with masterKey - const isCount = request.count; // if the query is a count operation (available on parse-server 2.4.0 or up) - const isGet = request.isGet; // if the query is a get operation - - // All possible read preferences - request.readPreference = Parse.Cloud.ReadPreferenceOption.Primary; - request.readPreference = Parse.Cloud.ReadPreferenceOption.PrimaryPreferred; - request.readPreference = Parse.Cloud.ReadPreferenceOption.Secondary; - request.readPreference = Parse.Cloud.ReadPreferenceOption.SecondaryPreferred; - request.readPreference = Parse.Cloud.ReadPreferenceOption.Nearest; - }); - - Parse.Cloud.beforeFind('MyCustomClass', (request: Parse.Cloud.BeforeFindRequest) => { - const query = request.query; // the Parse.Query - - return new Parse.Query('QueryMe!'); - }); - - Parse.Cloud.beforeFind('MyCustomClass', async (request: Parse.Cloud.BeforeFindRequest) => { - const query = request.query; // the Parse.Query - - return new Parse.Query('QueryMe, IN THE FUTURE!'); - }); - - Parse.Cloud.afterFind('MyCustomClass', async (request: Parse.Cloud.AfterFindRequest) => { - return new Parse.Object('MyCustomClass'); - }); - - Parse.Cloud.beforeLogin((request: Parse.Cloud.TriggerRequest) => { - return Promise.resolve(); - }); - - Parse.Cloud.afterLogin((request: Parse.Cloud.TriggerRequest) => { - return Promise.resolve(); - }); - - Parse.Cloud.afterLogout((request: Parse.Cloud.TriggerRequest) => { - return Promise.resolve(); - }); - - Parse.Cloud.beforeSaveFile((request: Parse.Cloud.FileTriggerRequest) => { - return Promise.resolve(new Parse.File('myFile.txt', { base64: '' })); - }); - - Parse.Cloud.beforeSaveFile((request: Parse.Cloud.FileTriggerRequest) => {}); - - Parse.Cloud.beforeDeleteFile((request: Parse.Cloud.FileTriggerRequest) => {}); - - Parse.Cloud.afterDeleteFile((request: Parse.Cloud.FileTriggerRequest) => {}); - - Parse.Cloud.define('AFunc', (request: Parse.Cloud.FunctionRequest) => { - return 'Some result'; - }); - - Parse.Cloud.define( - 'AFunc', - (request: Parse.Cloud.FunctionRequest) => { - return 'Some result'; - }, - { - requireUser: true, - requireMaster: true, - validateMasterKey: true, - skipWithMasterKey: true, - requireAnyUserRoles: ['a'], - requireAllUserRoles: ['a'], - fields: { - name: { - type: String, - constant: true, - default: true, - options: [], - error: 'invalid field.', - }, - }, - requireUserKeys: { - name: { - type: String, - constant: true, - default: true, - options: [], - error: 'invalid field.', - }, - }, - }, - ); - - Parse.Cloud.define('AFunc', request => { - // $ExpectType Params - request.params; - - // $ExpectType any - request.params.anything; - }); - - Parse.Cloud.define<() => void>('AFunc', request => { - // $ExpectType {} - request.params; - }); - - Parse.Cloud.define<(params: { something: string }) => number>('AFunc', request => { - // $ExpectType { something: string; } - request.params; - - // @ts-expect-error - request.params.somethingElse; - - return 123; - }); - - // @ts-expect-error - Parse.Cloud.define('AFunc'); - - // @ts-expect-error - Parse.Cloud.define<() => string>('AFunc', () => 123); - - // @ts-expect-error - Parse.Cloud.define<(params: string) => number>('AFunc', () => 123); - - Parse.Cloud.job('AJob', (request: Parse.Cloud.JobRequest) => { - request.message('Message to associate with this job run'); - }); - - Parse.Cloud.startJob('AJob', {}).then(v => v); - - Parse.Cloud.getJobStatus('AJob').then(v => v); - - Parse.Cloud.getJobsData().then(v => v); -} - -class PlaceObject extends Parse.Object {} - -function test_geo_points() { - let point = new Parse.GeoPoint(); - // @ts-expect-error - point = new Parse.GeoPoint('40.0'); - // @ts-expect-error - point = new Parse.GeoPoint(40.0); - // @ts-expect-error - point = new Parse.GeoPoint([40.0, -30.0, 20.0]); - point = new Parse.GeoPoint([40.0, -30.0]); - point = new Parse.GeoPoint(40.0, -30.0); - point = new Parse.GeoPoint({ latitude: 40.0, longitude: -30.0 }); - - const userObject = Parse.User.current>()!; - - // User's location - const userGeoPoint = userObject.get('location'); - - // Create a query for places - const query = new Parse.Query(Parse.User); - // Interested in locations near user. - query.near('location', userGeoPoint); - // Limit what could be a lot of points. - query.limit(10); - - const southwestOfSF = new Parse.GeoPoint(37.708813, -122.526398); - const northeastOfSF = new Parse.GeoPoint(37.822802, -122.373962); - - const query2 = new Parse.Query(PlaceObject); - query2.withinGeoBox('location', southwestOfSF, northeastOfSF); - - const query3 = new Parse.Query('PlaceObject').find().then((o: Parse.Object[]) => {}); -} - -function test_push() { - Parse.Push.send( - { - channels: ['Gia nts', 'Mets'], - data: { - alert: 'The Giants won against the Mets 2-3.', - }, - }, - { - success: () => { - // Push was successful - }, - error: (error: any) => { - // Handle error - }, - }, - ); - - const query = new Parse.Query(Parse.Installation); - query.equalTo('injuryReports', true); - - Parse.Push.send( - { - where: query, // Set our Installation query - data: { - alert: 'Willie Hayes injured by own pop fly.', - }, - }, - { - success() { - // Push was successful - }, - error(error: any) { - // Handle error - }, - }, - ); -} - -function test_batch_operations() { - const game1 = new Game(); - const game2 = new Game(); - const games = [game1, game2]; - - // Master key - Parse.Object.saveAll(games, { useMasterKey: true }); - Parse.Object.destroyAll(games, { useMasterKey: true }); - Parse.Object.fetchAll(games, { useMasterKey: true }); - Parse.Object.fetchAllIfNeeded(games, { useMasterKey: true }); - - // Session token - Parse.Object.saveAll(games, { sessionToken: '' }); - Parse.Object.destroyAll(games, { sessionToken: '' }); - Parse.Object.fetchAll(games, { sessionToken: '' }); - Parse.Object.fetchAllIfNeeded(games, { sessionToken: '' }); -} - -async function test_query_subscribe() { - // create new query from Game object type - const query = new Parse.Query(Game); - - // create subscription to Game object - // Without a token - // $ExpectType LiveQuerySubscription - let subscription = await query.subscribe(); - - // With a session token - // $ExpectType LiveQuerySubscription - subscription = await query.subscribe(new Parse.User().getSessionToken()); - - // listen for new Game objects created on Parse server - subscription.on('create', (game: any) => { - console.log(game); - }); - - // unsubscribe - subscription.unsubscribe(); -} - -function test_serverURL() { - Parse.serverURL = 'http://localhost:1337/parse'; -} -function test_polygon() { - const point = new Parse.GeoPoint(1, 2); - const polygon1 = new Parse.Polygon([ - [0, 0], - [1, 0], - [1, 1], - [0, 1], - ]); - const polygon2 = new Parse.Polygon([point, point, point]); - polygon1.equals(polygon2); - polygon1.containsPoint(point); - - const query = new Parse.Query('TestObject'); - query.polygonContains('key', point); - query.withinPolygon('key', [ - [0, 0], - [1, 0], - [1, 1], - [0, 1], - ]); -} - -async function test_local_datastore() { - Parse.enableLocalDatastore(); - const name = 'test_pin'; - const obj = new Parse.Object('TestObject'); - await obj.pin(); - await obj.unPin(); - await obj.isPinned(); - await obj.pinWithName(name); - await obj.unPinWithName(name); - await obj.fetchFromLocalDatastore(); - - await Parse.Object.pinAll([obj]); - await Parse.Object.unPinAll([obj]); - await Parse.Object.pinAllWithName(name, [obj]); - await Parse.Object.unPinAllWithName(name, [obj]); - await Parse.Object.unPinAllObjects(); - await Parse.Object.unPinAllObjectsWithName(name); - - const flag = Parse.isLocalDatastoreEnabled(); - const LDS = await Parse.dumpLocalDatastore(); - - const query = new Parse.Query('TestObject'); - query.fromPin(); - query.fromPinWithName(name); - query.fromLocalDatastore(); - - Parse.setLocalDatastoreController({}); -} - -async function test_from_network() { - const obj = new Parse.Object('TestObject'); - await obj.save(); - - const query = new Parse.Query('TestObject'); - query.fromNetwork(); -} - -async function test_cancel_query() { - const obj = new Parse.Object('TestObject'); - await obj.save(); - - const query = new Parse.Query('TestObject'); - query.fromNetwork().find(); - query.cancel(); -} - -type FieldType = - | string - | number - | boolean - | Date - | Parse.File - | Parse.GeoPoint - | any[] - | object - | Parse.Pointer - | Parse.Polygon - | Parse.Relation; -async function test_schema( - anyField: FieldType, - notString: Exclude, - notNumber: Exclude, - notboolean: Exclude, - notDate: Exclude, - notFile: Exclude, - notGeopoint: Exclude, - notArray: Exclude, - notObject: Exclude, - notPointer: Exclude, - notPolygon: Exclude, -) { - // $ExpectType RestSchema[] - await Parse.Schema.all(); - - const schema = new Parse.Schema('TestSchema'); - - schema.addArray('arrayField'); - schema.addArray('arrayField', { defaultValue: [1, 2, 3, 4] }); - // @ts-expect-error - schema.addArray('arrayField', { defaultValue: notArray }); - - /** - * @todo Enable type check for default value - */ - schema.addField('defaultFieldString'); - schema.addField('defaultFieldString', 'String', { defaultValue: anyField }); - schema.addField('defaultFieldString', 'Number'); - schema.addField('defaultFieldString', 'Relation'); - // @ts-expect-error - schema.addField('defaultFieldString', 'String', 'Invalid Options'); - - schema.addString('field'); - schema.addString('field', { defaultValue: 'some string', required: true }); - // @ts-expect-error - schema.addString('field', { defaultValue: notString }); - - schema.addNumber('field'); - schema.addNumber('field', { defaultValue: 0, required: true }); - // @ts-expect-error - schema.addNumber('field', { defaultValue: notNumber }); - - schema.addBoolean('field'); - schema.addBoolean('field', { defaultValue: true, required: true }); - // @ts-expect-error - schema.addBoolean('field', { defaultValue: notboolean }); - - schema.addDate('field'); - schema.addDate('field', { defaultValue: new Date(), required: true }); - // @ts-expect-error - schema.addDate('field', { defaultValue: notDate }); - - schema.addFile('field'); - schema.addFile('field', { defaultValue: new Parse.File('myfile', []), required: true }); - // @ts-expect-error - schema.addFile('field', { defaultValue: notFile }); - - schema.addGeoPoint('field'); - schema.addGeoPoint('field', { defaultValue: new Parse.GeoPoint(), required: true }); - // @ts-expect-error - schema.addGeoPoint('field', { defaultValue: notGeopoint }); - - schema.addPolygon('field'); - schema.addPolygon('field', { defaultValue: new Parse.Polygon([]), required: true }); - // @ts-expect-error - schema.addPolygon('field', { defaultValue: notPolygon }); - - schema.addObject('field'); - schema.addObject('field', { defaultValue: {}, required: true }); - schema.addObject('field', { defaultValue: { abc: 'def' } }); - // @ts-expect-error - schema.addObject('field', { defaultValue: notObject }); - - schema.addPointer('field', 'SomeClass'); - // @ts-expect-error - schema.addPointer('field'); - /** - * @todo Infer defaultValue type from targetClass - */ - schema.addPointer('field', '_User', { defaultValue: new Parse.User().toPointer(), required: true }); - // @ts-expect-error - schema.addPointer('field', { defaultValue: notPointer }); - - schema.addRelation('field', 'SomeClass'); - // @ts-expect-error - schema.addRelation('field'); - // @ts-expect-error - schema.addRelation('field', 'SomeClass', 'anything'); - - schema.addIndex('testIndex', { stringField: 'text' }); - schema.addIndex('testIndex', { stringField: 1 }); - schema.addIndex('testIndex', { stringField: -1 }); - // @ts-expect-error - schema.addIndex('testIndex', { stringField: true }); - - schema.deleteField('defaultFieldString'); - schema.deleteIndex('testIndex'); - schema.delete().then(results => {}); - // $ExpectType RestSchema - await schema.get(); - schema.purge().then(results => {}); - schema.save().then(results => {}); - schema.update().then(results => {}); - - function testGenericType() { - interface iTestAttributes { - arrField: any[]; - boolField: boolean; - stringField: string; - numField: number; - dateField: Date; - fileField: Parse.File; - geoPointField: Parse.GeoPoint; - polygonField: Parse.Polygon; - objectField: object; - relationField: Parse.Relation; - pointerField: Parse.Pointer | Parse.Object; - } - class TestObject extends Parse.Object {} - - const schema = new Parse.Schema('TestObject'); - schema.addArray('arrField'); - schema.addBoolean('boolField'); - schema.addDate('dateField'); - schema.addFile('fileField'); - schema.addGeoPoint('geoPointField'); - schema.addNumber('numField'); - schema.addObject('objectField'); - schema.addPointer('pointerField', 'FooClass'); - schema.addPolygon('polygonField'); - schema.addRelation('relationField', 'FooClass'); - schema.addString('stringField'); - - // @ts-expect-error - schema.addArray('wrong'); - // @ts-expect-error - schema.addBoolean('wrong'); - // @ts-expect-error - schema.addDate('wrong'); - // @ts-expect-error - schema.addFile('wrong'); - // @ts-expect-error - schema.addGeoPoint('wrong'); - // @ts-expect-error - schema.addNumber('wrong'); - // @ts-expect-error - schema.addObject('wrong'); - // @ts-expect-error - schema.addPointer('wrong', 'FooClass'); - // @ts-expect-error - schema.addPolygon('wrong'); - // @ts-expect-error - schema.addRelation('wrong', 'FooClass'); - // @ts-expect-error - schema.addString('wrong'); - } -} - -function testObject() { - function testConstructor() { - // $ExpectType Object - new Parse.Object(); - - // $ExpectType Object - new Parse.Object('TestObject'); - - // $ExpectType Object<{ example: number; }> - new Parse.Object('TestObject', { example: 100 }); - - // $ExpectType Object<{ example: boolean; }> - new Parse.Object<{ example: boolean }>('TestObject', { example: true }); - - // $ExpectType Object<{ example: string; }> - new Parse.Object('TestObject', { example: 'hello' }, { ignoreValidation: true }); - - // @ts-expect-error - new Parse.Object<{ example: string }>('TestObject'); - - // @ts-expect-error - new Parse.Object<{ example: boolean }>('TestObject', { example: 'hello' }); - } - - function testStaticMethods() { - async function testSaveAll(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { - // $ExpectType Object[] - await Parse.Object.saveAll([objUntyped]); - - // $ExpectType Object<{ example: string; }>[] - await Parse.Object.saveAll([objTyped]); - - // $ExpectType [Object, Object<{ example: string; }>] - await Parse.Object.saveAll<[typeof objUntyped, typeof objTyped]>([objUntyped, objTyped]); - - // @ts-expect-error - await Parse.Object.saveAll([123]); - } - } - - function testAttributes(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { - // $ExpectType any - objUntyped.attributes.whatever; - - // $ExpectType string - objTyped.attributes.example; - - // @ts-expect-error - objTyped.attributes.other; - } - - function testAdd(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { - // $ExpectType false | Object - objUntyped.add('whatever', 'hello'); - - // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> - objTyped.add('stringList', 'hello'); - - // @ts-expect-error - objTyped.add('stringList', 100); - - // @ts-expect-error - objTyped.add('thing', true); - - // @ts-expect-error - objTyped.add('whatever', 'hello'); - } - - function testAddAll(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { - // $ExpectType false | Object - objUntyped.addAll('whatever', ['hello', 100]); - - // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> - objTyped.addAll('stringList', ['hello']); - - // @ts-expect-error - objTyped.addAll('stringList', [100]); - - // @ts-expect-error - objTyped.addAll('thing', [true]); - - // @ts-expect-error - objTyped.addAll('whatever', ['hello']); - } - - function testAddAllUnique( - objUntyped: Parse.Object, - objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>, - ) { - // $ExpectType false | Object - objUntyped.addAllUnique('whatever', ['hello', 100]); - - // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> - objTyped.addAllUnique('stringList', ['hello']); - - // @ts-expect-error - objTyped.addAllUnique('stringList', [100]); - - // @ts-expect-error - objTyped.addAllUnique('thing', [true]); - - // @ts-expect-error - objTyped.addAllUnique('whatever', ['hello']); - } - - function testAddUnique(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { - // $ExpectType false | Object - objUntyped.addUnique('whatever', 'hello'); - - // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> - objTyped.addUnique('stringList', 'hello'); - - // @ts-expect-error - objTyped.addUnique('stringList', 100); - - // @ts-expect-error - objTyped.addUnique('thing', true); - - // @ts-expect-error - objTyped.addUnique('whatever', 'hello'); - } - - function testDirty(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { - // $ExpectType boolean - objUntyped.dirty(); - - // $ExpectType boolean - objUntyped.dirty('whatever'); - - // $ExpectType boolean - objTyped.dirty(); - - // $ExpectType boolean - objTyped.dirty('example'); - - // @ts-expect-error - objTyped.dirty('other'); - } - - function testEquals(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { - // $ExpectType boolean - objUntyped.equals(objTyped); - - // $ExpectType boolean - objTyped.equals(objUntyped); - - // @ts-expect-error - objUntyped.equals('blah'); - } - - function testEscape(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { - // $ExpectType string - objUntyped.escape('whatever'); - - // $ExpectType string - objTyped.escape('example'); - - // @ts-expect-error - objTyped.escape('other'); - } - - function testFetchWithInclude(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { - // $ExpectType Promise> - objUntyped.fetchWithInclude('whatever'); - - // $ExpectType Promise> - objUntyped.fetchWithInclude(['whatever']); - - // $ExpectType Promise> - objUntyped.fetchWithInclude([['whatever']]); - - // @ts-expect-error - objUntyped.fetchWithInclude([[['whatever']]]); - - // $ExpectType Promise> - objTyped.fetchWithInclude('example'); - - // $ExpectType Promise> - objTyped.fetchWithInclude(['example']); - - // $ExpectType Promise> - objTyped.fetchWithInclude([['example']]); - - // @ts-expect-error - objTyped.fetchWithInclude([[['example']]]); - - // $ExpectType Promise[]> - Parse.Object.fetchAllIfNeededWithInclude([objTyped], 'example'); - - // @ts-expect-error - Parse.Object.fetchAllIfNeededWithInclude([objTyped], 'notAnAttribute'); - - // $ExpectType Promise[]> - Parse.Object.fetchAllWithInclude([objTyped], 'example'); - - // @ts-expect-error - Parse.Object.fetchAllWithInclude([objTyped], 'notAnAttribute'); - } - - function testGet(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { - // $ExpectType any - objUntyped.get('whatever'); - - // $ExpectType number - objTyped.get('example'); - - // @ts-expect-error - objTyped.get('other'); - } - - function testHas(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { - // $ExpectType boolean - objUntyped.has('whatever'); - - // $ExpectType boolean - objTyped.has('example'); - - // @ts-expect-error - objTyped.has('other'); - } - - function testIncrement(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { - // $ExpectType false | Object - objUntyped.increment('whatever'); - - // $ExpectType false | Object - objUntyped.increment('whatever', 10); - - // $ExpectType false | Object<{ example: number; }> - objTyped.increment('example'); - - // $ExpectType false | Object<{ example: number; }> - objTyped.increment('example', 20); - - // @ts-expect-error - objTyped.increment('example', true); - - // @ts-expect-error - objTyped.increment('other'); - } - - function testDecrement(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { - // $ExpectType false | Object - objUntyped.decrement('whatever'); - - // $ExpectType false | Object - objUntyped.decrement('whatever', 10); - - // $ExpectType false | Object<{ example: number; }> - objTyped.decrement('example'); - - // $ExpectType false | Object<{ example: number; }> - objTyped.decrement('example', 20); - - // @ts-expect-error - objTyped.decrement('example', true); - - // @ts-expect-error - objTyped.decrement('other'); - } - - function testNewInstance(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { - // $ExpectType Object - objUntyped.newInstance(); - - // $ExpectType Object<{ example: number; }> - objTyped.newInstance(); - } - - function testOp(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { - // $ExpectType any - objUntyped.op('whatever'); - - // $ExpectType any - objTyped.op('example'); - - // @ts-expect-error - objTyped.op('other'); - } - - function testRelation(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number; rel: Parse.Relation }>) { - // $ExpectType Relation, Object> - objUntyped.relation('whatever'); - - // $ExpectType Relation, Object>; }>, Object> - objTyped.relation('rel'); - - // @ts-expect-error - objTyped.relation('example'); - - // @ts-expect-error - objTyped.relation('other'); - } - - function testRemove(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { - // $ExpectType false | Object - objUntyped.remove('whatever', 'hello'); - - // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> - objTyped.remove('stringList', 'hello'); - - // @ts-expect-error - objTyped.remove('stringList', 100); - - // @ts-expect-error - objTyped.remove('thing', true); - - // @ts-expect-error - objTyped.remove('whatever', 'hello'); - } - - function testRemoveAll(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { - // $ExpectType false | Object - objUntyped.removeAll('whatever', ['hello', 100]); - - // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> - objTyped.removeAll('stringList', ['hello']); - - // @ts-expect-error - objTyped.removeAll('stringList', [100]); - - // @ts-expect-error - objTyped.removeAll('thing', [true]); - - // @ts-expect-error - objTyped.removeAll('whatever', ['hello']); - } - - function testRevert(objUntyped: Parse.Object, objTyped: Parse.Object<{ thingOne: number; thingTwo: boolean }>) { - // $ExpectType void - objUntyped.revert(); - - // $ExpectType void - objUntyped.revert('whatever', 'more whatever'); - - // $ExpectType void - objTyped.revert(); - - // $ExpectType void - objTyped.revert('thingOne', 'thingTwo'); - - // @ts-expect-error - objTyped.revert('other'); - } - interface ObjectAttributes { - example: boolean; - someString: string; - } - interface OptionalObjectAttributes { - example?: boolean | undefined; - another?: string | undefined; - } - - async function testSave( - objUntyped: Parse.Object, - objTyped: Parse.Object, - objTypedOptional: Parse.Object, - ) { - // $ExpectType Object - await objUntyped.save({ whatever: 100 }); - - // $ExpectType Object - await objUntyped.save('whatever', 100); - - // $ExpectType Object - await objTyped.save({ example: true }); - - // $ExpectType Object - await objTyped.save({ example: true, someString: 'hello' }); - - // @ts-expect-error - await objTyped.save({ example: 'hello', someString: true }); - - // $ExpectType Object - await objTyped.save('example', true); - - // @ts-expect-error - await objTyped.save({ example: 'hello' }); - - // @ts-expect-error - await objTyped.save({ wrongProp: 5 }); - - // @ts-expect-error - await objTyped.save('example', 10); - - // @ts-expect-error - await objTyped.save('wrongProp', true); - - // @ts-expect-error - await objTyped.save({ example: undefined }); - - // @ts-expect-error - await objTyped.save('example', undefined); - - // $ExpectType Object - await objTyped.save({}); - - // $ExpectType Object - await objTypedOptional.save({ example: undefined }); - - // $ExpectType Object - await objTypedOptional.save('example', undefined); - - // $ExpectType Object - await objTypedOptional.save({}); - - // $ExpectType Object - await objTypedOptional.saveEventually({}); - - // $ExpectType Object - await objTypedOptional.destroyEventually({}); - } - - function testSet( - objUntyped: Parse.Object, - objTyped: Parse.Object, - objTypedOptional: Parse.Object, - ) { - // $ExpectType false | Object - objUntyped.set('propA', 'some value'); - - // $ExpectType false | Object - objUntyped.set({ propA: undefined }); - - // $ExpectType false | Object - objTyped.set({ example: false }); - - // $ExpectType false | Object - objTyped.set({ example: true, someString: 'abc' }); - - // @ts-expect-error - objTyped.set({ example: 123, someString: 'abc' }); - - // $ExpectType false | Object - objTyped.set('example', true); - - // @ts-expect-error - objTyped.set({ example: 100 }); - - // @ts-expect-error - objTyped.set({ other: 'something' }); - - // @ts-expect-error - objTyped.set('example', 100); - - // @ts-expect-error - objTyped.set('other', 100); - - // @ts-expect-error - objTyped.set({ example: undefined }); - - // $ExpectType false | Object - objTyped.set({}); - - // @ts-expect-error - objTyped.set('example', undefined); - - // $ExpectType false | Object - objTypedOptional.set({ example: undefined }); - - // $ExpectType false | Object - objTypedOptional.set('example', undefined); - - // $ExpectType false | Object - objTypedOptional.set({}); - } - - interface AttributesAllTypes { - someString: string; - someNumber: number; - someBoolean: boolean; - someDate: Date; - someJSONObject: AttributesAllTypes; - someJSONArray: AttributesAllTypes[]; - someRegExp: RegExp; - someUndefined: undefined; - someNull: null; - someParseObjectUntyped: Parse.Object; - someParseObjectTyped: Parse.Object; - someParseACL: Parse.ACL; - someParseGeoPoint: Parse.GeoPoint; - someParsePolygon: Parse.Polygon; - someParseRelation: Parse.Relation; - someParseFile: Parse.File; - } - - function testToJSON(objUntyped: Parse.Object, objTyped: Parse.Object) { - // $ExpectType ToJSON & JSONBaseAttributes - const JSONUntyped = objUntyped.toJSON(); - // $ExpectType string - JSONUntyped.objectId; - // $ExpectType string - JSONUntyped.createdAt; - // $ExpectType string - JSONUntyped.updatedAt; - // $ExpectType any - JSONUntyped.anything; - - // $ExpectType ToJSON & JSONBaseAttributes - const JSONTyped = objTyped.toJSON(); - // $ExpectType string - JSONTyped.objectId; - // $ExpectType string - JSONTyped.createdAt; - // $ExpectType string - JSONTyped.updatedAt; - // $ExpectType string - JSONTyped.someString; - // $ExpectType number - JSONTyped.someNumber; - // $ExpectType boolean - JSONTyped.someBoolean; - // $ExpectType { __type: "Date"; iso: string; } - JSONTyped.someDate; - // $ExpectType ToJSON - JSONTyped.someJSONObject; - // $ExpectType ToJSON[] - JSONTyped.someJSONArray; - // $ExpectType string - JSONTyped.someRegExp; - // $ExpectType undefined - JSONTyped.someUndefined; - // $ExpectType null - JSONTyped.someNull; - // $ExpectType Pointer | (ToJSON & JSONBaseAttributes) - JSONTyped.someParseObjectUntyped; - // $ExpectType Pointer | (ToJSON & JSONBaseAttributes) - JSONTyped.someParseObjectTyped; - // $ExpectType any - JSONTyped.someParseACL; - // $ExpectType any - JSONTyped.someParseGeoPoint; - // $ExpectType any - JSONTyped.someParsePolygon; - // $ExpectType any - JSONTyped.someParseRelation; - // $ExpectType { __type: string; name: string; url: string; } - JSONTyped.someParseFile; - } - - function testUnset(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { - // $ExpectType false | Object - objUntyped.unset('whatever'); - - // $ExpectType false | Object<{ example: string; }> - objTyped.unset('example'); - - // @ts-expect-error - objTyped.unset('other'); - } - - function testValidate(obj: Parse.Object<{}>) { - // Note: The attributes being validated don't necessarily have to match the current object's attributes - - // $ExpectType false | Error - obj.validate({ someAttrToValidate: 'hello' }); - } - - function testNullableArrays( - objTyped: Parse.Object<{ stringList?: string[] | null }> - ) { - // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> - objTyped.add('stringList', 'foo'); - - // @ts-expect-error - objTyped.add('stringList', 4); - - // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> - objTyped.addAll('stringList', ['foo']); - - // @ts-expect-error - objTyped.addAll('stringList', [4]); - - // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> - objTyped.addAllUnique('stringList', ['foo', 'bar']); - - // @ts-expect-error - objTyped.addAllUnique('stringList', [4]); - - // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> - objTyped.addUnique('stringList', 'foo'); - - // @ts-expect-error - objTyped.addUnique('stringList', 4); - - // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> - objTyped.remove('stringList', 'bar'); - - // @ts-expect-error - objTyped.remove('stringList', 4); - - // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> - objTyped.removeAll('stringList', ['bar']); - - // @ts-expect-error - objTyped.removeAll('stringList', [4]); - } -} - -function testInstallation() { - function testConstructor() { - // $ExpectType Installation - new Parse.Installation(); - - // $ExpectType Installation<{ example: number; }> - new Parse.Installation({ example: 100 }); - - // @ts-expect-error - new Parse.Installation<{ example: number }>(); - - // @ts-expect-error - new Parse.Installation<{ example: number }>({ example: 'hello' }); - } -} - -function testQuery() { - function testConstructor() { - // $ExpectType Query> - new Parse.Query('TestObject'); - - // $ExpectType Query> - new Parse.Query(Parse.Role); - - // $ExpectType Query> - new Parse.Query(Parse.User); - - // $ExpectType Query> - new Parse.Query>('TestObject'); - - // $ExpectType Query> - new Parse.Query>(Parse.Role); - - // $ExpectType Query> - new Parse.Query>(Parse.User); - } - - async function testQueryMethodTypes() { - class AnotherSubClass extends Parse.Object<{ x: any }> { - constructor() { - super('Another', { x: 'example' }); - } - } - class MySubClass extends Parse.Object<{ - attribute1: string; - attribute2: number; - attribute3: AnotherSubClass; - attribute4: string[]; - }> {} - const query = new Parse.Query(MySubClass); - - // $ExpectType Query - query.addAscending(['attribute1', 'attribute2', 'updatedAt']); - // @ts-expect-error - query.addAscending(['attribute1', 'unexistenProp']); - - // $ExpectType Query - query.addDescending(['attribute1', 'attribute2', 'createdAt']); - // @ts-expect-error - query.addDescending(['attribute1', 'unexistenProp']); - - // $ExpectType Query - query.ascending(['attribute1', 'attribute2', 'objectId']); - // @ts-expect-error - query.ascending(['attribute1', 'nonexistentProp']); - - // $ExpectType Query - query.containedBy('attribute1', ['a', 'b', 'c']); - // $ExpectType Query - query.containedBy('attribute3', ['objectId1', 'objectId2', 'objectId3']); - // @ts-expect-error - query.containedBy('attribute2', ['a', 'b', 'c']); - // @ts-expect-error - query.containedBy('attribute1', [1, 2, 3]); - // @ts-expect-error - query.containedBy('nonexistentProp', ['a', 'b', 'c']); - - // $ExpectType Query - query.containedIn('attribute1', ['a', 'b', 'c']); - // $ExpectType Query - query.containedIn('attribute3', ['objectId1', 'objectId2', 'objectId3']); - // @ts-expect-error - query.containedIn('attribute2', ['a', 'b', 'c']); - // @ts-expect-error - query.containedIn('attribute1', [1, 2, 3]); - // @ts-expect-error - query.containedIn('nonexistentProp', ['a', 'b', 'c']); - - // $ExpectType Query - query.contains('attribute1', 'a substring'); - // @ts-expect-error - query.contains('nonexistentProp', 'a substring'); - - // $ExpectType Query - query.containsAll('attribute1', ['a', 'b', 'c']); - // @ts-expect-error - query.containsAll('nonexistentProp', ['a', 'b', 'c']); - - // $ExpectType Query - query.containsAllStartingWith('attribute1', ['a', 'b', 'c']); - // @ts-expect-error - query.containsAllStartingWith('nonexistentProp', ['a', 'b', 'c']); - - // $ExpectType Query - query.descending(['attribute1', 'attribute2', 'objectId']); - // @ts-expect-error - query.descending(['attribute1', 'nonexistentProp']); - - // $ExpectType Query - query.doesNotExist('attribute1'); - // @ts-expect-error - query.doesNotExist('nonexistentProp'); - - // $ExpectType Query - query.doesNotMatchKeyInQuery('attribute1', 'x', new Parse.Query(AnotherSubClass)); - // @ts-expect-error - query.doesNotMatchKeyInQuery('unexistenProp', 'x', new Parse.Query(AnotherSubClass)); - // @ts-expect-error - query.doesNotMatchKeyInQuery('attribute1', 'unknownKey', new Parse.Query(AnotherSubClass)); - // $ExpectType Query - query.doesNotMatchKeyInQuery('objectId', 'x', new Parse.Query(AnotherSubClass)); - // $ExpectType Query - query.doesNotMatchKeyInQuery('updatedAt', 'x', new Parse.Query(AnotherSubClass)); - - // $ExpectType Query - query.doesNotMatchQuery('attribute1', new Parse.Query('Example')); - // @ts-expect-error - query.doesNotMatchQuery('nonexistentProp', new Parse.Query('Example')); - - // $ExpectType Query - query.endsWith('attribute1', 'asuffixstring'); - // @ts-expect-error - query.endsWith('nonexistentProp', 'asuffixstring'); - - // $ExpectType Query - query.equalTo('attribute2', 0); - // $ExpectType Query - query.equalTo('attribute3', new AnotherSubClass()); - // $ExpectType Query - query.equalTo('attribute3', new AnotherSubClass().toPointer()); - // @ts-expect-error - query.equalTo('attribute1', new AnotherSubClass().toPointer()); - // @ts-expect-error - query.equalTo('attribute2', 'a string value'); - // @ts-expect-error - query.equalTo('nonexistentProp', 'any value'); - - // $ExpectType Query - query.equalTo('attribute4', 'a_string_value'); // Can query contents of array - // Can query array itself if equal too (mongodb $eq matches the array exactly or the contains an element that matches the array exactly) - // $ExpectType Query - query.equalTo('attribute4', ['a_string_value']); - - // $ExpectType Query - query.notEqualTo('attribute4', 'a_string_value'); - // $ExpectType Query - query.notEqualTo('attribute4', ['a_string_value']); - - // @ts-expect-error - query.equalTo('attribute4', 5); - // @ts-expect-error - query.notEqualTo('attribute4', 5); - // @ts-expect-error - query.equalTo('attribute4', [5]); - // @ts-expect-error - query.notEqualTo('attribute4', [5]); - - // $ExpectType Query - query.exists('attribute1'); - // @ts-expect-error - query.exists('nonexistentProp'); - - // $ExpectType Query - query.fullText('attribute1', 'full text'); - // @ts-expect-error - query.fullText('nonexistentProp', 'full text'); - - // $ExpectType Query - query.greaterThan('attribute2', 1000); - // @ts-expect-error - query.greaterThan('attribute2', '1000'); - // @ts-expect-error - query.greaterThan('nonexistentProp', 1000); - - // $ExpectType Query - query.greaterThanOrEqualTo('attribute2', 1000); - // @ts-expect-error - query.greaterThanOrEqualTo('attribute2', '1000'); - // @ts-expect-error - query.greaterThanOrEqualTo('nonexistentProp', 1000); - - // $ExpectType Query - query.include(['attribute1', 'attribute2']); - // $ExpectType Query - query.include('attribute3.someProp'); - // @ts-expect-error - query.include(['attribute1', 'nonexistentProp']); - - // $ExpectType Query - query.lessThan('attribute2', 1000); - // @ts-expect-error - query.lessThan('attribute2', '1000'); - // @ts-expect-error - query.lessThan('nonexistentProp', 1000); - - // $ExpectType Query - query.lessThanOrEqualTo('attribute2', 1000); - // @ts-expect-error - query.lessThanOrEqualTo('attribute2', '1000'); - // @ts-expect-error - query.lessThanOrEqualTo('nonexistentProp', 1000); - - // $ExpectType Query - query.matches('attribute1', /a regex/); - // @ts-expect-error - query.matches('nonexistentProp', /a regex/); - - // $ExpectType Query - query.matchesKeyInQuery('attribute1', 'x', new Parse.Query(AnotherSubClass)); - // @ts-expect-error - query.matchesKeyInQuery('nonexistentProp', 'x', new Parse.Query(AnotherSubClass)); - // @ts-expect-error - query.matchesKeyInQuery('attribute1', 'unknownKey', new Parse.Query(AnotherSubClass)); - - // $ExpectType Query - query.matchesQuery('attribute1', new Parse.Query('Example')); - // @ts-expect-error - query.matchesQuery('nonexistentProp', new Parse.Query('Example')); - - // $ExpectType Query - query.near('attribute1', new Parse.GeoPoint()); - // @ts-expect-error - query.near('nonexistentProp', new Parse.GeoPoint()); - - // $ExpectType Query - query.notContainedIn('attribute2', [1, 2, 3]); - // @ts-expect-error - query.notContainedIn('attribute2', ['1', '2', '3']); - // @ts-expect-error - query.notContainedIn('nonexistentProp', [1, 2, 3]); - - // $ExpectType Query - query.notEqualTo('attribute1', '1'); - // @ts-expect-error - query.notEqualTo('attribute1', 1); - // @ts-expect-error - query.notEqualTo('nonexistentProp', 1); - - // $ExpectType Query - query.polygonContains('attribute1', new Parse.GeoPoint()); - // @ts-expect-error - query.polygonContains('nonexistentProp', new Parse.GeoPoint()); - - // $ExpectType Query - query.select('attribute1', 'attribute2'); - // @ts-expect-error - query.select('attribute1', 'nonexistentProp'); - - // $ExpectType Query - query.startsWith('attribute1', 'prefix string'); - // @ts-expect-error - query.startsWith('nonexistentProp', 'prefix string'); - - // $ExpectType Query - query.withCount(true); - - // $ExpectType Query - query.withinGeoBox('attribute1', new Parse.GeoPoint(), new Parse.GeoPoint()); - // @ts-expect-error - query.withinGeoBox('nonexistentProp', new Parse.GeoPoint(), new Parse.GeoPoint()); - - // $ExpectType Query - query.withinKilometers('attribute1', new Parse.GeoPoint(), 100); - // @ts-expect-error - query.withinKilometers('nonexistentProp', new Parse.GeoPoint(), 100); - - // $ExpectType Query - query.withinMiles('attribute1', new Parse.GeoPoint(), 100); - // @ts-expect-error - query.withinMiles('nonexistentProp', new Parse.GeoPoint(), 100); - - // $ExpectType Query - query.withinPolygon('attribute1', [ - [12.3, 45.6], - [-78.9, 10.1], - ]); - // @ts-expect-error - query.withinPolygon('nonexistentProp', [ - [12.3, 45.6], - [-78.9, 10.1], - ]); - - // $ExpectType Query - query.withinRadians('attribute1', new Parse.GeoPoint(), 100); - // @ts-expect-error - query.withinRadians('nonexistentProp', new Parse.GeoPoint(), 100); - } - - async function testQueryMethods( - queryUntyped: Parse.Query, - queryTyped: Parse.Query>, - ) { - // $ExpectType Object - await queryUntyped.get('objectId'); - - // $ExpectType Object[] - await queryUntyped.find(); - - // $ExpectType string[] - await queryTyped.distinct('example'); - - // $ExpectType Object | undefined - await queryUntyped.first(); - - // $ExpectType Object<{ example: string; }> - await queryTyped.get('objectId'); - - // $ExpectType Object<{ example: string; }>[] - await queryTyped.find(); - - // $ExpectType Object<{ example: string; }> | undefined - await queryTyped.first(); - } -} - -function testRole() { - function testConstructor(acl: Parse.ACL) { - // $ExpectType Role> - new Parse.Role<{ example: string }>('TestRole', acl); - } - - function testAttributes(roleUntyped: Parse.Role, roleTyped: Parse.Role<{ example: number }>) { - // $ExpectType Attributes - roleUntyped.attributes; - - // $ExpectType { example: number; } - roleTyped.attributes; - } -} - -function testSession() { - function testConstructor() { - // $ExpectType Session - new Parse.Session(); - - // $ExpectType Session<{ example: number; }> - new Parse.Session({ example: 100 }); - - // @ts-expect-error - new Parse.Session<{ example: number }>(); - - // @ts-expect-error - new Parse.Session<{ example: number }>({ example: 'hello' }); - } -} - -function testUser() { - function testConstructor() { - // $ExpectType User - new Parse.User(); - - // $ExpectType User<{ example: number; }> - new Parse.User({ example: 100 }); - - // @ts-expect-error - new Parse.User<{ example: number }>(); - - // @ts-expect-error - new Parse.User<{ example: number }>({ example: 'hello' }); - } - async function testAuthenticationProvider() { - const authProvider: Parse.AuthProvider = { - authenticate: () => {}, - getAuthType: () => 'customAuthorizationProvider', - restoreAuthentication: () => false, - deauthenticate: () => {}, - }; - const authData: Parse.AuthData = { - id: 'some-user-authentication-id', - access_token: 'some-access-token', - expiration_date: new Date().toISOString(), - }; - Parse.User._registerAuthenticationProvider(authProvider); - - const user = await Parse.User.logInWith( - authProvider, - { authData }, - { sessionToken: 'some-session-token', useMasterKey: true }, - ); - const isLinked = user._isLinked(authProvider); - const unlinkedUser = await user._unlinkFrom(authProvider); - const linkedUser = await user.linkWith(authProvider, { authData }); - } -} - -function testEncryptingUser() { - function testSecretKey() { - Parse.secret = 'secret!'; - } - - function testEnableEncryptedUserKey() { - Parse.encryptedUser = true; - } - - function testEnablingEncryptedUser() { - Parse.enableEncryptedUser(); - } - - function testIsEncryptedUserEnabled() { - Parse.isEncryptedUserEnabled(); - } -} - -function testEventuallyQueue() { - function test() { - const obj = new Parse.Object('TestObject'); - // $ExpectType Promise - Parse.EventuallyQueue.clear(); - // $ExpectType Promise - Parse.EventuallyQueue.getQueue(); - // $ExpectType boolean - Parse.EventuallyQueue.isPolling(); - // $ExpectType Promise - Parse.EventuallyQueue.save(obj); - // $ExpectType Promise - Parse.EventuallyQueue.save(obj, {}); - // $ExpectType Promise - Parse.EventuallyQueue.destroy(obj); - // $ExpectType Promise - Parse.EventuallyQueue.destroy(obj, {}); - // $ExpectType Promise - Parse.EventuallyQueue.length(); - // $ExpectType Promise - Parse.EventuallyQueue.sendQueue(); - // $ExpectType void - Parse.EventuallyQueue.stopPoll(); - // $ExpectType void - Parse.EventuallyQueue.poll(); - // $ExpectType void - Parse.EventuallyQueue.poll(300); - // @ts-expect-error - Parse.EventuallyQueue.poll('300'); - } -} - -function LiveQueryEvents() { - function testLiveQueryEvents() { - Parse.LiveQuery.on('open', () => { - }); - Parse.LiveQuery.on('close', () => { - }); - Parse.LiveQuery.on('error', (error) => { - }); - } -} diff --git a/types/tsconfig.json b/types/tsconfig.json deleted file mode 100644 index cb4026e9d..000000000 --- a/types/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": ["es6", "dom"], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "node.d.ts", - "react-native.d.ts", - "tests.ts" - ], - "exclude": [ - "node_modules" - ] - } \ No newline at end of file diff --git a/types/tslint.json b/types/tslint.json deleted file mode 100644 index f0e511597..000000000 --- a/types/tslint.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "dtslint/dtslint.json", - "rules": { - "ban-types": false, - "no-unnecessary-generics": false, - "no-redundant-jsdoc": false - } -} \ No newline at end of file diff --git a/types/types.d.ts b/types/types.d.ts new file mode 100644 index 000000000..46480c90c --- /dev/null +++ b/types/types.d.ts @@ -0,0 +1,1637 @@ +declare module "Analytics" { + /** + * Parse.Analytics provides an interface to Parse's logging and analytics + * backend. + * + * @class Parse.Analytics + * @static + * @hideconstructor + */ + /** + * Tracks the occurrence of a custom event with additional dimensions. + * Parse will store a data point at the time of invocation with the given + * event name. + * + * Dimensions will allow segmentation of the occurrences of this custom + * event. Keys and values should be {@code String}s, and will throw + * otherwise. + * + * To track a user signup along with additional metadata, consider the + * following: + *
+     * var dimensions = {
+     *  gender: 'm',
+     *  source: 'web',
+     *  dayType: 'weekend'
+     * };
+     * Parse.Analytics.track('signup', dimensions);
+     * 
+ * + * There is a default limit of 8 dimensions per event tracked. + * + * @function track + * @name Parse.Analytics.track + * @param {string} name The name of the custom event to report to Parse as + * having happened. + * @param {object} dimensions The dictionary of information by which to + * segment this event. + * @returns {Promise} A promise that is resolved when the round-trip + * to the server completes. + */ + export function track(name: string, dimensions: { + [key: string]: string; + }): Promise; +} +declare module "ParseOp" { + import ParseObject from "ParseObject"; + import ParseRelation from './ParseRelation'; + export function opFromJSON(json: { + [key: string]: any; + }): Op | null; + export class Op { + applyTo(value: any): any; + mergeWith(previous: Op): Op | void; + toJSON(offline?: boolean): any; + } + export class SetOp extends Op { + _value?: any; + constructor(value: any); + applyTo(): any; + mergeWith(): SetOp; + toJSON(offline?: boolean): any; + } + export class UnsetOp extends Op { + applyTo(): undefined; + mergeWith(): UnsetOp; + toJSON(): { + __op: string; + }; + } + export class IncrementOp extends Op { + _amount: number; + constructor(amount: number); + applyTo(value?: any): number; + mergeWith(previous: Op): Op; + toJSON(): { + __op: string; + amount: number; + }; + } + export class AddOp extends Op { + _value: Array; + constructor(value: any | Array); + applyTo(value: any): Array; + mergeWith(previous: Op): Op; + toJSON(): { + __op: string; + objects: any; + }; + } + export class AddUniqueOp extends Op { + _value: Array; + constructor(value: any | Array); + applyTo(value: any | Array): Array; + mergeWith(previous: Op): Op; + toJSON(): { + __op: string; + objects: any; + }; + } + export class RemoveOp extends Op { + _value: Array; + constructor(value: any | Array); + applyTo(value: any | Array): Array; + mergeWith(previous: Op): Op; + toJSON(): { + __op: string; + objects: any; + }; + } + export class RelationOp extends Op { + _targetClassName?: string | null; + relationsToAdd: Array; + relationsToRemove: Array; + constructor(adds: Array, removes: Array); + _extractId(obj: string | ParseObject): string; + applyTo(value: any, object?: { + className: string; + id?: string; + }, key?: string): ParseRelation | undefined; + mergeWith(previous: Op): Op; + toJSON(): { + __op?: string; + objects?: any; + ops?: any; + }; + } +} +declare module "ParseObject" { + import ParseACL from './ParseACL'; + import ParseError from './ParseError'; + import { Op } from "ParseOp"; + import ParseRelation from './ParseRelation'; + import type { AttributeMap, OpsMap } from "ObjectStateMutations"; + import type { RequestOptions, FullOptions } from './RESTController'; + export type Pointer = { + __type: string; + className: string; + objectId?: string; + _localId?: string; + }; + type SaveParams = { + method: string; + path: string; + body: AttributeMap; + }; + export type SaveOptions = FullOptions & { + cascadeSave?: boolean; + context?: AttributeMap; + }; + /** + * Creates a new model with defined attributes. + * + *

You won't normally call this method directly. It is recommended that + * you use a subclass of Parse.Object instead, created by calling + * extend.

+ * + *

However, if you don't want to use a subclass, or aren't sure which + * subclass is appropriate, you can use this form:

+     *     var object = new Parse.Object("ClassName");
+     * 
+ * That is basically equivalent to:
+     *     var MyClass = Parse.Object.extend("ClassName");
+     *     var object = new MyClass();
+     * 

+ * + * @alias Parse.Object + */ + class ParseObject { + /** + * @param {string} className The class name for the object + * @param {object} attributes The initial set of data to store in the object. + * @param {object} options The options for this object instance. + */ + constructor(className?: string | { + className: string; + [attr: string]: any; + }, attributes?: { + [attr: string]: any; + }, options?: { + ignoreValidation: boolean; + } | { + [attr: string]: any; + }); + /** + * The ID of this object, unique within its class. + * + * @property {string} id + */ + id?: string; + _localId?: string; + _objCount: number; + className: string; + _initializers?: ((...args: Array) => void)[]; + get attributes(): AttributeMap; + /** + * The first time this object was saved on the server. + * + * @property {Date} createdAt + * @returns {Date} + */ + get createdAt(): Date | null | undefined; + /** + * The last time this object was updated on the server. + * + * @property {Date} updatedAt + * @returns {Date} + */ + get updatedAt(): Date | null | undefined; + /** + * Returns a local or server Id used uniquely identify this object + * + * @returns {string} + */ + _getId(): string; + /** + * Returns a unique identifier used to pull data from the State Controller. + * + * @returns {Parse.Object|object} + */ + _getStateIdentifier(): ParseObject | { + id: string; + className: string; + }; + _getServerData(): AttributeMap; + _clearServerData(): void; + _getPendingOps(): Array; + /** + * @param {Array} [keysToClear] - if specified, only ops matching + * these fields will be cleared + */ + _clearPendingOps(keysToClear?: Array): void; + _getDirtyObjectAttributes(): AttributeMap; + _toFullJSON(seen?: Array, offline?: boolean): AttributeMap; + _getSaveJSON(): AttributeMap; + _getSaveParams(): SaveParams; + _finishFetch(serverData: AttributeMap): void; + _setExisted(existed: boolean): void; + _migrateId(serverId: string): void; + _handleSaveResponse(response: AttributeMap, status: number): void; + _handleSaveError(): void; + static _getClassMap(): {}; + initialize(): void; + /** + * Returns a JSON version of the object suitable for saving to Parse. + * + * @param seen + * @param offline + * @returns {object} + */ + toJSON(seen: Array | void, offline?: boolean): AttributeMap; + /** + * Determines whether this ParseObject is equal to another ParseObject + * + * @param {object} other - An other object ot compare + * @returns {boolean} + */ + equals(other: any): boolean; + /** + * Returns true if this object has been modified since its last + * save/refresh. If an attribute is specified, it returns true only if that + * particular attribute has been modified since the last save/refresh. + * + * @param {string} attr An attribute name (optional). + * @returns {boolean} + */ + dirty(attr?: string): boolean; + /** + * Returns an array of keys that have been modified since last save/refresh + * + * @returns {string[]} + */ + dirtyKeys(): Array; + /** + * Returns true if the object has been fetched. + * + * @returns {boolean} + */ + isDataAvailable(): boolean; + /** + * Gets a Pointer referencing this Object. + * + * @returns {Pointer} + */ + toPointer(): Pointer; + /** + * Gets a Pointer referencing this Object. + * + * @returns {Pointer} + */ + toOfflinePointer(): Pointer; + /** + * Gets the value of an attribute. + * + * @param {string} attr The string name of an attribute. + * @returns {*} + */ + get(attr: string): any; + /** + * Gets a relation on the given class for the attribute. + * + * @param {string} attr The attribute to get the relation for. + * @returns {Parse.Relation} + */ + relation(attr: string): ParseRelation; + /** + * Gets the HTML-escaped value of an attribute. + * + * @param {string} attr The string name of an attribute. + * @returns {string} + */ + escape(attr: string): string; + /** + * Returns true if the attribute contains a value that is not + * null or undefined. + * + * @param {string} attr The string name of the attribute. + * @returns {boolean} + */ + has(attr: string): boolean; + /** + * Sets a hash of model attributes on the object. + * + *

You can call it with an object containing keys and values, with one + * key and value, or dot notation. For example:

+         *   gameTurn.set({
+         *     player: player1,
+         *     diceRoll: 2
+         *   }, {
+         *     error: function(gameTurnAgain, error) {
+         *       // The set failed validation.
+         *     }
+         *   });
+         *
+         *   game.set("currentPlayer", player2, {
+         *     error: function(gameTurnAgain, error) {
+         *       // The set failed validation.
+         *     }
+         *   });
+         *
+         *   game.set("finished", true);

+ * + * game.set("player.score", 10);

+ * + * @param {(string|object)} key The key to set. + * @param {(string|object)} value The value to give it. + * @param {object} options A set of options for the set. + * The only supported option is error. + * @returns {(ParseObject|boolean)} true if the set succeeded. + */ + set(key: any, value?: any, options?: any): ParseObject | boolean; + /** + * Remove an attribute from the model. This is a noop if the attribute doesn't + * exist. + * + * @param {string} attr The string name of an attribute. + * @param options + * @returns {(ParseObject | boolean)} + */ + unset(attr: string, options?: { + [opt: string]: any; + }): ParseObject | boolean; + /** + * Atomically increments the value of the given attribute the next time the + * object is saved. If no amount is specified, 1 is used by default. + * + * @param attr {String} The key. + * @param amount {Number} The amount to increment by (optional). + * @returns {(ParseObject|boolean)} + */ + increment(attr: string, amount?: number): ParseObject | boolean; + /** + * Atomically decrements the value of the given attribute the next time the + * object is saved. If no amount is specified, 1 is used by default. + * + * @param attr {String} The key. + * @param amount {Number} The amount to decrement by (optional). + * @returns {(ParseObject | boolean)} + */ + decrement(attr: string, amount?: number): ParseObject | boolean; + /** + * Atomically add an object to the end of the array associated with a given + * key. + * + * @param attr {String} The key. + * @param item {} The item to add. + * @returns {(ParseObject | boolean)} + */ + add(attr: string, item: any): ParseObject | boolean; + /** + * Atomically add the objects to the end of the array associated with a given + * key. + * + * @param attr {String} The key. + * @param items {Object[]} The items to add. + * @returns {(ParseObject | boolean)} + */ + addAll(attr: string, items: Array): ParseObject | boolean; + /** + * Atomically add an object to the array associated with a given key, only + * if it is not already present in the array. The position of the insert is + * not guaranteed. + * + * @param attr {String} The key. + * @param item {} The object to add. + * @returns {(ParseObject | boolean)} + */ + addUnique(attr: string, item: any): ParseObject | boolean; + /** + * Atomically add the objects to the array associated with a given key, only + * if it is not already present in the array. The position of the insert is + * not guaranteed. + * + * @param attr {String} The key. + * @param items {Object[]} The objects to add. + * @returns {(ParseObject | boolean)} + */ + addAllUnique(attr: string, items: Array): ParseObject | boolean; + /** + * Atomically remove all instances of an object from the array associated + * with a given key. + * + * @param attr {String} The key. + * @param item {} The object to remove. + * @returns {(ParseObject | boolean)} + */ + remove(attr: string, item: any): ParseObject | boolean; + /** + * Atomically remove all instances of the objects from the array associated + * with a given key. + * + * @param attr {String} The key. + * @param items {Object[]} The object to remove. + * @returns {(ParseObject | boolean)} + */ + removeAll(attr: string, items: Array): ParseObject | boolean; + /** + * Returns an instance of a subclass of Parse.Op describing what kind of + * modification has been performed on this field since the last time it was + * saved. For example, after calling object.increment("x"), calling + * object.op("x") would return an instance of Parse.Op.Increment. + * + * @param attr {String} The key. + * @returns {Parse.Op | undefined} The operation, or undefined if none. + */ + op(attr: string): Op | null | undefined; + /** + * Creates a new model with identical attributes to this one. + * + * @returns {Parse.Object} + */ + clone(): any; + /** + * Creates a new instance of this object. Not to be confused with clone() + * + * @returns {Parse.Object} + */ + newInstance(): any; + /** + * Returns true if this object has never been saved to Parse. + * + * @returns {boolean} + */ + isNew(): boolean; + /** + * Returns true if this object was created by the Parse server when the + * object might have already been there (e.g. in the case of a Facebook + * login) + * + * @returns {boolean} + */ + existed(): boolean; + /** + * Returns true if this object exists on the Server + * + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @returns {Promise} A boolean promise that is fulfilled if object exists. + */ + exists(options?: RequestOptions): Promise; + /** + * Checks if the model is currently in a valid state. + * + * @returns {boolean} + */ + isValid(): boolean; + /** + * You should not call this function directly unless you subclass + * Parse.Object, in which case you can override this method + * to provide additional validation on set and + * save. Your implementation should return + * + * @param {object} attrs The current data to validate. + * @returns {Parse.Error|boolean} False if the data is valid. An error object otherwise. + * @see Parse.Object#set + */ + validate(attrs: AttributeMap): ParseError | boolean; + /** + * Returns the ACL for this object. + * + * @returns {Parse.ACL} An instance of Parse.ACL. + * @see Parse.Object#get + */ + getACL(): ParseACL | null; + /** + * Sets the ACL to be used for this object. + * + * @param {Parse.ACL} acl An instance of Parse.ACL. + * @param {object} options + * @returns {(ParseObject | boolean)} Whether the set passed validation. + * @see Parse.Object#set + */ + setACL(acl: ParseACL, options?: any): ParseObject | boolean; + /** + * Clears any (or specific) changes to this object made since the last call to save() + * + * @param {string} [keys] - specify which fields to revert + */ + revert(...keys: Array): void; + /** + * Clears all attributes on a model + * + * @returns {(ParseObject | boolean)} + */ + clear(): ParseObject | boolean; + /** + * Fetch the model from the server. If the server's representation of the + * model differs from its current attributes, they will be overriden. + * + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • include: The name(s) of the key(s) to include. Can be a string, an array of strings, + * or an array of array of strings. + *
  • context: A dictionary that is accessible in Cloud Code `beforeFind` trigger. + *
+ * @returns {Promise} A promise that is fulfilled when the fetch + * completes. + */ + fetch(options: RequestOptions): Promise; + /** + * Fetch the model from the server. If the server's representation of the + * model differs from its current attributes, they will be overriden. + * + * Includes nested Parse.Objects for the provided key. You can use dot + * notation to specify which fields in the included object are also fetched. + * + * @param {string | Array>} keys The name(s) of the key(s) to include. + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @returns {Promise} A promise that is fulfilled when the fetch + * completes. + */ + fetchWithInclude(keys: String | Array>, options: RequestOptions): Promise; + /** + * Saves this object to the server at some unspecified time in the future, + * even if Parse is currently inaccessible. + * + * Use this when you may not have a solid network connection, and don't need to know when the save completes. + * If there is some problem with the object such that it can't be saved, it will be silently discarded. + * + * Objects saved with this method will be stored locally in an on-disk cache until they can be delivered to Parse. + * They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection is + * available. Objects saved this way will persist even after the app is closed, in which case they will be sent the + * next time the app is opened. + * + * @param {object} [options] + * Used to pass option parameters to method if arg1 and arg2 were both passed as strings. + * Valid options are: + *
    + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • cascadeSave: If `false`, nested objects will not be saved (default is `true`). + *
  • context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers. + *
+ * @returns {Promise} A promise that is fulfilled when the save + * completes. + */ + saveEventually(options: SaveOptions): Promise; + /** + * Set a hash of model attributes, and save the model to the server. + * updatedAt will be updated when the request returns. + * You can either call it as:
+         * object.save();
+ * or
+         * object.save(attrs);
+ * or
+         * object.save(null, options);
+ * or
+         * object.save(attrs, options);
+ * or
+         * object.save(key, value);
+ * or
+         * object.save(key, value, options);
+ * + * Example 1:
+         * gameTurn.save({
+         * player: "Jake Cutter",
+         * diceRoll: 2
+         * }).then(function(gameTurnAgain) {
+         * // The save was successful.
+         * }, function(error) {
+         * // The save failed.  Error is an instance of Parse.Error.
+         * });
+ * + * Example 2:
+         * gameTurn.save("player", "Jake Cutter");
+ * + * @param {string | object | null} [arg1] + * Valid options are:
    + *
  • `Object` - Key/value pairs to update on the object.
  • + *
  • `String` Key - Key of attribute to update (requires arg2 to also be string)
  • + *
  • `null` - Passing null for arg1 allows you to save the object with options passed in arg2.
  • + *
+ * @param {string | object} [arg2] + *
    + *
  • `String` Value - If arg1 was passed as a key, arg2 is the value that should be set on that key.
  • + *
  • `Object` Options - Valid options are: + *
      + *
    • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
    • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
    • cascadeSave: If `false`, nested objects will not be saved (default is `true`). + *
    • context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers. + *
    + *
  • + *
+ * @param {object} [arg3] + * Used to pass option parameters to method if arg1 and arg2 were both passed as strings. + * Valid options are: + *
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • cascadeSave: If `false`, nested objects will not be saved (default is `true`). + *
  • context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers. + *
+ * @returns {Promise} A promise that is fulfilled when the save + * completes. + */ + save(arg1: { + [attr: string]: any; + } | undefined | null, arg2: SaveOptions | any, arg3?: SaveOptions): Promise; + /** + * Deletes this object from the server at some unspecified time in the future, + * even if Parse is currently inaccessible. + * + * Use this when you may not have a solid network connection, + * and don't need to know when the delete completes. If there is some problem with the object + * such that it can't be deleted, the request will be silently discarded. + * + * Delete instructions made with this method will be stored locally in an on-disk cache until they can be transmitted + * to Parse. They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection + * is available. Delete requests will persist even after the app is closed, in which case they will be sent the + * next time the app is opened. + * + * @param {object} [options] + * Valid options are:
    + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers. + *
+ * @returns {Promise} A promise that is fulfilled when the destroy + * completes. + */ + destroyEventually(options: RequestOptions): Promise; + /** + * Destroy this model on the server if it was already persisted. + * + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers. + *
+ * @returns {Promise} A promise that is fulfilled when the destroy + * completes. + */ + destroy(options: RequestOptions): Promise; + /** + * Asynchronously stores the object and every object it points to in the local datastore, + * recursively, using a default pin name: _default. + * + * If those other objects have not been fetched from Parse, they will not be stored. + * However, if they have changed data, all the changes will be retained. + * + *
+         * await object.pin();
+         * 
+ * + * To retrieve object: + * query.fromLocalDatastore() or query.fromPin() + * + * @returns {Promise} A promise that is fulfilled when the pin completes. + */ + pin(): Promise; + /** + * Asynchronously removes the object and every object it points to in the local datastore, + * recursively, using a default pin name: _default. + * + *
+         * await object.unPin();
+         * 
+ * + * @returns {Promise} A promise that is fulfilled when the unPin completes. + */ + unPin(): Promise; + /** + * Asynchronously returns if the object is pinned + * + *
+         * const isPinned = await object.isPinned();
+         * 
+ * + * @returns {Promise} A boolean promise that is fulfilled if object is pinned. + */ + isPinned(): Promise; + /** + * Asynchronously stores the objects and every object they point to in the local datastore, recursively. + * + * If those other objects have not been fetched from Parse, they will not be stored. + * However, if they have changed data, all the changes will be retained. + * + *
+         * await object.pinWithName(name);
+         * 
+ * + * To retrieve object: + * query.fromLocalDatastore() or query.fromPinWithName(name) + * + * @param {string} name Name of Pin. + * @returns {Promise} A promise that is fulfilled when the pin completes. + */ + pinWithName(name: string): Promise; + /** + * Asynchronously removes the object and every object it points to in the local datastore, recursively. + * + *
+         * await object.unPinWithName(name);
+         * 
+ * + * @param {string} name Name of Pin. + * @returns {Promise} A promise that is fulfilled when the unPin completes. + */ + unPinWithName(name: string): Promise; + /** + * Asynchronously loads data from the local datastore into this object. + * + *
+         * await object.fetchFromLocalDatastore();
+         * 
+ * + * You can create an unfetched pointer with Parse.Object.createWithoutData() + * and then call fetchFromLocalDatastore() on it. + * + * @returns {Promise} A promise that is fulfilled when the fetch completes. + */ + fetchFromLocalDatastore(): Promise; + static _clearAllState(): void; + /** + * Fetches the given list of Parse.Object. + * If any error is encountered, stops and calls the error handler. + * + *
+         *   Parse.Object.fetchAll([object1, object2, ...])
+         *    .then((list) => {
+         *      // All the objects were fetched.
+         *    }, (error) => {
+         *      // An error occurred while fetching one of the objects.
+         *    });
+         * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • include: The name(s) of the key(s) to include. Can be a string, an array of strings, + * or an array of array of strings. + *
+ * @static + * @returns {Parse.Object[]} + */ + static fetchAll(list: Array, options?: RequestOptions): any; + /** + * Fetches the given list of Parse.Object. + * + * Includes nested Parse.Objects for the provided key. You can use dot + * notation to specify which fields in the included object are also fetched. + * + * If any error is encountered, stops and calls the error handler. + * + *
+         *   Parse.Object.fetchAllWithInclude([object1, object2, ...], [pointer1, pointer2, ...])
+         *    .then((list) => {
+         *      // All the objects were fetched.
+         *    }, (error) => {
+         *      // An error occurred while fetching one of the objects.
+         *    });
+         * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {string | Array>} keys The name(s) of the key(s) to include. + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @static + * @returns {Parse.Object[]} + */ + static fetchAllWithInclude(list: Array, keys: String | Array>, options: RequestOptions): any; + /** + * Fetches the given list of Parse.Object if needed. + * If any error is encountered, stops and calls the error handler. + * + * Includes nested Parse.Objects for the provided key. You can use dot + * notation to specify which fields in the included object are also fetched. + * + * If any error is encountered, stops and calls the error handler. + * + *
+         *   Parse.Object.fetchAllIfNeededWithInclude([object1, object2, ...], [pointer1, pointer2, ...])
+         *    .then((list) => {
+         *      // All the objects were fetched.
+         *    }, (error) => {
+         *      // An error occurred while fetching one of the objects.
+         *    });
+         * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {string | Array>} keys The name(s) of the key(s) to include. + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @static + * @returns {Parse.Object[]} + */ + static fetchAllIfNeededWithInclude(list: Array, keys: String | Array>, options: RequestOptions): any; + /** + * Fetches the given list of Parse.Object if needed. + * If any error is encountered, stops and calls the error handler. + * + *
+         *   Parse.Object.fetchAllIfNeeded([object1, ...])
+         *    .then((list) => {
+         *      // Objects were fetched and updated.
+         *    }, (error) => {
+         *      // An error occurred while fetching one of the objects.
+         *    });
+         * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {object} options + * @static + * @returns {Parse.Object[]} + */ + static fetchAllIfNeeded(list: Array, options?: RequestOptions): any; + static handleIncludeOptions(options: any): string[]; + /** + * Destroy the given list of models on the server if it was already persisted. + * + *

Unlike saveAll, if an error occurs while deleting an individual model, + * this method will continue trying to delete the rest of the models if + * possible, except in the case of a fatal error like a connection error. + * + *

In particular, the Parse.Error object returned in the case of error may + * be one of two types: + * + *

    + *
  • A Parse.Error.AGGREGATE_ERROR. This object's "errors" property is an + * array of other Parse.Error objects. Each error object in this array + * has an "object" property that references the object that could not be + * deleted (for instance, because that object could not be found).
  • + *
  • A non-aggregate Parse.Error. This indicates a serious error that + * caused the delete operation to be aborted partway through (for + * instance, a connection failure in the middle of the delete).
  • + *
+ * + *
+         * Parse.Object.destroyAll([object1, object2, ...])
+         * .then((list) => {
+         * // All the objects were deleted.
+         * }, (error) => {
+         * // An error occurred while deleting one or more of the objects.
+         * // If this is an aggregate error, then we can inspect each error
+         * // object individually to determine the reason why a particular
+         * // object was not deleted.
+         * if (error.code === Parse.Error.AGGREGATE_ERROR) {
+         * for (var i = 0; i < error.errors.length; i++) {
+         * console.log("Couldn't delete " + error.errors[i].object.id +
+         * "due to " + error.errors[i].message);
+         * }
+         * } else {
+         * console.log("Delete aborted because of " + error.message);
+         * }
+         * });
+         * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled when the destroyAll + * completes. + */ + static destroyAll(list: Array, options?: RequestOptions): any; + /** + * Saves the given list of Parse.Object. + * If any error is encountered, stops and calls the error handler. + * + *
+         * Parse.Object.saveAll([object1, object2, ...])
+         * .then((list) => {
+         * // All the objects were saved.
+         * }, (error) => {
+         * // An error occurred while saving one of the objects.
+         * });
+         * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {object} options + * @static + * @returns {Parse.Object[]} + */ + static saveAll(list: Array, options?: RequestOptions): any; + /** + * Creates a reference to a subclass of Parse.Object with the given id. This + * does not exist on Parse.Object, only on subclasses. + * + *

A shortcut for:

+         *  var Foo = Parse.Object.extend("Foo");
+         *  var pointerToFoo = new Foo();
+         *  pointerToFoo.id = "myObjectId";
+         * 
+ * + * @param {string} id The ID of the object to create a reference to. + * @static + * @returns {Parse.Object} A Parse.Object reference. + */ + static createWithoutData(id: string): ParseObject; + /** + * Creates a new instance of a Parse Object from a JSON representation. + * + * @param {object} json The JSON map of the Object's data + * @param {boolean} override In single instance mode, all old server data + * is overwritten if this is set to true + * @param {boolean} dirty Whether the Parse.Object should set JSON keys to dirty + * @static + * @returns {Parse.Object} A Parse.Object reference + */ + static fromJSON(json: any, override?: boolean, dirty?: boolean): any; + /** + * Registers a subclass of Parse.Object with a specific class name. + * When objects of that class are retrieved from a query, they will be + * instantiated with this subclass. + * This is only necessary when using ES6 subclassing. + * + * @param {string} className The class name of the subclass + * @param {Function} constructor The subclass + */ + static registerSubclass(className: string, constructor: any): void; + /** + * Unegisters a subclass of Parse.Object with a specific class name. + * + * @param {string} className The class name of the subclass + */ + static unregisterSubclass(className: string): void; + /** + * Creates a new subclass of Parse.Object for the given Parse class name. + * + *

Every extension of a Parse class will inherit from the most recent + * previous extension of that class. When a Parse.Object is automatically + * created by parsing JSON, it will use the most recent extension of that + * class.

+ * + *

You should call either:

+         *     var MyClass = Parse.Object.extend("MyClass", {
+         *         Instance methods,
+         *         initialize: function(attrs, options) {
+         *             this.someInstanceProperty = [],
+         *             Other instance properties
+         *         }
+         *     }, {
+         *         Class properties
+         *     });
+ * or, for Backbone compatibility:
+         *     var MyClass = Parse.Object.extend({
+         *         className: "MyClass",
+         *         Instance methods,
+         *         initialize: function(attrs, options) {
+         *             this.someInstanceProperty = [],
+         *             Other instance properties
+         *         }
+         *     }, {
+         *         Class properties
+         *     });

+ * + * @param {string} className The name of the Parse class backing this model. + * @param {object} protoProps Instance properties to add to instances of the + * class returned from this method. + * @param {object} classProps Class properties to add the class returned from + * this method. + * @returns {Parse.Object} A new subclass of Parse.Object. + */ + static extend(className: any, protoProps: any, classProps: any): any; + /** + * Enable single instance objects, where any local objects with the same Id + * share the same attributes, and stay synchronized with each other. + * This is disabled by default in server environments, since it can lead to + * security issues. + * + * @static + */ + static enableSingleInstance(): void; + /** + * Disable single instance objects, where any local objects with the same Id + * share the same attributes, and stay synchronized with each other. + * When disabled, you can have two instances of the same object in memory + * without them sharing attributes. + * + * @static + */ + static disableSingleInstance(): void; + /** + * Asynchronously stores the objects and every object they point to in the local datastore, + * recursively, using a default pin name: _default. + * + * If those other objects have not been fetched from Parse, they will not be stored. + * However, if they have changed data, all the changes will be retained. + * + *
+         * await Parse.Object.pinAll([...]);
+         * 
+ * + * To retrieve object: + * query.fromLocalDatastore() or query.fromPin() + * + * @param {Array} objects A list of Parse.Object. + * @returns {Promise} A promise that is fulfilled when the pin completes. + * @static + */ + static pinAll(objects: Array): Promise; + /** + * Asynchronously stores the objects and every object they point to in the local datastore, recursively. + * + * If those other objects have not been fetched from Parse, they will not be stored. + * However, if they have changed data, all the changes will be retained. + * + *
+         * await Parse.Object.pinAllWithName(name, [obj1, obj2, ...]);
+         * 
+ * + * To retrieve object: + * query.fromLocalDatastore() or query.fromPinWithName(name) + * + * @param {string} name Name of Pin. + * @param {Array} objects A list of Parse.Object. + * @returns {Promise} A promise that is fulfilled when the pin completes. + * @static + */ + static pinAllWithName(name: string, objects: Array): Promise; + /** + * Asynchronously removes the objects and every object they point to in the local datastore, + * recursively, using a default pin name: _default. + * + *
+         * await Parse.Object.unPinAll([...]);
+         * 
+ * + * @param {Array} objects A list of Parse.Object. + * @returns {Promise} A promise that is fulfilled when the unPin completes. + * @static + */ + static unPinAll(objects: Array): Promise; + /** + * Asynchronously removes the objects and every object they point to in the local datastore, recursively. + * + *
+         * await Parse.Object.unPinAllWithName(name, [obj1, obj2, ...]);
+         * 
+ * + * @param {string} name Name of Pin. + * @param {Array} objects A list of Parse.Object. + * @returns {Promise} A promise that is fulfilled when the unPin completes. + * @static + */ + static unPinAllWithName(name: string, objects: Array): Promise; + /** + * Asynchronously removes all objects in the local datastore using a default pin name: _default. + * + *
+         * await Parse.Object.unPinAllObjects();
+         * 
+ * + * @returns {Promise} A promise that is fulfilled when the unPin completes. + * @static + */ + static unPinAllObjects(): Promise; + /** + * Asynchronously removes all objects with the specified pin name. + * Deletes the pin name also. + * + *
+         * await Parse.Object.unPinAllObjectsWithName(name);
+         * 
+ * + * @param {string} name Name of Pin. + * @returns {Promise} A promise that is fulfilled when the unPin completes. + * @static + */ + static unPinAllObjectsWithName(name: string): Promise; + } + export default ParseObject; +} +declare module "ObjectStateMutations" { + import TaskQueue from './TaskQueue'; + import type { Op } from "ParseOp"; + export type AttributeMap = { + [attr: string]: any; + }; + export type OpsMap = { + [attr: string]: Op; + }; + export type ObjectCache = { + [attr: string]: string; + }; + export type State = { + serverData: AttributeMap; + pendingOps: Array; + objectCache: ObjectCache; + tasks: TaskQueue; + existed: boolean; + }; + export function defaultState(): State; + export function setServerData(serverData: AttributeMap, attributes: AttributeMap): void; + export function setPendingOp(pendingOps: Array, attr: string, op?: Op): void; + export function pushPendingState(pendingOps: Array): void; + export function popPendingState(pendingOps: Array): OpsMap | undefined; + export function mergeFirstPendingState(pendingOps: Array): void; + export function estimateAttribute(serverData: AttributeMap, pendingOps: Array, className: string, id: string | undefined, attr: string): any; + export function estimateAttributes(serverData: AttributeMap, pendingOps: Array, className: string, id?: string): AttributeMap; + export function commitServerChanges(serverData: AttributeMap, objectCache: ObjectCache, changes: AttributeMap): void; +} +declare module "ParseUser" { + import ParseObject from "ParseObject"; + import type { AttributeMap } from "ObjectStateMutations"; + import type { RequestOptions, FullOptions } from './RESTController'; + import type { SaveOptions } from "ParseObject"; + export type AuthData = { + [key: string]: any; + } | undefined | null; + export type AuthProvider = { + restoreAuthentication(authData: any): boolean; + getAuthType(): boolean; + getAuthData(): { + authData: { + [key: string]: any; + }; + }; + }; + /** + *

A Parse.User object is a local representation of a user persisted to the + * Parse cloud. This class is a subclass of a Parse.Object, and retains the + * same functionality of a Parse.Object, but also extends it with various + * user specific methods, like authentication, signing up, and validation of + * uniqueness.

+ * + * @alias Parse.User + * @augments Parse.Object + */ + class ParseUser extends ParseObject { + /** + * @param {object} attributes The initial set of data to store in the user. + */ + constructor(attributes?: AttributeMap); + /** + * Request a revocable session token to replace the older style of token. + * + * @param {object} options + * @returns {Promise} A promise that is resolved when the replacement + * token has been fetched. + */ + _upgradeToRevocableSession(options: RequestOptions): Promise; + /** + * Parse allows you to link your users with {@link https://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication 3rd party authentication}, enabling + * your users to sign up or log into your application using their existing identities. + * Since 2.9.0 + * + * @see {@link https://docs.parseplatform.org/js/guide/#linking-users Linking Users} + * @param {string | AuthProvider} provider Name of auth provider or {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider} + * @param {object} options + *
    + *
  • If provider is string, options is {@link http://docs.parseplatform.org/parse-server/guide/#supported-3rd-party-authentications authData} + *
  • If provider is AuthProvider, options is saveOpts + *
+ * @param {object} saveOpts useMasterKey / sessionToken + * @returns {Promise} A promise that is fulfilled with the user is linked + */ + linkWith(provider: any, options: { + authData?: AuthData; + }, saveOpts?: FullOptions): Promise; + /** + * @param provider + * @param options + * @param saveOpts + * @deprecated since 2.9.0 see {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith} + * @returns {Promise} + */ + _linkWith(provider: any, options: { + authData?: AuthData; + }, saveOpts?: FullOptions): Promise; + /** + * Synchronizes auth data for a provider (e.g. puts the access token in the + * right place to be used by the Facebook SDK). + * + * @param provider + */ + _synchronizeAuthData(provider: string | AuthProvider): void; + /** + * Synchronizes authData for all providers. + */ + _synchronizeAllAuthData(): void; + /** + * Removes null values from authData (which exist temporarily for unlinking) + */ + _cleanupAuthData(): void; + /** + * Unlinks a user from a service. + * + * @param {string | AuthProvider} provider Name of auth provider or {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider} + * @param {object} options MasterKey / SessionToken + * @returns {Promise} A promise that is fulfilled when the unlinking + * finishes. + */ + _unlinkFrom(provider: any, options?: FullOptions): Promise; + /** + * Checks whether a user is linked to a service. + * + * @param {object} provider service to link to + * @returns {boolean} true if link was successful + */ + _isLinked(provider: any): boolean; + /** + * Deauthenticates all providers. + */ + _logOutWithAll(): void; + /** + * Deauthenticates a single provider (e.g. removing access tokens from the + * Facebook SDK). + * + * @param {object} provider service to logout of + */ + _logOutWith(provider: any): void; + /** + * Class instance method used to maintain specific keys when a fetch occurs. + * Used to ensure that the session token is not lost. + * + * @returns {object} sessionToken + */ + _preserveFieldsOnFetch(): AttributeMap; + /** + * Returns true if current would return this user. + * + * @returns {boolean} true if user is cached on disk + */ + isCurrent(): boolean; + /** + * Returns true if current would return this user. + * + * @returns {Promise} true if user is cached on disk + */ + isCurrentAsync(): Promise; + /** + * Returns get("username"). + * + * @returns {string} + */ + getUsername(): string | null | undefined; + /** + * Calls set("username", username, options) and returns the result. + * + * @param {string} username + */ + setUsername(username: string): void; + /** + * Calls set("password", password, options) and returns the result. + * + * @param {string} password User's Password + */ + setPassword(password: string): void; + /** + * Returns get("email"). + * + * @returns {string} User's Email + */ + getEmail(): string | null | undefined; + /** + * Calls set("email", email) and returns the result. + * + * @param {string} email + * @returns {boolean} + */ + setEmail(email: string): boolean | ParseObject; + /** + * Returns the session token for this user, if the user has been logged in, + * or if it is the result of a query with the master key. Otherwise, returns + * undefined. + * + * @returns {string} the session token, or undefined + */ + getSessionToken(): string | undefined | null; + /** + * Checks whether this user is the current user and has been authenticated. + * + * @returns {boolean} whether this user is the current user and is logged in. + */ + authenticated(): boolean; + /** + * Signs up a new user. You should call this instead of save for + * new Parse.Users. This will create a new Parse.User on the server, and + * also persist the session on disk so that you can access the user using + * current. + * + *

A username and password must be set before calling signUp.

+ * + * @param {object} attrs Extra fields to set on the new user, or null. + * @param {object} options + * @returns {Promise} A promise that is fulfilled when the signup + * finishes. + */ + signUp(attrs: AttributeMap, options?: FullOptions): Promise; + /** + * Logs in a Parse.User. On success, this saves the session to disk, + * so you can retrieve the currently logged in user using + * current. + * + *

A username and password must be set before calling logIn.

+ * + * @param {object} options + * @returns {Promise} A promise that is fulfilled with the user when + * the login is complete. + */ + logIn(options?: FullOptions): Promise; + /** + * Wrap the default save behavior with functionality to save to local + * storage if this is current user. + * + * @param {...any} arg1 + * @returns {Promise} + */ + save(arg1: { + [attr: string]: any; + } | undefined | null, arg2: SaveOptions | any, arg3?: SaveOptions): Promise; + /** + * Wrap the default destroy behavior with functionality that logs out + * the current user when it is destroyed + * + * @param {...any} options + * @returns {Parse.User} + */ + destroy(options: RequestOptions): Promise; + /** + * Wrap the default fetch behavior with functionality to save to local + * storage if this is current user. + * + * @param {...any} options + * @returns {Parse.User} + */ + fetch(options: RequestOptions): Promise; + /** + * Wrap the default fetchWithInclude behavior with functionality to save to local + * storage if this is current user. + * + * @param {...any} keys + * @returns {Parse.User} + */ + fetchWithInclude(keys: String | Array>, options: RequestOptions): Promise; + /** + * Verify whether a given password is the password of the current user. + * + * @param {string} password A password to be verified + * @param {object} options + * @returns {Promise} A promise that is fulfilled with a user + * when the password is correct. + */ + verifyPassword(password: string, options?: RequestOptions): Promise; + static readOnlyAttributes(): string[]; + /** + * Adds functionality to the existing Parse.User class. + * + * @param {object} protoProps A set of properties to add to the prototype + * @param {object} classProps A set of static properties to add to the class + * @static + * @returns {Parse.User} The newly extended Parse.User class + */ + static extend(protoProps: { + [prop: string]: any; + }, classProps: { + [prop: string]: any; + }): typeof ParseUser; + /** + * Retrieves the currently logged in ParseUser with a valid session, + * either from memory or localStorage, if necessary. + * + * @static + * @returns {Parse.Object} The currently logged in Parse.User. + */ + static current(): ParseUser | null | undefined; + /** + * Retrieves the currently logged in ParseUser from asynchronous Storage. + * + * @static + * @returns {Promise} A Promise that is resolved with the currently + * logged in Parse User + */ + static currentAsync(): Promise; + /** + * Signs up a new user with a username (or email) and password. + * This will create a new Parse.User on the server, and also persist the + * session in localStorage so that you can access the user using + * {@link #current}. + * + * @param {string} username The username (or email) to sign up with. + * @param {string} password The password to sign up with. + * @param {object} attrs Extra fields to set on the new user. + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled with the user when + * the signup completes. + */ + static signUp(username: string, password: string, attrs: AttributeMap, options?: FullOptions): Promise; + /** + * Logs in a user with a username (or email) and password. On success, this + * saves the session to disk, so you can retrieve the currently logged in + * user using current. + * + * @param {string} username The username (or email) to log in with. + * @param {string} password The password to log in with. + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled with the user when + * the login completes. + */ + static logIn(username: string, password: string, options?: FullOptions): Promise; + /** + * Logs in a user with an objectId. On success, this saves the session + * to disk, so you can retrieve the currently logged in user using + * current. + * + * @param {string} userId The objectId for the user. + * @static + * @returns {Promise} A promise that is fulfilled with the user when + * the login completes. + */ + static loginAs(userId: string): any; + /** + * Logs in a user with a session token. On success, this saves the session + * to disk, so you can retrieve the currently logged in user using + * current. + * + * @param {string} sessionToken The sessionToken to log in with. + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled with the user when + * the login completes. + */ + static become(sessionToken: string, options?: RequestOptions): any; + /** + * Retrieves a user with a session token. + * + * @param {string} sessionToken The sessionToken to get user with. + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled with the user is fetched. + */ + static me(sessionToken: string, options?: RequestOptions): any; + /** + * Logs in a user with a session token. On success, this saves the session + * to disk, so you can retrieve the currently logged in user using + * current. If there is no session token the user will not logged in. + * + * @param {object} userJSON The JSON map of the User's data + * @static + * @returns {Promise} A promise that is fulfilled with the user when + * the login completes. + */ + static hydrate(userJSON: AttributeMap): any; + /** + * Static version of {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith} + * + * @param provider + * @param options + * @param saveOpts + * @static + * @returns {Promise} + */ + static logInWith(provider: any, options: { + authData?: AuthData; + }, saveOpts?: FullOptions): Promise; + /** + * Logs out the currently logged in user session. This will remove the + * session from disk, log out of linked services, and future calls to + * current will return null. + * + * @param {object} options + * @static + * @returns {Promise} A promise that is resolved when the session is + * destroyed on the server. + */ + static logOut(options?: RequestOptions): any; + /** + * Requests a password reset email to be sent to the specified email address + * associated with the user account. This email allows the user to securely + * reset their password on the Parse site. + * + * @param {string} email The email address associated with the user that + * forgot their password. + * @param {object} options + * @static + * @returns {Promise} + */ + static requestPasswordReset(email: string, options?: RequestOptions): any; + /** + * Request an email verification. + * + * @param {string} email The email address associated with the user that + * needs to verify their email. + * @param {object} options + * @static + * @returns {Promise} + */ + static requestEmailVerification(email: string, options?: RequestOptions): any; + /** + * Verify whether a given password is the password of the current user. + * + * @param {string} username A username to be used for identificaiton + * @param {string} password A password to be verified + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled with a user + * when the password is correct. + */ + static verifyPassword(username: string, password: string, options?: RequestOptions): any; + /** + * Allow someone to define a custom User class without className + * being rewritten to _User. The default behavior is to rewrite + * User to _User for legacy reasons. This allows developers to + * override that behavior. + * + * @param {boolean} isAllowed Whether or not to allow custom User class + * @static + */ + static allowCustomUserClass(isAllowed: boolean): void; + /** + * Allows a legacy application to start using revocable sessions. If the + * current session token is not revocable, a request will be made for a new, + * revocable session. + * It is not necessary to call this method from cloud code unless you are + * handling user signup or login from the server side. In a cloud code call, + * this function will not attempt to upgrade the current token. + * + * @param {object} options + * @static + * @returns {Promise} A promise that is resolved when the process has + * completed. If a replacement session token is requested, the promise + * will be resolved after a new token has been fetched. + */ + static enableRevocableSession(options?: RequestOptions): Promise; + /** + * Enables the use of become or the current user in a server + * environment. These features are disabled by default, since they depend on + * global objects that are not memory-safe for most servers. + * + * @static + */ + static enableUnsafeCurrentUser(): void; + /** + * Disables the use of become or the current user in any environment. + * These features are disabled on servers by default, since they depend on + * global objects that are not memory-safe for most servers. + * + * @static + */ + static disableUnsafeCurrentUser(): void; + /** + * When registering users with {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith} a basic auth provider + * is automatically created for you. + * + * For advanced authentication, you can register an Auth provider to + * implement custom authentication, deauthentication. + * + * @param provider + * @see {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider} + * @see {@link https://docs.parseplatform.org/js/guide/#custom-authentication-module Custom Authentication Module} + * @static + */ + static _registerAuthenticationProvider(provider: any): void; + /** + * @param provider + * @param options + * @param saveOpts + * @deprecated since 2.9.0 see {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#logInWith logInWith} + * @static + * @returns {Promise} + */ + static _logInWith(provider: any, options: { + authData?: AuthData; + }, saveOpts?: FullOptions): Promise; + static _clearCache(): void; + static _setCurrentUserCache(user: ParseUser | undefined | null): void; + } + export default ParseUser; +} From ff9170dcd4a045aee868968033795b0587bdc0b4 Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 30 Jun 2023 19:02:44 +1000 Subject: [PATCH 03/10] wip --- .github/workflows/ci.yml | 2 +- package-lock.json | 2961 ++++++++++++-------- package.json | 8 +- src/Analytics.ts | 1 + src/Parse.js | 343 --- src/Parse.ts | 449 +++ src/{ParseGeoPoint.js => ParseGeoPoint.ts} | 2 +- src/ParseObject.ts | 6 +- src/ParseOp.ts | 2 +- src/{ParseQuery.js => ParseQuery.ts} | 116 +- src/{ParseRelation.js => ParseRelation.ts} | 13 +- tsconfig.json | 17 +- types/Analytics.d.ts | 45 + types/ObjectStateMutations.d.ts | 30 + types/Parse.d.ts | 74 + types/ParseGeoPoint.d.ts | 97 + types/ParseObject.d.ts | 1012 +++++++ types/ParseOp.d.ts | 84 + types/ParseQuery.d.ts | 924 ++++++ types/ParseRelation.d.ts | 59 + types/ParseUser.d.ts | 471 ++++ types/index.d.ts | 2 + types/tests.ts | 6 + types/tsconfig.json | 22 + types/tslint.json | 10 + types/types.d.ts | 1637 ----------- 26 files changed, 5081 insertions(+), 3312 deletions(-) delete mode 100644 src/Parse.js create mode 100644 src/Parse.ts rename src/{ParseGeoPoint.js => ParseGeoPoint.ts} (99%) rename src/{ParseQuery.js => ParseQuery.ts} (96%) rename src/{ParseRelation.js => ParseRelation.ts} (93%) create mode 100644 types/Analytics.d.ts create mode 100644 types/ObjectStateMutations.d.ts create mode 100644 types/Parse.d.ts create mode 100644 types/ParseGeoPoint.d.ts create mode 100644 types/ParseObject.d.ts create mode 100644 types/ParseOp.d.ts create mode 100644 types/ParseQuery.d.ts create mode 100644 types/ParseRelation.d.ts create mode 100644 types/ParseUser.d.ts create mode 100644 types/index.d.ts create mode 100644 types/tests.ts create mode 100644 types/tsconfig.json create mode 100644 types/tslint.json delete mode 100644 types/types.d.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e866bd3f..4a3cb6873 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Check types - - run: npm run test:types + run: npm run test:types build: runs-on: ubuntu-latest timeout-minutes: 30 diff --git a/package-lock.json b/package-lock.json index 84cdb39f6..ce43e6a97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,8 @@ "license": "Apache-2.0", "dependencies": { "@babel/runtime-corejs3": "7.22.3", + "@definitelytyped/dtslint": "^0.0.163", + "dts-gen": "^0.6.1", "idb-keyval": "6.2.1", "react-native-crypto-js": "1.0.0", "uuid": "9.0.0", @@ -42,7 +44,6 @@ "codecov": "3.8.3", "core-js": "3.30.2", "cross-env": "7.0.2", - "dtslint": "4.1.3", "eslint": "8.40.0", "eslint-plugin-flowtype": "8.0.3", "eslint-plugin-jsdoc": "43.0.7", @@ -2247,11 +2248,286 @@ "kuler": "^2.0.0" } }, + "node_modules/@definitelytyped/dts-critic": { + "version": "0.0.163", + "resolved": "https://registry.npmjs.org/@definitelytyped/dts-critic/-/dts-critic-0.0.163.tgz", + "integrity": "sha512-HsTvylj8x2gQaawsOCcN2Xk2Cx0wgV9kaj83hgsO9SITZSPd7dA0UkHyNRadbMkMwqNDKcnizcmWdz0+0gIo8A==", + "dependencies": { + "@definitelytyped/header-parser": "^0.0.163", + "command-exists": "^1.2.8", + "rimraf": "^3.0.2", + "semver": "^6.2.0", + "tmp": "^0.2.1", + "yargs": "^15.3.1" + }, + "engines": { + "node": ">=10.17.0" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/@definitelytyped/dts-critic/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@definitelytyped/dts-critic/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/@definitelytyped/dts-critic/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@definitelytyped/dts-critic/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/@definitelytyped/dts-critic/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@definitelytyped/dts-critic/node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + }, + "node_modules/@definitelytyped/dts-critic/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@definitelytyped/dts-critic/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "node_modules/@definitelytyped/dts-critic/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@definitelytyped/dts-critic/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@definitelytyped/dtslint": { + "version": "0.0.163", + "resolved": "https://registry.npmjs.org/@definitelytyped/dtslint/-/dtslint-0.0.163.tgz", + "integrity": "sha512-U0uw7Zu0QdYSuBMYgxvRYjkhkeulTEg8vDgJ7TiYQUv/wODeujSAmGahQn51E5hOlSMYUw7A9utdbUukxE02SQ==", + "dependencies": { + "@definitelytyped/dts-critic": "^0.0.163", + "@definitelytyped/header-parser": "^0.0.163", + "@definitelytyped/typescript-versions": "^0.0.163", + "@definitelytyped/utils": "^0.0.163", + "@typescript-eslint/eslint-plugin": "^5.55.0", + "@typescript-eslint/parser": "^5.55.0", + "@typescript-eslint/types": "^5.56.0", + "@typescript-eslint/typescript-estree": "^5.55.0", + "@typescript-eslint/utils": "^5.55.0", + "eslint": "^8.17.0", + "fs-extra": "^6.0.1", + "json-stable-stringify": "^1.0.1", + "strip-json-comments": "^2.0.1", + "tslint": "5.14.0", + "yargs": "^15.1.0" + }, + "bin": { + "dtslint": "dist/index.js" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "typescript": ">= 3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.7.0-dev || >= 3.8.0-dev || >= 3.9.0-dev || >= 4.0.0-dev || >=5.0.0-dev" + } + }, + "node_modules/@definitelytyped/dtslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@definitelytyped/dtslint/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/@definitelytyped/dtslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@definitelytyped/dtslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/@definitelytyped/dtslint/node_modules/fs-extra": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", + "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "node_modules/@definitelytyped/dtslint/node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@definitelytyped/dtslint/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/@definitelytyped/dtslint/node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + }, + "node_modules/@definitelytyped/dtslint/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@definitelytyped/dtslint/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "node_modules/@definitelytyped/dtslint/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@definitelytyped/dtslint/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/@definitelytyped/header-parser": { "version": "0.0.163", "resolved": "https://registry.npmjs.org/@definitelytyped/header-parser/-/header-parser-0.0.163.tgz", "integrity": "sha512-Jr+/q+ESfc7uWldz/j11BfpjIN/gB4WmwhFENhWaMwM0W/9p0ShF+OiUqGhk2Q3Iz8v/oyWzSsxyxgasg9kCxQ==", - "dev": true, "dependencies": { "@definitelytyped/typescript-versions": "^0.0.163", "@types/parsimmon": "^1.10.1", @@ -2261,14 +2537,12 @@ "node_modules/@definitelytyped/typescript-versions": { "version": "0.0.163", "resolved": "https://registry.npmjs.org/@definitelytyped/typescript-versions/-/typescript-versions-0.0.163.tgz", - "integrity": "sha512-+GWtJhC+7UaCUnJ+ZkA7bfGuPd6ZbJKEjbHqh76/gOXsqAUOMEa49ufsLlIPUbkEeQlnDNoTHCegE5X/Q+u+/A==", - "dev": true + "integrity": "sha512-+GWtJhC+7UaCUnJ+ZkA7bfGuPd6ZbJKEjbHqh76/gOXsqAUOMEa49ufsLlIPUbkEeQlnDNoTHCegE5X/Q+u+/A==" }, "node_modules/@definitelytyped/utils": { "version": "0.0.163", "resolved": "https://registry.npmjs.org/@definitelytyped/utils/-/utils-0.0.163.tgz", "integrity": "sha512-6MX5TxaQbG/j2RkCWbcbLvv+YNipKqY0eQJafDhwC/RprUocpg+uYVNlH8XzdKRWOGJ0pq7SZOsJD4C3A01ZXg==", - "dev": true, "dependencies": { "@definitelytyped/typescript-versions": "^0.0.163", "@qiwi/npm-registry-client": "^8.9.1", @@ -2283,14 +2557,12 @@ "node_modules/@definitelytyped/utils/node_modules/@types/node": { "version": "14.18.51", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.51.tgz", - "integrity": "sha512-P9bsdGFPpVtofEKlhWMVS2qqx1A/rt9QBfihWlklfHHpUpjtYse5AzFz6j4DWrARLYh6gRnw9+5+DJcrq3KvBA==", - "dev": true + "integrity": "sha512-P9bsdGFPpVtofEKlhWMVS2qqx1A/rt9QBfihWlklfHHpUpjtYse5AzFz6j4DWrARLYh6gRnw9+5+DJcrq3KvBA==" }, "node_modules/@definitelytyped/utils/node_modules/fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -2304,7 +2576,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -2313,7 +2584,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, "engines": { "node": ">= 4.0.0" } @@ -2395,7 +2665,6 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, "dependencies": { "eslint-visitor-keys": "^3.3.0" }, @@ -2410,7 +2679,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.1.tgz", "integrity": "sha512-BISJ6ZE4xQsuL/FmsyRaiffpq977bMlsKfGHTQrOGFErfByxIe6iZTxPf/00Zon9b9a7iUykfQwejN3s2ZW/Bw==", - "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } @@ -2419,7 +2687,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", - "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -2441,14 +2708,12 @@ "node_modules/@eslint/eslintrc/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "13.20.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, "dependencies": { "type-fest": "^0.20.2" }, @@ -2463,7 +2728,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, "dependencies": { "argparse": "^2.0.1" }, @@ -2475,7 +2739,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, "engines": { "node": ">=8" }, @@ -2487,7 +2750,6 @@ "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, "engines": { "node": ">=10" }, @@ -2499,7 +2761,6 @@ "version": "8.40.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.40.0.tgz", "integrity": "sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==", - "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -2657,7 +2918,6 @@ "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", - "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -2671,7 +2931,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, "engines": { "node": ">=12.22" }, @@ -2683,8 +2942,7 @@ "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" }, "node_modules/@isaacs/cliui": { "version": "8.0.2", @@ -3790,7 +4048,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -3803,7 +4060,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, "engines": { "node": ">= 8" } @@ -3812,7 +4068,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -4344,7 +4599,6 @@ "version": "8.9.1", "resolved": "https://registry.npmjs.org/@qiwi/npm-registry-client/-/npm-registry-client-8.9.1.tgz", "integrity": "sha512-rZF+mG+NfijR0SHphhTLHRr4aM4gtfdwoAMY6we2VGQam8vkN1cxGG1Lg/Llrj8Dd0Mu6VjdFQRyMMRZxtZR2A==", - "dev": true, "dependencies": { "concat-stream": "^2.0.0", "graceful-fs": "^4.2.4", @@ -4366,7 +4620,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", - "dev": true, "engines": [ "node >= 6.0" ], @@ -4381,7 +4634,6 @@ "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", - "dev": true, "engines": { "node": ">= 4" } @@ -4390,7 +4642,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -4764,6 +5015,11 @@ "parse5": "^7.0.0" } }, + "node_modules/@types/json-schema": { + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==" + }, "node_modules/@types/jsonwebtoken": { "version": "8.5.9", "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", @@ -4828,8 +5084,7 @@ "node_modules/@types/parsimmon": { "version": "1.10.6", "resolved": "https://registry.npmjs.org/@types/parsimmon/-/parsimmon-1.10.6.tgz", - "integrity": "sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA==", - "dev": true + "integrity": "sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA==" }, "node_modules/@types/prettier": { "version": "2.7.2", @@ -4855,6 +5110,11 @@ "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", "dev": true }, + "node_modules/@types/semver": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==" + }, "node_modules/@types/serve-static": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", @@ -4918,6 +5178,285 @@ "@types/node": "*" } }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.60.1.tgz", + "integrity": "sha512-KSWsVvsJsLJv3c4e73y/Bzt7OpqMCADUO846bHcuWYSYM19bldbAeDv7dYyV0jwkbMfJ2XdlzwjhXtuD7OY6bw==", + "dependencies": { + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.60.1", + "@typescript-eslint/type-utils": "5.60.1", + "@typescript-eslint/utils": "5.60.1", + "debug": "^4.3.4", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.60.1.tgz", + "integrity": "sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q==", + "dependencies": { + "@typescript-eslint/scope-manager": "5.60.1", + "@typescript-eslint/types": "5.60.1", + "@typescript-eslint/typescript-estree": "5.60.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.60.1.tgz", + "integrity": "sha512-Dn/LnN7fEoRD+KspEOV0xDMynEmR3iSHdgNsarlXNLGGtcUok8L4N71dxUgt3YvlO8si7E+BJ5Fe3wb5yUw7DQ==", + "dependencies": { + "@typescript-eslint/types": "5.60.1", + "@typescript-eslint/visitor-keys": "5.60.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.60.1.tgz", + "integrity": "sha512-vN6UztYqIu05nu7JqwQGzQKUJctzs3/Hg7E2Yx8rz9J+4LgtIDFWjjl1gm3pycH0P3mHAcEUBd23LVgfrsTR8A==", + "dependencies": { + "@typescript-eslint/typescript-estree": "5.60.1", + "@typescript-eslint/utils": "5.60.1", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@typescript-eslint/type-utils/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.60.1.tgz", + "integrity": "sha512-zDcDx5fccU8BA0IDZc71bAtYIcG9PowaOwaD8rjYbqwK7dpe/UMQl3inJ4UtUK42nOCT41jTSCwg76E62JpMcg==", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.1.tgz", + "integrity": "sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==", + "dependencies": { + "@typescript-eslint/types": "5.60.1", + "@typescript-eslint/visitor-keys": "5.60.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.60.1.tgz", + "integrity": "sha512-tiJ7FFdFQOWssFa3gqb94Ilexyw0JVxj6vBzaSpfN/8IhoKkDuSAenUKvsSHw2A/TMpJb26izIszTXaqygkvpQ==", + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.60.1", + "@typescript-eslint/types": "5.60.1", + "@typescript-eslint/typescript-estree": "5.60.1", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.1.tgz", + "integrity": "sha512-xEYIxKcultP6E/RMKqube11pGjXH1DCo60mQoWhVYyKfLkwbIVVjYxmOenNMxILx0TjCujPTjjnTIVzm09TXIw==", + "dependencies": { + "@typescript-eslint/types": "5.60.1", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@xmldom/xmldom": { "version": "0.8.6", "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.6.tgz", @@ -4968,7 +5507,6 @@ "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -5011,7 +5549,6 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -5065,7 +5602,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -5205,7 +5741,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -5214,7 +5749,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -5384,7 +5918,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true + "devOptional": true }, "node_modules/archy": { "version": "1.0.0", @@ -5405,7 +5939,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "dev": true, + "devOptional": true, "dependencies": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" @@ -5415,7 +5949,7 @@ "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, + "devOptional": true, "dependencies": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -5430,7 +5964,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, + "devOptional": true, "dependencies": { "safe-buffer": "~5.1.0" } @@ -5439,7 +5973,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -5617,7 +6150,6 @@ "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" } @@ -5644,7 +6176,6 @@ "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dev": true, "dependencies": { "safer-buffer": "~2.1.0" } @@ -5690,7 +6221,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true, "engines": { "node": ">=0.8" } @@ -5782,8 +6312,7 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "node_modules/atob": { "version": "2.1.2", @@ -5813,7 +6342,6 @@ "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true, "engines": { "node": "*" } @@ -5821,14 +6349,12 @@ "node_modules/aws4": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" }, "node_modules/babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==", - "dev": true, "dependencies": { "chalk": "^1.1.3", "esutils": "^2.0.2", @@ -5839,7 +6365,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -5848,7 +6373,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -5857,7 +6381,6 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, "dependencies": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", @@ -5872,14 +6395,12 @@ "node_modules/babel-code-frame/node_modules/js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==", - "dev": true + "integrity": "sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==" }, "node_modules/babel-code-frame/node_modules/strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, "dependencies": { "ansi-regex": "^2.0.0" }, @@ -5891,7 +6412,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -6197,8 +6717,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base": { "version": "0.11.2", @@ -6272,7 +6791,6 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, "funding": [ { "type": "github", @@ -6301,7 +6819,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, "dependencies": { "tweetnacl": "^0.14.3" } @@ -6341,7 +6858,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -6352,7 +6868,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, "funding": [ { "type": "github", @@ -6439,7 +6954,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6449,7 +6963,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -6844,8 +7357,7 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "node_modules/buffer-writer": { "version": "2.0.0", @@ -6878,7 +7390,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -6892,8 +7403,7 @@ "node_modules/builtins": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", - "integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==", - "dev": true + "integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==" }, "node_modules/busboy": { "version": "1.6.0", @@ -6959,7 +7469,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, "engines": { "node": ">=6" } @@ -6968,7 +7477,6 @@ "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true, "engines": { "node": ">=6" } @@ -7022,8 +7530,7 @@ "node_modules/caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, "node_modules/catharsis": { "version": "0.9.0", @@ -7056,7 +7563,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -7079,7 +7585,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/charm/-/charm-1.0.2.tgz", "integrity": "sha512-wqW3VdPnlSWT4eRiYX+hcs+C6ViBPUWk1qTCd+37qw9kEm/a5n2qcyQDMBWvSYKN/ctqZzeXNQaeBjOetJJUkw==", - "dev": true, "dependencies": { "inherits": "^2.0.1" } @@ -7661,7 +8166,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -7746,7 +8250,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -7754,8 +8257,7 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "node_modules/color-string": { "version": "1.9.1", @@ -7823,7 +8325,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -7834,8 +8335,7 @@ "node_modules/command-exists": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", - "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", - "dev": true + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==" }, "node_modules/commander": { "version": "10.0.0", @@ -7874,8 +8374,7 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "node_modules/concat-stream": { "version": "1.6.2", @@ -7942,7 +8441,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", - "dev": true + "devOptional": true }, "node_modules/constants-browserify": { "version": "1.0.0", @@ -8232,7 +8731,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true + "devOptional": true }, "node_modules/cors": { "version": "2.8.5", @@ -8337,7 +8836,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -8464,7 +8962,6 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, "dependencies": { "assert-plus": "^1.0.0" }, @@ -8551,7 +9048,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -8568,7 +9064,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -8867,8 +9362,7 @@ "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "node_modules/deepcopy": { "version": "2.1.0", @@ -9079,7 +9573,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -9088,7 +9581,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", - "dev": true + "devOptional": true }, "node_modules/denque": { "version": "2.1.0", @@ -9383,7 +9876,6 @@ "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true, "engines": { "node": ">=0.3.1" } @@ -9418,7 +9910,6 @@ "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" }, @@ -9439,7 +9930,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, "dependencies": { "esutils": "^2.0.2" }, @@ -9628,299 +10118,278 @@ "node": ">=4" } }, - "node_modules/dts-critic": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/dts-critic/-/dts-critic-3.3.11.tgz", - "integrity": "sha512-HMO2f9AO7ge44YO8OK18f+cxm/IaE1CFuyNFbfJRCEbyazWj5X5wWDF6W4CGdo5Ax0ILYVfJ7L/rOwuUN1fzWw==", - "dev": true, + "node_modules/dts-dom": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/dts-dom/-/dts-dom-3.7.0.tgz", + "integrity": "sha512-WnmiiHfhtcYS+DyGd2Rq3J6QA3ATVBdKtlrhutc/VzQVFoBgNDm+gnYc5gZizsXAI0xQ2frZntT5IJFeB2qQIg==" + }, + "node_modules/dts-gen": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/dts-gen/-/dts-gen-0.6.1.tgz", + "integrity": "sha512-0YXXhpP00T9BGj/szN1quCHYdQb+/gIe1H2NB9A4gc90SYWHAJbSB6XaStsy9B+3+RPhDzYDTmP4OaCIHiTDNw==", "dependencies": { - "@definitelytyped/header-parser": "latest", - "command-exists": "^1.2.8", - "rimraf": "^3.0.2", - "semver": "^6.2.0", - "tmp": "^0.2.1", - "yargs": "^15.3.1" + "dts-dom": "latest", + "parse-git-config": "^1.1.1", + "typescript": "^3.5.1", + "yargs": "^4.8.1" }, - "engines": { - "node": ">=10.17.0" + "bin": { + "dts-gen": "bin/lib/run.js" }, - "peerDependencies": { - "typescript": "*" + "engines": { + "node": ">=6.0.0" } }, - "node_modules/dts-critic/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, + "node_modules/dts-gen/node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=0.10.0" } }, - "node_modules/dts-critic/node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, + "node_modules/dts-gen/node_modules/camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dts-gen/node_modules/cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" } }, - "node_modules/dts-critic/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, + "node_modules/dts-gen/node_modules/find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", "dependencies": { - "color-name": "~1.1.4" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=0.10.0" } }, - "node_modules/dts-critic/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/dts-critic/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } + "node_modules/dts-gen/node_modules/get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" }, - "node_modules/dts-critic/node_modules/which-module": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", - "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", - "dev": true + "node_modules/dts-gen/node_modules/hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" }, - "node_modules/dts-critic/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, + "node_modules/dts-gen/node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "number-is-nan": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/dts-critic/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "node_modules/dts-critic/node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, + "node_modules/dts-gen/node_modules/load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/dts-critic/node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, + "node_modules/dts-gen/node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/dts-gen/node_modules/parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", + "dependencies": { + "error-ex": "^1.2.0" }, "engines": { - "node": ">=6" + "node": ">=0.10.0" } }, - "node_modules/dtslint": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/dtslint/-/dtslint-4.1.3.tgz", - "integrity": "sha512-UHW14DNpWnE5GkmORiDP0f4pc3AvgV7N0grB0skamXyExGOsbsHtNIe+8xeuAkPCrsf10O+Ph3W6+UgXvE4fiA==", - "dev": true, + "node_modules/dts-gen/node_modules/path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", "dependencies": { - "@definitelytyped/header-parser": "latest", - "@definitelytyped/typescript-versions": "latest", - "@definitelytyped/utils": "latest", - "dts-critic": "latest", - "fs-extra": "^6.0.1", - "json-stable-stringify": "^1.0.1", - "strip-json-comments": "^2.0.1", - "tslint": "5.14.0", - "tsutils": "^2.29.0", - "yargs": "^15.1.0" - }, - "bin": { - "dtslint": "bin/index.js" + "pinkie-promise": "^2.0.0" }, "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "typescript": ">= 3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.7.0-dev || >= 3.8.0-dev || >= 3.9.0-dev || >= 4.0.0-dev" + "node": ">=0.10.0" } }, - "node_modules/dtslint/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, + "node_modules/dts-gen/node_modules/path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", "dependencies": { - "color-convert": "^2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=0.10.0" } }, - "node_modules/dtslint/node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, + "node_modules/dts-gen/node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dts-gen/node_modules/read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/dtslint/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, + "node_modules/dts-gen/node_modules/read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", "dependencies": { - "color-name": "~1.1.4" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" }, "engines": { - "node": ">=7.0.0" + "node": ">=0.10.0" } }, - "node_modules/dtslint/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "node_modules/dts-gen/node_modules/require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==" }, - "node_modules/dtslint/node_modules/fs-extra": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", - "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", - "dev": true, + "node_modules/dts-gen/node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", "dependencies": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/dtslint/node_modules/jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, - "optionalDependencies": { - "graceful-fs": "^4.1.6" + "node_modules/dts-gen/node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "node_modules/dtslint/node_modules/universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true, + "node_modules/dts-gen/node_modules/strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", + "dependencies": { + "is-utf8": "^0.2.0" + }, "engines": { - "node": ">= 4.0.0" + "node": ">=0.10.0" } }, - "node_modules/dtslint/node_modules/which-module": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", - "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", - "dev": true + "node_modules/dts-gen/node_modules/typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } }, - "node_modules/dtslint/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, + "node_modules/dts-gen/node_modules/wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/dtslint/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true + "node_modules/dts-gen/node_modules/y18n": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" }, - "node_modules/dtslint/node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, + "node_modules/dts-gen/node_modules/yargs": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA==", "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", + "require-main-filename": "^1.0.1", "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, - "engines": { - "node": ">=8" + "string-width": "^1.0.1", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.1" } }, - "node_modules/dtslint/node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, + "node_modules/dts-gen/node_modules/yargs-parser": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==", "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - }, - "engines": { - "node": ">=6" + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" } }, "node_modules/duplexer2": { @@ -10030,7 +10499,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, "dependencies": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -10093,8 +10561,7 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/enabled": { "version": "2.0.0", @@ -10115,7 +10582,6 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, "dependencies": { "once": "^1.4.0" } @@ -10169,7 +10635,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -10278,7 +10743,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -10343,7 +10807,6 @@ "version": "8.40.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.40.0.tgz", "integrity": "sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==", - "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", @@ -10467,7 +10930,6 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -10480,7 +10942,6 @@ "version": "3.4.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, @@ -10492,7 +10953,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -10506,14 +10966,12 @@ "node_modules/eslint/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "node_modules/eslint/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -10529,7 +10987,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -10540,14 +10997,12 @@ "node_modules/eslint/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/eslint/node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, "engines": { "node": ">=10" }, @@ -10559,7 +11014,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", - "dev": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -10575,7 +11029,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, "engines": { "node": ">=4.0" } @@ -10584,7 +11037,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -10600,7 +11052,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, "dependencies": { "is-glob": "^4.0.3" }, @@ -10612,7 +11063,6 @@ "version": "13.20.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, "dependencies": { "type-fest": "^0.20.2" }, @@ -10627,7 +11077,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "engines": { "node": ">=8" } @@ -10636,7 +11085,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, "dependencies": { "argparse": "^2.0.1" }, @@ -10648,7 +11096,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -10661,7 +11108,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, "dependencies": { "p-locate": "^5.0.0" }, @@ -10676,7 +11122,6 @@ "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -10693,7 +11138,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, "dependencies": { "yocto-queue": "^0.1.0" }, @@ -10708,7 +11152,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, "dependencies": { "p-limit": "^3.0.2" }, @@ -10723,7 +11166,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, "engines": { "node": ">= 0.8.0" } @@ -10732,7 +11174,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, "engines": { "node": ">=8" }, @@ -10744,7 +11185,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -10756,7 +11196,6 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -10768,7 +11207,6 @@ "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, "engines": { "node": ">=10" }, @@ -10780,7 +11218,6 @@ "version": "9.5.2", "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", - "dev": true, "dependencies": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", @@ -10797,7 +11234,6 @@ "version": "8.8.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -10809,7 +11245,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -10822,7 +11257,6 @@ "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -10834,7 +11268,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, "engines": { "node": ">=4.0" } @@ -10843,7 +11276,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -10855,7 +11287,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, "engines": { "node": ">=4.0" } @@ -10864,7 +11295,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, "engines": { "node": ">=4.0" } @@ -10873,7 +11303,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -11244,8 +11673,7 @@ "node_modules/extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "node_modules/extend-shallow": { "version": "3.0.2", @@ -11404,7 +11832,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true, "engines": [ "node >=0.6.0" ] @@ -11427,14 +11854,12 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -11449,14 +11874,12 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, "node_modules/fast-safe-stringify": { "version": "2.1.1", @@ -11477,7 +11900,6 @@ "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -11525,7 +11947,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, "dependencies": { "flat-cache": "^3.0.4" }, @@ -11594,7 +12015,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -11645,7 +12065,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, "dependencies": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -11882,7 +12301,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, "dependencies": { "flatted": "^3.1.0", "rimraf": "^3.0.2" @@ -11894,8 +12312,7 @@ "node_modules/flatted": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" }, "node_modules/flush-write-stream": { "version": "1.1.1", @@ -12019,7 +12436,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true, "engines": { "node": "*" } @@ -12028,7 +12444,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -12153,8 +12568,15 @@ "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "node_modules/fs-exists-sync": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", + "integrity": "sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg==", + "engines": { + "node": ">=0.10.0" + } }, "node_modules/fs-extra": { "version": "11.1.0", @@ -12174,7 +12596,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dev": true, "dependencies": { "minipass": "^3.0.0" }, @@ -12186,7 +12607,6 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -12244,8 +12664,7 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "node_modules/fsevents": { "version": "1.2.13", @@ -12270,7 +12689,6 @@ "version": "1.0.12", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "dev": true, "dependencies": { "graceful-fs": "^4.1.2", "inherits": "~2.0.0", @@ -12285,7 +12703,6 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -12296,14 +12713,13 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "node_modules/gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", - "dev": true, + "devOptional": true, "dependencies": { "aproba": "^1.0.3", "console-control-strings": "^1.0.0", @@ -12319,7 +12735,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -12328,7 +12744,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", - "dev": true, + "devOptional": true, "dependencies": { "number-is-nan": "^1.0.0" }, @@ -12340,7 +12756,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", - "dev": true, + "devOptional": true, "dependencies": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -12354,7 +12770,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, + "devOptional": true, "dependencies": { "ansi-regex": "^2.0.0" }, @@ -12390,7 +12806,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true, "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -12531,11 +12946,34 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, "dependencies": { "assert-plus": "^1.0.0" } }, + "node_modules/git-config-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz", + "integrity": "sha512-KcJ2dlrrP5DbBnYIZ2nlikALfRhKzNSX0stvv3ImJ+fvC4hXKoV+U+74SV0upg+jlQZbrtQzc0bu6/Zh+7aQbg==", + "dependencies": { + "extend-shallow": "^2.0.1", + "fs-exists-sync": "^0.1.0", + "homedir-polyfill": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/git-config-path/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/git-log-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.0.tgz", @@ -12597,7 +13035,6 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -12660,7 +13097,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -12817,7 +13253,6 @@ "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", @@ -12903,14 +13338,12 @@ "node_modules/graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "node_modules/grapheme-splitter": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==" }, "node_modules/graphql": { "version": "16.6.0", @@ -13705,7 +14138,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true, "engines": { "node": ">=4" } @@ -13715,7 +14147,6 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "deprecated": "this library is no longer supported", - "dev": true, "dependencies": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -13737,7 +14168,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -13749,7 +14179,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", - "dev": true, "dependencies": { "ansi-regex": "^2.0.0" }, @@ -13761,7 +14190,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -13770,7 +14198,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, "engines": { "node": ">=4" } @@ -13851,7 +14278,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", - "dev": true + "devOptional": true }, "node_modules/has-value": { "version": "1.0.0", @@ -13975,7 +14402,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, "dependencies": { "parse-passwd": "^1.0.0" }, @@ -13996,7 +14422,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -14079,7 +14504,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, "dependencies": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -14154,7 +14578,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, "funding": [ { "type": "github", @@ -14174,7 +14597,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true, "engines": { "node": ">= 4" } @@ -14192,7 +14614,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -14208,7 +14629,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, "engines": { "node": ">=4" } @@ -14248,7 +14668,6 @@ "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true, "engines": { "node": ">=0.8.19" } @@ -14266,7 +14685,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "dependencies": { "once": "^1.3.0", "wrappy": "1" @@ -14275,14 +14693,12 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "node_modules/ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "node_modules/inline-source-map": { "version": "0.6.2", @@ -14383,7 +14799,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -14468,8 +14883,7 @@ "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "node_modules/is-binary-path": { "version": "1.0.1", @@ -14505,7 +14919,6 @@ "version": "2.10.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", - "dev": true, "dependencies": { "has": "^1.0.3" }, @@ -14585,7 +14998,6 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -14594,7 +15006,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -14603,7 +15014,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -14636,7 +15046,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -14694,7 +15103,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } @@ -14730,7 +15138,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, "engines": { "node": ">=8" } @@ -14850,8 +15257,7 @@ "node_modules/is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, "node_modules/is-unc-path": { "version": "1.0.0", @@ -14868,8 +15274,7 @@ "node_modules/is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" }, "node_modules/is-valid-glob": { "version": "1.0.0", @@ -14902,13 +15307,12 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "devOptional": true }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "node_modules/isobject": { "version": "3.0.1", @@ -14922,8 +15326,7 @@ "node_modules/isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "node_modules/issue-parser": { "version": "6.0.0", @@ -16966,7 +17369,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", - "dev": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/js-sdsl" @@ -16982,7 +17384,6 @@ "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -17003,8 +17404,7 @@ "node_modules/jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, "node_modules/jsdoc": { "version": "4.0.2", @@ -17264,20 +17664,17 @@ "node_modules/json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" }, "node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "node_modules/json-stable-stringify": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz", "integrity": "sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g==", - "dev": true, "dependencies": { "jsonify": "^0.0.1" }, @@ -17288,14 +17685,12 @@ "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "node_modules/json5": { "version": "2.2.3", @@ -17325,7 +17720,6 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", - "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -17381,7 +17775,6 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dev": true, "dependencies": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -17538,7 +17931,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, "dependencies": { "invert-kv": "^1.0.0" }, @@ -17979,7 +18371,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, "dependencies": { "p-locate": "^4.1.0" }, @@ -17993,6 +18384,11 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "node_modules/lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==" + }, "node_modules/lodash.assignin": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", @@ -18116,8 +18512,7 @@ "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "node_modules/lodash.once": { "version": "4.1.1", @@ -18297,7 +18692,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -18787,7 +19181,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, "engines": { "node": ">= 8" } @@ -18858,7 +19251,6 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -18902,7 +19294,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, "engines": { "node": ">= 0.6" } @@ -18911,7 +19302,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "dependencies": { "mime-db": "1.52.0" }, @@ -18962,7 +19352,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -18973,8 +19362,7 @@ "node_modules/minimist": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "node_modules/minimist-options": { "version": "4.1.0", @@ -19003,7 +19391,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dev": true, "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -19016,7 +19403,6 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -19071,7 +19457,6 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, "dependencies": { "minimist": "^1.2.6" }, @@ -19677,8 +20062,7 @@ "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==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/mustache": { "version": "4.2.0", @@ -19730,8 +20114,12 @@ "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + }, + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==" }, "node_modules/negotiator": { "version": "0.6.3", @@ -19851,7 +20239,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", - "dev": true, "dependencies": { "hosted-git-info": "^4.0.1", "is-core-module": "^2.5.0", @@ -19866,7 +20253,6 @@ "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -20095,7 +20481,6 @@ "version": "8.1.5", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz", "integrity": "sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q==", - "dev": true, "dependencies": { "hosted-git-info": "^4.0.1", "semver": "^7.3.4", @@ -20109,7 +20494,6 @@ "version": "7.5.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -22538,7 +22922,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dev": true, + "devOptional": true, "dependencies": { "are-we-there-yet": "~1.1.2", "console-control-strings": "~1.1.0", @@ -22559,7 +22943,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -22574,7 +22957,6 @@ "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true, "engines": { "node": "*" } @@ -22583,7 +22965,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -22777,7 +23159,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "dependencies": { "wrappy": "1" } @@ -22878,7 +23259,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, "dependencies": { "lcid": "^1.0.0" }, @@ -22953,7 +23333,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, "dependencies": { "p-try": "^2.0.0" }, @@ -22968,7 +23347,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, "dependencies": { "p-limit": "^2.2.0" }, @@ -23023,7 +23401,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true, "engines": { "node": ">=6" } @@ -23120,7 +23497,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, "dependencies": { "callsites": "^3.0.0" }, @@ -23185,6 +23561,31 @@ "node": ">=0.8" } }, + "node_modules/parse-git-config": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz", + "integrity": "sha512-S3LGXJZVSy/hswvbSkfdbKBRVsnqKrVu6j8fcvdtJ4TxosSELyQDsJPuGPXuZ+EyuYuJd3O4uAF8gcISR0OFrQ==", + "dependencies": { + "extend-shallow": "^2.0.1", + "fs-exists-sync": "^0.1.0", + "git-config-path": "^1.0.1", + "ini": "^1.3.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/parse-git-config/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -23252,7 +23653,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -23542,8 +23942,7 @@ "node_modules/parsimmon": { "version": "1.18.1", "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.18.1.tgz", - "integrity": "sha512-u7p959wLfGAhJpSDJVYXoyMCXWYwHia78HhRBWqk7AIbxdmlrfdp5wX0l3xv/iTSH5HvhN9K7o26hwwpgS5Nmw==", - "dev": true + "integrity": "sha512-u7p959wLfGAhJpSDJVYXoyMCXWYwHia78HhRBWqk7AIbxdmlrfdp5wX0l3xv/iTSH5HvhN9K7o26hwwpgS5Nmw==" }, "node_modules/pascalcase": { "version": "0.1.1", @@ -23570,7 +23969,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, "engines": { "node": ">=8" } @@ -23579,7 +23977,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -23588,7 +23985,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, "engines": { "node": ">=8" } @@ -23596,8 +23992,7 @@ "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-platform": { "version": "0.11.15", @@ -23664,7 +24059,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, "engines": { "node": ">=8" } @@ -23694,8 +24088,7 @@ "node_modules/performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "node_modules/pg": { "version": "8.9.0", @@ -23833,7 +24226,6 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, "engines": { "node": ">=8.6" }, @@ -23866,7 +24258,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -23875,7 +24266,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, "dependencies": { "pinkie": "^2.0.0" }, @@ -24155,7 +24545,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true + "devOptional": true }, "node_modules/progress": { "version": "2.0.3", @@ -24288,8 +24678,7 @@ "node_modules/psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" }, "node_modules/public-encrypt": { "version": "4.0.3", @@ -24491,7 +24880,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, "funding": [ { "type": "github", @@ -24734,7 +25122,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -25130,7 +25517,6 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dev": true, "dependencies": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -25161,7 +25547,6 @@ "version": "6.5.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "dev": true, "engines": { "node": ">=0.6" } @@ -25171,7 +25556,6 @@ "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "dev": true, "bin": { "uuid": "bin/uuid" } @@ -25208,7 +25592,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -25216,8 +25599,7 @@ "node_modules/require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "node_modules/requires-port": { "version": "1.0.0", @@ -25238,7 +25620,6 @@ "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "dev": true, "dependencies": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", @@ -25348,7 +25729,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -25364,7 +25744,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "dependencies": { "glob": "^7.1.3" }, @@ -25389,7 +25768,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "funding": [ { "type": "github", @@ -25426,8 +25804,7 @@ "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/safe-regex": { "version": "1.1.0", @@ -25450,8 +25827,7 @@ "node_modules/safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/saslprep": { "version": "1.0.3", @@ -25558,7 +25934,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, "bin": { "semver": "bin/semver" } @@ -25683,8 +26058,7 @@ "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "node_modules/set-value": { "version": "2.0.1", @@ -25757,7 +26131,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "dependencies": { "shebang-regex": "^3.0.0" }, @@ -25769,7 +26142,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, "engines": { "node": ">=8" } @@ -25798,7 +26170,7 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "devOptional": true }, "node_modules/signale": { "version": "1.4.0", @@ -25871,7 +26243,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, "engines": { "node": ">=8" } @@ -25930,7 +26301,6 @@ "version": "1.1.6", "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", "integrity": "sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==", - "dev": true, "engines": { "node": "*" } @@ -26233,7 +26603,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, "dependencies": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -26242,14 +26611,12 @@ "node_modules/spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" }, "node_modules/spdx-expression-parse": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, "dependencies": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -26258,8 +26625,7 @@ "node_modules/spdx-license-ids": { "version": "3.0.12", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz", - "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==", - "dev": true + "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==" }, "node_modules/spex": { "version": "3.2.0", @@ -26306,14 +26672,12 @@ "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "node_modules/sshpk": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "dev": true, "dependencies": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -26338,7 +26702,6 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", - "dev": true, "dependencies": { "minipass": "^3.1.1" }, @@ -26350,7 +26713,6 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -26582,7 +26944,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "dependencies": { "safe-buffer": "~5.2.0" } @@ -26591,7 +26952,6 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true, "funding": [ { "type": "github", @@ -26639,7 +26999,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -26668,7 +27027,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -26757,7 +27115,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -26831,7 +27188,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -26877,7 +27233,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -26932,7 +27287,6 @@ "version": "6.1.15", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", - "dev": true, "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -26961,7 +27315,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dev": true, "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", @@ -26977,7 +27330,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "dev": true, "engines": { "node": ">=10" } @@ -26986,7 +27338,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -26995,7 +27346,6 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, "bin": { "mkdirp": "bin/cmd.js" }, @@ -27123,8 +27473,7 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" }, "node_modules/through": { "version": "2.3.8", @@ -27238,7 +27587,6 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, "dependencies": { "rimraf": "^3.0.0" }, @@ -27323,7 +27671,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -27390,7 +27737,6 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, "dependencies": { "psl": "^1.1.28", "punycode": "^2.1.1" @@ -27403,7 +27749,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, "engines": { "node": ">=6" } @@ -27460,7 +27805,6 @@ "version": "5.14.0", "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", - "dev": true, "dependencies": { "babel-code-frame": "^6.22.0", "builtin-modules": "^1.1.1", @@ -27489,20 +27833,17 @@ "node_modules/tslint/node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, "node_modules/tslint/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "node_modules/tsutils": { "version": "2.29.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, "dependencies": { "tslib": "^1.8.1" }, @@ -27513,8 +27854,7 @@ "node_modules/tsutils/node_modules/tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" }, "node_modules/tty-browserify": { "version": "0.0.1", @@ -27526,7 +27866,6 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, "dependencies": { "safe-buffer": "^5.0.1" }, @@ -27546,8 +27885,7 @@ "node_modules/tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, "node_modules/type": { "version": "1.2.0", @@ -27604,14 +27942,12 @@ "node_modules/typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "node_modules/typescript": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", - "dev": true, "peer": true, "bin": { "tsc": "bin/tsc", @@ -27923,7 +28259,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "dependencies": { "punycode": "^2.1.0" } @@ -27932,7 +28267,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true, "engines": { "node": ">=6" } @@ -28043,8 +28377,7 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "node_modules/utils-merge": { "version": "1.0.1", @@ -28093,7 +28426,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, "dependencies": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -28103,7 +28435,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", "integrity": "sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==", - "dev": true, "dependencies": { "builtins": "^1.0.3" } @@ -28151,7 +28482,6 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, "engines": [ "node >=0.6.0" ], @@ -28164,8 +28494,7 @@ "node_modules/verror/node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, "node_modules/vinyl": { "version": "2.2.1", @@ -28519,7 +28848,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "dependencies": { "isexe": "^2.0.0" }, @@ -28533,8 +28861,7 @@ "node_modules/which-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" }, "node_modules/which-typed-array": { "version": "1.1.9", @@ -28560,11 +28887,22 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dev": true, + "devOptional": true, "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" } }, + "node_modules/window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==", + "bin": { + "window-size": "cli.js" + }, + "engines": { + "node": ">= 0.10.0" + } + }, "node_modules/winston": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/winston/-/winston-3.8.1.tgz", @@ -28622,7 +28960,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -28737,8 +29074,7 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "node_modules/write-file-atomic": { "version": "4.0.2", @@ -28823,8 +29159,7 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yaml": { "version": "1.10.2", @@ -28876,7 +29211,6 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, "engines": { "node": ">=10" }, @@ -30404,11 +30738,233 @@ "kuler": "^2.0.0" } }, + "@definitelytyped/dts-critic": { + "version": "0.0.163", + "resolved": "https://registry.npmjs.org/@definitelytyped/dts-critic/-/dts-critic-0.0.163.tgz", + "integrity": "sha512-HsTvylj8x2gQaawsOCcN2Xk2Cx0wgV9kaj83hgsO9SITZSPd7dA0UkHyNRadbMkMwqNDKcnizcmWdz0+0gIo8A==", + "requires": { + "@definitelytyped/header-parser": "^0.0.163", + "command-exists": "^1.2.8", + "rimraf": "^3.0.2", + "semver": "^6.2.0", + "tmp": "^0.2.1", + "yargs": "^15.3.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + }, + "which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "@definitelytyped/dtslint": { + "version": "0.0.163", + "resolved": "https://registry.npmjs.org/@definitelytyped/dtslint/-/dtslint-0.0.163.tgz", + "integrity": "sha512-U0uw7Zu0QdYSuBMYgxvRYjkhkeulTEg8vDgJ7TiYQUv/wODeujSAmGahQn51E5hOlSMYUw7A9utdbUukxE02SQ==", + "requires": { + "@definitelytyped/dts-critic": "^0.0.163", + "@definitelytyped/header-parser": "^0.0.163", + "@definitelytyped/typescript-versions": "^0.0.163", + "@definitelytyped/utils": "^0.0.163", + "@typescript-eslint/eslint-plugin": "^5.55.0", + "@typescript-eslint/parser": "^5.55.0", + "@typescript-eslint/types": "^5.56.0", + "@typescript-eslint/typescript-estree": "^5.55.0", + "@typescript-eslint/utils": "^5.55.0", + "eslint": "^8.17.0", + "fs-extra": "^6.0.1", + "json-stable-stringify": "^1.0.1", + "strip-json-comments": "^2.0.1", + "tslint": "5.14.0", + "yargs": "^15.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "fs-extra": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", + "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" + }, + "which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==" + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "@definitelytyped/header-parser": { "version": "0.0.163", "resolved": "https://registry.npmjs.org/@definitelytyped/header-parser/-/header-parser-0.0.163.tgz", "integrity": "sha512-Jr+/q+ESfc7uWldz/j11BfpjIN/gB4WmwhFENhWaMwM0W/9p0ShF+OiUqGhk2Q3Iz8v/oyWzSsxyxgasg9kCxQ==", - "dev": true, "requires": { "@definitelytyped/typescript-versions": "^0.0.163", "@types/parsimmon": "^1.10.1", @@ -30418,14 +30974,12 @@ "@definitelytyped/typescript-versions": { "version": "0.0.163", "resolved": "https://registry.npmjs.org/@definitelytyped/typescript-versions/-/typescript-versions-0.0.163.tgz", - "integrity": "sha512-+GWtJhC+7UaCUnJ+ZkA7bfGuPd6ZbJKEjbHqh76/gOXsqAUOMEa49ufsLlIPUbkEeQlnDNoTHCegE5X/Q+u+/A==", - "dev": true + "integrity": "sha512-+GWtJhC+7UaCUnJ+ZkA7bfGuPd6ZbJKEjbHqh76/gOXsqAUOMEa49ufsLlIPUbkEeQlnDNoTHCegE5X/Q+u+/A==" }, "@definitelytyped/utils": { "version": "0.0.163", "resolved": "https://registry.npmjs.org/@definitelytyped/utils/-/utils-0.0.163.tgz", "integrity": "sha512-6MX5TxaQbG/j2RkCWbcbLvv+YNipKqY0eQJafDhwC/RprUocpg+uYVNlH8XzdKRWOGJ0pq7SZOsJD4C3A01ZXg==", - "dev": true, "requires": { "@definitelytyped/typescript-versions": "^0.0.163", "@qiwi/npm-registry-client": "^8.9.1", @@ -30440,14 +30994,12 @@ "@types/node": { "version": "14.18.51", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.51.tgz", - "integrity": "sha512-P9bsdGFPpVtofEKlhWMVS2qqx1A/rt9QBfihWlklfHHpUpjtYse5AzFz6j4DWrARLYh6gRnw9+5+DJcrq3KvBA==", - "dev": true + "integrity": "sha512-P9bsdGFPpVtofEKlhWMVS2qqx1A/rt9QBfihWlklfHHpUpjtYse5AzFz6j4DWrARLYh6gRnw9+5+DJcrq3KvBA==" }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", - "dev": true, "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", @@ -30458,7 +31010,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, "requires": { "graceful-fs": "^4.1.6" } @@ -30466,8 +31017,7 @@ "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" } } }, @@ -30533,7 +31083,6 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, "requires": { "eslint-visitor-keys": "^3.3.0" } @@ -30541,14 +31090,12 @@ "@eslint-community/regexpp": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.1.tgz", - "integrity": "sha512-BISJ6ZE4xQsuL/FmsyRaiffpq977bMlsKfGHTQrOGFErfByxIe6iZTxPf/00Zon9b9a7iUykfQwejN3s2ZW/Bw==", - "dev": true + "integrity": "sha512-BISJ6ZE4xQsuL/FmsyRaiffpq977bMlsKfGHTQrOGFErfByxIe6iZTxPf/00Zon9b9a7iUykfQwejN3s2ZW/Bw==" }, "@eslint/eslintrc": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", - "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -30564,14 +31111,12 @@ "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "globals": { "version": "13.20.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, "requires": { "type-fest": "^0.20.2" } @@ -30580,7 +31125,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, "requires": { "argparse": "^2.0.1" } @@ -30588,22 +31132,19 @@ "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" } } }, "@eslint/js": { "version": "8.40.0", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.40.0.tgz", - "integrity": "sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==", - "dev": true + "integrity": "sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA==" }, "@graphql-tools/merge": { "version": "8.3.6", @@ -30735,7 +31276,6 @@ "version": "0.11.8", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", - "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", @@ -30745,14 +31285,12 @@ "@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==" }, "@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" }, "@isaacs/cliui": { "version": "8.0.2", @@ -31541,7 +32079,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "requires": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -31550,14 +32087,12 @@ "@nodelib/fs.stat": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==" }, "@nodelib/fs.walk": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "requires": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -31964,7 +32499,6 @@ "version": "8.9.1", "resolved": "https://registry.npmjs.org/@qiwi/npm-registry-client/-/npm-registry-client-8.9.1.tgz", "integrity": "sha512-rZF+mG+NfijR0SHphhTLHRr4aM4gtfdwoAMY6we2VGQam8vkN1cxGG1Lg/Llrj8Dd0Mu6VjdFQRyMMRZxtZR2A==", - "dev": true, "requires": { "concat-stream": "^2.0.0", "graceful-fs": "^4.2.4", @@ -31984,7 +32518,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", - "dev": true, "requires": { "buffer-from": "^1.0.0", "inherits": "^2.0.3", @@ -31995,14 +32528,12 @@ "retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", - "dev": true + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==" }, "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" } } }, @@ -32315,6 +32846,11 @@ "parse5": "^7.0.0" } }, + "@types/json-schema": { + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", + "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==" + }, "@types/jsonwebtoken": { "version": "8.5.9", "resolved": "https://registry.npmjs.org/@types/jsonwebtoken/-/jsonwebtoken-8.5.9.tgz", @@ -32379,8 +32915,7 @@ "@types/parsimmon": { "version": "1.10.6", "resolved": "https://registry.npmjs.org/@types/parsimmon/-/parsimmon-1.10.6.tgz", - "integrity": "sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA==", - "dev": true + "integrity": "sha512-FwAQwMRbkhx0J6YELkwIpciVzCcgEqXEbIrIn3a2P5d3kGEHQ3wVhlN3YdVepYP+bZzCYO6OjmD4o9TGOZ40rA==" }, "@types/prettier": { "version": "2.7.2", @@ -32406,6 +32941,11 @@ "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==", "dev": true }, + "@types/semver": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==" + }, "@types/serve-static": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.0.tgz", @@ -32469,6 +33009,168 @@ "@types/node": "*" } }, + "@typescript-eslint/eslint-plugin": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.60.1.tgz", + "integrity": "sha512-KSWsVvsJsLJv3c4e73y/Bzt7OpqMCADUO846bHcuWYSYM19bldbAeDv7dYyV0jwkbMfJ2XdlzwjhXtuD7OY6bw==", + "requires": { + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.60.1", + "@typescript-eslint/type-utils": "5.60.1", + "@typescript-eslint/utils": "5.60.1", + "debug": "^4.3.4", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "dependencies": { + "semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/parser": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.60.1.tgz", + "integrity": "sha512-pHWlc3alg2oSMGwsU/Is8hbm3XFbcrb6P5wIxcQW9NsYBfnrubl/GhVVD/Jm/t8HXhA2WncoIRfBtnCgRGV96Q==", + "requires": { + "@typescript-eslint/scope-manager": "5.60.1", + "@typescript-eslint/types": "5.60.1", + "@typescript-eslint/typescript-estree": "5.60.1", + "debug": "^4.3.4" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.60.1.tgz", + "integrity": "sha512-Dn/LnN7fEoRD+KspEOV0xDMynEmR3iSHdgNsarlXNLGGtcUok8L4N71dxUgt3YvlO8si7E+BJ5Fe3wb5yUw7DQ==", + "requires": { + "@typescript-eslint/types": "5.60.1", + "@typescript-eslint/visitor-keys": "5.60.1" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.60.1.tgz", + "integrity": "sha512-vN6UztYqIu05nu7JqwQGzQKUJctzs3/Hg7E2Yx8rz9J+4LgtIDFWjjl1gm3pycH0P3mHAcEUBd23LVgfrsTR8A==", + "requires": { + "@typescript-eslint/typescript-estree": "5.60.1", + "@typescript-eslint/utils": "5.60.1", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/types": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.60.1.tgz", + "integrity": "sha512-zDcDx5fccU8BA0IDZc71bAtYIcG9PowaOwaD8rjYbqwK7dpe/UMQl3inJ4UtUK42nOCT41jTSCwg76E62JpMcg==" + }, + "@typescript-eslint/typescript-estree": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.60.1.tgz", + "integrity": "sha512-hkX70J9+2M2ZT6fhti5Q2FoU9zb+GeZK2SLP1WZlvUDqdMbEKhexZODD1WodNRyO8eS+4nScvT0dts8IdaBzfw==", + "requires": { + "@typescript-eslint/types": "5.60.1", + "@typescript-eslint/visitor-keys": "5.60.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "dependencies": { + "semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "requires": { + "lru-cache": "^6.0.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@typescript-eslint/utils": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.60.1.tgz", + "integrity": "sha512-tiJ7FFdFQOWssFa3gqb94Ilexyw0JVxj6vBzaSpfN/8IhoKkDuSAenUKvsSHw2A/TMpJb26izIszTXaqygkvpQ==", + "requires": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.60.1", + "@typescript-eslint/types": "5.60.1", + "@typescript-eslint/typescript-estree": "5.60.1", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, + "dependencies": { + "semver": { + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.60.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.60.1.tgz", + "integrity": "sha512-xEYIxKcultP6E/RMKqube11pGjXH1DCo60mQoWhVYyKfLkwbIVVjYxmOenNMxILx0TjCujPTjjnTIVzm09TXIw==", + "requires": { + "@typescript-eslint/types": "5.60.1", + "eslint-visitor-keys": "^3.3.0" + } + }, "@xmldom/xmldom": { "version": "0.8.6", "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.6.tgz", @@ -32509,8 +33211,7 @@ "acorn": { "version": "7.4.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", - "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", - "dev": true + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" }, "acorn-globals": { "version": "7.0.1", @@ -32540,7 +33241,6 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, "requires": {} }, "acorn-node": { @@ -32583,7 +33283,6 @@ "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -32704,14 +33403,12 @@ "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "requires": { "color-convert": "^1.9.0" } @@ -32856,7 +33553,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true + "devOptional": true }, "archy": { "version": "1.0.0", @@ -32874,7 +33571,7 @@ "version": "1.1.7", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "dev": true, + "devOptional": true, "requires": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" @@ -32884,7 +33581,7 @@ "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, + "devOptional": true, "requires": { "core-util-is": "~1.0.0", "inherits": "~2.0.3", @@ -32899,7 +33596,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, + "devOptional": true, "requires": { "safe-buffer": "~5.1.0" } @@ -32910,7 +33607,6 @@ "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, "requires": { "sprintf-js": "~1.0.2" } @@ -33050,8 +33746,7 @@ "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 + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" }, "array-unique": { "version": "0.3.2", @@ -33069,7 +33764,6 @@ "version": "0.2.6", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "dev": true, "requires": { "safer-buffer": "~2.1.0" } @@ -33130,8 +33824,7 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, "assign-symbols": { "version": "1.0.0", @@ -33190,8 +33883,7 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "dev": true + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "atob": { "version": "2.1.2", @@ -33208,20 +33900,17 @@ "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "dev": true + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { "version": "1.11.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "dev": true + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" }, "babel-code-frame": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", "integrity": "sha512-XqYMR2dfdGMW+hd0IUZ2PwK+fGeFkOxZJ0wY+JaQAHzt1Zx8LcvpiZD2NiGkEG8qx0CfkAOr5xt76d1e8vG90g==", - "dev": true, "requires": { "chalk": "^1.1.3", "esutils": "^2.0.2", @@ -33231,20 +33920,17 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", - "dev": true + "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==" }, "chalk": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==", - "dev": true, "requires": { "ansi-styles": "^2.2.1", "escape-string-regexp": "^1.0.2", @@ -33256,14 +33942,12 @@ "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==", - "dev": true + "integrity": "sha512-RjTcuD4xjtthQkaWH7dFlH85L+QaVtSoOyGdZ3g6HFhS9dFNDfLyqgm2NFe2X6cQpeFmt0452FJjFG5UameExg==" }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, "requires": { "ansi-regex": "^2.0.0" } @@ -33271,8 +33955,7 @@ "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==", - "dev": true + "integrity": "sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==" } } }, @@ -33521,8 +34204,7 @@ "balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "base": { "version": "0.11.2", @@ -33582,8 +34264,7 @@ "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, "basic-ftp": { "version": "5.0.3", @@ -33595,7 +34276,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dev": true, "requires": { "tweetnacl": "^0.14.3" } @@ -33632,7 +34312,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, "requires": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -33643,7 +34322,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -33716,7 +34394,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -33726,7 +34403,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "requires": { "fill-range": "^7.0.1" } @@ -34066,8 +34742,7 @@ "buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "buffer-writer": { "version": "2.0.0", @@ -34093,8 +34768,7 @@ "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", - "dev": true + "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==" }, "builtin-status-codes": { "version": "3.0.0", @@ -34105,8 +34779,7 @@ "builtins": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/builtins/-/builtins-1.0.3.tgz", - "integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==", - "dev": true + "integrity": "sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ==" }, "busboy": { "version": "1.6.0", @@ -34159,14 +34832,12 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", - "dev": true + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "camelcase-keys": { "version": "6.2.2", @@ -34198,8 +34869,7 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "dev": true + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, "catharsis": { "version": "0.9.0", @@ -34226,7 +34896,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -34243,7 +34912,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/charm/-/charm-1.0.2.tgz", "integrity": "sha512-wqW3VdPnlSWT4eRiYX+hcs+C6ViBPUWk1qTCd+37qw9kEm/a5n2qcyQDMBWvSYKN/ctqZzeXNQaeBjOetJJUkw==", - "dev": true, "requires": { "inherits": "^2.0.1" } @@ -34719,8 +35387,7 @@ "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, "codecov": { "version": "3.8.3", @@ -34788,7 +35455,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "requires": { "color-name": "1.1.3" } @@ -34796,8 +35462,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "color-string": { "version": "1.9.1", @@ -34861,7 +35526,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -34869,8 +35533,7 @@ "command-exists": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", - "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", - "dev": true + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==" }, "commander": { "version": "10.0.0", @@ -34903,8 +35566,7 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "concat-stream": { "version": "1.6.2", @@ -34970,7 +35632,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", - "dev": true + "devOptional": true }, "constants-browserify": { "version": "1.0.0", @@ -35163,7 +35825,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true + "devOptional": true }, "cors": { "version": "2.8.5", @@ -35255,7 +35917,6 @@ "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, "requires": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -35369,7 +36030,6 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -35434,7 +36094,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "requires": { "ms": "2.1.2" } @@ -35442,8 +36101,7 @@ "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "dev": true + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "decamelize-keys": { "version": "1.1.0", @@ -35690,8 +36348,7 @@ "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "deepcopy": { "version": "2.1.0", @@ -35852,14 +36509,13 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", - "dev": true + "devOptional": true }, "denque": { "version": "2.1.0", @@ -36111,8 +36767,7 @@ "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" }, "diff-sequences": { "version": "29.4.3", @@ -36143,7 +36798,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, "requires": { "path-type": "^4.0.0" } @@ -36158,7 +36812,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, "requires": { "esutils": "^2.0.2" } @@ -36322,244 +36975,220 @@ "integrity": "sha512-g/M9sqy3oHe477Ar4voQxWtaPIFw1jTdKZuomOjhCcBx9nHUNn0pu6NopuFFrTh/TRZIKEj+76vLWFu9BNKk+Q==", "dev": true }, - "dts-critic": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/dts-critic/-/dts-critic-3.3.11.tgz", - "integrity": "sha512-HMO2f9AO7ge44YO8OK18f+cxm/IaE1CFuyNFbfJRCEbyazWj5X5wWDF6W4CGdo5Ax0ILYVfJ7L/rOwuUN1fzWw==", - "dev": true, + "dts-dom": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/dts-dom/-/dts-dom-3.7.0.tgz", + "integrity": "sha512-WnmiiHfhtcYS+DyGd2Rq3J6QA3ATVBdKtlrhutc/VzQVFoBgNDm+gnYc5gZizsXAI0xQ2frZntT5IJFeB2qQIg==" + }, + "dts-gen": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/dts-gen/-/dts-gen-0.6.1.tgz", + "integrity": "sha512-0YXXhpP00T9BGj/szN1quCHYdQb+/gIe1H2NB9A4gc90SYWHAJbSB6XaStsy9B+3+RPhDzYDTmP4OaCIHiTDNw==", "requires": { - "@definitelytyped/header-parser": "latest", - "command-exists": "^1.2.8", - "rimraf": "^3.0.2", - "semver": "^6.2.0", - "tmp": "^0.2.1", - "yargs": "^15.3.1" + "dts-dom": "latest", + "parse-git-config": "^1.1.1", + "typescript": "^3.5.1", + "yargs": "^4.8.1" }, "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" + }, + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==" }, "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", "requires": { - "color-name": "~1.1.4" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" }, - "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "hosted-git-info": { + "version": "2.8.9", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", + "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" }, - "which-module": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", - "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", - "dev": true + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", + "requires": { + "number-is-nan": "^1.0.0" + } }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" } }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "error-ex": "^1.2.0" } }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "pinkie-promise": "^2.0.0" } - } - } - }, - "dtslint": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/dtslint/-/dtslint-4.1.3.tgz", - "integrity": "sha512-UHW14DNpWnE5GkmORiDP0f4pc3AvgV7N0grB0skamXyExGOsbsHtNIe+8xeuAkPCrsf10O+Ph3W6+UgXvE4fiA==", - "dev": true, - "requires": { - "@definitelytyped/header-parser": "latest", - "@definitelytyped/typescript-versions": "latest", - "@definitelytyped/utils": "latest", - "dts-critic": "latest", - "fs-extra": "^6.0.1", - "json-stable-stringify": "^1.0.1", - "strip-json-comments": "^2.0.1", - "tslint": "5.14.0", - "tsutils": "^2.29.0", - "yargs": "^15.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", "requires": { - "color-convert": "^2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==" + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", "requires": { - "color-name": "~1.1.4" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==" }, - "fs-extra": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-6.0.1.tgz", - "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", - "dev": true, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^4.0.0", - "universalify": "^0.1.0" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, - "jsonfile": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", - "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", - "dev": true, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", "requires": { - "graceful-fs": "^4.1.6" + "ansi-regex": "^2.0.0" } }, - "universalify": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", - "dev": true + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", + "requires": { + "is-utf8": "^0.2.0" + } }, - "which-module": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", - "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", - "dev": true + "typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==" }, "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" } }, "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", + "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" }, "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", + "integrity": "sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA==", "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "lodash.assign": "^4.0.3", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", + "require-main-filename": "^1.0.1", "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "string-width": "^1.0.1", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^2.4.1" } }, "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", + "integrity": "sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==", "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "camelcase": "^3.0.0", + "lodash.assign": "^4.0.6" } } } @@ -36674,7 +37303,6 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dev": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -36733,8 +37361,7 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "enabled": { "version": "2.0.0", @@ -36752,7 +37379,6 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, "requires": { "once": "^1.4.0" } @@ -36799,7 +37425,6 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", - "dev": true, "requires": { "is-arrayish": "^0.2.1" } @@ -36899,8 +37524,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "escodegen": { "version": "2.0.0", @@ -36946,7 +37570,6 @@ "version": "8.40.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.40.0.tgz", "integrity": "sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ==", - "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", @@ -36994,7 +37617,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -37002,14 +37624,12 @@ "argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -37019,7 +37639,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "requires": { "color-name": "~1.1.4" } @@ -37027,20 +37646,17 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, "eslint-scope": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", - "dev": true, "requires": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -37049,14 +37665,12 @@ "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" }, "find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, "requires": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" @@ -37066,7 +37680,6 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, "requires": { "is-glob": "^4.0.3" } @@ -37075,7 +37688,6 @@ "version": "13.20.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, "requires": { "type-fest": "^0.20.2" } @@ -37083,14 +37695,12 @@ "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, "requires": { "argparse": "^2.0.1" } @@ -37099,7 +37709,6 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, "requires": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -37109,7 +37718,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, "requires": { "p-locate": "^5.0.0" } @@ -37118,7 +37726,6 @@ "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, "requires": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -37132,7 +37739,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, "requires": { "yocto-queue": "^0.1.0" } @@ -37141,7 +37747,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, "requires": { "p-limit": "^3.0.2" } @@ -37149,20 +37754,17 @@ "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" }, "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -37171,7 +37773,6 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, "requires": { "prelude-ls": "^1.2.1" } @@ -37179,8 +37780,7 @@ "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" } } }, @@ -37231,7 +37831,6 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, "requires": { "esrecurse": "^4.3.0", "estraverse": "^4.1.1" @@ -37240,14 +37839,12 @@ "eslint-visitor-keys": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", - "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==", - "dev": true + "integrity": "sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==" }, "espree": { "version": "9.5.2", "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", - "dev": true, "requires": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", @@ -37257,22 +37854,19 @@ "acorn": { "version": "8.8.2", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==" } } }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esquery": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, "requires": { "estraverse": "^5.1.0" }, @@ -37280,8 +37874,7 @@ "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" } } }, @@ -37289,7 +37882,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, "requires": { "estraverse": "^5.2.0" }, @@ -37297,22 +37889,19 @@ "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" } } }, "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" }, "etag": { "version": "1.8.1", @@ -37612,8 +38201,7 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "dev": true + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "extend-shallow": { "version": "3.0.2", @@ -37736,8 +38324,7 @@ "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" }, "fancy-log": { "version": "1.3.3", @@ -37754,14 +38341,12 @@ "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "fast-glob": { "version": "3.2.12", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -37773,14 +38358,12 @@ "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" }, "fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, "fast-safe-stringify": { "version": "2.1.1", @@ -37801,7 +38384,6 @@ "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", - "dev": true, "requires": { "reusify": "^1.0.4" } @@ -37843,7 +38425,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, "requires": { "flat-cache": "^3.0.4" } @@ -37897,7 +38478,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "requires": { "to-regex-range": "^5.0.1" } @@ -37944,7 +38524,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, "requires": { "locate-path": "^5.0.0", "path-exists": "^4.0.0" @@ -38145,7 +38724,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, "requires": { "flatted": "^3.1.0", "rimraf": "^3.0.2" @@ -38154,8 +38732,7 @@ "flatted": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==" }, "flush-write-stream": { "version": "1.1.1", @@ -38250,14 +38827,12 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "dev": true + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" }, "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -38354,8 +38929,12 @@ "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" + }, + "fs-exists-sync": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", + "integrity": "sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg==" }, "fs-extra": { "version": "11.1.0", @@ -38372,7 +38951,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dev": true, "requires": { "minipass": "^3.0.0" }, @@ -38381,7 +38959,6 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -38437,8 +39014,7 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { "version": "1.2.13", @@ -38455,7 +39031,6 @@ "version": "1.0.12", "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", - "dev": true, "requires": { "graceful-fs": "^4.1.2", "inherits": "~2.0.0", @@ -38467,7 +39042,6 @@ "version": "2.7.1", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, "requires": { "glob": "^7.1.3" } @@ -38477,14 +39051,13 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, "gauge": { "version": "2.7.4", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==", - "dev": true, + "devOptional": true, "requires": { "aproba": "^1.0.3", "console-control-strings": "^1.0.0", @@ -38500,13 +39073,13 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true + "devOptional": true }, "is-fullwidth-code-point": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", - "dev": true, + "devOptional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -38515,7 +39088,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", - "dev": true, + "devOptional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -38526,7 +39099,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dev": true, + "devOptional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -38554,8 +39127,7 @@ "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "dev": true + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-intrinsic": { "version": "1.2.0", @@ -38662,11 +39234,30 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, "requires": { "assert-plus": "^1.0.0" } }, + "git-config-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz", + "integrity": "sha512-KcJ2dlrrP5DbBnYIZ2nlikALfRhKzNSX0stvv3ImJ+fvC4hXKoV+U+74SV0upg+jlQZbrtQzc0bu6/Zh+7aQbg==", + "requires": { + "extend-shallow": "^2.0.1", + "fs-exists-sync": "^0.1.0", + "homedir-polyfill": "^1.0.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "git-log-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.0.tgz", @@ -38730,7 +39321,6 @@ "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -38780,7 +39370,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "requires": { "is-glob": "^4.0.1" } @@ -38916,7 +39505,6 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, "requires": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -38983,14 +39571,12 @@ "graceful-fs": { "version": "4.2.10", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, "grapheme-splitter": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==" }, "graphql": { "version": "16.6.0", @@ -39667,14 +40253,12 @@ "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "dev": true + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" }, "har-validator": { "version": "5.1.5", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "dev": true, "requires": { "ajv": "^6.12.3", "har-schema": "^2.0.0" @@ -39690,7 +40274,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -39699,7 +40282,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg==", - "dev": true, "requires": { "ansi-regex": "^2.0.0" }, @@ -39707,16 +40289,14 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "dev": true + "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" } } }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, "has-gulplog": { "version": "0.1.0", @@ -39770,7 +40350,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", - "dev": true + "devOptional": true }, "has-value": { "version": "1.0.0", @@ -39868,7 +40448,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", - "dev": true, "requires": { "parse-passwd": "^1.0.0" } @@ -39883,7 +40462,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", - "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -39951,7 +40529,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dev": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -40003,14 +40580,12 @@ "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, "ignore": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", - "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", - "dev": true + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" }, "ignore-walk": { "version": "3.0.4", @@ -40025,7 +40600,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" @@ -40034,8 +40608,7 @@ "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" } } }, @@ -40058,8 +40631,7 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, "indent-string": { "version": "4.0.0", @@ -40071,7 +40643,6 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -40080,14 +40651,12 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "inline-source-map": { "version": "0.6.2", @@ -40177,8 +40746,7 @@ "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" }, "ip": { "version": "2.0.0", @@ -40244,8 +40812,7 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", - "dev": true + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "is-binary-path": { "version": "1.0.1", @@ -40272,7 +40839,6 @@ "version": "2.10.0", "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", - "dev": true, "requires": { "has": "^1.0.3" } @@ -40334,20 +40900,17 @@ "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", - "dev": true + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "is-generator-fn": { "version": "2.1.0", @@ -40368,7 +40931,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "requires": { "is-extglob": "^2.1.1" } @@ -40415,8 +40977,7 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-obj": { "version": "2.0.0", @@ -40439,8 +41000,7 @@ "is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" }, "is-plain-obj": { "version": "1.1.0", @@ -40524,8 +41084,7 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, "is-unc-path": { "version": "1.0.0", @@ -40539,8 +41098,7 @@ "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", - "dev": true + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" }, "is-valid-glob": { "version": "1.0.0", @@ -40564,13 +41122,12 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true + "devOptional": true }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", - "dev": true + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "isobject": { "version": "3.0.1", @@ -40581,8 +41138,7 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "dev": true + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "issue-parser": { "version": "6.0.0", @@ -42086,8 +42642,7 @@ "js-sdsl": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", - "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", - "dev": true + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==" }, "js-tokens": { "version": "4.0.0", @@ -42099,7 +42654,6 @@ "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", - "dev": true, "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -42117,8 +42671,7 @@ "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, "jsdoc": { "version": "4.0.2", @@ -42308,20 +42861,17 @@ "json-schema": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "dev": true + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" }, "json-stable-stringify": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz", "integrity": "sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g==", - "dev": true, "requires": { "jsonify": "^0.0.1" } @@ -42329,14 +42879,12 @@ "json-stable-stringify-without-jsonify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", - "dev": true + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=" }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "dev": true + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json5": { "version": "2.2.3", @@ -42357,8 +42905,7 @@ "jsonify": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz", - "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==", - "dev": true + "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==" }, "jsonparse": { "version": "1.3.1", @@ -42398,7 +42945,6 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -42539,7 +43085,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, "requires": { "invert-kv": "^1.0.0" } @@ -42854,7 +43399,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, "requires": { "p-locate": "^4.1.0" } @@ -42865,6 +43409,11 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==" + }, "lodash.assignin": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", @@ -42988,8 +43537,7 @@ "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" }, "lodash.once": { "version": "4.1.1", @@ -43138,7 +43686,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -43543,8 +44090,7 @@ "merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" }, "methods": { "version": "1.1.2", @@ -43603,7 +44149,6 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, "requires": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -43636,14 +44181,12 @@ "mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" }, "mime-types": { "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "requires": { "mime-db": "1.52.0" } @@ -43682,7 +44225,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "requires": { "brace-expansion": "^1.1.7" } @@ -43690,8 +44232,7 @@ "minimist": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", - "dev": true + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "minimist-options": { "version": "4.1.0", @@ -43714,7 +44255,6 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dev": true, "requires": { "minipass": "^3.0.0", "yallist": "^4.0.0" @@ -43724,7 +44264,6 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -43771,7 +44310,6 @@ "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, "requires": { "minimist": "^1.2.6" } @@ -44282,8 +44820,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "mustache": { "version": "4.2.0", @@ -44326,8 +44863,12 @@ "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", - "dev": true + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=" + }, + "natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==" }, "negotiator": { "version": "0.6.3", @@ -44414,7 +44955,6 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz", "integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==", - "dev": true, "requires": { "hosted-git-info": "^4.0.1", "is-core-module": "^2.5.0", @@ -44426,7 +44966,6 @@ "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", - "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -46260,7 +46799,6 @@ "version": "8.1.5", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.5.tgz", "integrity": "sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q==", - "dev": true, "requires": { "hosted-git-info": "^4.0.1", "semver": "^7.3.4", @@ -46271,7 +46809,6 @@ "version": "7.5.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", - "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -46291,7 +46828,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dev": true, + "devOptional": true, "requires": { "are-we-there-yet": "~1.1.2", "console-control-strings": "~1.1.0", @@ -46311,8 +46848,7 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "nwsapi": { "version": "2.2.2", @@ -46323,14 +46859,13 @@ "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "dev": true + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" }, "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true + "devOptional": true }, "object-copy": { "version": "0.1.0", @@ -46477,7 +47012,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, "requires": { "wrappy": "1" } @@ -46568,7 +47102,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, "requires": { "lcid": "^1.0.0" } @@ -46619,7 +47152,6 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, "requires": { "p-try": "^2.0.0" } @@ -46628,7 +47160,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, "requires": { "p-limit": "^2.2.0" } @@ -46667,8 +47198,7 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", - "dev": true + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, "pac-proxy-agent": { "version": "6.0.3", @@ -46751,7 +47281,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, "requires": { "callsites": "^3.0.0" } @@ -46848,6 +47377,27 @@ "path-root": "^0.1.1" } }, + "parse-git-config": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz", + "integrity": "sha512-S3LGXJZVSy/hswvbSkfdbKBRVsnqKrVu6j8fcvdtJ4TxosSELyQDsJPuGPXuZ+EyuYuJd3O4uAF8gcISR0OFrQ==", + "requires": { + "extend-shallow": "^2.0.1", + "fs-exists-sync": "^0.1.0", + "git-config-path": "^1.0.1", + "ini": "^1.3.4" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -46898,8 +47448,7 @@ "parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", - "dev": true + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" }, "parse-server": { "version": "git+ssh://git@github.com/parse-community/parse-server.git#c78a5a6f10ce09032579fed8ef4cbd84c1ee96a9", @@ -47057,8 +47606,7 @@ "parsimmon": { "version": "1.18.1", "resolved": "https://registry.npmjs.org/parsimmon/-/parsimmon-1.18.1.tgz", - "integrity": "sha512-u7p959wLfGAhJpSDJVYXoyMCXWYwHia78HhRBWqk7AIbxdmlrfdp5wX0l3xv/iTSH5HvhN9K7o26hwwpgS5Nmw==", - "dev": true + "integrity": "sha512-u7p959wLfGAhJpSDJVYXoyMCXWYwHia78HhRBWqk7AIbxdmlrfdp5wX0l3xv/iTSH5HvhN9K7o26hwwpgS5Nmw==" }, "pascalcase": { "version": "0.1.1", @@ -47081,26 +47629,22 @@ "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "path-platform": { "version": "0.11.15", @@ -47150,8 +47694,7 @@ "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" }, "pbkdf2": { "version": "3.1.2", @@ -47175,8 +47718,7 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "dev": true + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, "pg": { "version": "8.9.0", @@ -47284,8 +47826,7 @@ "picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, "pidtree": { "version": "0.6.0", @@ -47302,14 +47843,12 @@ "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", - "dev": true + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", - "dev": true, "requires": { "pinkie": "^2.0.0" } @@ -47506,7 +48045,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true + "devOptional": true }, "progress": { "version": "2.0.3", @@ -47617,8 +48156,7 @@ "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", - "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", - "dev": true + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==" }, "public-encrypt": { "version": "4.0.3", @@ -47777,8 +48315,7 @@ "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" }, "quick-lru": { "version": "4.0.1", @@ -47974,7 +48511,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -48313,7 +48849,6 @@ "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -48340,14 +48875,12 @@ "qs": { "version": "6.5.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "dev": true + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==" }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "dev": true + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" } } }, @@ -48378,14 +48911,12 @@ "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", - "dev": true + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "requires-port": { "version": "1.0.0", @@ -48406,7 +48937,6 @@ "version": "1.22.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", - "dev": true, "requires": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", @@ -48484,8 +49014,7 @@ "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" }, "rfdc": { "version": "1.3.0", @@ -48497,7 +49026,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, "requires": { "glob": "^7.1.3" } @@ -48516,7 +49044,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "requires": { "queue-microtask": "^1.2.2" } @@ -48539,8 +49066,7 @@ "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "safe-regex": { "version": "1.1.0", @@ -48560,8 +49086,7 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "saslprep": { "version": "1.0.3", @@ -48649,8 +49174,7 @@ "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, "semver-diff": { "version": "3.1.1", @@ -48751,8 +49275,7 @@ "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "set-value": { "version": "2.0.1", @@ -48815,7 +49338,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, "requires": { "shebang-regex": "^3.0.0" } @@ -48823,8 +49345,7 @@ "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" }, "shell-quote": { "version": "1.7.3", @@ -48847,7 +49368,7 @@ "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "devOptional": true }, "signale": { "version": "1.4.0", @@ -48903,8 +49424,7 @@ "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" }, "slice-ansi": { "version": "4.0.0", @@ -48946,8 +49466,7 @@ "slide": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==", - "dev": true + "integrity": "sha512-NwrtjCg+lZoqhFU8fOwl4ay2ei8PaqCBOUV3/ektPY9trO1yQ1oXEfmHAhKArUVUr/hOHvy5f6AdP17dCM0zMw==" }, "smart-buffer": { "version": "4.2.0", @@ -49196,7 +49715,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", - "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -49205,14 +49723,12 @@ "spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", - "dev": true + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==" }, "spdx-expression-parse": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", - "dev": true, "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -49221,8 +49737,7 @@ "spdx-license-ids": { "version": "3.0.12", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.12.tgz", - "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==", - "dev": true + "integrity": "sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==" }, "spex": { "version": "3.2.0", @@ -49260,14 +49775,12 @@ "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", - "dev": true + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" }, "sshpk": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -49284,7 +49797,6 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", - "dev": true, "requires": { "minipass": "^3.1.1" }, @@ -49293,7 +49805,6 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -49510,7 +50021,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dev": true, "requires": { "safe-buffer": "~5.2.0" }, @@ -49518,8 +50028,7 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "dev": true + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" } } }, @@ -49549,7 +50058,6 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -49571,7 +50079,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "requires": { "ansi-regex": "^5.0.1" } @@ -49639,8 +50146,7 @@ "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, "strip-outer": { "version": "1.0.1", @@ -49692,7 +50198,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "requires": { "has-flag": "^3.0.0" } @@ -49727,8 +50232,7 @@ "supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" }, "sver-compat": { "version": "1.5.0", @@ -49774,7 +50278,6 @@ "version": "6.1.15", "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", - "dev": true, "requires": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", @@ -49787,20 +50290,17 @@ "chownr": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "dev": true + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" }, "minipass": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "dev": true + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==" }, "mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" } } }, @@ -49820,7 +50320,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dev": true, "requires": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", @@ -49920,8 +50419,7 @@ "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" }, "through": { "version": "2.3.8", @@ -50025,7 +50523,6 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, "requires": { "rimraf": "^3.0.0" } @@ -50094,7 +50591,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "requires": { "is-number": "^7.0.0" } @@ -50154,7 +50650,6 @@ "version": "2.5.0", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "dev": true, "requires": { "psl": "^1.1.28", "punycode": "^2.1.1" @@ -50163,8 +50658,7 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" } } }, @@ -50211,7 +50705,6 @@ "version": "5.14.0", "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.14.0.tgz", "integrity": "sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==", - "dev": true, "requires": { "babel-code-frame": "^6.22.0", "builtin-modules": "^1.1.1", @@ -50231,14 +50724,12 @@ "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" } } }, @@ -50246,7 +50737,6 @@ "version": "2.29.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", - "dev": true, "requires": { "tslib": "^1.8.1" }, @@ -50254,8 +50744,7 @@ "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" } } }, @@ -50269,7 +50758,6 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -50283,8 +50771,7 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" }, "type": { "version": "1.2.0", @@ -50326,14 +50813,12 @@ "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", - "dev": true + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" }, "typescript": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", - "dev": true, "peer": true }, "uc.micro": { @@ -50564,7 +51049,6 @@ "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, "requires": { "punycode": "^2.1.0" }, @@ -50572,8 +51056,7 @@ "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" } } }, @@ -50669,8 +51152,7 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "utils-merge": { "version": "1.0.1", @@ -50707,7 +51189,6 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", - "dev": true, "requires": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -50717,7 +51198,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz", "integrity": "sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw==", - "dev": true, "requires": { "builtins": "^1.0.3" } @@ -50753,7 +51233,6 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -50763,8 +51242,7 @@ "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" } } }, @@ -51073,7 +51551,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, "requires": { "isexe": "^2.0.0" } @@ -51081,8 +51558,7 @@ "which-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", - "dev": true + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" }, "which-typed-array": { "version": "1.1.9", @@ -51102,11 +51578,16 @@ "version": "1.1.5", "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dev": true, + "devOptional": true, "requires": { "string-width": "^1.0.2 || 2 || 3 || 4" } }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==" + }, "winston": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/winston/-/winston-3.8.1.tgz", @@ -51151,8 +51632,7 @@ "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" }, "wordwrap": { "version": "1.0.0", @@ -51237,8 +51717,7 @@ "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "write-file-atomic": { "version": "4.0.2", @@ -51294,8 +51773,7 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yaml": { "version": "1.10.2", @@ -51337,8 +51815,7 @@ "yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" } } } diff --git a/package.json b/package.json index a2e30b6b2..d36d2c907 100644 --- a/package.json +++ b/package.json @@ -29,9 +29,10 @@ "browser": { "react-native": false }, - "types": "types/index.d.ts", + "types": "types", "dependencies": { "@babel/runtime-corejs3": "7.22.3", + "@definitelytyped/dtslint": "^0.0.163", "idb-keyval": "6.2.1", "react-native-crypto-js": "1.0.0", "uuid": "9.0.0", @@ -39,7 +40,6 @@ "xmlhttprequest": "1.8.0" }, "devDependencies": { - "@babel/preset-typescript": "^7.22.5", "@babel/core": "7.22.0", "@babel/eslint-parser": "7.21.8", "@babel/plugin-proposal-class-properties": "7.18.6", @@ -48,6 +48,7 @@ "@babel/plugin-transform-runtime": "7.21.4", "@babel/preset-env": "7.21.5", "@babel/preset-react": "7.18.6", + "@babel/preset-typescript": "^7.22.5", "@parse/minami": "1.0.0", "@saithodev/semantic-release-backmerge": "2.1.3", "@semantic-release/changelog": "6.0.3", @@ -64,7 +65,6 @@ "codecov": "3.8.3", "core-js": "3.30.2", "cross-env": "7.0.2", - "dtslint": "4.1.3", "eslint": "8.40.0", "eslint-plugin-flowtype": "8.0.3", "eslint-plugin-jsdoc": "43.0.7", @@ -104,7 +104,7 @@ "test": "cross-env PARSE_BUILD=node jest", "test:mongodb": "npm run test:mongodb:runnerstart && npm run integration", "test:mongodb:runnerstart": "mongodb-runner start", - "test:types": "dtslint types", + "test:types": "dtslint --expectOnly types", "posttest:mongodb": "mongodb-runner stop", "lint": "eslint --cache src/ integration/", "lint:fix": "eslint --fix --cache src/ integration/", diff --git a/src/Analytics.ts b/src/Analytics.ts index 19f0996cd..e36ddc2b9 100644 --- a/src/Analytics.ts +++ b/src/Analytics.ts @@ -45,6 +45,7 @@ import CoreManager from './CoreManager'; * @returns {Promise} A promise that is resolved when the round-trip * to the server completes. */ + export function track(name: string, dimensions: { [key: string]: string }): Promise { name = name || ''; name = name.replace(/^\s*/, ''); diff --git a/src/Parse.js b/src/Parse.js deleted file mode 100644 index 606ad731a..000000000 --- a/src/Parse.js +++ /dev/null @@ -1,343 +0,0 @@ -import decode from './decode'; -import encode from './encode'; -import CoreManager from './CoreManager'; -import CryptoController from './CryptoController'; -import EventuallyQueue from './EventuallyQueue'; -import InstallationController from './InstallationController'; -import * as ParseOp from './ParseOp'; -import RESTController from './RESTController'; - -/** - * Contains all Parse API classes and functions. - * - * @static - * @global - * @class - * @hideconstructor - */ -const Parse = { - /** - * Call this method first to set up your authentication tokens for Parse. - * - * @param {string} applicationId Your Parse Application ID. - * @param {string} [javaScriptKey] Your Parse JavaScript Key (Not needed for parse-server) - * @param {string} [masterKey] Your Parse Master Key. (Node.js only!) - * @static - */ - initialize(applicationId: string, javaScriptKey: string) { - if ( - process.env.PARSE_BUILD === 'browser' && - CoreManager.get('IS_NODE') && - !process.env.SERVER_RENDERING - ) { - /* eslint-disable no-console */ - console.log( - "It looks like you're using the browser version of the SDK in a " + - "node.js environment. You should require('parse/node') instead." - ); - /* eslint-enable no-console */ - } - Parse._initialize(applicationId, javaScriptKey); - }, - - _initialize(applicationId: string, javaScriptKey: string, masterKey: string) { - CoreManager.set('APPLICATION_ID', applicationId); - CoreManager.set('JAVASCRIPT_KEY', javaScriptKey); - CoreManager.set('MASTER_KEY', masterKey); - CoreManager.set('USE_MASTER_KEY', false); - }, - - /** - * Call this method to set your AsyncStorage engine - * Starting Parse@1.11, the ParseSDK do not provide a React AsyncStorage as the ReactNative module - * is not provided at a stable path and changes over versions. - * - * @param {AsyncStorage} storage a react native async storage. - * @static - */ - setAsyncStorage(storage: any) { - CoreManager.setAsyncStorage(storage); - }, - - /** - * Call this method to set your LocalDatastoreStorage engine - * If using React-Native use {@link Parse.setAsyncStorage Parse.setAsyncStorage()} - * - * @param {LocalDatastoreController} controller a data storage. - * @static - */ - setLocalDatastoreController(controller: any) { - CoreManager.setLocalDatastoreController(controller); - }, - - /** - * Returns information regarding the current server's health - * - * @returns {Promise} - * @static - */ - getServerHealth() { - return CoreManager.getRESTController().request('GET', 'health'); - }, - - /** - * @member {string} Parse.applicationId - * @static - */ - set applicationId(value) { - CoreManager.set('APPLICATION_ID', value); - }, - get applicationId() { - return CoreManager.get('APPLICATION_ID'); - }, - - /** - * @member {string} Parse.javaScriptKey - * @static - */ - set javaScriptKey(value) { - CoreManager.set('JAVASCRIPT_KEY', value); - }, - get javaScriptKey() { - return CoreManager.get('JAVASCRIPT_KEY'); - }, - - /** - * @member {string} Parse.masterKey - * @static - */ - set masterKey(value) { - CoreManager.set('MASTER_KEY', value); - }, - get masterKey() { - return CoreManager.get('MASTER_KEY'); - }, - - /** - * @member {string} Parse.serverURL - * @static - */ - set serverURL(value) { - CoreManager.set('SERVER_URL', value); - }, - get serverURL() { - return CoreManager.get('SERVER_URL'); - }, - - /** - * @member {string} Parse.serverAuthToken - * @static - */ - set serverAuthToken(value) { - CoreManager.set('SERVER_AUTH_TOKEN', value); - }, - get serverAuthToken() { - return CoreManager.get('SERVER_AUTH_TOKEN'); - }, - - /** - * @member {string} Parse.serverAuthType - * @static - */ - set serverAuthType(value) { - CoreManager.set('SERVER_AUTH_TYPE', value); - }, - get serverAuthType() { - return CoreManager.get('SERVER_AUTH_TYPE'); - }, - - /** - * @member {string} Parse.liveQueryServerURL - * @static - */ - set liveQueryServerURL(value) { - CoreManager.set('LIVEQUERY_SERVER_URL', value); - }, - get liveQueryServerURL() { - return CoreManager.get('LIVEQUERY_SERVER_URL'); - }, - - /** - * @member {string} Parse.encryptedUser - * @static - */ - set encryptedUser(value) { - CoreManager.set('ENCRYPTED_USER', value); - }, - get encryptedUser() { - return CoreManager.get('ENCRYPTED_USER'); - }, - - /** - * @member {string} Parse.secret - * @static - */ - set secret(value) { - CoreManager.set('ENCRYPTED_KEY', value); - }, - get secret() { - return CoreManager.get('ENCRYPTED_KEY'); - }, - - /** - * @member {boolean} Parse.idempotency - * @static - */ - set idempotency(value) { - CoreManager.set('IDEMPOTENCY', value); - }, - get idempotency() { - return CoreManager.get('IDEMPOTENCY'); - }, - - /** - * @member {boolean} Parse.allowCustomObjectId - * @static - */ - set allowCustomObjectId(value) { - CoreManager.set('ALLOW_CUSTOM_OBJECT_ID', value); - }, - get allowCustomObjectId() { - return CoreManager.get('ALLOW_CUSTOM_OBJECT_ID'); - }, -}; - -Parse.ACL = require('./ParseACL').default; -Parse.Analytics = require('./Analytics'); -Parse.AnonymousUtils = require('./AnonymousUtils').default; -Parse.Cloud = require('./Cloud'); -Parse.CLP = require('./ParseCLP').default; -Parse.CoreManager = require('./CoreManager'); -Parse.Config = require('./ParseConfig').default; -Parse.Error = require('./ParseError').default; -Parse.EventuallyQueue = EventuallyQueue; -Parse.FacebookUtils = require('./FacebookUtils').default; -Parse.File = require('./ParseFile').default; -Parse.GeoPoint = require('./ParseGeoPoint').default; -Parse.Polygon = require('./ParsePolygon').default; -Parse.Installation = require('./ParseInstallation').default; -Parse.LocalDatastore = require('./LocalDatastore'); -Parse.Object = require('./ParseObject').default; -Parse.Op = { - Set: ParseOp.SetOp, - Unset: ParseOp.UnsetOp, - Increment: ParseOp.IncrementOp, - Add: ParseOp.AddOp, - Remove: ParseOp.RemoveOp, - AddUnique: ParseOp.AddUniqueOp, - Relation: ParseOp.RelationOp, -}; -Parse.Push = require('./Push'); -Parse.Query = require('./ParseQuery').default; -Parse.Relation = require('./ParseRelation').default; -Parse.Role = require('./ParseRole').default; -Parse.Schema = require('./ParseSchema').default; -Parse.Session = require('./ParseSession').default; -Parse.Storage = require('./Storage'); -Parse.User = require('./ParseUser').default; -Parse.LiveQuery = require('./ParseLiveQuery').default; -Parse.LiveQueryClient = require('./LiveQueryClient').default; -if (process.env.PARSE_BUILD === 'browser') { - Parse.IndexedDB = require('./IndexedDBStorageController'); -} -Parse._request = function (...args) { - return CoreManager.getRESTController().request.apply(null, args); -}; -Parse._ajax = function (...args) { - return CoreManager.getRESTController().ajax.apply(null, args); -}; -// We attempt to match the signatures of the legacy versions of these methods -Parse._decode = function (_, value) { - return decode(value); -}; -Parse._encode = function (value, _, disallowObjects) { - return encode(value, disallowObjects); -}; -Parse._getInstallationId = function () { - return CoreManager.getInstallationController().currentInstallationId(); -}; -/** - * Enable pinning in your application. - * This must be called after `Parse.initialize` in your application. - * - * @param [polling] Allow pinging the server /health endpoint. Default true - * @param [ms] Milliseconds to ping the server. Default 2000ms - * @static - */ -Parse.enableLocalDatastore = function (polling = true, ms: number = 2000) { - if (!Parse.applicationId) { - console.log("'enableLocalDataStore' must be called after 'initialize'"); - return; - } - if (!Parse.LocalDatastore.isEnabled) { - Parse.LocalDatastore.isEnabled = true; - if (polling) { - EventuallyQueue.poll(ms); - } - } -}; -/** - * Flag that indicates whether Local Datastore is enabled. - * - * @static - * @returns {boolean} - */ -Parse.isLocalDatastoreEnabled = function () { - return Parse.LocalDatastore.isEnabled; -}; -/** - * Gets all contents from Local Datastore - * - *
- * await Parse.dumpLocalDatastore();
- * 
- * - * @static - * @returns {object} - */ -Parse.dumpLocalDatastore = function () { - if (!Parse.LocalDatastore.isEnabled) { - console.log('Parse.enableLocalDatastore() must be called first'); // eslint-disable-line no-console - return Promise.resolve({}); - } else { - return Parse.LocalDatastore._getAllContents(); - } -}; - -/** - * Enable the current user encryption. - * This must be called before login any user. - * - * @static - */ -Parse.enableEncryptedUser = function () { - Parse.encryptedUser = true; -}; - -/** - * Flag that indicates whether Encrypted User is enabled. - * - * @static - * @returns {boolean} - */ -Parse.isEncryptedUserEnabled = function () { - return Parse.encryptedUser; -}; - -CoreManager.setCryptoController(CryptoController); -CoreManager.setInstallationController(InstallationController); -CoreManager.setRESTController(RESTController); - -if (process.env.PARSE_BUILD === 'node') { - Parse.initialize = Parse._initialize; - Parse.Cloud = Parse.Cloud || {}; - Parse.Cloud.useMasterKey = function () { - CoreManager.set('USE_MASTER_KEY', true); - }; - Parse.Hooks = require('./ParseHooks'); -} - -// For legacy requires, of the form `var Parse = require('parse').Parse` -Parse.Parse = Parse; - -module.exports = Parse; diff --git a/src/Parse.ts b/src/Parse.ts new file mode 100644 index 000000000..ed7fbd1d3 --- /dev/null +++ b/src/Parse.ts @@ -0,0 +1,449 @@ +import decode from './decode'; +import encode from './encode'; +import CryptoController from './CryptoController'; +import EventuallyQueue from './EventuallyQueue'; +import InstallationController from './InstallationController'; +import * as ParseOp from './ParseOp'; +import RESTController from './RESTController'; +import ACL from './ParseACL'; +import * as Analytics from './Analytics' +import * as AnonymousUtils from './AnonymousUtils' +import Cloud from './Cloud'; +import CLP from './ParseCLP'; +import CoreManager from './CoreManager'; +import Config from './ParseConfig' +import ParseError from './ParseError' +import FacebookUtils from './FacebookUtils' +import File from './ParseFile' +import GeoPoint from './ParseGeoPoint' +import Polygon from './ParsePolygon' +import Installation from './ParseInstallation' +import LocalDatastore from './LocalDatastore' +import Object from './ParseObject' +import Push from './Push' +import Query from './ParseQuery' +import Relation from './ParseRelation' +import Role from './ParseRole' +import Schema from './ParseSchema' +import Session from './ParseSession' +import Storage from './Storage' +import User from './ParseUser' +import LiveQuery from './ParseLiveQuery' +import LiveQueryClient from './LiveQueryClient' + +/** + * Contains all Parse API classes and functions. + * + * @static + * @global + * @class + * @hideconstructor +*/ + + + + +interface Parse { + ACL: any, + Parse?: Parse, + Analytics: any, + AnonymousUtils: any, + Cloud: any, + CLP: any, + CoreManager: any, + Config: any, + Error: any, + EventuallyQueue: any, + FacebookUtils: any, + File: any, + GeoPoint: typeof GeoPoint, + Hooks?: any, + Polygon: any, + Installation: any, + LocalDatastore: any, + Object: typeof Object, + Op: { + Set: typeof ParseOp.SetOp, + Unset: typeof ParseOp.UnsetOp, + Increment: typeof ParseOp.IncrementOp, + Add: typeof ParseOp.AddOp, + Remove: typeof ParseOp.RemoveOp, + AddUnique: typeof ParseOp.AddUniqueOp, + Relation: typeof ParseOp.RelationOp, + }; + Push: any, + Query: typeof Query, + Relation: typeof Relation, + Role: any, + Schema: any, + Session: any, + Storage: any, + User: typeof User, + LiveQuery: any, + LiveQueryClient: any, + + initialize(applicationId: string, javaScriptKey: string): void, + _initialize(applicationId: string, javaScriptKey: string, masterKey?: string): void, + setAsyncStorage(storage: any): void, + setLocalDatastoreController(controller: any): void, + getServerHealth(): Promise + + applicationId: string, + javaScriptKey: string, + masterKey: string, + serverURL: string, + serverAuthToken: string, + serverAuthType: string, + liveQueryServerURL: string, + encryptedUser: string, + secret: string, + idempotency: boolean, + allowCustomObjectId: boolean, + IndexedDB?: any, + _request(...args: any[]): void, + _ajax(...args: any[]): void, + _decode(...args: any[]): void, + _encode(...args: any[]): void, + _getInstallationId?(): string, + enableLocalDatastore(polling: boolean, ms: number): void, + isLocalDatastoreEnabled(): boolean, + dumpLocalDatastore(): void, + enableEncryptedUser(): void, + isEncryptedUserEnabled(): void, +} + +const Parse: Parse = { + ACL: ACL, + Analytics: Analytics, + AnonymousUtils: AnonymousUtils, + Cloud: Cloud, + CLP: CLP, + CoreManager: CoreManager, + Config: Config, + Error: ParseError, + EventuallyQueue: EventuallyQueue, + FacebookUtils: FacebookUtils, + File: File, + GeoPoint: GeoPoint, + Polygon: Polygon, + Installation: Installation, + LocalDatastore: LocalDatastore, + Object: Object, + Op: { + Set: ParseOp.SetOp, + Unset: ParseOp.UnsetOp, + Increment: ParseOp.IncrementOp, + Add: ParseOp.AddOp, + Remove: ParseOp.RemoveOp, + AddUnique: ParseOp.AddUniqueOp, + Relation: ParseOp.RelationOp, + }, + Push: Push, + Query: Query, + Relation: Relation, + Role: Role, + Schema: Schema, + Session: Session, + Storage: Storage, + User: User, + LiveQuery: LiveQuery, + LiveQueryClient: LiveQueryClient, + + + /** + * Call this method first to set up your authentication tokens for Parse. + * + * @param {string} applicationId Your Parse Application ID. + * @param {string} [javaScriptKey] Your Parse JavaScript Key (Not needed for parse-server) + * @param {string} [masterKey] Your Parse Master Key. (Node.js only!) + * @static + */ + initialize(applicationId: string, javaScriptKey: string) { + if ( + process.env.PARSE_BUILD === 'browser' && + CoreManager.get('IS_NODE') && + !process.env.SERVER_RENDERING + ) { + /* eslint-disable no-console */ + console.log( + "It looks like you're using the browser version of the SDK in a " + + "node.js environment. You should require('parse/node') instead." + ); + /* eslint-enable no-console */ + } + Parse._initialize(applicationId, javaScriptKey); + }, + + _initialize(applicationId: string, javaScriptKey: string, masterKey?: string) { + CoreManager.set('APPLICATION_ID', applicationId); + CoreManager.set('JAVASCRIPT_KEY', javaScriptKey); + CoreManager.set('MASTER_KEY', masterKey); + CoreManager.set('USE_MASTER_KEY', false); + }, + + /** + * Call this method to set your AsyncStorage engine + * Starting Parse@1.11, the ParseSDK do not provide a React AsyncStorage as the ReactNative module + * is not provided at a stable path and changes over versions. + * + * @param {AsyncStorage} storage a react native async storage. + * @static + */ + setAsyncStorage(storage: any) { + CoreManager.setAsyncStorage(storage); + }, + + /** + * Call this method to set your LocalDatastoreStorage engine + * If using React-Native use {@link Parse.setAsyncStorage Parse.setAsyncStorage()} + * + * @param {LocalDatastoreController} controller a data storage. + * @static + */ + setLocalDatastoreController(controller: any) { + CoreManager.setLocalDatastoreController(controller); + }, + + /** + * Returns information regarding the current server's health + * + * @returns {Promise} + * @static + */ + getServerHealth() { + return CoreManager.getRESTController().request('GET', 'health'); + }, + + /** + * @member {string} Parse.applicationId + * @static + */ + set applicationId(value) { + CoreManager.set('APPLICATION_ID', value); + }, + get applicationId() { + return CoreManager.get('APPLICATION_ID'); + }, + + /** + * @member {string} Parse.javaScriptKey + * @static + */ + set javaScriptKey(value) { + CoreManager.set('JAVASCRIPT_KEY', value); + }, + get javaScriptKey() { + return CoreManager.get('JAVASCRIPT_KEY'); + }, + + /** + * @member {string} Parse.masterKey + * @static + */ + set masterKey(value) { + CoreManager.set('MASTER_KEY', value); + }, + get masterKey() { + return CoreManager.get('MASTER_KEY'); + }, + + /** + * @member {string} Parse.serverURL + * @static + */ + set serverURL(value) { + CoreManager.set('SERVER_URL', value); + }, + get serverURL() { + return CoreManager.get('SERVER_URL'); + }, + + /** + * @member {string} Parse.serverAuthToken + * @static + */ + set serverAuthToken(value) { + CoreManager.set('SERVER_AUTH_TOKEN', value); + }, + get serverAuthToken() { + return CoreManager.get('SERVER_AUTH_TOKEN'); + }, + + /** + * @member {string} Parse.serverAuthType + * @static + */ + set serverAuthType(value) { + CoreManager.set('SERVER_AUTH_TYPE', value); + }, + get serverAuthType() { + return CoreManager.get('SERVER_AUTH_TYPE'); + }, + + /** + * @member {string} Parse.liveQueryServerURL + * @static + */ + set liveQueryServerURL(value) { + CoreManager.set('LIVEQUERY_SERVER_URL', value); + }, + get liveQueryServerURL() { + return CoreManager.get('LIVEQUERY_SERVER_URL'); + }, + + /** + * @member {string} Parse.encryptedUser + * @static + */ + set encryptedUser(value) { + CoreManager.set('ENCRYPTED_USER', value); + }, + get encryptedUser() { + return CoreManager.get('ENCRYPTED_USER'); + }, + + /** + * @member {string} Parse.secret + * @static + */ + set secret(value) { + CoreManager.set('ENCRYPTED_KEY', value); + }, + get secret() { + return CoreManager.get('ENCRYPTED_KEY'); + }, + + /** + * @member {boolean} Parse.idempotency + * @static + */ + set idempotency(value) { + CoreManager.set('IDEMPOTENCY', value); + }, + get idempotency() { + return CoreManager.get('IDEMPOTENCY'); + }, + + /** + * @member {boolean} Parse.allowCustomObjectId + * @static + */ + set allowCustomObjectId(value) { + CoreManager.set('ALLOW_CUSTOM_OBJECT_ID', value); + }, + get allowCustomObjectId() { + return CoreManager.get('ALLOW_CUSTOM_OBJECT_ID'); + }, + + _request(...args) { + return CoreManager.getRESTController().request.apply(null, args); + }, + + _ajax(...args) { + return CoreManager.getRESTController().ajax.apply(null, args); + }, + + // We attempt to match the signatures of the legacy versions of these methods + _decode(_, value) { + return decode(value); + }, + + _encode(value, _, disallowObjects) { + return encode(value, disallowObjects); + }, + + _getInstallationId () { + return CoreManager.getInstallationController().currentInstallationId(); + }, + /** + * Enable pinning in your application. + * This must be called after `Parse.initialize` in your application. + * + * @param [polling] Allow pinging the server /health endpoint. Default true + * @param [ms] Milliseconds to ping the server. Default 2000ms + * @static + */ + enableLocalDatastore(polling = true, ms: number = 2000) { + if (!this.applicationId) { + console.log("'enableLocalDataStore' must be called after 'initialize'"); + return; + } + if (!this.LocalDatastore.isEnabled) { + this.LocalDatastore.isEnabled = true; + if (polling) { + EventuallyQueue.poll(ms); + } + } + }, + /** + * Flag that indicates whether Local Datastore is enabled. + * + * @static + * @returns {boolean} + */ + isLocalDatastoreEnabled () { + return this.LocalDatastore.isEnabled; + }, + /** + * Gets all contents from Local Datastore + * + *
+   * await Parse.dumpLocalDatastore();
+   * 
+ * + * @static + * @returns {object} + */ + dumpLocalDatastore() { + if (!this.LocalDatastore.isEnabled) { + console.log('Parse.enableLocalDatastore() must be called first'); // eslint-disable-line no-console + return Promise.resolve({}); + } else { + return Parse.LocalDatastore._getAllContents(); + } + }, + + /** + * Enable the current user encryption. + * This must be called before login any user. + * + * @static + */ + enableEncryptedUser () { + this.encryptedUser = true; + }, + + /** + * Flag that indicates whether Encrypted User is enabled. + * + * @static + * @returns {boolean} + */ + isEncryptedUserEnabled () { + return this.encryptedUser; + }, + +}; + +if (process.env.PARSE_BUILD === 'browser') { + Parse.IndexedDB = require('./IndexedDBStorageController'); +} + +CoreManager.setCryptoController(CryptoController); +CoreManager.setInstallationController(InstallationController); +CoreManager.setRESTController(RESTController); + +if (process.env.PARSE_BUILD === 'node') { + Parse.initialize = Parse._initialize; + Parse.Cloud = Parse.Cloud || {}; + Parse.Cloud.useMasterKey = function () { + CoreManager.set('USE_MASTER_KEY', true); + }; + Parse.Hooks = require('./ParseHooks'); +} + +// For legacy requires, of the form `var Parse = require('parse').Parse` +Parse.Parse = Parse; + +module.exports = Parse; +export default Parse; \ No newline at end of file diff --git a/src/ParseGeoPoint.js b/src/ParseGeoPoint.ts similarity index 99% rename from src/ParseGeoPoint.js rename to src/ParseGeoPoint.ts index 3af089e98..1ff522b07 100644 --- a/src/ParseGeoPoint.js +++ b/src/ParseGeoPoint.ts @@ -102,7 +102,7 @@ class ParseGeoPoint { }; } - equals(other: mixed): boolean { + equals(other: any): boolean { return ( other instanceof ParseGeoPoint && this.latitude === other.latitude && diff --git a/src/ParseObject.ts b/src/ParseObject.ts index a26576607..aa8f6eb0a 100644 --- a/src/ParseObject.ts +++ b/src/ParseObject.ts @@ -2204,7 +2204,7 @@ const DefaultController = { } const objs: ParseObject[] = []; const ids: string[] = []; - let className: string | null = null; + let className: string = ''; const results: any[] = []; let error = null; target.forEach(el => { @@ -2243,7 +2243,9 @@ const DefaultController = { return query.find(options).then(async objects => { const idMap: {[key: string]: ParseObject} = {}; objects.forEach(o => { - idMap[o.id] = o; + if (o.id) { + idMap[o.id] = o; + } }); for (let i = 0; i < objs.length; i++) { const obj = objs[i]; diff --git a/src/ParseOp.ts b/src/ParseOp.ts index 7f3848055..bbe73fc4a 100644 --- a/src/ParseOp.ts +++ b/src/ParseOp.ts @@ -297,7 +297,7 @@ export class RemoveOp extends Op { } export class RelationOp extends Op { - _targetClassName?: string | null = null; + _targetClassName: string | undefined | null = null; relationsToAdd: Array = []; relationsToRemove: Array = []; diff --git a/src/ParseQuery.js b/src/ParseQuery.ts similarity index 96% rename from src/ParseQuery.js rename to src/ParseQuery.ts index f2e18b4d0..664e3dff5 100644 --- a/src/ParseQuery.js +++ b/src/ParseQuery.ts @@ -17,7 +17,7 @@ import type { RequestOptions, FullOptions } from './RESTController'; type BatchOptions = FullOptions & { batchSize?: number }; export type WhereClause = { - [attr: string]: mixed, + [attr: string]: any, }; export type QueryJSON = { @@ -31,7 +31,7 @@ export type QueryJSON = { order?: string, className?: string, count?: number, - hint?: mixed, + hint?: any, explain?: boolean, readPreference?: string, includeReadPreference?: string, @@ -59,8 +59,8 @@ function quote(s: string): string { * @private * @returns {string} */ -function _getClassNameFromQueries(queries: Array): ?string { - let className = null; +function _getClassNameFromQueries(queries: Array): string { + let className = ''; queries.forEach(q => { if (!className) { className = q.className; @@ -228,19 +228,19 @@ class ParseQuery { _watch: Array; _include: Array; _exclude: Array; - _select: Array; + _select: Array = []; _limit: number; _skip: number; _count: boolean; - _order: Array; - _readPreference: string; - _includeReadPreference: string; - _subqueryReadPreference: string; + _order: Array = []; + _readPreference: string | undefined | null; + _includeReadPreference: string | undefined | null; + _subqueryReadPreference: string | undefined | null; _queriesLocalDatastore: boolean; _localDatastorePinName: any; - _extraOptions: { [key: string]: mixed }; - _hint: mixed; - _explain: boolean; + _extraOptions: { [key: string]: any }; + _hint: any; + _explain: boolean = false; _xhrRequest: any; /** @@ -256,10 +256,10 @@ class ParseQuery { } else if (objectClass instanceof ParseObject) { this.className = objectClass.className; } else if (typeof objectClass === 'function') { - if (typeof objectClass.className === 'string') { - this.className = objectClass.className; + if (typeof (objectClass as any).className === 'string') { + this.className = (objectClass as any).className; } else { - const obj = new objectClass(); + const obj = new (objectClass as any)(); this.className = obj.className; } } else { @@ -338,7 +338,7 @@ class ParseQuery { * @param value * @returns {Parse.Query} */ - _addCondition(key: string, condition: string, value: mixed): ParseQuery { + _addCondition(key: string, condition: string, value: any): ParseQuery { if (!this._where[key] || typeof this._where[key] === 'string') { this._where[key] = {}; } @@ -612,7 +612,7 @@ class ParseQuery { get(objectId: string, options?: FullOptions): Promise { this.equalTo('objectId', objectId); - const firstOptions = {}; + const firstOptions: FullOptions = {}; if (options && options.hasOwnProperty('useMasterKey')) { firstOptions.useMasterKey = options.useMasterKey; } @@ -651,10 +651,8 @@ class ParseQuery { * @returns {Promise} A promise that is resolved with the results when * the query completes. */ - find(options?: FullOptions): Promise> { - options = options || {}; - - const findOptions = {}; + find(options: FullOptions = {}): Promise> { + const findOptions: FullOptions = {}; if (options.hasOwnProperty('useMasterKey')) { findOptions.useMasterKey = options.useMasterKey; } @@ -727,6 +725,7 @@ class ParseQuery { let result: ParseObject[] = []; await this.eachBatch((objects: ParseObject[]) => { result = [...result, ...objects]; + return Promise.resolve(); }, options); return result; } @@ -744,10 +743,8 @@ class ParseQuery { * @returns {Promise} A promise that is resolved with the count when * the query completes. */ - count(options?: FullOptions): Promise { - options = options || {}; - - const findOptions = {}; + count(options: FullOptions = {}): Promise { + const findOptions: FullOptions = {}; if (options.hasOwnProperty('useMasterKey')) { findOptions.useMasterKey = options.useMasterKey; } @@ -778,10 +775,8 @@ class ParseQuery { * * @returns {Promise} A promise that is resolved with the query completes. */ - distinct(key: string, options?: FullOptions): Promise> { - options = options || {}; - - const distinctOptions = {}; + distinct(key: string, options: FullOptions = {}): Promise> { + const distinctOptions: FullOptions = {}; distinctOptions.useMasterKey = true; if (options.hasOwnProperty('sessionToken')) { @@ -810,9 +805,8 @@ class ParseQuery { * * @returns {Promise} A promise that is resolved with the query completes. */ - aggregate(pipeline: mixed, options?: FullOptions): Promise> { - options = options || {}; - const aggregateOptions = {}; + aggregate(pipeline: any, options: FullOptions = {}): Promise> { + const aggregateOptions: FullOptions = {}; aggregateOptions.useMasterKey = true; if (options.hasOwnProperty('sessionToken')) { @@ -860,10 +854,9 @@ class ParseQuery { * @returns {Promise} A promise that is resolved with the object when * the query completes. */ - first(options?: FullOptions): Promise { - options = options || {}; + first(options: FullOptions = {}): Promise { - const findOptions = {}; + const findOptions: FullOptions = {}; if (options.hasOwnProperty('useMasterKey')) { findOptions.useMasterKey = options.useMasterKey; } @@ -936,7 +929,7 @@ class ParseQuery { * iteration has completed. */ eachBatch( - callback: (objs: Array) => Promise<*>, + callback: (objs: Array) => Promise, options?: BatchOptions ): Promise { options = options || {}; @@ -977,7 +970,7 @@ class ParseQuery { query.ascending('objectId'); - const findOptions = {}; + const findOptions: FullOptions = {}; if (options.hasOwnProperty('useMasterKey')) { findOptions.useMasterKey = options.useMasterKey; } @@ -992,7 +985,7 @@ class ParseQuery { } let finished = false; - let previousResults = []; + let previousResults: ParseObject[] = []; return continueWhile( () => { return !finished; @@ -1053,7 +1046,7 @@ class ParseQuery { * @param {(string|object)} value String or Object of index that should be used when executing query * @returns {Parse.Query} Returns the query, so you can chain this call. */ - hint(value: mixed): ParseQuery { + hint(value: any): ParseQuery { if (typeof value === 'undefined') { delete this._hint; } @@ -1101,7 +1094,7 @@ class ParseQuery { callback: (currentObject: ParseObject, index: number, query: ParseQuery) => any, options?: BatchOptions ): Promise> { - const array = []; + const array: ParseObject[] = []; let index = 0; await this.each(object => { return Promise.resolve(callback(object, index, this)).then(result => { @@ -1189,7 +1182,7 @@ class ParseQuery { callback: (currentObject: ParseObject, index: number, query: ParseQuery) => boolean, options?: BatchOptions ): Promise> { - const array = []; + const array: ParseObject[] = []; let index = 0; await this.each(object => { return Promise.resolve(callback(object, index, this)).then(flag => { @@ -1212,11 +1205,12 @@ class ParseQuery { * @param value The value that the Parse.Object must contain. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - equalTo(key: string | { [key: string]: any }, value: ?mixed): ParseQuery { + equalTo(key: string | { [key: string]: any }, value?: any): ParseQuery { if (key && typeof key === 'object') { Object.entries(key).forEach(([k, val]) => this.equalTo(k, val)); return this; } + key = key as string; if (typeof value === 'undefined') { return this.doesNotExist(key); } @@ -1233,12 +1227,12 @@ class ParseQuery { * @param value The value that must not be equalled. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - notEqualTo(key: string | { [key: string]: any }, value: ?mixed): ParseQuery { + notEqualTo(key: string | { [key: string]: any }, value?: any): ParseQuery { if (key && typeof key === 'object') { Object.entries(key).forEach(([k, val]) => this.notEqualTo(k, val)); return this; } - return this._addCondition(key, '$ne', value); + return this._addCondition(key as string, '$ne', value); } /** @@ -1249,7 +1243,7 @@ class ParseQuery { * @param value The value that provides an upper bound. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - lessThan(key: string, value: mixed): ParseQuery { + lessThan(key: string, value: any): ParseQuery { return this._addCondition(key, '$lt', value); } @@ -1261,7 +1255,7 @@ class ParseQuery { * @param value The value that provides an lower bound. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - greaterThan(key: string, value: mixed): ParseQuery { + greaterThan(key: string, value: any): ParseQuery { return this._addCondition(key, '$gt', value); } @@ -1273,7 +1267,7 @@ class ParseQuery { * @param value The value that provides an upper bound. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - lessThanOrEqualTo(key: string, value: mixed): ParseQuery { + lessThanOrEqualTo(key: string, value: any): ParseQuery { return this._addCondition(key, '$lte', value); } @@ -1285,7 +1279,7 @@ class ParseQuery { * @param {*} value The value that provides an lower bound. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - greaterThanOrEqualTo(key: string, value: mixed): ParseQuery { + greaterThanOrEqualTo(key: string, value: any): ParseQuery { return this._addCondition(key, '$gte', value); } @@ -1297,7 +1291,7 @@ class ParseQuery { * @param {Array<*>} value The values that will match. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - containedIn(key: string, value: Array): ParseQuery { + containedIn(key: string, value: Array): ParseQuery { return this._addCondition(key, '$in', value); } @@ -1309,7 +1303,7 @@ class ParseQuery { * @param {Array<*>} value The values that will not match. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - notContainedIn(key: string, value: Array): ParseQuery { + notContainedIn(key: string, value: Array): ParseQuery { return this._addCondition(key, '$nin', value); } @@ -1321,7 +1315,7 @@ class ParseQuery { * @param {Array} values The values that will match. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - containedBy(key: string, values: Array): ParseQuery { + containedBy(key: string, values: Array): ParseQuery { return this._addCondition(key, '$containedBy', values); } @@ -1333,7 +1327,7 @@ class ParseQuery { * @param {Array} values The values that will match. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - containsAll(key: string, values: Array): ParseQuery { + containsAll(key: string, values: Array): ParseQuery { return this._addCondition(key, '$all', values); } @@ -1519,9 +1513,7 @@ class ParseQuery { * @param {boolean} options.diacriticSensitive A boolean flag to enable or disable diacritic sensitive search. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - fullText(key: string, value: string, options: ?Object): ParseQuery { - options = options || {}; - + fullText(key: string, value: string, options: FullOptions = {}): ParseQuery { if (!key) { throw new Error('A key is required.'); } @@ -1532,7 +1524,7 @@ class ParseQuery { throw new Error('The value being searched for must be a string.'); } - const fullOptions = {}; + const fullOptions: FullOptions = {}; fullOptions.$term = value; for (const option in options) { @@ -1579,7 +1571,7 @@ class ParseQuery { if (typeof prefix !== 'string') { throw new Error('The value being searched for must be a string.'); } - return this.matches(key, this._regexStartWith(prefix), modifiers); + return this.matches(key, new RegExp(this._regexStartWith(prefix)), modifiers); } /** @@ -1595,7 +1587,7 @@ class ParseQuery { if (typeof suffix !== 'string') { throw new Error('The value being searched for must be a string.'); } - return this.matches(key, quote(suffix) + '$', modifiers); + return this.matches(key, new RegExp(quote(suffix) + '$'), modifiers); } /** @@ -2083,7 +2075,7 @@ class ParseQuery { * @param {string} name The name of query source. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - fromPinWithName(name?: string): ParseQuery { + fromPinWithName(name?: string | null): ParseQuery { const localDatastore = CoreManager.getLocalDatastore(); if (localDatastore.checkIfEnabled()) { this._queriesLocalDatastore = true; @@ -2097,7 +2089,7 @@ class ParseQuery { * * @returns {Parse.Query} Returns the query, so you can chain this call. */ - cancel(): ParseQuery { + cancel(): ParseQuery { if (this._xhrRequest.task && typeof this._xhrRequest.task.abort === 'function') { this._xhrRequest.task._aborted = true; this._xhrRequest.task.abort(); @@ -2105,7 +2097,7 @@ class ParseQuery { this._xhrRequest.onchange = () => {}; return this; } - return (this._xhrRequest.onchange = () => this.cancel()); + return (this._xhrRequest.onchange = () => this.cancel())(); } _setRequestTask(options) { @@ -2122,7 +2114,7 @@ const DefaultController = { return RESTController.request('GET', 'classes/' + className, params, options); }, - aggregate(className: string, params: any, options: RequestOptions): Promise> { + aggregate(className: string, params: any, options: RequestOptions): Promise> { const RESTController = CoreManager.getRESTController(); return RESTController.request('GET', 'aggregate/' + className, params, options); diff --git a/src/ParseRelation.js b/src/ParseRelation.ts similarity index 93% rename from src/ParseRelation.js rename to src/ParseRelation.ts index 50c8c09f1..7e410d789 100644 --- a/src/ParseRelation.js +++ b/src/ParseRelation.ts @@ -20,18 +20,17 @@ import ParseQuery from './ParseQuery'; * @alias Parse.Relation */ class ParseRelation { - parent: ?ParseObject; - key: ?string; - targetClassName: ?string; + parent?: ParseObject; + key?: string; + targetClassName: string | undefined | null = null; /** * @param {Parse.Object} parent The parent of this relation. * @param {string} key The key for this relation on the parent. */ - constructor(parent: ?ParseObject, key: ?string) { + constructor(parent?: ParseObject, key?: string) { this.parent = parent; this.key = key; - this.targetClassName = null; } /* @@ -108,10 +107,10 @@ class ParseRelation { * * @returns {object} JSON representation of Relation */ - toJSON(): { __type: 'Relation', className: ?string } { + toJSON(): { __type: 'Relation', className?: string } { return { __type: 'Relation', - className: this.targetClassName, + className: this.targetClassName || undefined, }; } diff --git a/tsconfig.json b/tsconfig.json index c429d8e3c..7e1f1dc08 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,11 @@ { "compilerOptions": { - "target": "esnext", - // Search under node_modules for non-relative imports. - "moduleResolution": "node", - // Process & infer types from .js files. - "allowJs": false, - // Enable strictest settings like strictNullChecks & noImplicitAny. - "strict": true, - // Import non-ES modules as default imports. - "esModuleInterop": true, + "module": "commonjs", + "target": "es2015", "declaration": true, "emitDeclarationOnly": true, - "outFile": "types/types.js", - "noImplicitAny": false + "outDir": "types", + "noImplicitAny": false, }, - "include": ["src"], + "include": ["src/Parse.ts"], } diff --git a/types/Analytics.d.ts b/types/Analytics.d.ts new file mode 100644 index 000000000..5e03afff7 --- /dev/null +++ b/types/Analytics.d.ts @@ -0,0 +1,45 @@ +/** + * @flow + */ +/** + * Parse.Analytics provides an interface to Parse's logging and analytics + * backend. + * + * @class Parse.Analytics + * @static + * @hideconstructor + */ +/** + * Tracks the occurrence of a custom event with additional dimensions. + * Parse will store a data point at the time of invocation with the given + * event name. + * + * Dimensions will allow segmentation of the occurrences of this custom + * event. Keys and values should be {@code String}s, and will throw + * otherwise. + * + * To track a user signup along with additional metadata, consider the + * following: + *
+ * var dimensions = {
+ *  gender: 'm',
+ *  source: 'web',
+ *  dayType: 'weekend'
+ * };
+ * Parse.Analytics.track('signup', dimensions);
+ * 
+ * + * There is a default limit of 8 dimensions per event tracked. + * + * @function track + * @name Parse.Analytics.track + * @param {string} name The name of the custom event to report to Parse as + * having happened. + * @param {object} dimensions The dictionary of information by which to + * segment this event. + * @returns {Promise} A promise that is resolved when the round-trip + * to the server completes. + */ +export declare function track(name: string, dimensions: { + [key: string]: string; +}): Promise; diff --git a/types/ObjectStateMutations.d.ts b/types/ObjectStateMutations.d.ts new file mode 100644 index 000000000..eb4ff5b73 --- /dev/null +++ b/types/ObjectStateMutations.d.ts @@ -0,0 +1,30 @@ +/** + * @flow + */ +import TaskQueue from './TaskQueue'; +import type { Op } from './ParseOp'; +export type AttributeMap = { + [attr: string]: any; +}; +export type OpsMap = { + [attr: string]: Op; +}; +export type ObjectCache = { + [attr: string]: string; +}; +export type State = { + serverData: AttributeMap; + pendingOps: Array; + objectCache: ObjectCache; + tasks: TaskQueue; + existed: boolean; +}; +export declare function defaultState(): State; +export declare function setServerData(serverData: AttributeMap, attributes: AttributeMap): void; +export declare function setPendingOp(pendingOps: Array, attr: string, op?: Op): void; +export declare function pushPendingState(pendingOps: Array): void; +export declare function popPendingState(pendingOps: Array): OpsMap | undefined; +export declare function mergeFirstPendingState(pendingOps: Array): void; +export declare function estimateAttribute(serverData: AttributeMap, pendingOps: Array, className: string, id: string | undefined, attr: string): any; +export declare function estimateAttributes(serverData: AttributeMap, pendingOps: Array, className: string, id?: string): AttributeMap; +export declare function commitServerChanges(serverData: AttributeMap, objectCache: ObjectCache, changes: AttributeMap): void; diff --git a/types/Parse.d.ts b/types/Parse.d.ts new file mode 100644 index 000000000..382569ed4 --- /dev/null +++ b/types/Parse.d.ts @@ -0,0 +1,74 @@ +import * as ParseOp from './ParseOp'; +import GeoPoint from './ParseGeoPoint'; +import Object from './ParseObject'; +import Query from './ParseQuery'; +import Relation from './ParseRelation'; +import User from './ParseUser'; +interface Parse { + ACL: any; + Parse?: Parse; + Analytics: any; + AnonymousUtils: any; + Cloud: any; + CLP: any; + CoreManager: any; + Config: any; + Error: any; + EventuallyQueue: any; + FacebookUtils: any; + File: any; + GeoPoint: typeof GeoPoint; + Hooks?: any; + Polygon: any; + Installation: any; + LocalDatastore: any; + Object: typeof Object; + Op: { + Set: typeof ParseOp.SetOp; + Unset: typeof ParseOp.UnsetOp; + Increment: typeof ParseOp.IncrementOp; + Add: typeof ParseOp.AddOp; + Remove: typeof ParseOp.RemoveOp; + AddUnique: typeof ParseOp.AddUniqueOp; + Relation: typeof ParseOp.RelationOp; + }; + Push: any; + Query: typeof Query; + Relation: typeof Relation; + Role: any; + Schema: any; + Session: any; + Storage: any; + User: typeof User; + LiveQuery: any; + LiveQueryClient: any; + initialize(applicationId: string, javaScriptKey: string): void; + _initialize(applicationId: string, javaScriptKey: string, masterKey?: string): void; + setAsyncStorage(storage: any): void; + setLocalDatastoreController(controller: any): void; + getServerHealth(): Promise; + applicationId: string; + javaScriptKey: string; + masterKey: string; + serverURL: string; + serverAuthToken: string; + serverAuthType: string; + liveQueryServerURL: string; + encryptedUser: string; + secret: string; + idempotency: boolean; + allowCustomObjectId: boolean; + IndexedDB?: any; + _request(...args: any[]): void; + _ajax(...args: any[]): void; + _decode(...args: any[]): void; + _encode(...args: any[]): void; + _getInstallationId?(): string; + enableLocalDatastore(polling: boolean, ms: number): void; + isLocalDatastoreEnabled(): boolean; + dumpLocalDatastore(): void; + enableEncryptedUser(): void; + isEncryptedUserEnabled(): void; +} +declare const Parse: Parse; +export default Parse; diff --git a/types/ParseGeoPoint.d.ts b/types/ParseGeoPoint.d.ts new file mode 100644 index 000000000..bd2d43f15 --- /dev/null +++ b/types/ParseGeoPoint.d.ts @@ -0,0 +1,97 @@ +/** + * @flow + */ +/** + * Creates a new GeoPoint with any of the following forms:
+ *
+ *   new GeoPoint(otherGeoPoint)
+ *   new GeoPoint(30, 30)
+ *   new GeoPoint([30, 30])
+ *   new GeoPoint({latitude: 30, longitude: 30})
+ *   new GeoPoint()  // defaults to (0, 0)
+ *   
+ *

Represents a latitude / longitude point that may be associated + * with a key in a ParseObject or used as a reference point for geo queries. + * This allows proximity-based queries on the key.

+ * + *

Only one key in a class may contain a GeoPoint.

+ * + *

Example:

+ *   var point = new Parse.GeoPoint(30.0, -20.0);
+ *   var object = new Parse.Object("PlaceObject");
+ *   object.set("location", point);
+ *   object.save();

+ * + * @alias Parse.GeoPoint + */ +declare class ParseGeoPoint { + _latitude: number; + _longitude: number; + /** + * @param {(number[] | object | number)} arg1 Either a list of coordinate pairs, an object with `latitude`, `longitude`, or the latitude or the point. + * @param {number} arg2 The longitude of the GeoPoint + */ + constructor(arg1: Array | { + latitude: number; + longitude: number; + } | number, arg2?: number); + /** + * North-south portion of the coordinate, in range [-90, 90]. + * Throws an exception if set out of range in a modern browser. + * + * @property {number} latitude + * @returns {number} + */ + get latitude(): number; + set latitude(val: number); + /** + * East-west portion of the coordinate, in range [-180, 180]. + * Throws if set out of range in a modern browser. + * + * @property {number} longitude + * @returns {number} + */ + get longitude(): number; + set longitude(val: number); + /** + * Returns a JSON representation of the GeoPoint, suitable for Parse. + * + * @returns {object} + */ + toJSON(): { + __type: string; + latitude: number; + longitude: number; + }; + equals(other: any): boolean; + /** + * Returns the distance from this GeoPoint to another in radians. + * + * @param {Parse.GeoPoint} point the other Parse.GeoPoint. + * @returns {number} + */ + radiansTo(point: ParseGeoPoint): number; + /** + * Returns the distance from this GeoPoint to another in kilometers. + * + * @param {Parse.GeoPoint} point the other Parse.GeoPoint. + * @returns {number} + */ + kilometersTo(point: ParseGeoPoint): number; + /** + * Returns the distance from this GeoPoint to another in miles. + * + * @param {Parse.GeoPoint} point the other Parse.GeoPoint. + * @returns {number} + */ + milesTo(point: ParseGeoPoint): number; + static _validate(latitude: number, longitude: number): void; + /** + * Creates a GeoPoint with the user's current location, if available. + * + * @static + * @returns {Parse.GeoPoint} User's current location + */ + static current(): void; +} +export default ParseGeoPoint; diff --git a/types/ParseObject.d.ts b/types/ParseObject.d.ts new file mode 100644 index 000000000..a40205936 --- /dev/null +++ b/types/ParseObject.d.ts @@ -0,0 +1,1012 @@ +/** + * @flow + */ +import ParseACL from './ParseACL'; +import ParseError from './ParseError'; +import { Op } from './ParseOp'; +import ParseRelation from './ParseRelation'; +import type { AttributeMap, OpsMap } from './ObjectStateMutations'; +import type { RequestOptions, FullOptions } from './RESTController'; +export type Pointer = { + __type: string; + className: string; + objectId?: string; + _localId?: string; +}; +type SaveParams = { + method: string; + path: string; + body: AttributeMap; +}; +export type SaveOptions = FullOptions & { + cascadeSave?: boolean; + context?: AttributeMap; +}; +/** + * Creates a new model with defined attributes. + * + *

You won't normally call this method directly. It is recommended that + * you use a subclass of Parse.Object instead, created by calling + * extend.

+ * + *

However, if you don't want to use a subclass, or aren't sure which + * subclass is appropriate, you can use this form:

+ *     var object = new Parse.Object("ClassName");
+ * 
+ * That is basically equivalent to:
+ *     var MyClass = Parse.Object.extend("ClassName");
+ *     var object = new MyClass();
+ * 

+ * + * @alias Parse.Object + */ +declare class ParseObject { + /** + * @param {string} className The class name for the object + * @param {object} attributes The initial set of data to store in the object. + * @param {object} options The options for this object instance. + */ + constructor(className?: string | { + className: string; + [attr: string]: any; + }, attributes?: { + [attr: string]: any; + }, options?: { + ignoreValidation: boolean; + } | { + [attr: string]: any; + }); + /** + * The ID of this object, unique within its class. + * + * @property {string} id + */ + id?: string; + _localId?: string; + _objCount: number; + className: string; + _initializers?: ((...args: Array) => void)[]; + get attributes(): AttributeMap; + /** + * The first time this object was saved on the server. + * + * @property {Date} createdAt + * @returns {Date} + */ + get createdAt(): Date | null | undefined; + /** + * The last time this object was updated on the server. + * + * @property {Date} updatedAt + * @returns {Date} + */ + get updatedAt(): Date | null | undefined; + /** + * Returns a local or server Id used uniquely identify this object + * + * @returns {string} + */ + _getId(): string; + /** + * Returns a unique identifier used to pull data from the State Controller. + * + * @returns {Parse.Object|object} + */ + _getStateIdentifier(): ParseObject | { + id: string; + className: string; + }; + _getServerData(): AttributeMap; + _clearServerData(): void; + _getPendingOps(): Array; + /** + * @param {Array} [keysToClear] - if specified, only ops matching + * these fields will be cleared + */ + _clearPendingOps(keysToClear?: Array): void; + _getDirtyObjectAttributes(): AttributeMap; + _toFullJSON(seen?: Array, offline?: boolean): AttributeMap; + _getSaveJSON(): AttributeMap; + _getSaveParams(): SaveParams; + _finishFetch(serverData: AttributeMap): void; + _setExisted(existed: boolean): void; + _migrateId(serverId: string): void; + _handleSaveResponse(response: AttributeMap, status: number): void; + _handleSaveError(): void; + static _getClassMap(): {}; + initialize(): void; + /** + * Returns a JSON version of the object suitable for saving to Parse. + * + * @param seen + * @param offline + * @returns {object} + */ + toJSON(seen: Array | void, offline?: boolean): AttributeMap; + /** + * Determines whether this ParseObject is equal to another ParseObject + * + * @param {object} other - An other object ot compare + * @returns {boolean} + */ + equals(other: any): boolean; + /** + * Returns true if this object has been modified since its last + * save/refresh. If an attribute is specified, it returns true only if that + * particular attribute has been modified since the last save/refresh. + * + * @param {string} attr An attribute name (optional). + * @returns {boolean} + */ + dirty(attr?: string): boolean; + /** + * Returns an array of keys that have been modified since last save/refresh + * + * @returns {string[]} + */ + dirtyKeys(): Array; + /** + * Returns true if the object has been fetched. + * + * @returns {boolean} + */ + isDataAvailable(): boolean; + /** + * Gets a Pointer referencing this Object. + * + * @returns {Pointer} + */ + toPointer(): Pointer; + /** + * Gets a Pointer referencing this Object. + * + * @returns {Pointer} + */ + toOfflinePointer(): Pointer; + /** + * Gets the value of an attribute. + * + * @param {string} attr The string name of an attribute. + * @returns {*} + */ + get(attr: string): any; + /** + * Gets a relation on the given class for the attribute. + * + * @param {string} attr The attribute to get the relation for. + * @returns {Parse.Relation} + */ + relation(attr: string): ParseRelation; + /** + * Gets the HTML-escaped value of an attribute. + * + * @param {string} attr The string name of an attribute. + * @returns {string} + */ + escape(attr: string): string; + /** + * Returns true if the attribute contains a value that is not + * null or undefined. + * + * @param {string} attr The string name of the attribute. + * @returns {boolean} + */ + has(attr: string): boolean; + /** + * Sets a hash of model attributes on the object. + * + *

You can call it with an object containing keys and values, with one + * key and value, or dot notation. For example:

+     *   gameTurn.set({
+     *     player: player1,
+     *     diceRoll: 2
+     *   }, {
+     *     error: function(gameTurnAgain, error) {
+     *       // The set failed validation.
+     *     }
+     *   });
+     *
+     *   game.set("currentPlayer", player2, {
+     *     error: function(gameTurnAgain, error) {
+     *       // The set failed validation.
+     *     }
+     *   });
+     *
+     *   game.set("finished", true);

+ * + * game.set("player.score", 10);

+ * + * @param {(string|object)} key The key to set. + * @param {(string|object)} value The value to give it. + * @param {object} options A set of options for the set. + * The only supported option is error. + * @returns {(ParseObject|boolean)} true if the set succeeded. + */ + set(key: any, value?: any, options?: any): ParseObject | boolean; + /** + * Remove an attribute from the model. This is a noop if the attribute doesn't + * exist. + * + * @param {string} attr The string name of an attribute. + * @param options + * @returns {(ParseObject | boolean)} + */ + unset(attr: string, options?: { + [opt: string]: any; + }): ParseObject | boolean; + /** + * Atomically increments the value of the given attribute the next time the + * object is saved. If no amount is specified, 1 is used by default. + * + * @param attr {String} The key. + * @param amount {Number} The amount to increment by (optional). + * @returns {(ParseObject|boolean)} + */ + increment(attr: string, amount?: number): ParseObject | boolean; + /** + * Atomically decrements the value of the given attribute the next time the + * object is saved. If no amount is specified, 1 is used by default. + * + * @param attr {String} The key. + * @param amount {Number} The amount to decrement by (optional). + * @returns {(ParseObject | boolean)} + */ + decrement(attr: string, amount?: number): ParseObject | boolean; + /** + * Atomically add an object to the end of the array associated with a given + * key. + * + * @param attr {String} The key. + * @param item {} The item to add. + * @returns {(ParseObject | boolean)} + */ + add(attr: string, item: any): ParseObject | boolean; + /** + * Atomically add the objects to the end of the array associated with a given + * key. + * + * @param attr {String} The key. + * @param items {Object[]} The items to add. + * @returns {(ParseObject | boolean)} + */ + addAll(attr: string, items: Array): ParseObject | boolean; + /** + * Atomically add an object to the array associated with a given key, only + * if it is not already present in the array. The position of the insert is + * not guaranteed. + * + * @param attr {String} The key. + * @param item {} The object to add. + * @returns {(ParseObject | boolean)} + */ + addUnique(attr: string, item: any): ParseObject | boolean; + /** + * Atomically add the objects to the array associated with a given key, only + * if it is not already present in the array. The position of the insert is + * not guaranteed. + * + * @param attr {String} The key. + * @param items {Object[]} The objects to add. + * @returns {(ParseObject | boolean)} + */ + addAllUnique(attr: string, items: Array): ParseObject | boolean; + /** + * Atomically remove all instances of an object from the array associated + * with a given key. + * + * @param attr {String} The key. + * @param item {} The object to remove. + * @returns {(ParseObject | boolean)} + */ + remove(attr: string, item: any): ParseObject | boolean; + /** + * Atomically remove all instances of the objects from the array associated + * with a given key. + * + * @param attr {String} The key. + * @param items {Object[]} The object to remove. + * @returns {(ParseObject | boolean)} + */ + removeAll(attr: string, items: Array): ParseObject | boolean; + /** + * Returns an instance of a subclass of Parse.Op describing what kind of + * modification has been performed on this field since the last time it was + * saved. For example, after calling object.increment("x"), calling + * object.op("x") would return an instance of Parse.Op.Increment. + * + * @param attr {String} The key. + * @returns {Parse.Op | undefined} The operation, or undefined if none. + */ + op(attr: string): Op | null | undefined; + /** + * Creates a new model with identical attributes to this one. + * + * @returns {Parse.Object} + */ + clone(): any; + /** + * Creates a new instance of this object. Not to be confused with clone() + * + * @returns {Parse.Object} + */ + newInstance(): any; + /** + * Returns true if this object has never been saved to Parse. + * + * @returns {boolean} + */ + isNew(): boolean; + /** + * Returns true if this object was created by the Parse server when the + * object might have already been there (e.g. in the case of a Facebook + * login) + * + * @returns {boolean} + */ + existed(): boolean; + /** + * Returns true if this object exists on the Server + * + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @returns {Promise} A boolean promise that is fulfilled if object exists. + */ + exists(options?: RequestOptions): Promise; + /** + * Checks if the model is currently in a valid state. + * + * @returns {boolean} + */ + isValid(): boolean; + /** + * You should not call this function directly unless you subclass + * Parse.Object, in which case you can override this method + * to provide additional validation on set and + * save. Your implementation should return + * + * @param {object} attrs The current data to validate. + * @returns {Parse.Error|boolean} False if the data is valid. An error object otherwise. + * @see Parse.Object#set + */ + validate(attrs: AttributeMap): ParseError | boolean; + /** + * Returns the ACL for this object. + * + * @returns {Parse.ACL} An instance of Parse.ACL. + * @see Parse.Object#get + */ + getACL(): ParseACL | null; + /** + * Sets the ACL to be used for this object. + * + * @param {Parse.ACL} acl An instance of Parse.ACL. + * @param {object} options + * @returns {(ParseObject | boolean)} Whether the set passed validation. + * @see Parse.Object#set + */ + setACL(acl: ParseACL, options?: any): ParseObject | boolean; + /** + * Clears any (or specific) changes to this object made since the last call to save() + * + * @param {string} [keys] - specify which fields to revert + */ + revert(...keys: Array): void; + /** + * Clears all attributes on a model + * + * @returns {(ParseObject | boolean)} + */ + clear(): ParseObject | boolean; + /** + * Fetch the model from the server. If the server's representation of the + * model differs from its current attributes, they will be overriden. + * + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • include: The name(s) of the key(s) to include. Can be a string, an array of strings, + * or an array of array of strings. + *
  • context: A dictionary that is accessible in Cloud Code `beforeFind` trigger. + *
+ * @returns {Promise} A promise that is fulfilled when the fetch + * completes. + */ + fetch(options: RequestOptions): Promise; + /** + * Fetch the model from the server. If the server's representation of the + * model differs from its current attributes, they will be overriden. + * + * Includes nested Parse.Objects for the provided key. You can use dot + * notation to specify which fields in the included object are also fetched. + * + * @param {string | Array>} keys The name(s) of the key(s) to include. + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @returns {Promise} A promise that is fulfilled when the fetch + * completes. + */ + fetchWithInclude(keys: String | Array>, options: RequestOptions): Promise; + /** + * Saves this object to the server at some unspecified time in the future, + * even if Parse is currently inaccessible. + * + * Use this when you may not have a solid network connection, and don't need to know when the save completes. + * If there is some problem with the object such that it can't be saved, it will be silently discarded. + * + * Objects saved with this method will be stored locally in an on-disk cache until they can be delivered to Parse. + * They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection is + * available. Objects saved this way will persist even after the app is closed, in which case they will be sent the + * next time the app is opened. + * + * @param {object} [options] + * Used to pass option parameters to method if arg1 and arg2 were both passed as strings. + * Valid options are: + *
    + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • cascadeSave: If `false`, nested objects will not be saved (default is `true`). + *
  • context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers. + *
+ * @returns {Promise} A promise that is fulfilled when the save + * completes. + */ + saveEventually(options: SaveOptions): Promise; + /** + * Set a hash of model attributes, and save the model to the server. + * updatedAt will be updated when the request returns. + * You can either call it as:
+     * object.save();
+ * or
+     * object.save(attrs);
+ * or
+     * object.save(null, options);
+ * or
+     * object.save(attrs, options);
+ * or
+     * object.save(key, value);
+ * or
+     * object.save(key, value, options);
+ * + * Example 1:
+     * gameTurn.save({
+     * player: "Jake Cutter",
+     * diceRoll: 2
+     * }).then(function(gameTurnAgain) {
+     * // The save was successful.
+     * }, function(error) {
+     * // The save failed.  Error is an instance of Parse.Error.
+     * });
+ * + * Example 2:
+     * gameTurn.save("player", "Jake Cutter");
+ * + * @param {string | object | null} [arg1] + * Valid options are:
    + *
  • `Object` - Key/value pairs to update on the object.
  • + *
  • `String` Key - Key of attribute to update (requires arg2 to also be string)
  • + *
  • `null` - Passing null for arg1 allows you to save the object with options passed in arg2.
  • + *
+ * @param {string | object} [arg2] + *
    + *
  • `String` Value - If arg1 was passed as a key, arg2 is the value that should be set on that key.
  • + *
  • `Object` Options - Valid options are: + *
      + *
    • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
    • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
    • cascadeSave: If `false`, nested objects will not be saved (default is `true`). + *
    • context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers. + *
    + *
  • + *
+ * @param {object} [arg3] + * Used to pass option parameters to method if arg1 and arg2 were both passed as strings. + * Valid options are: + *
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • cascadeSave: If `false`, nested objects will not be saved (default is `true`). + *
  • context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers. + *
+ * @returns {Promise} A promise that is fulfilled when the save + * completes. + */ + save(arg1: { + [attr: string]: any; + } | undefined | null, arg2: SaveOptions | any, arg3?: SaveOptions): Promise; + /** + * Deletes this object from the server at some unspecified time in the future, + * even if Parse is currently inaccessible. + * + * Use this when you may not have a solid network connection, + * and don't need to know when the delete completes. If there is some problem with the object + * such that it can't be deleted, the request will be silently discarded. + * + * Delete instructions made with this method will be stored locally in an on-disk cache until they can be transmitted + * to Parse. They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection + * is available. Delete requests will persist even after the app is closed, in which case they will be sent the + * next time the app is opened. + * + * @param {object} [options] + * Valid options are:
    + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers. + *
+ * @returns {Promise} A promise that is fulfilled when the destroy + * completes. + */ + destroyEventually(options: RequestOptions): Promise; + /** + * Destroy this model on the server if it was already persisted. + * + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers. + *
+ * @returns {Promise} A promise that is fulfilled when the destroy + * completes. + */ + destroy(options: RequestOptions): Promise; + /** + * Asynchronously stores the object and every object it points to in the local datastore, + * recursively, using a default pin name: _default. + * + * If those other objects have not been fetched from Parse, they will not be stored. + * However, if they have changed data, all the changes will be retained. + * + *
+     * await object.pin();
+     * 
+ * + * To retrieve object: + * query.fromLocalDatastore() or query.fromPin() + * + * @returns {Promise} A promise that is fulfilled when the pin completes. + */ + pin(): Promise; + /** + * Asynchronously removes the object and every object it points to in the local datastore, + * recursively, using a default pin name: _default. + * + *
+     * await object.unPin();
+     * 
+ * + * @returns {Promise} A promise that is fulfilled when the unPin completes. + */ + unPin(): Promise; + /** + * Asynchronously returns if the object is pinned + * + *
+     * const isPinned = await object.isPinned();
+     * 
+ * + * @returns {Promise} A boolean promise that is fulfilled if object is pinned. + */ + isPinned(): Promise; + /** + * Asynchronously stores the objects and every object they point to in the local datastore, recursively. + * + * If those other objects have not been fetched from Parse, they will not be stored. + * However, if they have changed data, all the changes will be retained. + * + *
+     * await object.pinWithName(name);
+     * 
+ * + * To retrieve object: + * query.fromLocalDatastore() or query.fromPinWithName(name) + * + * @param {string} name Name of Pin. + * @returns {Promise} A promise that is fulfilled when the pin completes. + */ + pinWithName(name: string): Promise; + /** + * Asynchronously removes the object and every object it points to in the local datastore, recursively. + * + *
+     * await object.unPinWithName(name);
+     * 
+ * + * @param {string} name Name of Pin. + * @returns {Promise} A promise that is fulfilled when the unPin completes. + */ + unPinWithName(name: string): Promise; + /** + * Asynchronously loads data from the local datastore into this object. + * + *
+     * await object.fetchFromLocalDatastore();
+     * 
+ * + * You can create an unfetched pointer with Parse.Object.createWithoutData() + * and then call fetchFromLocalDatastore() on it. + * + * @returns {Promise} A promise that is fulfilled when the fetch completes. + */ + fetchFromLocalDatastore(): Promise; + static _clearAllState(): void; + /** + * Fetches the given list of Parse.Object. + * If any error is encountered, stops and calls the error handler. + * + *
+     *   Parse.Object.fetchAll([object1, object2, ...])
+     *    .then((list) => {
+     *      // All the objects were fetched.
+     *    }, (error) => {
+     *      // An error occurred while fetching one of the objects.
+     *    });
+     * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • include: The name(s) of the key(s) to include. Can be a string, an array of strings, + * or an array of array of strings. + *
+ * @static + * @returns {Parse.Object[]} + */ + static fetchAll(list: Array, options?: RequestOptions): any; + /** + * Fetches the given list of Parse.Object. + * + * Includes nested Parse.Objects for the provided key. You can use dot + * notation to specify which fields in the included object are also fetched. + * + * If any error is encountered, stops and calls the error handler. + * + *
+     *   Parse.Object.fetchAllWithInclude([object1, object2, ...], [pointer1, pointer2, ...])
+     *    .then((list) => {
+     *      // All the objects were fetched.
+     *    }, (error) => {
+     *      // An error occurred while fetching one of the objects.
+     *    });
+     * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {string | Array>} keys The name(s) of the key(s) to include. + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @static + * @returns {Parse.Object[]} + */ + static fetchAllWithInclude(list: Array, keys: String | Array>, options: RequestOptions): any; + /** + * Fetches the given list of Parse.Object if needed. + * If any error is encountered, stops and calls the error handler. + * + * Includes nested Parse.Objects for the provided key. You can use dot + * notation to specify which fields in the included object are also fetched. + * + * If any error is encountered, stops and calls the error handler. + * + *
+     *   Parse.Object.fetchAllIfNeededWithInclude([object1, object2, ...], [pointer1, pointer2, ...])
+     *    .then((list) => {
+     *      // All the objects were fetched.
+     *    }, (error) => {
+     *      // An error occurred while fetching one of the objects.
+     *    });
+     * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {string | Array>} keys The name(s) of the key(s) to include. + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @static + * @returns {Parse.Object[]} + */ + static fetchAllIfNeededWithInclude(list: Array, keys: String | Array>, options: RequestOptions): any; + /** + * Fetches the given list of Parse.Object if needed. + * If any error is encountered, stops and calls the error handler. + * + *
+     *   Parse.Object.fetchAllIfNeeded([object1, ...])
+     *    .then((list) => {
+     *      // Objects were fetched and updated.
+     *    }, (error) => {
+     *      // An error occurred while fetching one of the objects.
+     *    });
+     * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {object} options + * @static + * @returns {Parse.Object[]} + */ + static fetchAllIfNeeded(list: Array, options?: RequestOptions): any; + static handleIncludeOptions(options: any): string[]; + /** + * Destroy the given list of models on the server if it was already persisted. + * + *

Unlike saveAll, if an error occurs while deleting an individual model, + * this method will continue trying to delete the rest of the models if + * possible, except in the case of a fatal error like a connection error. + * + *

In particular, the Parse.Error object returned in the case of error may + * be one of two types: + * + *

    + *
  • A Parse.Error.AGGREGATE_ERROR. This object's "errors" property is an + * array of other Parse.Error objects. Each error object in this array + * has an "object" property that references the object that could not be + * deleted (for instance, because that object could not be found).
  • + *
  • A non-aggregate Parse.Error. This indicates a serious error that + * caused the delete operation to be aborted partway through (for + * instance, a connection failure in the middle of the delete).
  • + *
+ * + *
+     * Parse.Object.destroyAll([object1, object2, ...])
+     * .then((list) => {
+     * // All the objects were deleted.
+     * }, (error) => {
+     * // An error occurred while deleting one or more of the objects.
+     * // If this is an aggregate error, then we can inspect each error
+     * // object individually to determine the reason why a particular
+     * // object was not deleted.
+     * if (error.code === Parse.Error.AGGREGATE_ERROR) {
+     * for (var i = 0; i < error.errors.length; i++) {
+     * console.log("Couldn't delete " + error.errors[i].object.id +
+     * "due to " + error.errors[i].message);
+     * }
+     * } else {
+     * console.log("Delete aborted because of " + error.message);
+     * }
+     * });
+     * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled when the destroyAll + * completes. + */ + static destroyAll(list: Array, options?: RequestOptions): any; + /** + * Saves the given list of Parse.Object. + * If any error is encountered, stops and calls the error handler. + * + *
+     * Parse.Object.saveAll([object1, object2, ...])
+     * .then((list) => {
+     * // All the objects were saved.
+     * }, (error) => {
+     * // An error occurred while saving one of the objects.
+     * });
+     * 
+ * + * @param {Array} list A list of Parse.Object. + * @param {object} options + * @static + * @returns {Parse.Object[]} + */ + static saveAll(list: Array, options?: RequestOptions): any; + /** + * Creates a reference to a subclass of Parse.Object with the given id. This + * does not exist on Parse.Object, only on subclasses. + * + *

A shortcut for:

+     *  var Foo = Parse.Object.extend("Foo");
+     *  var pointerToFoo = new Foo();
+     *  pointerToFoo.id = "myObjectId";
+     * 
+ * + * @param {string} id The ID of the object to create a reference to. + * @static + * @returns {Parse.Object} A Parse.Object reference. + */ + static createWithoutData(id: string): ParseObject; + /** + * Creates a new instance of a Parse Object from a JSON representation. + * + * @param {object} json The JSON map of the Object's data + * @param {boolean} override In single instance mode, all old server data + * is overwritten if this is set to true + * @param {boolean} dirty Whether the Parse.Object should set JSON keys to dirty + * @static + * @returns {Parse.Object} A Parse.Object reference + */ + static fromJSON(json: any, override?: boolean, dirty?: boolean): any; + /** + * Registers a subclass of Parse.Object with a specific class name. + * When objects of that class are retrieved from a query, they will be + * instantiated with this subclass. + * This is only necessary when using ES6 subclassing. + * + * @param {string} className The class name of the subclass + * @param {Function} constructor The subclass + */ + static registerSubclass(className: string, constructor: any): void; + /** + * Unegisters a subclass of Parse.Object with a specific class name. + * + * @param {string} className The class name of the subclass + */ + static unregisterSubclass(className: string): void; + /** + * Creates a new subclass of Parse.Object for the given Parse class name. + * + *

Every extension of a Parse class will inherit from the most recent + * previous extension of that class. When a Parse.Object is automatically + * created by parsing JSON, it will use the most recent extension of that + * class.

+ * + *

You should call either:

+     *     var MyClass = Parse.Object.extend("MyClass", {
+     *         Instance methods,
+     *         initialize: function(attrs, options) {
+     *             this.someInstanceProperty = [],
+     *             Other instance properties
+     *         }
+     *     }, {
+     *         Class properties
+     *     });
+ * or, for Backbone compatibility:
+     *     var MyClass = Parse.Object.extend({
+     *         className: "MyClass",
+     *         Instance methods,
+     *         initialize: function(attrs, options) {
+     *             this.someInstanceProperty = [],
+     *             Other instance properties
+     *         }
+     *     }, {
+     *         Class properties
+     *     });

+ * + * @param {string} className The name of the Parse class backing this model. + * @param {object} protoProps Instance properties to add to instances of the + * class returned from this method. + * @param {object} classProps Class properties to add the class returned from + * this method. + * @returns {Parse.Object} A new subclass of Parse.Object. + */ + static extend(className: any, protoProps: any, classProps: any): any; + /** + * Enable single instance objects, where any local objects with the same Id + * share the same attributes, and stay synchronized with each other. + * This is disabled by default in server environments, since it can lead to + * security issues. + * + * @static + */ + static enableSingleInstance(): void; + /** + * Disable single instance objects, where any local objects with the same Id + * share the same attributes, and stay synchronized with each other. + * When disabled, you can have two instances of the same object in memory + * without them sharing attributes. + * + * @static + */ + static disableSingleInstance(): void; + /** + * Asynchronously stores the objects and every object they point to in the local datastore, + * recursively, using a default pin name: _default. + * + * If those other objects have not been fetched from Parse, they will not be stored. + * However, if they have changed data, all the changes will be retained. + * + *
+     * await Parse.Object.pinAll([...]);
+     * 
+ * + * To retrieve object: + * query.fromLocalDatastore() or query.fromPin() + * + * @param {Array} objects A list of Parse.Object. + * @returns {Promise} A promise that is fulfilled when the pin completes. + * @static + */ + static pinAll(objects: Array): Promise; + /** + * Asynchronously stores the objects and every object they point to in the local datastore, recursively. + * + * If those other objects have not been fetched from Parse, they will not be stored. + * However, if they have changed data, all the changes will be retained. + * + *
+     * await Parse.Object.pinAllWithName(name, [obj1, obj2, ...]);
+     * 
+ * + * To retrieve object: + * query.fromLocalDatastore() or query.fromPinWithName(name) + * + * @param {string} name Name of Pin. + * @param {Array} objects A list of Parse.Object. + * @returns {Promise} A promise that is fulfilled when the pin completes. + * @static + */ + static pinAllWithName(name: string, objects: Array): Promise; + /** + * Asynchronously removes the objects and every object they point to in the local datastore, + * recursively, using a default pin name: _default. + * + *
+     * await Parse.Object.unPinAll([...]);
+     * 
+ * + * @param {Array} objects A list of Parse.Object. + * @returns {Promise} A promise that is fulfilled when the unPin completes. + * @static + */ + static unPinAll(objects: Array): Promise; + /** + * Asynchronously removes the objects and every object they point to in the local datastore, recursively. + * + *
+     * await Parse.Object.unPinAllWithName(name, [obj1, obj2, ...]);
+     * 
+ * + * @param {string} name Name of Pin. + * @param {Array} objects A list of Parse.Object. + * @returns {Promise} A promise that is fulfilled when the unPin completes. + * @static + */ + static unPinAllWithName(name: string, objects: Array): Promise; + /** + * Asynchronously removes all objects in the local datastore using a default pin name: _default. + * + *
+     * await Parse.Object.unPinAllObjects();
+     * 
+ * + * @returns {Promise} A promise that is fulfilled when the unPin completes. + * @static + */ + static unPinAllObjects(): Promise; + /** + * Asynchronously removes all objects with the specified pin name. + * Deletes the pin name also. + * + *
+     * await Parse.Object.unPinAllObjectsWithName(name);
+     * 
+ * + * @param {string} name Name of Pin. + * @returns {Promise} A promise that is fulfilled when the unPin completes. + * @static + */ + static unPinAllObjectsWithName(name: string): Promise; +} +export default ParseObject; diff --git a/types/ParseOp.d.ts b/types/ParseOp.d.ts new file mode 100644 index 000000000..fa2f7011e --- /dev/null +++ b/types/ParseOp.d.ts @@ -0,0 +1,84 @@ +/** + * @flow + */ +import ParseObject from './ParseObject'; +import ParseRelation from './ParseRelation'; +export declare function opFromJSON(json: { + [key: string]: any; +}): Op | null; +export declare class Op { + applyTo(value: any): any; + mergeWith(previous: Op): Op | void; + toJSON(offline?: boolean): any; +} +export declare class SetOp extends Op { + _value?: any; + constructor(value: any); + applyTo(): any; + mergeWith(): SetOp; + toJSON(offline?: boolean): any; +} +export declare class UnsetOp extends Op { + applyTo(): any; + mergeWith(): UnsetOp; + toJSON(): { + __op: string; + }; +} +export declare class IncrementOp extends Op { + _amount: number; + constructor(amount: number); + applyTo(value?: any): number; + mergeWith(previous: Op): Op; + toJSON(): { + __op: string; + amount: number; + }; +} +export declare class AddOp extends Op { + _value: Array; + constructor(value: any | Array); + applyTo(value: any): Array; + mergeWith(previous: Op): Op; + toJSON(): { + __op: string; + objects: any; + }; +} +export declare class AddUniqueOp extends Op { + _value: Array; + constructor(value: any | Array); + applyTo(value: any | Array): Array; + mergeWith(previous: Op): Op; + toJSON(): { + __op: string; + objects: any; + }; +} +export declare class RemoveOp extends Op { + _value: Array; + constructor(value: any | Array); + applyTo(value: any | Array): Array; + mergeWith(previous: Op): Op; + toJSON(): { + __op: string; + objects: any; + }; +} +export declare class RelationOp extends Op { + _targetClassName: string | undefined | null; + relationsToAdd: Array; + relationsToRemove: Array; + constructor(adds: Array, removes: Array); + _extractId(obj: string | ParseObject): string; + applyTo(value: any, object?: { + className: string; + id?: string; + }, key?: string): ParseRelation | undefined; + mergeWith(previous: Op): Op; + toJSON(): { + __op?: string; + objects?: any; + ops?: any; + }; +} diff --git a/types/ParseQuery.d.ts b/types/ParseQuery.d.ts new file mode 100644 index 000000000..44288f187 --- /dev/null +++ b/types/ParseQuery.d.ts @@ -0,0 +1,924 @@ +import ParseGeoPoint from './ParseGeoPoint'; +import ParseObject from './ParseObject'; +import type LiveQuerySubscription from './LiveQuerySubscription'; +import type { FullOptions } from './RESTController'; +type BatchOptions = FullOptions & { + batchSize?: number; +}; +export type WhereClause = { + [attr: string]: any; +}; +export type QueryJSON = { + where: WhereClause; + watch?: string; + include?: string; + excludeKeys?: string; + keys?: string; + limit?: number; + skip?: number; + order?: string; + className?: string; + count?: number; + hint?: any; + explain?: boolean; + readPreference?: string; + includeReadPreference?: string; + subqueryReadPreference?: string; +}; +/** + * Creates a new parse Parse.Query for the given Parse.Object subclass. + * + *

Parse.Query defines a query that is used to fetch Parse.Objects. The + * most common use case is finding all objects that match a query through the + * find method. for example, this sample code fetches all objects + * of class myclass. it calls a different function depending on + * whether the fetch succeeded or not. + * + *

+ * var query = new Parse.Query(myclass);
+ * query.find().then((results) => {
+ *   // results is an array of parse.object.
+ * }).catch((error) =>  {
+ *  // error is an instance of parse.error.
+ * });

+ * + *

a Parse.Query can also be used to retrieve a single object whose id is + * known, through the get method. for example, this sample code fetches an + * object of class myclass and id myid. it calls a + * different function depending on whether the fetch succeeded or not. + * + *

+ * var query = new Parse.Query(myclass);
+ * query.get(myid).then((object) => {
+ *     // object is an instance of parse.object.
+ * }).catch((error) =>  {
+ *  // error is an instance of parse.error.
+ * });

+ * + *

a Parse.Query can also be used to count the number of objects that match + * the query without retrieving all of those objects. for example, this + * sample code counts the number of objects of the class myclass + *

+ * var query = new Parse.Query(myclass);
+ * query.count().then((number) => {
+ *     // there are number instances of myclass.
+ * }).catch((error) => {
+ *     // error is an instance of Parse.Error.
+ * });

+ * + * @alias Parse.Query + */ +declare class ParseQuery { + /** + * @property {string} className + */ + className: string; + _where: any; + _watch: Array; + _include: Array; + _exclude: Array; + _select: Array; + _limit: number; + _skip: number; + _count: boolean; + _order: Array; + _readPreference: string | undefined | null; + _includeReadPreference: string | undefined | null; + _subqueryReadPreference: string | undefined | null; + _queriesLocalDatastore: boolean; + _localDatastorePinName: any; + _extraOptions: { + [key: string]: any; + }; + _hint: any; + _explain: boolean; + _xhrRequest: any; + /** + * @param {(string | Parse.Object)} objectClass An instance of a subclass of Parse.Object, or a Parse className string. + */ + constructor(objectClass: string | ParseObject); + /** + * Adds constraint that at least one of the passed in queries matches. + * + * @param {Array} queries + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + _orQuery(queries: Array): ParseQuery; + /** + * Adds constraint that all of the passed in queries match. + * + * @param {Array} queries + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + _andQuery(queries: Array): ParseQuery; + /** + * Adds constraint that none of the passed in queries match. + * + * @param {Array} queries + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + _norQuery(queries: Array): ParseQuery; + /** + * Helper for condition queries + * + * @param key + * @param condition + * @param value + * @returns {Parse.Query} + */ + _addCondition(key: string, condition: string, value: any): ParseQuery; + /** + * Converts string for regular expression at the beginning + * + * @param string + * @returns {string} + */ + _regexStartWith(string: string): string; + _handleOfflineQuery(params: any): Promise; + /** + * Returns a JSON representation of this query. + * + * @returns {object} The JSON representation of the query. + */ + toJSON(): QueryJSON; + /** + * Return a query with conditions from json, can be useful to send query from server side to client + * Not static, all query conditions was set before calling this method will be deleted. + * For example on the server side we have + * var query = new Parse.Query("className"); + * query.equalTo(key: value); + * query.limit(100); + * ... (others queries) + * Create JSON representation of Query Object + * var jsonFromServer = query.fromJSON(); + * + * On client side getting query: + * var query = new Parse.Query("className"); + * query.fromJSON(jsonFromServer); + * + * and continue to query... + * query.skip(100).find().then(...); + * + * @param {QueryJSON} json from Parse.Query.toJSON() method + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + withJSON(json: QueryJSON): ParseQuery; + /** + * Static method to restore Parse.Query by json representation + * Internally calling Parse.Query.withJSON + * + * @param {string} className + * @param {QueryJSON} json from Parse.Query.toJSON() method + * @returns {Parse.Query} new created query + */ + static fromJSON(className: string, json: QueryJSON): ParseQuery; + /** + * Constructs a Parse.Object whose id is already known by fetching data from + * the server. Unlike the first method, it never returns undefined. + * + * @param {string} objectId The id of the object to be fetched. + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • context: A dictionary that is accessible in Cloud Code `beforeFind` trigger. + *
  • json: Return raw json without converting to Parse.Object + *
+ * @returns {Promise} A promise that is resolved with the result when + * the query completes. + */ + get(objectId: string, options?: FullOptions): Promise; + /** + * Retrieves a list of ParseObjects that satisfy this query. + * + * @param {object} options Valid options + * are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • context: A dictionary that is accessible in Cloud Code `beforeFind` trigger. + *
  • json: Return raw json without converting to Parse.Object + *
+ * @returns {Promise} A promise that is resolved with the results when + * the query completes. + */ + find(options?: FullOptions): Promise>; + /** + * Retrieves a complete list of ParseObjects that satisfy this query. + * Using `eachBatch` under the hood to fetch all the valid objects. + * + * @param {object} options Valid options are:
    + *
  • batchSize: How many objects to yield in each batch (default: 100) + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @returns {Promise} A promise that is resolved with the results when + * the query completes. + */ + findAll(options?: BatchOptions): Promise>; + /** + * Counts the number of objects that match this query. + * + * @param {object} options + * Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @returns {Promise} A promise that is resolved with the count when + * the query completes. + */ + count(options?: FullOptions): Promise; + /** + * Executes a distinct query and returns unique values + * + * @param {string} key A field to find distinct values + * @param {object} options + * Valid options are:
    + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @returns {Promise} A promise that is resolved with the query completes. + */ + distinct(key: string, options?: FullOptions): Promise>; + /** + * Executes an aggregate query and returns aggregate results + * + * @param {(Array|object)} pipeline Array or Object of stages to process query + * @param {object} options Valid options are:
    + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @returns {Promise} A promise that is resolved with the query completes. + */ + aggregate(pipeline: any, options?: FullOptions): Promise>; + /** + * Retrieves at most one Parse.Object that satisfies this query. + * + * Returns the object if there is one, otherwise undefined. + * + * @param {object} options Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • context: A dictionary that is accessible in Cloud Code `beforeFind` trigger. + *
  • json: Return raw json without converting to Parse.Object + *
+ * @returns {Promise} A promise that is resolved with the object when + * the query completes. + */ + first(options?: FullOptions): Promise; + /** + * Iterates over objects matching a query, calling a callback for each batch. + * If the callback returns a promise, the iteration will not continue until + * that promise has been fulfilled. If the callback returns a rejected + * promise, then iteration will stop with that error. The items are processed + * in an unspecified order. The query may not have any sort order, and may + * not use limit or skip. + * + * @param {Function} callback Callback that will be called with each result + * of the query. + * @param {object} options Valid options are:
    + *
  • batchSize: How many objects to yield in each batch (default: 100) + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • context: A dictionary that is accessible in Cloud Code `beforeFind` trigger. + *
+ * @returns {Promise} A promise that will be fulfilled once the + * iteration has completed. + */ + eachBatch(callback: (objs: Array) => Promise, options?: BatchOptions): Promise; + /** + * Iterates over each result of a query, calling a callback for each one. If + * the callback returns a promise, the iteration will not continue until + * that promise has been fulfilled. If the callback returns a rejected + * promise, then iteration will stop with that error. The items are + * processed in an unspecified order. The query may not have any sort order, + * and may not use limit or skip. + * + * @param {Function} callback Callback that will be called with each result + * of the query. + * @param {object} options Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
  • json: Return raw json without converting to Parse.Object + *
+ * @returns {Promise} A promise that will be fulfilled once the + * iteration has completed. + */ + each(callback: (obj: ParseObject) => any, options?: BatchOptions): Promise; + /** + * Adds a hint to force index selection. (https://docs.mongodb.com/manual/reference/operator/meta/hint/) + * + * @param {(string|object)} value String or Object of index that should be used when executing query + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + hint(value: any): ParseQuery; + /** + * Investigates the query execution plan. Useful for optimizing queries. (https://docs.mongodb.com/manual/reference/operator/meta/explain/) + * + * @param {boolean} explain Used to toggle the information on the query plan. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + explain(explain?: boolean): ParseQuery; + /** + * Iterates over each result of a query, calling a callback for each one. If + * the callback returns a promise, the iteration will not continue until + * that promise has been fulfilled. If the callback returns a rejected + * promise, then iteration will stop with that error. The items are + * processed in an unspecified order. The query may not have any sort order, + * and may not use limit or skip. + * + * @param {Function} callback Callback
    + *
  • currentObject: The current Parse.Object being processed in the array.
  • + *
  • index: The index of the current Parse.Object being processed in the array.
  • + *
  • query: The query map was called upon.
  • + *
+ * @param {object} options Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @returns {Promise} A promise that will be fulfilled once the + * iteration has completed. + */ + map(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => any, options?: BatchOptions): Promise>; + /** + * Iterates over each result of a query, calling a callback for each one. If + * the callback returns a promise, the iteration will not continue until + * that promise has been fulfilled. If the callback returns a rejected + * promise, then iteration will stop with that error. The items are + * processed in an unspecified order. The query may not have any sort order, + * and may not use limit or skip. + * + * @param {Function} callback Callback
    + *
  • accumulator: The accumulator accumulates the callback's return values. It is the accumulated value previously returned in the last invocation of the callback.
  • + *
  • currentObject: The current Parse.Object being processed in the array.
  • + *
  • index: The index of the current Parse.Object being processed in the array.
  • + *
+ * @param {*} initialValue A value to use as the first argument to the first call of the callback. If no initialValue is supplied, the first object in the query will be used and skipped. + * @param {object} options Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @returns {Promise} A promise that will be fulfilled once the + * iteration has completed. + */ + reduce(callback: (accumulator: any, currentObject: ParseObject, index: number) => any, initialValue: any, options?: BatchOptions): Promise>; + /** + * Iterates over each result of a query, calling a callback for each one. If + * the callback returns a promise, the iteration will not continue until + * that promise has been fulfilled. If the callback returns a rejected + * promise, then iteration will stop with that error. The items are + * processed in an unspecified order. The query may not have any sort order, + * and may not use limit or skip. + * + * @param {Function} callback Callback
    + *
  • currentObject: The current Parse.Object being processed in the array.
  • + *
  • index: The index of the current Parse.Object being processed in the array.
  • + *
  • query: The query filter was called upon.
  • + *
+ * @param {object} options Valid options are:
    + *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to + * be used for this request. + *
  • sessionToken: A valid session token, used for making a request on + * behalf of a specific user. + *
+ * @returns {Promise} A promise that will be fulfilled once the + * iteration has completed. + */ + filter(callback: (currentObject: ParseObject, index: number, query: ParseQuery) => boolean, options?: BatchOptions): Promise>; + /** + * Adds a constraint to the query that requires a particular key's value to + * be equal to the provided value. + * + * @param {string} key The key to check. + * @param value The value that the Parse.Object must contain. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + equalTo(key: string | { + [key: string]: any; + }, value?: any): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's value to + * be not equal to the provided value. + * + * @param {string} key The key to check. + * @param value The value that must not be equalled. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + notEqualTo(key: string | { + [key: string]: any; + }, value?: any): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's value to + * be less than the provided value. + * + * @param {string} key The key to check. + * @param value The value that provides an upper bound. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + lessThan(key: string, value: any): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's value to + * be greater than the provided value. + * + * @param {string} key The key to check. + * @param value The value that provides an lower bound. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + greaterThan(key: string, value: any): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's value to + * be less than or equal to the provided value. + * + * @param {string} key The key to check. + * @param value The value that provides an upper bound. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + lessThanOrEqualTo(key: string, value: any): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's value to + * be greater than or equal to the provided value. + * + * @param {string} key The key to check. + * @param {*} value The value that provides an lower bound. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + greaterThanOrEqualTo(key: string, value: any): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's value to + * be contained in the provided list of values. + * + * @param {string} key The key to check. + * @param {Array<*>} value The values that will match. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + containedIn(key: string, value: Array): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's value to + * not be contained in the provided list of values. + * + * @param {string} key The key to check. + * @param {Array<*>} value The values that will not match. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + notContainedIn(key: string, value: Array): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's value to + * be contained by the provided list of values. Get objects where all array elements match. + * + * @param {string} key The key to check. + * @param {Array} values The values that will match. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + containedBy(key: string, values: Array): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's value to + * contain each one of the provided list of values. + * + * @param {string} key The key to check. This key's value must be an array. + * @param {Array} values The values that will match. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + containsAll(key: string, values: Array): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's value to + * contain each one of the provided list of values starting with given strings. + * + * @param {string} key The key to check. This key's value must be an array. + * @param {Array} values The string values that will match as starting string. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + containsAllStartingWith(key: string, values: Array): ParseQuery; + /** + * Adds a constraint for finding objects that contain the given key. + * + * @param {string} key The key that should exist. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + exists(key: string): ParseQuery; + /** + * Adds a constraint for finding objects that do not contain a given key. + * + * @param {string} key The key that should not exist + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + doesNotExist(key: string): ParseQuery; + /** + * Adds a regular expression constraint for finding string values that match + * the provided regular expression. + * This may be slow for large datasets. + * + * @param {string} key The key that the string to match is stored in. + * @param {RegExp} regex The regular expression pattern to match. + * @param {string} modifiers The regular expression mode. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + matches(key: string, regex: RegExp, modifiers: string): ParseQuery; + /** + * Adds a constraint that requires that a key's value matches a Parse.Query + * constraint. + * + * @param {string} key The key that the contains the object to match the + * query. + * @param {Parse.Query} query The query that should match. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + matchesQuery(key: string, query: ParseQuery): ParseQuery; + /** + * Adds a constraint that requires that a key's value not matches a + * Parse.Query constraint. + * + * @param {string} key The key that the contains the object to match the + * query. + * @param {Parse.Query} query The query that should not match. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + doesNotMatchQuery(key: string, query: ParseQuery): ParseQuery; + /** + * Adds a constraint that requires that a key's value matches a value in + * an object returned by a different Parse.Query. + * + * @param {string} key The key that contains the value that is being + * matched. + * @param {string} queryKey The key in the objects returned by the query to + * match against. + * @param {Parse.Query} query The query to run. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + matchesKeyInQuery(key: string, queryKey: string, query: ParseQuery): ParseQuery; + /** + * Adds a constraint that requires that a key's value not match a value in + * an object returned by a different Parse.Query. + * + * @param {string} key The key that contains the value that is being + * excluded. + * @param {string} queryKey The key in the objects returned by the query to + * match against. + * @param {Parse.Query} query The query to run. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + doesNotMatchKeyInQuery(key: string, queryKey: string, query: ParseQuery): ParseQuery; + /** + * Adds a constraint for finding string values that contain a provided + * string. This may be slow for large datasets. + * + * @param {string} key The key that the string to match is stored in. + * @param {string} substring The substring that the value must contain. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + contains(key: string, substring: string): ParseQuery; + /** + * Adds a constraint for finding string values that contain a provided + * string. This may be slow for large datasets. Requires Parse-Server > 2.5.0 + * + * In order to sort you must use select and ascending ($score is required) + *
+     *   query.fullText('field', 'term');
+     *   query.ascending('$score');
+     *   query.select('$score');
+     *  
+ * + * To retrieve the weight / rank + *
+     *   object->get('score');
+     *  
+ * + * You can define optionals by providing an object as a third parameter + *
+     *   query.fullText('field', 'term', { language: 'es', diacriticSensitive: true });
+     *  
+ * + * @param {string} key The key that the string to match is stored in. + * @param {string} value The string to search + * @param {object} options (Optional) + * @param {string} options.language The language that determines the list of stop words for the search and the rules for the stemmer and tokenizer. + * @param {boolean} options.caseSensitive A boolean flag to enable or disable case sensitive search. + * @param {boolean} options.diacriticSensitive A boolean flag to enable or disable diacritic sensitive search. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + fullText(key: string, value: string, options?: FullOptions): ParseQuery; + /** + * Method to sort the full text search by text score + * + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + sortByTextScore(): this; + /** + * Adds a constraint for finding string values that start with a provided + * string. This query will use the backend index, so it will be fast even + * for large datasets. + * + * @param {string} key The key that the string to match is stored in. + * @param {string} prefix The substring that the value must start with. + * @param {string} modifiers The regular expression mode. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + startsWith(key: string, prefix: string, modifiers: string): ParseQuery; + /** + * Adds a constraint for finding string values that end with a provided + * string. This will be slow for large datasets. + * + * @param {string} key The key that the string to match is stored in. + * @param {string} suffix The substring that the value must end with. + * @param {string} modifiers The regular expression mode. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + endsWith(key: string, suffix: string, modifiers: string): ParseQuery; + /** + * Adds a proximity based constraint for finding objects with key point + * values near the point given. + * + * @param {string} key The key that the Parse.GeoPoint is stored in. + * @param {Parse.GeoPoint} point The reference Parse.GeoPoint that is used. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + near(key: string, point: ParseGeoPoint): ParseQuery; + /** + * Adds a proximity based constraint for finding objects with key point + * values near the point given and within the maximum distance given. + * + * @param {string} key The key that the Parse.GeoPoint is stored in. + * @param {Parse.GeoPoint} point The reference Parse.GeoPoint that is used. + * @param {number} maxDistance Maximum distance (in radians) of results to return. + * @param {boolean} sorted A Bool value that is true if results should be + * sorted by distance ascending, false is no sorting is required, + * defaults to true. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + withinRadians(key: string, point: ParseGeoPoint, maxDistance: number, sorted: boolean): ParseQuery; + /** + * Adds a proximity based constraint for finding objects with key point + * values near the point given and within the maximum distance given. + * Radius of earth used is 3958.8 miles. + * + * @param {string} key The key that the Parse.GeoPoint is stored in. + * @param {Parse.GeoPoint} point The reference Parse.GeoPoint that is used. + * @param {number} maxDistance Maximum distance (in miles) of results to return. + * @param {boolean} sorted A Bool value that is true if results should be + * sorted by distance ascending, false is no sorting is required, + * defaults to true. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + withinMiles(key: string, point: ParseGeoPoint, maxDistance: number, sorted: boolean): ParseQuery; + /** + * Adds a proximity based constraint for finding objects with key point + * values near the point given and within the maximum distance given. + * Radius of earth used is 6371.0 kilometers. + * + * @param {string} key The key that the Parse.GeoPoint is stored in. + * @param {Parse.GeoPoint} point The reference Parse.GeoPoint that is used. + * @param {number} maxDistance Maximum distance (in kilometers) of results to return. + * @param {boolean} sorted A Bool value that is true if results should be + * sorted by distance ascending, false is no sorting is required, + * defaults to true. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + withinKilometers(key: string, point: ParseGeoPoint, maxDistance: number, sorted: boolean): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's + * coordinates be contained within a given rectangular geographic bounding + * box. + * + * @param {string} key The key to be constrained. + * @param {Parse.GeoPoint} southwest + * The lower-left inclusive corner of the box. + * @param {Parse.GeoPoint} northeast + * The upper-right inclusive corner of the box. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + withinGeoBox(key: string, southwest: ParseGeoPoint, northeast: ParseGeoPoint): ParseQuery; + /** + * Adds a constraint to the query that requires a particular key's + * coordinates be contained within and on the bounds of a given polygon. + * Supports closed and open (last point is connected to first) paths + * + * Polygon must have at least 3 points + * + * @param {string} key The key to be constrained. + * @param {Array} points Array of Coordinates / GeoPoints + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + withinPolygon(key: string, points: Array>): ParseQuery; + /** + * Add a constraint to the query that requires a particular key's + * coordinates that contains a ParseGeoPoint + * + * @param {string} key The key to be constrained. + * @param {Parse.GeoPoint} point + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + polygonContains(key: string, point: ParseGeoPoint): ParseQuery; + /** + * Sorts the results in ascending order by the given key. + * + * @param {(string|string[])} keys The key to order by, which is a + * string of comma separated values, or an Array of keys, or multiple keys. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + ascending(...keys: Array): ParseQuery; + /** + * Sorts the results in ascending order by the given key, + * but can also add secondary sort descriptors without overwriting _order. + * + * @param {(string|string[])} keys The key to order by, which is a + * string of comma separated values, or an Array of keys, or multiple keys. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + addAscending(...keys: Array): ParseQuery; + /** + * Sorts the results in descending order by the given key. + * + * @param {(string|string[])} keys The key to order by, which is a + * string of comma separated values, or an Array of keys, or multiple keys. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + descending(...keys: Array): ParseQuery; + /** + * Sorts the results in descending order by the given key, + * but can also add secondary sort descriptors without overwriting _order. + * + * @param {(string|string[])} keys The key to order by, which is a + * string of comma separated values, or an Array of keys, or multiple keys. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + addDescending(...keys: Array): ParseQuery; + /** + * Sets the number of results to skip before returning any results. + * This is useful for pagination. + * Default is to skip zero results. + * + * @param {number} n the number of results to skip. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + skip(n: number): ParseQuery; + /** + * Sets the limit of the number of results to return. The default limit is 100. + * + * @param {number} n the number of results to limit to. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + limit(n: number): ParseQuery; + /** + * Sets the flag to include with response the total number of objects satisfying this query, + * despite limits/skip. Might be useful for pagination. + * Note that result of this query will be wrapped as an object with + * `results`: holding {ParseObject} array and `count`: integer holding total number + * + * @param {boolean} includeCount false - disable, true - enable. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + withCount(includeCount?: boolean): ParseQuery; + /** + * Includes nested Parse.Objects for the provided key. You can use dot + * notation to specify which fields in the included object are also fetched. + * + * You can include all nested Parse.Objects by passing in '*'. + * Requires Parse Server 3.0.0+ + *
query.include('*');
+ * + * @param {...string|Array} keys The name(s) of the key(s) to include. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + include(...keys: Array>): ParseQuery; + /** + * Includes all nested Parse.Objects one level deep. + * + * Requires Parse Server 3.0.0+ + * + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + includeAll(): ParseQuery; + /** + * Restricts the fields of the returned Parse.Objects to include only the + * provided keys. If this is called multiple times, then all of the keys + * specified in each of the calls will be included. + * + * @param {...string|Array} keys The name(s) of the key(s) to include. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + select(...keys: Array>): ParseQuery; + /** + * Restricts the fields of the returned Parse.Objects to all keys except the + * provided keys. Exclude takes precedence over select and include. + * + * Requires Parse Server 3.6.0+ + * + * @param {...string|Array} keys The name(s) of the key(s) to exclude. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + exclude(...keys: Array>): ParseQuery; + /** + * Restricts live query to trigger only for watched fields. + * + * Requires Parse Server 6.0.0+ + * + * @param {...string|Array} keys The name(s) of the key(s) to watch. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + watch(...keys: Array>): ParseQuery; + /** + * Changes the read preference that the backend will use when performing the query to the database. + * + * @param {string} readPreference The read preference for the main query. + * @param {string} includeReadPreference The read preference for the queries to include pointers. + * @param {string} subqueryReadPreference The read preference for the sub queries. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + readPreference(readPreference: string, includeReadPreference?: string, subqueryReadPreference?: string): ParseQuery; + /** + * Subscribe this query to get liveQuery updates + * + * @param {string} sessionToken (optional) Defaults to the currentUser + * @returns {Promise} Returns the liveQuerySubscription, it's an event emitter + * which can be used to get liveQuery updates. + */ + subscribe(sessionToken?: string): Promise; + /** + * Constructs a Parse.Query that is the OR of the passed in queries. For + * example: + *
var compoundQuery = Parse.Query.or(query1, query2, query3);
+ * + * will create a compoundQuery that is an or of the query1, query2, and + * query3. + * + * @param {...Parse.Query} queries The list of queries to OR. + * @static + * @returns {Parse.Query} The query that is the OR of the passed in queries. + */ + static or(...queries: Array): ParseQuery; + /** + * Constructs a Parse.Query that is the AND of the passed in queries. For + * example: + *
var compoundQuery = Parse.Query.and(query1, query2, query3);
+ * + * will create a compoundQuery that is an and of the query1, query2, and + * query3. + * + * @param {...Parse.Query} queries The list of queries to AND. + * @static + * @returns {Parse.Query} The query that is the AND of the passed in queries. + */ + static and(...queries: Array): ParseQuery; + /** + * Constructs a Parse.Query that is the NOR of the passed in queries. For + * example: + *
const compoundQuery = Parse.Query.nor(query1, query2, query3);
+ * + * will create a compoundQuery that is a nor of the query1, query2, and + * query3. + * + * @param {...Parse.Query} queries The list of queries to NOR. + * @static + * @returns {Parse.Query} The query that is the NOR of the passed in queries. + */ + static nor(...queries: Array): ParseQuery; + /** + * Change the source of this query to the server. + * + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + fromNetwork(): ParseQuery; + /** + * Changes the source of this query to all pinned objects. + * + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + fromLocalDatastore(): ParseQuery; + /** + * Changes the source of this query to the default group of pinned objects. + * + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + fromPin(): ParseQuery; + /** + * Changes the source of this query to a specific group of pinned objects. + * + * @param {string} name The name of query source. + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + fromPinWithName(name?: string | null): ParseQuery; + /** + * Cancels the current network request (if any is running). + * + * @returns {Parse.Query} Returns the query, so you can chain this call. + */ + cancel(): ParseQuery; + _setRequestTask(options: any): void; +} +export default ParseQuery; diff --git a/types/ParseRelation.d.ts b/types/ParseRelation.d.ts new file mode 100644 index 000000000..a0995e891 --- /dev/null +++ b/types/ParseRelation.d.ts @@ -0,0 +1,59 @@ +/** + * @flow + */ +import ParseObject from './ParseObject'; +import ParseQuery from './ParseQuery'; +/** + * Creates a new Relation for the given parent object and key. This + * constructor should rarely be used directly, but rather created by + * Parse.Object.relation. + * + *

+ * A class that is used to access all of the children of a many-to-many + * relationship. Each instance of Parse.Relation is associated with a + * particular parent object and key. + *

+ * + * @alias Parse.Relation + */ +declare class ParseRelation { + parent?: ParseObject; + key?: string; + targetClassName: string | undefined | null; + /** + * @param {Parse.Object} parent The parent of this relation. + * @param {string} key The key for this relation on the parent. + */ + constructor(parent?: ParseObject, key?: string); + _ensureParentAndKey(parent: ParseObject, key: string): void; + /** + * Adds a Parse.Object or an array of Parse.Objects to the relation. + * + * @param {(Parse.Object|Array)} objects The item or items to add. + * @returns {Parse.Object} The parent of the relation. + */ + add(objects: ParseObject | Array): ParseObject; + /** + * Removes a Parse.Object or an array of Parse.Objects from this relation. + * + * @param {(Parse.Object|Array)} objects The item or items to remove. + */ + remove(objects: ParseObject | Array): void; + /** + * Returns a JSON version of the object suitable for saving to disk. + * + * @returns {object} JSON representation of Relation + */ + toJSON(): { + __type: 'Relation'; + className?: string; + }; + /** + * Returns a Parse.Query that is limited to objects in this + * relation. + * + * @returns {Parse.Query} Relation Query + */ + query(): ParseQuery; +} +export default ParseRelation; diff --git a/types/ParseUser.d.ts b/types/ParseUser.d.ts new file mode 100644 index 000000000..fafe41fc7 --- /dev/null +++ b/types/ParseUser.d.ts @@ -0,0 +1,471 @@ +/** + * @flow + */ +import ParseObject from './ParseObject'; +import type { AttributeMap } from './ObjectStateMutations'; +import type { RequestOptions, FullOptions } from './RESTController'; +import type { SaveOptions } from './ParseObject'; +export type AuthData = { + [key: string]: any; +} | undefined | null; +export type AuthProvider = { + restoreAuthentication(authData: any): boolean; + getAuthType(): boolean; + getAuthData(): { + authData: { + [key: string]: any; + }; + }; +}; +/** + *

A Parse.User object is a local representation of a user persisted to the + * Parse cloud. This class is a subclass of a Parse.Object, and retains the + * same functionality of a Parse.Object, but also extends it with various + * user specific methods, like authentication, signing up, and validation of + * uniqueness.

+ * + * @alias Parse.User + * @augments Parse.Object + */ +declare class ParseUser extends ParseObject { + /** + * @param {object} attributes The initial set of data to store in the user. + */ + constructor(attributes?: AttributeMap); + /** + * Request a revocable session token to replace the older style of token. + * + * @param {object} options + * @returns {Promise} A promise that is resolved when the replacement + * token has been fetched. + */ + _upgradeToRevocableSession(options: RequestOptions): Promise; + /** + * Parse allows you to link your users with {@link https://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication 3rd party authentication}, enabling + * your users to sign up or log into your application using their existing identities. + * Since 2.9.0 + * + * @see {@link https://docs.parseplatform.org/js/guide/#linking-users Linking Users} + * @param {string | AuthProvider} provider Name of auth provider or {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider} + * @param {object} options + *
    + *
  • If provider is string, options is {@link http://docs.parseplatform.org/parse-server/guide/#supported-3rd-party-authentications authData} + *
  • If provider is AuthProvider, options is saveOpts + *
+ * @param {object} saveOpts useMasterKey / sessionToken + * @returns {Promise} A promise that is fulfilled with the user is linked + */ + linkWith(provider: any, options: { + authData?: AuthData; + }, saveOpts?: FullOptions): Promise; + /** + * @param provider + * @param options + * @param saveOpts + * @deprecated since 2.9.0 see {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith} + * @returns {Promise} + */ + _linkWith(provider: any, options: { + authData?: AuthData; + }, saveOpts?: FullOptions): Promise; + /** + * Synchronizes auth data for a provider (e.g. puts the access token in the + * right place to be used by the Facebook SDK). + * + * @param provider + */ + _synchronizeAuthData(provider: string | AuthProvider): void; + /** + * Synchronizes authData for all providers. + */ + _synchronizeAllAuthData(): void; + /** + * Removes null values from authData (which exist temporarily for unlinking) + */ + _cleanupAuthData(): void; + /** + * Unlinks a user from a service. + * + * @param {string | AuthProvider} provider Name of auth provider or {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider} + * @param {object} options MasterKey / SessionToken + * @returns {Promise} A promise that is fulfilled when the unlinking + * finishes. + */ + _unlinkFrom(provider: any, options?: FullOptions): Promise; + /** + * Checks whether a user is linked to a service. + * + * @param {object} provider service to link to + * @returns {boolean} true if link was successful + */ + _isLinked(provider: any): boolean; + /** + * Deauthenticates all providers. + */ + _logOutWithAll(): void; + /** + * Deauthenticates a single provider (e.g. removing access tokens from the + * Facebook SDK). + * + * @param {object} provider service to logout of + */ + _logOutWith(provider: any): void; + /** + * Class instance method used to maintain specific keys when a fetch occurs. + * Used to ensure that the session token is not lost. + * + * @returns {object} sessionToken + */ + _preserveFieldsOnFetch(): AttributeMap; + /** + * Returns true if current would return this user. + * + * @returns {boolean} true if user is cached on disk + */ + isCurrent(): boolean; + /** + * Returns true if current would return this user. + * + * @returns {Promise} true if user is cached on disk + */ + isCurrentAsync(): Promise; + /** + * Returns get("username"). + * + * @returns {string} + */ + getUsername(): string | null | undefined; + /** + * Calls set("username", username, options) and returns the result. + * + * @param {string} username + */ + setUsername(username: string): void; + /** + * Calls set("password", password, options) and returns the result. + * + * @param {string} password User's Password + */ + setPassword(password: string): void; + /** + * Returns get("email"). + * + * @returns {string} User's Email + */ + getEmail(): string | null | undefined; + /** + * Calls set("email", email) and returns the result. + * + * @param {string} email + * @returns {boolean} + */ + setEmail(email: string): boolean | ParseObject; + /** + * Returns the session token for this user, if the user has been logged in, + * or if it is the result of a query with the master key. Otherwise, returns + * undefined. + * + * @returns {string} the session token, or undefined + */ + getSessionToken(): string | undefined | null; + /** + * Checks whether this user is the current user and has been authenticated. + * + * @returns {boolean} whether this user is the current user and is logged in. + */ + authenticated(): boolean; + /** + * Signs up a new user. You should call this instead of save for + * new Parse.Users. This will create a new Parse.User on the server, and + * also persist the session on disk so that you can access the user using + * current. + * + *

A username and password must be set before calling signUp.

+ * + * @param {object} attrs Extra fields to set on the new user, or null. + * @param {object} options + * @returns {Promise} A promise that is fulfilled when the signup + * finishes. + */ + signUp(attrs: AttributeMap, options?: FullOptions): Promise; + /** + * Logs in a Parse.User. On success, this saves the session to disk, + * so you can retrieve the currently logged in user using + * current. + * + *

A username and password must be set before calling logIn.

+ * + * @param {object} options + * @returns {Promise} A promise that is fulfilled with the user when + * the login is complete. + */ + logIn(options?: FullOptions): Promise; + /** + * Wrap the default save behavior with functionality to save to local + * storage if this is current user. + * + * @param {...any} arg1 + * @returns {Promise} + */ + save(arg1: { + [attr: string]: any; + } | undefined | null, arg2: SaveOptions | any, arg3?: SaveOptions): Promise; + /** + * Wrap the default destroy behavior with functionality that logs out + * the current user when it is destroyed + * + * @param {...any} options + * @returns {Parse.User} + */ + destroy(options: RequestOptions): Promise; + /** + * Wrap the default fetch behavior with functionality to save to local + * storage if this is current user. + * + * @param {...any} options + * @returns {Parse.User} + */ + fetch(options: RequestOptions): Promise; + /** + * Wrap the default fetchWithInclude behavior with functionality to save to local + * storage if this is current user. + * + * @param {...any} keys + * @returns {Parse.User} + */ + fetchWithInclude(keys: String | Array>, options: RequestOptions): Promise; + /** + * Verify whether a given password is the password of the current user. + * + * @param {string} password A password to be verified + * @param {object} options + * @returns {Promise} A promise that is fulfilled with a user + * when the password is correct. + */ + verifyPassword(password: string, options?: RequestOptions): Promise; + static readOnlyAttributes(): string[]; + /** + * Adds functionality to the existing Parse.User class. + * + * @param {object} protoProps A set of properties to add to the prototype + * @param {object} classProps A set of static properties to add to the class + * @static + * @returns {Parse.User} The newly extended Parse.User class + */ + static extend(protoProps: { + [prop: string]: any; + }, classProps: { + [prop: string]: any; + }): typeof ParseUser; + /** + * Retrieves the currently logged in ParseUser with a valid session, + * either from memory or localStorage, if necessary. + * + * @static + * @returns {Parse.Object} The currently logged in Parse.User. + */ + static current(): ParseUser | null | undefined; + /** + * Retrieves the currently logged in ParseUser from asynchronous Storage. + * + * @static + * @returns {Promise} A Promise that is resolved with the currently + * logged in Parse User + */ + static currentAsync(): Promise; + /** + * Signs up a new user with a username (or email) and password. + * This will create a new Parse.User on the server, and also persist the + * session in localStorage so that you can access the user using + * {@link #current}. + * + * @param {string} username The username (or email) to sign up with. + * @param {string} password The password to sign up with. + * @param {object} attrs Extra fields to set on the new user. + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled with the user when + * the signup completes. + */ + static signUp(username: string, password: string, attrs: AttributeMap, options?: FullOptions): Promise; + /** + * Logs in a user with a username (or email) and password. On success, this + * saves the session to disk, so you can retrieve the currently logged in + * user using current. + * + * @param {string} username The username (or email) to log in with. + * @param {string} password The password to log in with. + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled with the user when + * the login completes. + */ + static logIn(username: string, password: string, options?: FullOptions): Promise; + /** + * Logs in a user with an objectId. On success, this saves the session + * to disk, so you can retrieve the currently logged in user using + * current. + * + * @param {string} userId The objectId for the user. + * @static + * @returns {Promise} A promise that is fulfilled with the user when + * the login completes. + */ + static loginAs(userId: string): any; + /** + * Logs in a user with a session token. On success, this saves the session + * to disk, so you can retrieve the currently logged in user using + * current. + * + * @param {string} sessionToken The sessionToken to log in with. + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled with the user when + * the login completes. + */ + static become(sessionToken: string, options?: RequestOptions): any; + /** + * Retrieves a user with a session token. + * + * @param {string} sessionToken The sessionToken to get user with. + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled with the user is fetched. + */ + static me(sessionToken: string, options?: RequestOptions): any; + /** + * Logs in a user with a session token. On success, this saves the session + * to disk, so you can retrieve the currently logged in user using + * current. If there is no session token the user will not logged in. + * + * @param {object} userJSON The JSON map of the User's data + * @static + * @returns {Promise} A promise that is fulfilled with the user when + * the login completes. + */ + static hydrate(userJSON: AttributeMap): any; + /** + * Static version of {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith} + * + * @param provider + * @param options + * @param saveOpts + * @static + * @returns {Promise} + */ + static logInWith(provider: any, options: { + authData?: AuthData; + }, saveOpts?: FullOptions): Promise; + /** + * Logs out the currently logged in user session. This will remove the + * session from disk, log out of linked services, and future calls to + * current will return null. + * + * @param {object} options + * @static + * @returns {Promise} A promise that is resolved when the session is + * destroyed on the server. + */ + static logOut(options?: RequestOptions): any; + /** + * Requests a password reset email to be sent to the specified email address + * associated with the user account. This email allows the user to securely + * reset their password on the Parse site. + * + * @param {string} email The email address associated with the user that + * forgot their password. + * @param {object} options + * @static + * @returns {Promise} + */ + static requestPasswordReset(email: string, options?: RequestOptions): any; + /** + * Request an email verification. + * + * @param {string} email The email address associated with the user that + * needs to verify their email. + * @param {object} options + * @static + * @returns {Promise} + */ + static requestEmailVerification(email: string, options?: RequestOptions): any; + /** + * Verify whether a given password is the password of the current user. + * + * @param {string} username A username to be used for identificaiton + * @param {string} password A password to be verified + * @param {object} options + * @static + * @returns {Promise} A promise that is fulfilled with a user + * when the password is correct. + */ + static verifyPassword(username: string, password: string, options?: RequestOptions): any; + /** + * Allow someone to define a custom User class without className + * being rewritten to _User. The default behavior is to rewrite + * User to _User for legacy reasons. This allows developers to + * override that behavior. + * + * @param {boolean} isAllowed Whether or not to allow custom User class + * @static + */ + static allowCustomUserClass(isAllowed: boolean): void; + /** + * Allows a legacy application to start using revocable sessions. If the + * current session token is not revocable, a request will be made for a new, + * revocable session. + * It is not necessary to call this method from cloud code unless you are + * handling user signup or login from the server side. In a cloud code call, + * this function will not attempt to upgrade the current token. + * + * @param {object} options + * @static + * @returns {Promise} A promise that is resolved when the process has + * completed. If a replacement session token is requested, the promise + * will be resolved after a new token has been fetched. + */ + static enableRevocableSession(options?: RequestOptions): Promise; + /** + * Enables the use of become or the current user in a server + * environment. These features are disabled by default, since they depend on + * global objects that are not memory-safe for most servers. + * + * @static + */ + static enableUnsafeCurrentUser(): void; + /** + * Disables the use of become or the current user in any environment. + * These features are disabled on servers by default, since they depend on + * global objects that are not memory-safe for most servers. + * + * @static + */ + static disableUnsafeCurrentUser(): void; + /** + * When registering users with {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith} a basic auth provider + * is automatically created for you. + * + * For advanced authentication, you can register an Auth provider to + * implement custom authentication, deauthentication. + * + * @param provider + * @see {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider} + * @see {@link https://docs.parseplatform.org/js/guide/#custom-authentication-module Custom Authentication Module} + * @static + */ + static _registerAuthenticationProvider(provider: any): void; + /** + * @param provider + * @param options + * @param saveOpts + * @deprecated since 2.9.0 see {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#logInWith logInWith} + * @static + * @returns {Promise} + */ + static _logInWith(provider: any, options: { + authData?: AuthData; + }, saveOpts?: FullOptions): Promise; + static _clearCache(): void; + static _setCurrentUserCache(user: ParseUser | undefined | null): void; +} +export default ParseUser; diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 000000000..358fb4d56 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,2 @@ +import parse from "./Parse"; +export default parse; diff --git a/types/tests.ts b/types/tests.ts new file mode 100644 index 000000000..9613c1d57 --- /dev/null +++ b/types/tests.ts @@ -0,0 +1,6 @@ +import Parse from 'parse'; +class GameScore extends Parse.Object { + constructor(options?: any) { + super('GameScore', options); + } +} diff --git a/types/tsconfig.json b/types/tsconfig.json new file mode 100644 index 000000000..1248086f6 --- /dev/null +++ b/types/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + + // If the library is an external module (uses `export`), this allows your test file to import "mylib" instead of "./index". + // If the library is global (cannot be imported via `import` or `require`), leave this out. + "baseUrl": ".", + "paths": { "parse": ["."] } + }, + "include": [ + "tests.ts" + ] +} + diff --git a/types/tslint.json b/types/tslint.json new file mode 100644 index 000000000..776df04be --- /dev/null +++ b/types/tslint.json @@ -0,0 +1,10 @@ +{ + "extends": "@definitelytyped/dtslint/dtslint.json", + "rules": { + "semicolon": false, + "ban-types": false, + "no-unnecessary-generics": false, + "no-redundant-jsdoc": false, + "strict-export-declare-modifiers": false + } +} \ No newline at end of file diff --git a/types/types.d.ts b/types/types.d.ts deleted file mode 100644 index 46480c90c..000000000 --- a/types/types.d.ts +++ /dev/null @@ -1,1637 +0,0 @@ -declare module "Analytics" { - /** - * Parse.Analytics provides an interface to Parse's logging and analytics - * backend. - * - * @class Parse.Analytics - * @static - * @hideconstructor - */ - /** - * Tracks the occurrence of a custom event with additional dimensions. - * Parse will store a data point at the time of invocation with the given - * event name. - * - * Dimensions will allow segmentation of the occurrences of this custom - * event. Keys and values should be {@code String}s, and will throw - * otherwise. - * - * To track a user signup along with additional metadata, consider the - * following: - *
-     * var dimensions = {
-     *  gender: 'm',
-     *  source: 'web',
-     *  dayType: 'weekend'
-     * };
-     * Parse.Analytics.track('signup', dimensions);
-     * 
- * - * There is a default limit of 8 dimensions per event tracked. - * - * @function track - * @name Parse.Analytics.track - * @param {string} name The name of the custom event to report to Parse as - * having happened. - * @param {object} dimensions The dictionary of information by which to - * segment this event. - * @returns {Promise} A promise that is resolved when the round-trip - * to the server completes. - */ - export function track(name: string, dimensions: { - [key: string]: string; - }): Promise; -} -declare module "ParseOp" { - import ParseObject from "ParseObject"; - import ParseRelation from './ParseRelation'; - export function opFromJSON(json: { - [key: string]: any; - }): Op | null; - export class Op { - applyTo(value: any): any; - mergeWith(previous: Op): Op | void; - toJSON(offline?: boolean): any; - } - export class SetOp extends Op { - _value?: any; - constructor(value: any); - applyTo(): any; - mergeWith(): SetOp; - toJSON(offline?: boolean): any; - } - export class UnsetOp extends Op { - applyTo(): undefined; - mergeWith(): UnsetOp; - toJSON(): { - __op: string; - }; - } - export class IncrementOp extends Op { - _amount: number; - constructor(amount: number); - applyTo(value?: any): number; - mergeWith(previous: Op): Op; - toJSON(): { - __op: string; - amount: number; - }; - } - export class AddOp extends Op { - _value: Array; - constructor(value: any | Array); - applyTo(value: any): Array; - mergeWith(previous: Op): Op; - toJSON(): { - __op: string; - objects: any; - }; - } - export class AddUniqueOp extends Op { - _value: Array; - constructor(value: any | Array); - applyTo(value: any | Array): Array; - mergeWith(previous: Op): Op; - toJSON(): { - __op: string; - objects: any; - }; - } - export class RemoveOp extends Op { - _value: Array; - constructor(value: any | Array); - applyTo(value: any | Array): Array; - mergeWith(previous: Op): Op; - toJSON(): { - __op: string; - objects: any; - }; - } - export class RelationOp extends Op { - _targetClassName?: string | null; - relationsToAdd: Array; - relationsToRemove: Array; - constructor(adds: Array, removes: Array); - _extractId(obj: string | ParseObject): string; - applyTo(value: any, object?: { - className: string; - id?: string; - }, key?: string): ParseRelation | undefined; - mergeWith(previous: Op): Op; - toJSON(): { - __op?: string; - objects?: any; - ops?: any; - }; - } -} -declare module "ParseObject" { - import ParseACL from './ParseACL'; - import ParseError from './ParseError'; - import { Op } from "ParseOp"; - import ParseRelation from './ParseRelation'; - import type { AttributeMap, OpsMap } from "ObjectStateMutations"; - import type { RequestOptions, FullOptions } from './RESTController'; - export type Pointer = { - __type: string; - className: string; - objectId?: string; - _localId?: string; - }; - type SaveParams = { - method: string; - path: string; - body: AttributeMap; - }; - export type SaveOptions = FullOptions & { - cascadeSave?: boolean; - context?: AttributeMap; - }; - /** - * Creates a new model with defined attributes. - * - *

You won't normally call this method directly. It is recommended that - * you use a subclass of Parse.Object instead, created by calling - * extend.

- * - *

However, if you don't want to use a subclass, or aren't sure which - * subclass is appropriate, you can use this form:

-     *     var object = new Parse.Object("ClassName");
-     * 
- * That is basically equivalent to:
-     *     var MyClass = Parse.Object.extend("ClassName");
-     *     var object = new MyClass();
-     * 

- * - * @alias Parse.Object - */ - class ParseObject { - /** - * @param {string} className The class name for the object - * @param {object} attributes The initial set of data to store in the object. - * @param {object} options The options for this object instance. - */ - constructor(className?: string | { - className: string; - [attr: string]: any; - }, attributes?: { - [attr: string]: any; - }, options?: { - ignoreValidation: boolean; - } | { - [attr: string]: any; - }); - /** - * The ID of this object, unique within its class. - * - * @property {string} id - */ - id?: string; - _localId?: string; - _objCount: number; - className: string; - _initializers?: ((...args: Array) => void)[]; - get attributes(): AttributeMap; - /** - * The first time this object was saved on the server. - * - * @property {Date} createdAt - * @returns {Date} - */ - get createdAt(): Date | null | undefined; - /** - * The last time this object was updated on the server. - * - * @property {Date} updatedAt - * @returns {Date} - */ - get updatedAt(): Date | null | undefined; - /** - * Returns a local or server Id used uniquely identify this object - * - * @returns {string} - */ - _getId(): string; - /** - * Returns a unique identifier used to pull data from the State Controller. - * - * @returns {Parse.Object|object} - */ - _getStateIdentifier(): ParseObject | { - id: string; - className: string; - }; - _getServerData(): AttributeMap; - _clearServerData(): void; - _getPendingOps(): Array; - /** - * @param {Array} [keysToClear] - if specified, only ops matching - * these fields will be cleared - */ - _clearPendingOps(keysToClear?: Array): void; - _getDirtyObjectAttributes(): AttributeMap; - _toFullJSON(seen?: Array, offline?: boolean): AttributeMap; - _getSaveJSON(): AttributeMap; - _getSaveParams(): SaveParams; - _finishFetch(serverData: AttributeMap): void; - _setExisted(existed: boolean): void; - _migrateId(serverId: string): void; - _handleSaveResponse(response: AttributeMap, status: number): void; - _handleSaveError(): void; - static _getClassMap(): {}; - initialize(): void; - /** - * Returns a JSON version of the object suitable for saving to Parse. - * - * @param seen - * @param offline - * @returns {object} - */ - toJSON(seen: Array | void, offline?: boolean): AttributeMap; - /** - * Determines whether this ParseObject is equal to another ParseObject - * - * @param {object} other - An other object ot compare - * @returns {boolean} - */ - equals(other: any): boolean; - /** - * Returns true if this object has been modified since its last - * save/refresh. If an attribute is specified, it returns true only if that - * particular attribute has been modified since the last save/refresh. - * - * @param {string} attr An attribute name (optional). - * @returns {boolean} - */ - dirty(attr?: string): boolean; - /** - * Returns an array of keys that have been modified since last save/refresh - * - * @returns {string[]} - */ - dirtyKeys(): Array; - /** - * Returns true if the object has been fetched. - * - * @returns {boolean} - */ - isDataAvailable(): boolean; - /** - * Gets a Pointer referencing this Object. - * - * @returns {Pointer} - */ - toPointer(): Pointer; - /** - * Gets a Pointer referencing this Object. - * - * @returns {Pointer} - */ - toOfflinePointer(): Pointer; - /** - * Gets the value of an attribute. - * - * @param {string} attr The string name of an attribute. - * @returns {*} - */ - get(attr: string): any; - /** - * Gets a relation on the given class for the attribute. - * - * @param {string} attr The attribute to get the relation for. - * @returns {Parse.Relation} - */ - relation(attr: string): ParseRelation; - /** - * Gets the HTML-escaped value of an attribute. - * - * @param {string} attr The string name of an attribute. - * @returns {string} - */ - escape(attr: string): string; - /** - * Returns true if the attribute contains a value that is not - * null or undefined. - * - * @param {string} attr The string name of the attribute. - * @returns {boolean} - */ - has(attr: string): boolean; - /** - * Sets a hash of model attributes on the object. - * - *

You can call it with an object containing keys and values, with one - * key and value, or dot notation. For example:

-         *   gameTurn.set({
-         *     player: player1,
-         *     diceRoll: 2
-         *   }, {
-         *     error: function(gameTurnAgain, error) {
-         *       // The set failed validation.
-         *     }
-         *   });
-         *
-         *   game.set("currentPlayer", player2, {
-         *     error: function(gameTurnAgain, error) {
-         *       // The set failed validation.
-         *     }
-         *   });
-         *
-         *   game.set("finished", true);

- * - * game.set("player.score", 10);

- * - * @param {(string|object)} key The key to set. - * @param {(string|object)} value The value to give it. - * @param {object} options A set of options for the set. - * The only supported option is error. - * @returns {(ParseObject|boolean)} true if the set succeeded. - */ - set(key: any, value?: any, options?: any): ParseObject | boolean; - /** - * Remove an attribute from the model. This is a noop if the attribute doesn't - * exist. - * - * @param {string} attr The string name of an attribute. - * @param options - * @returns {(ParseObject | boolean)} - */ - unset(attr: string, options?: { - [opt: string]: any; - }): ParseObject | boolean; - /** - * Atomically increments the value of the given attribute the next time the - * object is saved. If no amount is specified, 1 is used by default. - * - * @param attr {String} The key. - * @param amount {Number} The amount to increment by (optional). - * @returns {(ParseObject|boolean)} - */ - increment(attr: string, amount?: number): ParseObject | boolean; - /** - * Atomically decrements the value of the given attribute the next time the - * object is saved. If no amount is specified, 1 is used by default. - * - * @param attr {String} The key. - * @param amount {Number} The amount to decrement by (optional). - * @returns {(ParseObject | boolean)} - */ - decrement(attr: string, amount?: number): ParseObject | boolean; - /** - * Atomically add an object to the end of the array associated with a given - * key. - * - * @param attr {String} The key. - * @param item {} The item to add. - * @returns {(ParseObject | boolean)} - */ - add(attr: string, item: any): ParseObject | boolean; - /** - * Atomically add the objects to the end of the array associated with a given - * key. - * - * @param attr {String} The key. - * @param items {Object[]} The items to add. - * @returns {(ParseObject | boolean)} - */ - addAll(attr: string, items: Array): ParseObject | boolean; - /** - * Atomically add an object to the array associated with a given key, only - * if it is not already present in the array. The position of the insert is - * not guaranteed. - * - * @param attr {String} The key. - * @param item {} The object to add. - * @returns {(ParseObject | boolean)} - */ - addUnique(attr: string, item: any): ParseObject | boolean; - /** - * Atomically add the objects to the array associated with a given key, only - * if it is not already present in the array. The position of the insert is - * not guaranteed. - * - * @param attr {String} The key. - * @param items {Object[]} The objects to add. - * @returns {(ParseObject | boolean)} - */ - addAllUnique(attr: string, items: Array): ParseObject | boolean; - /** - * Atomically remove all instances of an object from the array associated - * with a given key. - * - * @param attr {String} The key. - * @param item {} The object to remove. - * @returns {(ParseObject | boolean)} - */ - remove(attr: string, item: any): ParseObject | boolean; - /** - * Atomically remove all instances of the objects from the array associated - * with a given key. - * - * @param attr {String} The key. - * @param items {Object[]} The object to remove. - * @returns {(ParseObject | boolean)} - */ - removeAll(attr: string, items: Array): ParseObject | boolean; - /** - * Returns an instance of a subclass of Parse.Op describing what kind of - * modification has been performed on this field since the last time it was - * saved. For example, after calling object.increment("x"), calling - * object.op("x") would return an instance of Parse.Op.Increment. - * - * @param attr {String} The key. - * @returns {Parse.Op | undefined} The operation, or undefined if none. - */ - op(attr: string): Op | null | undefined; - /** - * Creates a new model with identical attributes to this one. - * - * @returns {Parse.Object} - */ - clone(): any; - /** - * Creates a new instance of this object. Not to be confused with clone() - * - * @returns {Parse.Object} - */ - newInstance(): any; - /** - * Returns true if this object has never been saved to Parse. - * - * @returns {boolean} - */ - isNew(): boolean; - /** - * Returns true if this object was created by the Parse server when the - * object might have already been there (e.g. in the case of a Facebook - * login) - * - * @returns {boolean} - */ - existed(): boolean; - /** - * Returns true if this object exists on the Server - * - * @param {object} options - * Valid options are:
    - *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to - * be used for this request. - *
  • sessionToken: A valid session token, used for making a request on - * behalf of a specific user. - *
- * @returns {Promise} A boolean promise that is fulfilled if object exists. - */ - exists(options?: RequestOptions): Promise; - /** - * Checks if the model is currently in a valid state. - * - * @returns {boolean} - */ - isValid(): boolean; - /** - * You should not call this function directly unless you subclass - * Parse.Object, in which case you can override this method - * to provide additional validation on set and - * save. Your implementation should return - * - * @param {object} attrs The current data to validate. - * @returns {Parse.Error|boolean} False if the data is valid. An error object otherwise. - * @see Parse.Object#set - */ - validate(attrs: AttributeMap): ParseError | boolean; - /** - * Returns the ACL for this object. - * - * @returns {Parse.ACL} An instance of Parse.ACL. - * @see Parse.Object#get - */ - getACL(): ParseACL | null; - /** - * Sets the ACL to be used for this object. - * - * @param {Parse.ACL} acl An instance of Parse.ACL. - * @param {object} options - * @returns {(ParseObject | boolean)} Whether the set passed validation. - * @see Parse.Object#set - */ - setACL(acl: ParseACL, options?: any): ParseObject | boolean; - /** - * Clears any (or specific) changes to this object made since the last call to save() - * - * @param {string} [keys] - specify which fields to revert - */ - revert(...keys: Array): void; - /** - * Clears all attributes on a model - * - * @returns {(ParseObject | boolean)} - */ - clear(): ParseObject | boolean; - /** - * Fetch the model from the server. If the server's representation of the - * model differs from its current attributes, they will be overriden. - * - * @param {object} options - * Valid options are:
    - *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to - * be used for this request. - *
  • sessionToken: A valid session token, used for making a request on - * behalf of a specific user. - *
  • include: The name(s) of the key(s) to include. Can be a string, an array of strings, - * or an array of array of strings. - *
  • context: A dictionary that is accessible in Cloud Code `beforeFind` trigger. - *
- * @returns {Promise} A promise that is fulfilled when the fetch - * completes. - */ - fetch(options: RequestOptions): Promise; - /** - * Fetch the model from the server. If the server's representation of the - * model differs from its current attributes, they will be overriden. - * - * Includes nested Parse.Objects for the provided key. You can use dot - * notation to specify which fields in the included object are also fetched. - * - * @param {string | Array>} keys The name(s) of the key(s) to include. - * @param {object} options - * Valid options are:
    - *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to - * be used for this request. - *
  • sessionToken: A valid session token, used for making a request on - * behalf of a specific user. - *
- * @returns {Promise} A promise that is fulfilled when the fetch - * completes. - */ - fetchWithInclude(keys: String | Array>, options: RequestOptions): Promise; - /** - * Saves this object to the server at some unspecified time in the future, - * even if Parse is currently inaccessible. - * - * Use this when you may not have a solid network connection, and don't need to know when the save completes. - * If there is some problem with the object such that it can't be saved, it will be silently discarded. - * - * Objects saved with this method will be stored locally in an on-disk cache until they can be delivered to Parse. - * They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection is - * available. Objects saved this way will persist even after the app is closed, in which case they will be sent the - * next time the app is opened. - * - * @param {object} [options] - * Used to pass option parameters to method if arg1 and arg2 were both passed as strings. - * Valid options are: - *
    - *
  • sessionToken: A valid session token, used for making a request on - * behalf of a specific user. - *
  • cascadeSave: If `false`, nested objects will not be saved (default is `true`). - *
  • context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers. - *
- * @returns {Promise} A promise that is fulfilled when the save - * completes. - */ - saveEventually(options: SaveOptions): Promise; - /** - * Set a hash of model attributes, and save the model to the server. - * updatedAt will be updated when the request returns. - * You can either call it as:
-         * object.save();
- * or
-         * object.save(attrs);
- * or
-         * object.save(null, options);
- * or
-         * object.save(attrs, options);
- * or
-         * object.save(key, value);
- * or
-         * object.save(key, value, options);
- * - * Example 1:
-         * gameTurn.save({
-         * player: "Jake Cutter",
-         * diceRoll: 2
-         * }).then(function(gameTurnAgain) {
-         * // The save was successful.
-         * }, function(error) {
-         * // The save failed.  Error is an instance of Parse.Error.
-         * });
- * - * Example 2:
-         * gameTurn.save("player", "Jake Cutter");
- * - * @param {string | object | null} [arg1] - * Valid options are:
    - *
  • `Object` - Key/value pairs to update on the object.
  • - *
  • `String` Key - Key of attribute to update (requires arg2 to also be string)
  • - *
  • `null` - Passing null for arg1 allows you to save the object with options passed in arg2.
  • - *
- * @param {string | object} [arg2] - *
    - *
  • `String` Value - If arg1 was passed as a key, arg2 is the value that should be set on that key.
  • - *
  • `Object` Options - Valid options are: - *
      - *
    • useMasterKey: In Cloud Code and Node only, causes the Master Key to - * be used for this request. - *
    • sessionToken: A valid session token, used for making a request on - * behalf of a specific user. - *
    • cascadeSave: If `false`, nested objects will not be saved (default is `true`). - *
    • context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers. - *
    - *
  • - *
- * @param {object} [arg3] - * Used to pass option parameters to method if arg1 and arg2 were both passed as strings. - * Valid options are: - *
    - *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to - * be used for this request. - *
  • sessionToken: A valid session token, used for making a request on - * behalf of a specific user. - *
  • cascadeSave: If `false`, nested objects will not be saved (default is `true`). - *
  • context: A dictionary that is accessible in Cloud Code `beforeSave` and `afterSave` triggers. - *
- * @returns {Promise} A promise that is fulfilled when the save - * completes. - */ - save(arg1: { - [attr: string]: any; - } | undefined | null, arg2: SaveOptions | any, arg3?: SaveOptions): Promise; - /** - * Deletes this object from the server at some unspecified time in the future, - * even if Parse is currently inaccessible. - * - * Use this when you may not have a solid network connection, - * and don't need to know when the delete completes. If there is some problem with the object - * such that it can't be deleted, the request will be silently discarded. - * - * Delete instructions made with this method will be stored locally in an on-disk cache until they can be transmitted - * to Parse. They will be sent immediately if possible. Otherwise, they will be sent the next time a network connection - * is available. Delete requests will persist even after the app is closed, in which case they will be sent the - * next time the app is opened. - * - * @param {object} [options] - * Valid options are:
    - *
  • sessionToken: A valid session token, used for making a request on - * behalf of a specific user. - *
  • context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers. - *
- * @returns {Promise} A promise that is fulfilled when the destroy - * completes. - */ - destroyEventually(options: RequestOptions): Promise; - /** - * Destroy this model on the server if it was already persisted. - * - * @param {object} options - * Valid options are:
    - *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to - * be used for this request. - *
  • sessionToken: A valid session token, used for making a request on - * behalf of a specific user. - *
  • context: A dictionary that is accessible in Cloud Code `beforeDelete` and `afterDelete` triggers. - *
- * @returns {Promise} A promise that is fulfilled when the destroy - * completes. - */ - destroy(options: RequestOptions): Promise; - /** - * Asynchronously stores the object and every object it points to in the local datastore, - * recursively, using a default pin name: _default. - * - * If those other objects have not been fetched from Parse, they will not be stored. - * However, if they have changed data, all the changes will be retained. - * - *
-         * await object.pin();
-         * 
- * - * To retrieve object: - * query.fromLocalDatastore() or query.fromPin() - * - * @returns {Promise} A promise that is fulfilled when the pin completes. - */ - pin(): Promise; - /** - * Asynchronously removes the object and every object it points to in the local datastore, - * recursively, using a default pin name: _default. - * - *
-         * await object.unPin();
-         * 
- * - * @returns {Promise} A promise that is fulfilled when the unPin completes. - */ - unPin(): Promise; - /** - * Asynchronously returns if the object is pinned - * - *
-         * const isPinned = await object.isPinned();
-         * 
- * - * @returns {Promise} A boolean promise that is fulfilled if object is pinned. - */ - isPinned(): Promise; - /** - * Asynchronously stores the objects and every object they point to in the local datastore, recursively. - * - * If those other objects have not been fetched from Parse, they will not be stored. - * However, if they have changed data, all the changes will be retained. - * - *
-         * await object.pinWithName(name);
-         * 
- * - * To retrieve object: - * query.fromLocalDatastore() or query.fromPinWithName(name) - * - * @param {string} name Name of Pin. - * @returns {Promise} A promise that is fulfilled when the pin completes. - */ - pinWithName(name: string): Promise; - /** - * Asynchronously removes the object and every object it points to in the local datastore, recursively. - * - *
-         * await object.unPinWithName(name);
-         * 
- * - * @param {string} name Name of Pin. - * @returns {Promise} A promise that is fulfilled when the unPin completes. - */ - unPinWithName(name: string): Promise; - /** - * Asynchronously loads data from the local datastore into this object. - * - *
-         * await object.fetchFromLocalDatastore();
-         * 
- * - * You can create an unfetched pointer with Parse.Object.createWithoutData() - * and then call fetchFromLocalDatastore() on it. - * - * @returns {Promise} A promise that is fulfilled when the fetch completes. - */ - fetchFromLocalDatastore(): Promise; - static _clearAllState(): void; - /** - * Fetches the given list of Parse.Object. - * If any error is encountered, stops and calls the error handler. - * - *
-         *   Parse.Object.fetchAll([object1, object2, ...])
-         *    .then((list) => {
-         *      // All the objects were fetched.
-         *    }, (error) => {
-         *      // An error occurred while fetching one of the objects.
-         *    });
-         * 
- * - * @param {Array} list A list of Parse.Object. - * @param {object} options - * Valid options are:
    - *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to - * be used for this request. - *
  • sessionToken: A valid session token, used for making a request on - * behalf of a specific user. - *
  • include: The name(s) of the key(s) to include. Can be a string, an array of strings, - * or an array of array of strings. - *
- * @static - * @returns {Parse.Object[]} - */ - static fetchAll(list: Array, options?: RequestOptions): any; - /** - * Fetches the given list of Parse.Object. - * - * Includes nested Parse.Objects for the provided key. You can use dot - * notation to specify which fields in the included object are also fetched. - * - * If any error is encountered, stops and calls the error handler. - * - *
-         *   Parse.Object.fetchAllWithInclude([object1, object2, ...], [pointer1, pointer2, ...])
-         *    .then((list) => {
-         *      // All the objects were fetched.
-         *    }, (error) => {
-         *      // An error occurred while fetching one of the objects.
-         *    });
-         * 
- * - * @param {Array} list A list of Parse.Object. - * @param {string | Array>} keys The name(s) of the key(s) to include. - * @param {object} options - * Valid options are:
    - *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to - * be used for this request. - *
  • sessionToken: A valid session token, used for making a request on - * behalf of a specific user. - *
- * @static - * @returns {Parse.Object[]} - */ - static fetchAllWithInclude(list: Array, keys: String | Array>, options: RequestOptions): any; - /** - * Fetches the given list of Parse.Object if needed. - * If any error is encountered, stops and calls the error handler. - * - * Includes nested Parse.Objects for the provided key. You can use dot - * notation to specify which fields in the included object are also fetched. - * - * If any error is encountered, stops and calls the error handler. - * - *
-         *   Parse.Object.fetchAllIfNeededWithInclude([object1, object2, ...], [pointer1, pointer2, ...])
-         *    .then((list) => {
-         *      // All the objects were fetched.
-         *    }, (error) => {
-         *      // An error occurred while fetching one of the objects.
-         *    });
-         * 
- * - * @param {Array} list A list of Parse.Object. - * @param {string | Array>} keys The name(s) of the key(s) to include. - * @param {object} options - * Valid options are:
    - *
  • useMasterKey: In Cloud Code and Node only, causes the Master Key to - * be used for this request. - *
  • sessionToken: A valid session token, used for making a request on - * behalf of a specific user. - *
- * @static - * @returns {Parse.Object[]} - */ - static fetchAllIfNeededWithInclude(list: Array, keys: String | Array>, options: RequestOptions): any; - /** - * Fetches the given list of Parse.Object if needed. - * If any error is encountered, stops and calls the error handler. - * - *
-         *   Parse.Object.fetchAllIfNeeded([object1, ...])
-         *    .then((list) => {
-         *      // Objects were fetched and updated.
-         *    }, (error) => {
-         *      // An error occurred while fetching one of the objects.
-         *    });
-         * 
- * - * @param {Array} list A list of Parse.Object. - * @param {object} options - * @static - * @returns {Parse.Object[]} - */ - static fetchAllIfNeeded(list: Array, options?: RequestOptions): any; - static handleIncludeOptions(options: any): string[]; - /** - * Destroy the given list of models on the server if it was already persisted. - * - *

Unlike saveAll, if an error occurs while deleting an individual model, - * this method will continue trying to delete the rest of the models if - * possible, except in the case of a fatal error like a connection error. - * - *

In particular, the Parse.Error object returned in the case of error may - * be one of two types: - * - *

    - *
  • A Parse.Error.AGGREGATE_ERROR. This object's "errors" property is an - * array of other Parse.Error objects. Each error object in this array - * has an "object" property that references the object that could not be - * deleted (for instance, because that object could not be found).
  • - *
  • A non-aggregate Parse.Error. This indicates a serious error that - * caused the delete operation to be aborted partway through (for - * instance, a connection failure in the middle of the delete).
  • - *
- * - *
-         * Parse.Object.destroyAll([object1, object2, ...])
-         * .then((list) => {
-         * // All the objects were deleted.
-         * }, (error) => {
-         * // An error occurred while deleting one or more of the objects.
-         * // If this is an aggregate error, then we can inspect each error
-         * // object individually to determine the reason why a particular
-         * // object was not deleted.
-         * if (error.code === Parse.Error.AGGREGATE_ERROR) {
-         * for (var i = 0; i < error.errors.length; i++) {
-         * console.log("Couldn't delete " + error.errors[i].object.id +
-         * "due to " + error.errors[i].message);
-         * }
-         * } else {
-         * console.log("Delete aborted because of " + error.message);
-         * }
-         * });
-         * 
- * - * @param {Array} list A list of Parse.Object. - * @param {object} options - * @static - * @returns {Promise} A promise that is fulfilled when the destroyAll - * completes. - */ - static destroyAll(list: Array, options?: RequestOptions): any; - /** - * Saves the given list of Parse.Object. - * If any error is encountered, stops and calls the error handler. - * - *
-         * Parse.Object.saveAll([object1, object2, ...])
-         * .then((list) => {
-         * // All the objects were saved.
-         * }, (error) => {
-         * // An error occurred while saving one of the objects.
-         * });
-         * 
- * - * @param {Array} list A list of Parse.Object. - * @param {object} options - * @static - * @returns {Parse.Object[]} - */ - static saveAll(list: Array, options?: RequestOptions): any; - /** - * Creates a reference to a subclass of Parse.Object with the given id. This - * does not exist on Parse.Object, only on subclasses. - * - *

A shortcut for:

-         *  var Foo = Parse.Object.extend("Foo");
-         *  var pointerToFoo = new Foo();
-         *  pointerToFoo.id = "myObjectId";
-         * 
- * - * @param {string} id The ID of the object to create a reference to. - * @static - * @returns {Parse.Object} A Parse.Object reference. - */ - static createWithoutData(id: string): ParseObject; - /** - * Creates a new instance of a Parse Object from a JSON representation. - * - * @param {object} json The JSON map of the Object's data - * @param {boolean} override In single instance mode, all old server data - * is overwritten if this is set to true - * @param {boolean} dirty Whether the Parse.Object should set JSON keys to dirty - * @static - * @returns {Parse.Object} A Parse.Object reference - */ - static fromJSON(json: any, override?: boolean, dirty?: boolean): any; - /** - * Registers a subclass of Parse.Object with a specific class name. - * When objects of that class are retrieved from a query, they will be - * instantiated with this subclass. - * This is only necessary when using ES6 subclassing. - * - * @param {string} className The class name of the subclass - * @param {Function} constructor The subclass - */ - static registerSubclass(className: string, constructor: any): void; - /** - * Unegisters a subclass of Parse.Object with a specific class name. - * - * @param {string} className The class name of the subclass - */ - static unregisterSubclass(className: string): void; - /** - * Creates a new subclass of Parse.Object for the given Parse class name. - * - *

Every extension of a Parse class will inherit from the most recent - * previous extension of that class. When a Parse.Object is automatically - * created by parsing JSON, it will use the most recent extension of that - * class.

- * - *

You should call either:

-         *     var MyClass = Parse.Object.extend("MyClass", {
-         *         Instance methods,
-         *         initialize: function(attrs, options) {
-         *             this.someInstanceProperty = [],
-         *             Other instance properties
-         *         }
-         *     }, {
-         *         Class properties
-         *     });
- * or, for Backbone compatibility:
-         *     var MyClass = Parse.Object.extend({
-         *         className: "MyClass",
-         *         Instance methods,
-         *         initialize: function(attrs, options) {
-         *             this.someInstanceProperty = [],
-         *             Other instance properties
-         *         }
-         *     }, {
-         *         Class properties
-         *     });

- * - * @param {string} className The name of the Parse class backing this model. - * @param {object} protoProps Instance properties to add to instances of the - * class returned from this method. - * @param {object} classProps Class properties to add the class returned from - * this method. - * @returns {Parse.Object} A new subclass of Parse.Object. - */ - static extend(className: any, protoProps: any, classProps: any): any; - /** - * Enable single instance objects, where any local objects with the same Id - * share the same attributes, and stay synchronized with each other. - * This is disabled by default in server environments, since it can lead to - * security issues. - * - * @static - */ - static enableSingleInstance(): void; - /** - * Disable single instance objects, where any local objects with the same Id - * share the same attributes, and stay synchronized with each other. - * When disabled, you can have two instances of the same object in memory - * without them sharing attributes. - * - * @static - */ - static disableSingleInstance(): void; - /** - * Asynchronously stores the objects and every object they point to in the local datastore, - * recursively, using a default pin name: _default. - * - * If those other objects have not been fetched from Parse, they will not be stored. - * However, if they have changed data, all the changes will be retained. - * - *
-         * await Parse.Object.pinAll([...]);
-         * 
- * - * To retrieve object: - * query.fromLocalDatastore() or query.fromPin() - * - * @param {Array} objects A list of Parse.Object. - * @returns {Promise} A promise that is fulfilled when the pin completes. - * @static - */ - static pinAll(objects: Array): Promise; - /** - * Asynchronously stores the objects and every object they point to in the local datastore, recursively. - * - * If those other objects have not been fetched from Parse, they will not be stored. - * However, if they have changed data, all the changes will be retained. - * - *
-         * await Parse.Object.pinAllWithName(name, [obj1, obj2, ...]);
-         * 
- * - * To retrieve object: - * query.fromLocalDatastore() or query.fromPinWithName(name) - * - * @param {string} name Name of Pin. - * @param {Array} objects A list of Parse.Object. - * @returns {Promise} A promise that is fulfilled when the pin completes. - * @static - */ - static pinAllWithName(name: string, objects: Array): Promise; - /** - * Asynchronously removes the objects and every object they point to in the local datastore, - * recursively, using a default pin name: _default. - * - *
-         * await Parse.Object.unPinAll([...]);
-         * 
- * - * @param {Array} objects A list of Parse.Object. - * @returns {Promise} A promise that is fulfilled when the unPin completes. - * @static - */ - static unPinAll(objects: Array): Promise; - /** - * Asynchronously removes the objects and every object they point to in the local datastore, recursively. - * - *
-         * await Parse.Object.unPinAllWithName(name, [obj1, obj2, ...]);
-         * 
- * - * @param {string} name Name of Pin. - * @param {Array} objects A list of Parse.Object. - * @returns {Promise} A promise that is fulfilled when the unPin completes. - * @static - */ - static unPinAllWithName(name: string, objects: Array): Promise; - /** - * Asynchronously removes all objects in the local datastore using a default pin name: _default. - * - *
-         * await Parse.Object.unPinAllObjects();
-         * 
- * - * @returns {Promise} A promise that is fulfilled when the unPin completes. - * @static - */ - static unPinAllObjects(): Promise; - /** - * Asynchronously removes all objects with the specified pin name. - * Deletes the pin name also. - * - *
-         * await Parse.Object.unPinAllObjectsWithName(name);
-         * 
- * - * @param {string} name Name of Pin. - * @returns {Promise} A promise that is fulfilled when the unPin completes. - * @static - */ - static unPinAllObjectsWithName(name: string): Promise; - } - export default ParseObject; -} -declare module "ObjectStateMutations" { - import TaskQueue from './TaskQueue'; - import type { Op } from "ParseOp"; - export type AttributeMap = { - [attr: string]: any; - }; - export type OpsMap = { - [attr: string]: Op; - }; - export type ObjectCache = { - [attr: string]: string; - }; - export type State = { - serverData: AttributeMap; - pendingOps: Array; - objectCache: ObjectCache; - tasks: TaskQueue; - existed: boolean; - }; - export function defaultState(): State; - export function setServerData(serverData: AttributeMap, attributes: AttributeMap): void; - export function setPendingOp(pendingOps: Array, attr: string, op?: Op): void; - export function pushPendingState(pendingOps: Array): void; - export function popPendingState(pendingOps: Array): OpsMap | undefined; - export function mergeFirstPendingState(pendingOps: Array): void; - export function estimateAttribute(serverData: AttributeMap, pendingOps: Array, className: string, id: string | undefined, attr: string): any; - export function estimateAttributes(serverData: AttributeMap, pendingOps: Array, className: string, id?: string): AttributeMap; - export function commitServerChanges(serverData: AttributeMap, objectCache: ObjectCache, changes: AttributeMap): void; -} -declare module "ParseUser" { - import ParseObject from "ParseObject"; - import type { AttributeMap } from "ObjectStateMutations"; - import type { RequestOptions, FullOptions } from './RESTController'; - import type { SaveOptions } from "ParseObject"; - export type AuthData = { - [key: string]: any; - } | undefined | null; - export type AuthProvider = { - restoreAuthentication(authData: any): boolean; - getAuthType(): boolean; - getAuthData(): { - authData: { - [key: string]: any; - }; - }; - }; - /** - *

A Parse.User object is a local representation of a user persisted to the - * Parse cloud. This class is a subclass of a Parse.Object, and retains the - * same functionality of a Parse.Object, but also extends it with various - * user specific methods, like authentication, signing up, and validation of - * uniqueness.

- * - * @alias Parse.User - * @augments Parse.Object - */ - class ParseUser extends ParseObject { - /** - * @param {object} attributes The initial set of data to store in the user. - */ - constructor(attributes?: AttributeMap); - /** - * Request a revocable session token to replace the older style of token. - * - * @param {object} options - * @returns {Promise} A promise that is resolved when the replacement - * token has been fetched. - */ - _upgradeToRevocableSession(options: RequestOptions): Promise; - /** - * Parse allows you to link your users with {@link https://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication 3rd party authentication}, enabling - * your users to sign up or log into your application using their existing identities. - * Since 2.9.0 - * - * @see {@link https://docs.parseplatform.org/js/guide/#linking-users Linking Users} - * @param {string | AuthProvider} provider Name of auth provider or {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider} - * @param {object} options - *
    - *
  • If provider is string, options is {@link http://docs.parseplatform.org/parse-server/guide/#supported-3rd-party-authentications authData} - *
  • If provider is AuthProvider, options is saveOpts - *
- * @param {object} saveOpts useMasterKey / sessionToken - * @returns {Promise} A promise that is fulfilled with the user is linked - */ - linkWith(provider: any, options: { - authData?: AuthData; - }, saveOpts?: FullOptions): Promise; - /** - * @param provider - * @param options - * @param saveOpts - * @deprecated since 2.9.0 see {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith} - * @returns {Promise} - */ - _linkWith(provider: any, options: { - authData?: AuthData; - }, saveOpts?: FullOptions): Promise; - /** - * Synchronizes auth data for a provider (e.g. puts the access token in the - * right place to be used by the Facebook SDK). - * - * @param provider - */ - _synchronizeAuthData(provider: string | AuthProvider): void; - /** - * Synchronizes authData for all providers. - */ - _synchronizeAllAuthData(): void; - /** - * Removes null values from authData (which exist temporarily for unlinking) - */ - _cleanupAuthData(): void; - /** - * Unlinks a user from a service. - * - * @param {string | AuthProvider} provider Name of auth provider or {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider} - * @param {object} options MasterKey / SessionToken - * @returns {Promise} A promise that is fulfilled when the unlinking - * finishes. - */ - _unlinkFrom(provider: any, options?: FullOptions): Promise; - /** - * Checks whether a user is linked to a service. - * - * @param {object} provider service to link to - * @returns {boolean} true if link was successful - */ - _isLinked(provider: any): boolean; - /** - * Deauthenticates all providers. - */ - _logOutWithAll(): void; - /** - * Deauthenticates a single provider (e.g. removing access tokens from the - * Facebook SDK). - * - * @param {object} provider service to logout of - */ - _logOutWith(provider: any): void; - /** - * Class instance method used to maintain specific keys when a fetch occurs. - * Used to ensure that the session token is not lost. - * - * @returns {object} sessionToken - */ - _preserveFieldsOnFetch(): AttributeMap; - /** - * Returns true if current would return this user. - * - * @returns {boolean} true if user is cached on disk - */ - isCurrent(): boolean; - /** - * Returns true if current would return this user. - * - * @returns {Promise} true if user is cached on disk - */ - isCurrentAsync(): Promise; - /** - * Returns get("username"). - * - * @returns {string} - */ - getUsername(): string | null | undefined; - /** - * Calls set("username", username, options) and returns the result. - * - * @param {string} username - */ - setUsername(username: string): void; - /** - * Calls set("password", password, options) and returns the result. - * - * @param {string} password User's Password - */ - setPassword(password: string): void; - /** - * Returns get("email"). - * - * @returns {string} User's Email - */ - getEmail(): string | null | undefined; - /** - * Calls set("email", email) and returns the result. - * - * @param {string} email - * @returns {boolean} - */ - setEmail(email: string): boolean | ParseObject; - /** - * Returns the session token for this user, if the user has been logged in, - * or if it is the result of a query with the master key. Otherwise, returns - * undefined. - * - * @returns {string} the session token, or undefined - */ - getSessionToken(): string | undefined | null; - /** - * Checks whether this user is the current user and has been authenticated. - * - * @returns {boolean} whether this user is the current user and is logged in. - */ - authenticated(): boolean; - /** - * Signs up a new user. You should call this instead of save for - * new Parse.Users. This will create a new Parse.User on the server, and - * also persist the session on disk so that you can access the user using - * current. - * - *

A username and password must be set before calling signUp.

- * - * @param {object} attrs Extra fields to set on the new user, or null. - * @param {object} options - * @returns {Promise} A promise that is fulfilled when the signup - * finishes. - */ - signUp(attrs: AttributeMap, options?: FullOptions): Promise; - /** - * Logs in a Parse.User. On success, this saves the session to disk, - * so you can retrieve the currently logged in user using - * current. - * - *

A username and password must be set before calling logIn.

- * - * @param {object} options - * @returns {Promise} A promise that is fulfilled with the user when - * the login is complete. - */ - logIn(options?: FullOptions): Promise; - /** - * Wrap the default save behavior with functionality to save to local - * storage if this is current user. - * - * @param {...any} arg1 - * @returns {Promise} - */ - save(arg1: { - [attr: string]: any; - } | undefined | null, arg2: SaveOptions | any, arg3?: SaveOptions): Promise; - /** - * Wrap the default destroy behavior with functionality that logs out - * the current user when it is destroyed - * - * @param {...any} options - * @returns {Parse.User} - */ - destroy(options: RequestOptions): Promise; - /** - * Wrap the default fetch behavior with functionality to save to local - * storage if this is current user. - * - * @param {...any} options - * @returns {Parse.User} - */ - fetch(options: RequestOptions): Promise; - /** - * Wrap the default fetchWithInclude behavior with functionality to save to local - * storage if this is current user. - * - * @param {...any} keys - * @returns {Parse.User} - */ - fetchWithInclude(keys: String | Array>, options: RequestOptions): Promise; - /** - * Verify whether a given password is the password of the current user. - * - * @param {string} password A password to be verified - * @param {object} options - * @returns {Promise} A promise that is fulfilled with a user - * when the password is correct. - */ - verifyPassword(password: string, options?: RequestOptions): Promise; - static readOnlyAttributes(): string[]; - /** - * Adds functionality to the existing Parse.User class. - * - * @param {object} protoProps A set of properties to add to the prototype - * @param {object} classProps A set of static properties to add to the class - * @static - * @returns {Parse.User} The newly extended Parse.User class - */ - static extend(protoProps: { - [prop: string]: any; - }, classProps: { - [prop: string]: any; - }): typeof ParseUser; - /** - * Retrieves the currently logged in ParseUser with a valid session, - * either from memory or localStorage, if necessary. - * - * @static - * @returns {Parse.Object} The currently logged in Parse.User. - */ - static current(): ParseUser | null | undefined; - /** - * Retrieves the currently logged in ParseUser from asynchronous Storage. - * - * @static - * @returns {Promise} A Promise that is resolved with the currently - * logged in Parse User - */ - static currentAsync(): Promise; - /** - * Signs up a new user with a username (or email) and password. - * This will create a new Parse.User on the server, and also persist the - * session in localStorage so that you can access the user using - * {@link #current}. - * - * @param {string} username The username (or email) to sign up with. - * @param {string} password The password to sign up with. - * @param {object} attrs Extra fields to set on the new user. - * @param {object} options - * @static - * @returns {Promise} A promise that is fulfilled with the user when - * the signup completes. - */ - static signUp(username: string, password: string, attrs: AttributeMap, options?: FullOptions): Promise; - /** - * Logs in a user with a username (or email) and password. On success, this - * saves the session to disk, so you can retrieve the currently logged in - * user using current. - * - * @param {string} username The username (or email) to log in with. - * @param {string} password The password to log in with. - * @param {object} options - * @static - * @returns {Promise} A promise that is fulfilled with the user when - * the login completes. - */ - static logIn(username: string, password: string, options?: FullOptions): Promise; - /** - * Logs in a user with an objectId. On success, this saves the session - * to disk, so you can retrieve the currently logged in user using - * current. - * - * @param {string} userId The objectId for the user. - * @static - * @returns {Promise} A promise that is fulfilled with the user when - * the login completes. - */ - static loginAs(userId: string): any; - /** - * Logs in a user with a session token. On success, this saves the session - * to disk, so you can retrieve the currently logged in user using - * current. - * - * @param {string} sessionToken The sessionToken to log in with. - * @param {object} options - * @static - * @returns {Promise} A promise that is fulfilled with the user when - * the login completes. - */ - static become(sessionToken: string, options?: RequestOptions): any; - /** - * Retrieves a user with a session token. - * - * @param {string} sessionToken The sessionToken to get user with. - * @param {object} options - * @static - * @returns {Promise} A promise that is fulfilled with the user is fetched. - */ - static me(sessionToken: string, options?: RequestOptions): any; - /** - * Logs in a user with a session token. On success, this saves the session - * to disk, so you can retrieve the currently logged in user using - * current. If there is no session token the user will not logged in. - * - * @param {object} userJSON The JSON map of the User's data - * @static - * @returns {Promise} A promise that is fulfilled with the user when - * the login completes. - */ - static hydrate(userJSON: AttributeMap): any; - /** - * Static version of {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith} - * - * @param provider - * @param options - * @param saveOpts - * @static - * @returns {Promise} - */ - static logInWith(provider: any, options: { - authData?: AuthData; - }, saveOpts?: FullOptions): Promise; - /** - * Logs out the currently logged in user session. This will remove the - * session from disk, log out of linked services, and future calls to - * current will return null. - * - * @param {object} options - * @static - * @returns {Promise} A promise that is resolved when the session is - * destroyed on the server. - */ - static logOut(options?: RequestOptions): any; - /** - * Requests a password reset email to be sent to the specified email address - * associated with the user account. This email allows the user to securely - * reset their password on the Parse site. - * - * @param {string} email The email address associated with the user that - * forgot their password. - * @param {object} options - * @static - * @returns {Promise} - */ - static requestPasswordReset(email: string, options?: RequestOptions): any; - /** - * Request an email verification. - * - * @param {string} email The email address associated with the user that - * needs to verify their email. - * @param {object} options - * @static - * @returns {Promise} - */ - static requestEmailVerification(email: string, options?: RequestOptions): any; - /** - * Verify whether a given password is the password of the current user. - * - * @param {string} username A username to be used for identificaiton - * @param {string} password A password to be verified - * @param {object} options - * @static - * @returns {Promise} A promise that is fulfilled with a user - * when the password is correct. - */ - static verifyPassword(username: string, password: string, options?: RequestOptions): any; - /** - * Allow someone to define a custom User class without className - * being rewritten to _User. The default behavior is to rewrite - * User to _User for legacy reasons. This allows developers to - * override that behavior. - * - * @param {boolean} isAllowed Whether or not to allow custom User class - * @static - */ - static allowCustomUserClass(isAllowed: boolean): void; - /** - * Allows a legacy application to start using revocable sessions. If the - * current session token is not revocable, a request will be made for a new, - * revocable session. - * It is not necessary to call this method from cloud code unless you are - * handling user signup or login from the server side. In a cloud code call, - * this function will not attempt to upgrade the current token. - * - * @param {object} options - * @static - * @returns {Promise} A promise that is resolved when the process has - * completed. If a replacement session token is requested, the promise - * will be resolved after a new token has been fetched. - */ - static enableRevocableSession(options?: RequestOptions): Promise; - /** - * Enables the use of become or the current user in a server - * environment. These features are disabled by default, since they depend on - * global objects that are not memory-safe for most servers. - * - * @static - */ - static enableUnsafeCurrentUser(): void; - /** - * Disables the use of become or the current user in any environment. - * These features are disabled on servers by default, since they depend on - * global objects that are not memory-safe for most servers. - * - * @static - */ - static disableUnsafeCurrentUser(): void; - /** - * When registering users with {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#linkWith linkWith} a basic auth provider - * is automatically created for you. - * - * For advanced authentication, you can register an Auth provider to - * implement custom authentication, deauthentication. - * - * @param provider - * @see {@link https://parseplatform.org/Parse-SDK-JS/api/master/AuthProvider.html AuthProvider} - * @see {@link https://docs.parseplatform.org/js/guide/#custom-authentication-module Custom Authentication Module} - * @static - */ - static _registerAuthenticationProvider(provider: any): void; - /** - * @param provider - * @param options - * @param saveOpts - * @deprecated since 2.9.0 see {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.User.html#logInWith logInWith} - * @static - * @returns {Promise} - */ - static _logInWith(provider: any, options: { - authData?: AuthData; - }, saveOpts?: FullOptions): Promise; - static _clearCache(): void; - static _setCurrentUserCache(user: ParseUser | undefined | null): void; - } - export default ParseUser; -} From 87cdc3597eae8a04c5eba1f551559704a541a244 Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 30 Jun 2023 22:10:24 +1000 Subject: [PATCH 04/10] wip --- babel-jest.js | 2 +- package-lock.json | 684 +++--------------------------------------- package.json | 4 +- src/ParseOp.ts | 4 +- src/ParseQuery.ts | 8 +- types/Parse.d.ts | 8 + types/ParseOp.d.ts | 4 +- types/ParseQuery.d.ts | 6 +- 8 files changed, 68 insertions(+), 652 deletions(-) diff --git a/babel-jest.js b/babel-jest.js index 3e65cec9f..e17601e2a 100644 --- a/babel-jest.js +++ b/babel-jest.js @@ -1,7 +1,7 @@ const babelJest = require('babel-jest'); module.exports = babelJest.createTransformer({ - presets: [["@babel/preset-env", { + presets: ["@babel/preset-typescript", ["@babel/preset-env", { "targets": { "node": "14" }, diff --git a/package-lock.json b/package-lock.json index ce43e6a97..dae7091b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,8 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@babel/runtime-corejs3": "7.22.3", - "@definitelytyped/dtslint": "^0.0.163", - "dts-gen": "^0.6.1", + "@definitelytyped/dtslint": "0.0.163", "idb-keyval": "6.2.1", "react-native-crypto-js": "1.0.0", "uuid": "9.0.0", @@ -27,7 +26,7 @@ "@babel/plugin-transform-runtime": "7.21.4", "@babel/preset-env": "7.21.5", "@babel/preset-react": "7.18.6", - "@babel/preset-typescript": "^7.22.5", + "@babel/preset-typescript": "7.22.5", "@parse/minami": "1.0.0", "@saithodev/semantic-release-backmerge": "2.1.3", "@semantic-release/changelog": "6.0.3", @@ -8166,6 +8165,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -10118,280 +10118,6 @@ "node": ">=4" } }, - "node_modules/dts-dom": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/dts-dom/-/dts-dom-3.7.0.tgz", - "integrity": "sha512-WnmiiHfhtcYS+DyGd2Rq3J6QA3ATVBdKtlrhutc/VzQVFoBgNDm+gnYc5gZizsXAI0xQ2frZntT5IJFeB2qQIg==" - }, - "node_modules/dts-gen": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/dts-gen/-/dts-gen-0.6.1.tgz", - "integrity": "sha512-0YXXhpP00T9BGj/szN1quCHYdQb+/gIe1H2NB9A4gc90SYWHAJbSB6XaStsy9B+3+RPhDzYDTmP4OaCIHiTDNw==", - "dependencies": { - "dts-dom": "latest", - "parse-git-config": "^1.1.1", - "typescript": "^3.5.1", - "yargs": "^4.8.1" - }, - "bin": { - "dts-gen": "bin/lib/run.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/dts-gen/node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", - "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "node_modules/dts-gen/node_modules/find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", - "dependencies": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" - }, - "node_modules/dts-gen/node_modules/hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" - }, - "node_modules/dts-gen/node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", - "dependencies": { - "number-is-nan": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", - "dependencies": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "dependencies": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "node_modules/dts-gen/node_modules/parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", - "dependencies": { - "error-ex": "^1.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", - "dependencies": { - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", - "dependencies": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", - "dependencies": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", - "dependencies": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==" - }, - "node_modules/dts-gen/node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", - "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", - "dependencies": { - "is-utf8": "^0.2.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/dts-gen/node_modules/wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", - "dependencies": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/dts-gen/node_modules/y18n": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" - }, - "node_modules/dts-gen/node_modules/yargs": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA==", - "dependencies": { - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "lodash.assign": "^4.0.3", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.1", - "which-module": "^1.0.0", - "window-size": "^0.2.0", - "y18n": "^3.2.1", - "yargs-parser": "^2.4.1" - } - }, - "node_modules/dts-gen/node_modules/yargs-parser": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==", - "dependencies": { - "camelcase": "^3.0.0", - "lodash.assign": "^4.0.6" - } - }, "node_modules/duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", @@ -10635,6 +10361,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, "dependencies": { "is-arrayish": "^0.2.1" } @@ -12570,14 +12297,6 @@ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, - "node_modules/fs-exists-sync": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", - "integrity": "sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/fs-extra": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", @@ -12950,30 +12669,6 @@ "assert-plus": "^1.0.0" } }, - "node_modules/git-config-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz", - "integrity": "sha512-KcJ2dlrrP5DbBnYIZ2nlikALfRhKzNSX0stvv3ImJ+fvC4hXKoV+U+74SV0upg+jlQZbrtQzc0bu6/Zh+7aQbg==", - "dependencies": { - "extend-shallow": "^2.0.1", - "fs-exists-sync": "^0.1.0", - "homedir-polyfill": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/git-config-path/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/git-log-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.0.tgz", @@ -14402,6 +14097,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, "dependencies": { "parse-passwd": "^1.0.0" }, @@ -14698,7 +14394,8 @@ "node_modules/ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "node_modules/inline-source-map": { "version": "0.6.2", @@ -14799,6 +14496,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -14883,7 +14581,8 @@ "node_modules/is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true }, "node_modules/is-binary-path": { "version": "1.0.1", @@ -14998,6 +14697,7 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -15274,7 +14974,8 @@ "node_modules/is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true }, "node_modules/is-valid-glob": { "version": "1.0.0", @@ -17931,6 +17632,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, "dependencies": { "invert-kv": "^1.0.0" }, @@ -18384,11 +18086,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==" - }, "node_modules/lodash.assignin": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", @@ -22943,6 +22640,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "devOptional": true, "engines": { "node": ">=0.10.0" } @@ -23259,6 +22957,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, "dependencies": { "lcid": "^1.0.0" }, @@ -23561,31 +23260,6 @@ "node": ">=0.8" } }, - "node_modules/parse-git-config": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz", - "integrity": "sha512-S3LGXJZVSy/hswvbSkfdbKBRVsnqKrVu6j8fcvdtJ4TxosSELyQDsJPuGPXuZ+EyuYuJd3O4uAF8gcISR0OFrQ==", - "dependencies": { - "extend-shallow": "^2.0.1", - "fs-exists-sync": "^0.1.0", - "git-config-path": "^1.0.1", - "ini": "^1.3.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/parse-git-config/node_modules/extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "dependencies": { - "is-extendable": "^0.1.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -23653,6 +23327,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -24258,6 +23933,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -24266,6 +23942,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, "dependencies": { "pinkie": "^2.0.0" }, @@ -28861,7 +28538,8 @@ "node_modules/which-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true }, "node_modules/which-typed-array": { "version": "1.1.9", @@ -28892,17 +28570,6 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, - "node_modules/window-size": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==", - "bin": { - "window-size": "cli.js" - }, - "engines": { - "node": ">= 0.10.0" - } - }, "node_modules/winston": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/winston/-/winston-3.8.1.tgz", @@ -35387,7 +35054,8 @@ "code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "devOptional": true }, "codecov": { "version": "3.8.3", @@ -36975,224 +36643,6 @@ "integrity": "sha512-g/M9sqy3oHe477Ar4voQxWtaPIFw1jTdKZuomOjhCcBx9nHUNn0pu6NopuFFrTh/TRZIKEj+76vLWFu9BNKk+Q==", "dev": true }, - "dts-dom": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/dts-dom/-/dts-dom-3.7.0.tgz", - "integrity": "sha512-WnmiiHfhtcYS+DyGd2Rq3J6QA3ATVBdKtlrhutc/VzQVFoBgNDm+gnYc5gZizsXAI0xQ2frZntT5IJFeB2qQIg==" - }, - "dts-gen": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/dts-gen/-/dts-gen-0.6.1.tgz", - "integrity": "sha512-0YXXhpP00T9BGj/szN1quCHYdQb+/gIe1H2NB9A4gc90SYWHAJbSB6XaStsy9B+3+RPhDzYDTmP4OaCIHiTDNw==", - "requires": { - "dts-dom": "latest", - "parse-git-config": "^1.1.1", - "typescript": "^3.5.1", - "yargs": "^4.8.1" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==" - }, - "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==" - }, - "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" - } - }, - "find-up": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", - "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==", - "requires": { - "path-exists": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "get-caller-file": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" - }, - "hosted-git-info": { - "version": "2.8.9", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz", - "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==" - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==", - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "load-json-file": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", - "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==", - "requires": { - "graceful-fs": "^4.1.2", - "parse-json": "^2.2.0", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0", - "strip-bom": "^2.0.0" - } - }, - "normalize-package-data": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", - "requires": { - "hosted-git-info": "^2.1.4", - "resolve": "^1.10.0", - "semver": "2 || 3 || 4 || 5", - "validate-npm-package-license": "^3.0.1" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==", - "requires": { - "error-ex": "^1.2.0" - } - }, - "path-exists": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", - "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==", - "requires": { - "pinkie-promise": "^2.0.0" - } - }, - "path-type": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", - "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==", - "requires": { - "graceful-fs": "^4.1.2", - "pify": "^2.0.0", - "pinkie-promise": "^2.0.0" - } - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==" - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==", - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==", - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==" - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==", - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-bom": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", - "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==", - "requires": { - "is-utf8": "^0.2.0" - } - }, - "typescript": { - "version": "3.9.10", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", - "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==" - }, - "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" - } - }, - "y18n": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz", - "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ==" - }, - "yargs": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz", - "integrity": "sha512-LqodLrnIDM3IFT+Hf/5sxBnEGECrfdC1uIbgZeJmESCSo4HoCAaKEus8MylXHAkdacGc0ye+Qa+dpkuom8uVYA==", - "requires": { - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "lodash.assign": "^4.0.3", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", - "set-blocking": "^2.0.0", - "string-width": "^1.0.1", - "which-module": "^1.0.0", - "window-size": "^0.2.0", - "y18n": "^3.2.1", - "yargs-parser": "^2.4.1" - } - }, - "yargs-parser": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz", - "integrity": "sha512-9pIKIJhnI5tonzG6OnCFlz/yln8xHYcGl+pn3xR0Vzff0vzN1PbNRaelgfgRUwZ3s4i3jvxT9WhmUGL4whnasA==", - "requires": { - "camelcase": "^3.0.0", - "lodash.assign": "^4.0.6" - } - } - } - }, "duplexer2": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", @@ -37425,6 +36875,7 @@ "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, "requires": { "is-arrayish": "^0.2.1" } @@ -38931,11 +38382,6 @@ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, - "fs-exists-sync": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", - "integrity": "sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg==" - }, "fs-extra": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.0.tgz", @@ -39238,26 +38684,6 @@ "assert-plus": "^1.0.0" } }, - "git-config-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz", - "integrity": "sha512-KcJ2dlrrP5DbBnYIZ2nlikALfRhKzNSX0stvv3ImJ+fvC4hXKoV+U+74SV0upg+jlQZbrtQzc0bu6/Zh+7aQbg==", - "requires": { - "extend-shallow": "^2.0.1", - "fs-exists-sync": "^0.1.0", - "homedir-polyfill": "^1.0.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "git-log-parser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/git-log-parser/-/git-log-parser-1.2.0.tgz", @@ -40448,6 +39874,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, "requires": { "parse-passwd": "^1.0.0" } @@ -40656,7 +40083,8 @@ "ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true }, "inline-source-map": { "version": "0.6.2", @@ -40746,7 +40174,8 @@ "invert-kv": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true }, "ip": { "version": "2.0.0", @@ -40812,7 +40241,8 @@ "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true }, "is-binary-path": { "version": "1.0.1", @@ -40900,7 +40330,8 @@ "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true }, "is-extglob": { "version": "2.1.1", @@ -41098,7 +40529,8 @@ "is-utf8": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", - "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=" + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true }, "is-valid-glob": { "version": "1.0.0", @@ -43085,6 +42517,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, "requires": { "invert-kv": "^1.0.0" } @@ -43409,11 +42842,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha512-hFuH8TY+Yji7Eja3mGiuAxBqLagejScbG8GbG0j6o9vzn0YL14My+ktnqtZgFTosKymC9/44wP6s7xyuLfnClw==" - }, "lodash.assignin": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.assignin/-/lodash.assignin-4.2.0.tgz", @@ -46848,7 +46276,8 @@ "number-is-nan": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "devOptional": true }, "nwsapi": { "version": "2.2.2", @@ -47102,6 +46531,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, "requires": { "lcid": "^1.0.0" } @@ -47377,27 +46807,6 @@ "path-root": "^0.1.1" } }, - "parse-git-config": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/parse-git-config/-/parse-git-config-1.1.1.tgz", - "integrity": "sha512-S3LGXJZVSy/hswvbSkfdbKBRVsnqKrVu6j8fcvdtJ4TxosSELyQDsJPuGPXuZ+EyuYuJd3O4uAF8gcISR0OFrQ==", - "requires": { - "extend-shallow": "^2.0.1", - "fs-exists-sync": "^0.1.0", - "git-config-path": "^1.0.1", - "ini": "^1.3.4" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -47448,7 +46857,8 @@ "parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", - "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true }, "parse-server": { "version": "git+ssh://git@github.com/parse-community/parse-server.git#c78a5a6f10ce09032579fed8ef4cbd84c1ee96a9", @@ -47843,12 +47253,14 @@ "pinkie": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true }, "pinkie-promise": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, "requires": { "pinkie": "^2.0.0" } @@ -51558,7 +50970,8 @@ "which-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=" + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true }, "which-typed-array": { "version": "1.1.9", @@ -51583,11 +50996,6 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, - "window-size": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", - "integrity": "sha512-UD7d8HFA2+PZsbKyaOCEy8gMh1oDtHgJh1LfgjQ4zVXmYjAT/kvz3PueITKuqDiIXQe7yzpPnxX3lNc+AhQMyw==" - }, "winston": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/winston/-/winston-3.8.1.tgz", diff --git a/package.json b/package.json index d36d2c907..c03bf1e1e 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "types": "types", "dependencies": { "@babel/runtime-corejs3": "7.22.3", - "@definitelytyped/dtslint": "^0.0.163", + "@definitelytyped/dtslint": "0.0.163", "idb-keyval": "6.2.1", "react-native-crypto-js": "1.0.0", "uuid": "9.0.0", @@ -48,7 +48,7 @@ "@babel/plugin-transform-runtime": "7.21.4", "@babel/preset-env": "7.21.5", "@babel/preset-react": "7.18.6", - "@babel/preset-typescript": "^7.22.5", + "@babel/preset-typescript": "7.22.5", "@parse/minami": "1.0.0", "@saithodev/semantic-release-backmerge": "2.1.3", "@semantic-release/changelog": "6.0.3", diff --git a/src/ParseOp.ts b/src/ParseOp.ts index bbe73fc4a..fa0e6e42c 100644 --- a/src/ParseOp.ts +++ b/src/ParseOp.ts @@ -298,8 +298,8 @@ export class RemoveOp extends Op { export class RelationOp extends Op { _targetClassName: string | undefined | null = null; - relationsToAdd: Array = []; - relationsToRemove: Array = []; + relationsToAdd?: Array; + relationsToRemove?: Array; constructor(adds: Array, removes: Array) { super(); diff --git a/src/ParseQuery.ts b/src/ParseQuery.ts index 664e3dff5..9e64277f3 100644 --- a/src/ParseQuery.ts +++ b/src/ParseQuery.ts @@ -228,11 +228,11 @@ class ParseQuery { _watch: Array; _include: Array; _exclude: Array; - _select: Array = []; + _select?: Array; _limit: number; _skip: number; _count: boolean; - _order: Array = []; + _order?: Array; _readPreference: string | undefined | null; _includeReadPreference: string | undefined | null; _subqueryReadPreference: string | undefined | null; @@ -2089,7 +2089,7 @@ class ParseQuery { * * @returns {Parse.Query} Returns the query, so you can chain this call. */ - cancel(): ParseQuery { + cancel(): ParseQuery | any { if (this._xhrRequest.task && typeof this._xhrRequest.task.abort === 'function') { this._xhrRequest.task._aborted = true; this._xhrRequest.task.abort(); @@ -2097,7 +2097,7 @@ class ParseQuery { this._xhrRequest.onchange = () => {}; return this; } - return (this._xhrRequest.onchange = () => this.cancel())(); + return (this._xhrRequest.onchange = () => this.cancel()); } _setRequestTask(options) { diff --git a/types/Parse.d.ts b/types/Parse.d.ts index 382569ed4..3a31a13b9 100644 --- a/types/Parse.d.ts +++ b/types/Parse.d.ts @@ -4,6 +4,14 @@ import Object from './ParseObject'; import Query from './ParseQuery'; import Relation from './ParseRelation'; import User from './ParseUser'; +/** + * Contains all Parse API classes and functions. + * + * @static + * @global + * @class + * @hideconstructor +*/ interface Parse { ACL: any; Parse?: Parse; diff --git a/types/ParseOp.d.ts b/types/ParseOp.d.ts index fa2f7011e..ea1887c52 100644 --- a/types/ParseOp.d.ts +++ b/types/ParseOp.d.ts @@ -67,8 +67,8 @@ export declare class RemoveOp extends Op { } export declare class RelationOp extends Op { _targetClassName: string | undefined | null; - relationsToAdd: Array; - relationsToRemove: Array; + relationsToAdd?: Array; + relationsToRemove?: Array; constructor(adds: Array, removes: Array); _extractId(obj: string | ParseObject): string; applyTo(value: any, object?: { diff --git a/types/ParseQuery.d.ts b/types/ParseQuery.d.ts index 44288f187..f7241c6be 100644 --- a/types/ParseQuery.d.ts +++ b/types/ParseQuery.d.ts @@ -77,11 +77,11 @@ declare class ParseQuery { _watch: Array; _include: Array; _exclude: Array; - _select: Array; + _select?: Array; _limit: number; _skip: number; _count: boolean; - _order: Array; + _order?: Array; _readPreference: string | undefined | null; _includeReadPreference: string | undefined | null; _subqueryReadPreference: string | undefined | null; @@ -918,7 +918,7 @@ declare class ParseQuery { * * @returns {Parse.Query} Returns the query, so you can chain this call. */ - cancel(): ParseQuery; + cancel(): ParseQuery | any; _setRequestTask(options: any): void; } export default ParseQuery; From 5d3b6078dd7fee4bb79af5527519c039ed02c7a3 Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 30 Jun 2023 22:12:31 +1000 Subject: [PATCH 05/10] wip --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a3cb6873..dacfb9e48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - run: npm ci - name: Check types run: npm run test:types build: From bc43849f8268fa6ac6c47791efbe06f0bdb3e7cf Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 30 Jun 2023 22:32:46 +1000 Subject: [PATCH 06/10] wip --- src/Analytics.ts | 1 - src/ParseObject.ts | 4 ++-- src/{TaskQueue.js => TaskQueue.ts} | 11 ++++++----- src/{promiseUtils.js => promiseUtils.ts} | 13 +++++++++---- types/TaskQueue.d.ts | 15 +++++++++++++++ types/promiseUtils.d.ts | 7 +++++++ 6 files changed, 39 insertions(+), 12 deletions(-) rename src/{TaskQueue.js => TaskQueue.ts} (80%) rename src/{promiseUtils.js => promiseUtils.ts} (82%) create mode 100644 types/TaskQueue.d.ts create mode 100644 types/promiseUtils.d.ts diff --git a/src/Analytics.ts b/src/Analytics.ts index e36ddc2b9..e42822dba 100644 --- a/src/Analytics.ts +++ b/src/Analytics.ts @@ -2,7 +2,6 @@ * @flow */ -// @ts-ignore import CoreManager from './CoreManager'; /** diff --git a/src/ParseObject.ts b/src/ParseObject.ts index aa8f6eb0a..f49ec640e 100644 --- a/src/ParseObject.ts +++ b/src/ParseObject.ts @@ -2447,11 +2447,11 @@ const DefaultController = { // Queue up tasks for each object in the batch. // When every task is ready, the API request will execute - const batchReturned = new resolvingPromise(); + const batchReturned = resolvingPromise(); const batchReady: any[] = []; const batchTasks: any[] = []; batch.forEach((obj, index) => { - const ready = new resolvingPromise(); + const ready = resolvingPromise(); batchReady.push(ready); const task = function () { ready.resolve(); diff --git a/src/TaskQueue.js b/src/TaskQueue.ts similarity index 80% rename from src/TaskQueue.js rename to src/TaskQueue.ts index eedd769fe..d1b8f6440 100644 --- a/src/TaskQueue.js +++ b/src/TaskQueue.ts @@ -4,19 +4,19 @@ import { resolvingPromise } from './promiseUtils'; type Task = { - task: () => Promise, - _completion: Promise, + task: () => Promise, + _completion: resolvingPromise, }; class TaskQueue { - queue: Array; + queue: Task[]; constructor() { this.queue = []; } - enqueue(task: () => Promise): Promise { - const taskComplete = new resolvingPromise(); + enqueue(task: () => Promise): Promise { + const taskComplete = resolvingPromise(); this.queue.push({ task: task, _completion: taskComplete, @@ -55,3 +55,4 @@ class TaskQueue { } module.exports = TaskQueue; +export default TaskQueue; diff --git a/src/promiseUtils.js b/src/promiseUtils.ts similarity index 82% rename from src/promiseUtils.js rename to src/promiseUtils.ts index 176c32a0b..c012a9fc0 100644 --- a/src/promiseUtils.js +++ b/src/promiseUtils.ts @@ -1,8 +1,13 @@ // Create Deferred Promise +export interface resolvingPromise extends Promise { + resolve?:(value?: any) => void; + reject?:(value?: any) => void; +} + export function resolvingPromise() { - let res; - let rej; - const promise = new Promise((resolve, reject) => { + let res: (value: any) => void | null; + let rej: (value: any) => void | null; + const promise: resolvingPromise = new Promise((resolve, reject) => { res = resolve; rej = reject; }); @@ -32,7 +37,7 @@ export function when(promises) { return Promise.resolve(returnValue); } - const promise = new resolvingPromise(); + const promise = resolvingPromise(); const resolveOne = function () { total--; diff --git a/types/TaskQueue.d.ts b/types/TaskQueue.d.ts new file mode 100644 index 000000000..ff7abf862 --- /dev/null +++ b/types/TaskQueue.d.ts @@ -0,0 +1,15 @@ +/** + * @flow + */ +import { resolvingPromise } from './promiseUtils'; +type Task = { + task: () => Promise; + _completion: resolvingPromise; +}; +declare class TaskQueue { + queue: Task[]; + constructor(); + enqueue(task: () => Promise): Promise; + _dequeue(): void; +} +export default TaskQueue; diff --git a/types/promiseUtils.d.ts b/types/promiseUtils.d.ts new file mode 100644 index 000000000..370815429 --- /dev/null +++ b/types/promiseUtils.d.ts @@ -0,0 +1,7 @@ +export interface resolvingPromise extends Promise { + resolve?: (value?: any) => void; + reject?: (value?: any) => void; +} +export declare function resolvingPromise(): resolvingPromise; +export declare function when(promises: any): resolvingPromise | Promise; +export declare function continueWhile(test: any, emitter: any): any; From fa45eb4c67308d2559e0f0f0dc40452470f7bfe6 Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 30 Jun 2023 22:50:29 +1000 Subject: [PATCH 07/10] tests --- gulpfile.js | 4 ++-- src/Parse.ts | 8 ++++---- src/ParseQuery.ts | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 687af221f..981e18fd2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -137,7 +137,7 @@ gulp.task('minify-weapp', function() { gulp.task('watch', function() { if (BUILD === 'browser') { - const watcher = gulp.watch('src/*.js', { ignoreInitial: false }, gulp.series('compile', 'browserify', 'minify')); + const watcher = gulp.watch('src/*.*(js|ts)', { ignoreInitial: false }, gulp.series('compile', 'browserify', 'minify')); watcher.on('add', function(path) { console.log(`File ${path} was added`); }); @@ -146,5 +146,5 @@ gulp.task('watch', function() { }); return watcher; } - return compileTask(watch('src/*.js', { ignoreInitial: false, verbose: true })); + return compileTask(watch('src/*.*(js|ts)', { ignoreInitial: false, verbose: true })); }); diff --git a/src/Parse.ts b/src/Parse.ts index ed7fbd1d3..a8ead2f7f 100644 --- a/src/Parse.ts +++ b/src/Parse.ts @@ -7,8 +7,8 @@ import * as ParseOp from './ParseOp'; import RESTController from './RESTController'; import ACL from './ParseACL'; import * as Analytics from './Analytics' -import * as AnonymousUtils from './AnonymousUtils' -import Cloud from './Cloud'; +import AnonymousUtils from './AnonymousUtils' +import * as Cloud from './Cloud'; import CLP from './ParseCLP'; import CoreManager from './CoreManager'; import Config from './ParseConfig' @@ -116,8 +116,8 @@ const Parse: Parse = { ACL: ACL, Analytics: Analytics, AnonymousUtils: AnonymousUtils, - Cloud: Cloud, - CLP: CLP, + Cloud: Cloud, + CLP: CLP, CoreManager: CoreManager, Config: Config, Error: ParseError, diff --git a/src/ParseQuery.ts b/src/ParseQuery.ts index 9e64277f3..d485bc6ab 100644 --- a/src/ParseQuery.ts +++ b/src/ParseQuery.ts @@ -1382,15 +1382,15 @@ class ParseQuery { * @param {string} modifiers The regular expression mode. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - matches(key: string, regex: RegExp, modifiers: string): ParseQuery { + matches(key: string, regex: RegExp | string, modifiers: string): ParseQuery { this._addCondition(key, '$regex', regex); if (!modifiers) { modifiers = ''; } - if (regex.ignoreCase) { + if ((regex as RegExp).ignoreCase) { modifiers += 'i'; } - if (regex.multiline) { + if ((regex as RegExp).multiline) { modifiers += 'm'; } if (modifiers.length) { @@ -1571,7 +1571,7 @@ class ParseQuery { if (typeof prefix !== 'string') { throw new Error('The value being searched for must be a string.'); } - return this.matches(key, new RegExp(this._regexStartWith(prefix)), modifiers); + return this.matches(key, this._regexStartWith(prefix), modifiers); } /** @@ -1587,7 +1587,7 @@ class ParseQuery { if (typeof suffix !== 'string') { throw new Error('The value being searched for must be a string.'); } - return this.matches(key, new RegExp(quote(suffix) + '$'), modifiers); + return this.matches(key, quote(suffix) + '$', modifiers); } /** From c85c3317409caf4c65b005972490144d42dccf42 Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 30 Jun 2023 23:01:35 +1000 Subject: [PATCH 08/10] Update Parse.ts --- src/Parse.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Parse.ts b/src/Parse.ts index a8ead2f7f..cad071d22 100644 --- a/src/Parse.ts +++ b/src/Parse.ts @@ -20,7 +20,7 @@ import Polygon from './ParsePolygon' import Installation from './ParseInstallation' import LocalDatastore from './LocalDatastore' import Object from './ParseObject' -import Push from './Push' +import * as Push from './Push' import Query from './ParseQuery' import Relation from './ParseRelation' import Role from './ParseRole' From 1556f77b8c5ada19f943f77e393468543f69d13f Mon Sep 17 00:00:00 2001 From: dblythy Date: Fri, 30 Jun 2023 23:06:27 +1000 Subject: [PATCH 09/10] tests --- src/ParseObject.ts | 2 +- types/ParseQuery.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ParseObject.ts b/src/ParseObject.ts index f49ec640e..1f1cca232 100644 --- a/src/ParseObject.ts +++ b/src/ParseObject.ts @@ -147,7 +147,7 @@ class ParseObject { id?: string; _localId?: string; _objCount: number; - className: string = ''; + className: string = undefined; _initializers?: ((...args: Array) => void)[]; /* Prototype getters / setters */ diff --git a/types/ParseQuery.d.ts b/types/ParseQuery.d.ts index f7241c6be..89c7572fc 100644 --- a/types/ParseQuery.d.ts +++ b/types/ParseQuery.d.ts @@ -529,7 +529,7 @@ declare class ParseQuery { * @param {string} modifiers The regular expression mode. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - matches(key: string, regex: RegExp, modifiers: string): ParseQuery; + matches(key: string, regex: RegExp | string, modifiers: string): ParseQuery; /** * Adds a constraint that requires that a key's value matches a Parse.Query * constraint. From 74d0bbeb01234e4e386983ff4478f43b4f8a7def Mon Sep 17 00:00:00 2001 From: dblythy Date: Sat, 1 Jul 2023 01:19:27 +1000 Subject: [PATCH 10/10] wip --- src/{AnonymousUtils.js => AnonymousUtils.ts} | 0 src/{EventEmitter.js => EventEmitter.ts} | 7 +- ...{EventuallyQueue.js => EventuallyQueue.ts} | 13 +- ...bscription.js => LiveQuerySubscription.ts} | 20 +- src/Parse.ts | 60 +- src/{ParseACL.js => ParseACL.ts} | 0 src/ParseError.js | 541 ---- src/ParseError.ts | 547 +++++ src/ParseObject.ts | 14 +- src/ParseQuery.ts | 32 +- src/{ParseRole.js => ParseRole.ts} | 8 +- src/{RESTController.js => RESTController.ts} | 10 +- tsconfig.json | 2 +- types/AnonymousUtils.d.ts | 87 + types/EventEmitter.d.ts | 5 + types/EventuallyQueue.d.ts | 183 ++ types/LiveQuerySubscription.d.ts | 107 + types/Parse.d.ts | 71 +- types/ParseACL.d.ts | 144 ++ types/ParseError.d.ts | 474 ++++ types/ParseObject.d.ts | 4 +- types/ParseQuery.d.ts | 22 +- types/ParseRole.d.ts | 81 + types/RESTController.d.ts | 37 + types/node.d.ts | 2 + types/react-native.d.ts | 2 + types/tests.ts | 2168 ++++++++++++++++- 27 files changed, 4000 insertions(+), 641 deletions(-) rename src/{AnonymousUtils.js => AnonymousUtils.ts} (100%) rename src/{EventEmitter.js => EventEmitter.ts} (72%) rename src/{EventuallyQueue.js => EventuallyQueue.ts} (98%) rename src/{LiveQuerySubscription.js => LiveQuerySubscription.ts} (87%) rename src/{ParseACL.js => ParseACL.ts} (100%) delete mode 100644 src/ParseError.js create mode 100644 src/ParseError.ts rename src/{ParseRole.js => ParseRole.ts} (95%) rename src/{RESTController.js => RESTController.ts} (97%) create mode 100644 types/AnonymousUtils.d.ts create mode 100644 types/EventEmitter.d.ts create mode 100644 types/EventuallyQueue.d.ts create mode 100644 types/LiveQuerySubscription.d.ts create mode 100644 types/ParseACL.d.ts create mode 100644 types/ParseError.d.ts create mode 100644 types/ParseRole.d.ts create mode 100644 types/RESTController.d.ts create mode 100644 types/node.d.ts create mode 100644 types/react-native.d.ts diff --git a/src/AnonymousUtils.js b/src/AnonymousUtils.ts similarity index 100% rename from src/AnonymousUtils.js rename to src/AnonymousUtils.ts diff --git a/src/EventEmitter.js b/src/EventEmitter.ts similarity index 72% rename from src/EventEmitter.js rename to src/EventEmitter.ts index f7bdd3172..29f17dd06 100644 --- a/src/EventEmitter.js +++ b/src/EventEmitter.ts @@ -2,13 +2,16 @@ * This is a simple wrapper to unify EventEmitter implementations across platforms. */ +let emitter: any = null; if (process.env.PARSE_BUILD === 'react-native') { let EventEmitter = require('react-native/Libraries/vendor/emitter/EventEmitter'); if (EventEmitter.default) { EventEmitter = EventEmitter.default; } EventEmitter.prototype.on = EventEmitter.prototype.addListener; - module.exports = EventEmitter; + emitter = EventEmitter; } else { - module.exports = require('events').EventEmitter; + emitter = require('events').EventEmitter; } +module.exports = emitter; +export default emitter; diff --git a/src/EventuallyQueue.js b/src/EventuallyQueue.ts similarity index 98% rename from src/EventuallyQueue.js rename to src/EventuallyQueue.ts index 8925fda42..207e09e03 100644 --- a/src/EventuallyQueue.js +++ b/src/EventuallyQueue.ts @@ -49,7 +49,7 @@ const EventuallyQueue = { * @static * @see Parse.Object#saveEventually */ - save(object: ParseObject, serverOptions: SaveOptions = {}): Promise { + save(object: ParseObject, serverOptions: SaveOptions = {}): Promise { return this.enqueue('save', object, serverOptions); }, @@ -64,7 +64,7 @@ const EventuallyQueue = { * @static * @see Parse.Object#destroyEventually */ - destroy(object: ParseObject, serverOptions: RequestOptions = {}): Promise { + destroy(object: ParseObject, serverOptions: RequestOptions = {}): Promise { return this.enqueue('destroy', object, serverOptions); }, @@ -98,7 +98,7 @@ const EventuallyQueue = { action: string, object: ParseObject, serverOptions: SaveOptions | RequestOptions - ): Promise { + ): Promise { const queueData = await this.getQueue(); const queueId = this.generateQueueId(action, object); @@ -142,7 +142,7 @@ const EventuallyQueue = { * @returns {Promise} * @static */ - async getQueue(): Promise { + async getQueue(): Promise { if (dirtyCache) { queueCache = JSON.parse((await this.load()) || '[]'); dirtyCache = false; @@ -188,7 +188,7 @@ const EventuallyQueue = { * @returns {Promise} A promise that is fulfilled when queue is cleared. * @static */ - clear(): Promise { + clear(): Promise { queueCache = []; return this.store([]); }, @@ -214,7 +214,7 @@ const EventuallyQueue = { * @returns {number} * @static */ - async length(): number { + async length(): Promise { const queueData = await this.getQueue(); return queueData.length; }, @@ -373,3 +373,4 @@ const EventuallyQueue = { }; module.exports = EventuallyQueue; +export default EventuallyQueue; diff --git a/src/LiveQuerySubscription.js b/src/LiveQuerySubscription.ts similarity index 87% rename from src/LiveQuerySubscription.js rename to src/LiveQuerySubscription.ts index 503a07175..589b3867a 100644 --- a/src/LiveQuerySubscription.js +++ b/src/LiveQuerySubscription.ts @@ -1,6 +1,8 @@ import EventEmitter from './EventEmitter'; import CoreManager from './CoreManager'; import { resolvingPromise } from './promiseUtils'; +import ParseQuery from './ParseQuery'; +import ParseObject from './ParseObject'; /** * Creates a new LiveQuery Subscription. @@ -93,7 +95,14 @@ class Subscription extends EventEmitter { * @param {string} query - query to subscribe to * @param {string} sessionToken - optional session token */ - constructor(id, query, sessionToken) { + id: string; + query: ParseQuery; + sessionToken: string; + subscribePromise: resolvingPromise + unsubscribePromise: resolvingPromise + subscribed: boolean; + emit: any; + constructor(id: string, query: ParseQuery, sessionToken: string) { super(); this.id = id; this.query = query; @@ -112,7 +121,7 @@ class Subscription extends EventEmitter { * * @returns {Promise} */ - unsubscribe(): Promise { + unsubscribe(): Promise { return CoreManager.getLiveQueryController() .getDefaultLiveQueryClient() .then(liveQueryClient => { @@ -120,6 +129,13 @@ class Subscription extends EventEmitter { return liveQueryClient.unsubscribe(this); }); } + + on( + event: 'error' | 'open' | 'create' | 'update' | 'enter' | 'leave' | 'delete' | 'close', + listener: (object: ParseObject) => void, + ) { + return super.on(event, listener); + } } export default Subscription; diff --git a/src/Parse.ts b/src/Parse.ts index cad071d22..4dbfe64ba 100644 --- a/src/Parse.ts +++ b/src/Parse.ts @@ -40,27 +40,24 @@ import LiveQueryClient from './LiveQueryClient' * @hideconstructor */ - - - -interface Parse { - ACL: any, - Parse?: Parse, - Analytics: any, - AnonymousUtils: any, - Cloud: any, - CLP: any, - CoreManager: any, - Config: any, - Error: any, - EventuallyQueue: any, - FacebookUtils: any, - File: any, +interface ParseType { + ACL: typeof ACL, + Parse?: ParseType, + Analytics: typeof Analytics, + AnonymousUtils: typeof AnonymousUtils, + Cloud: typeof Cloud, + CLP: typeof CLP, + CoreManager: typeof CoreManager, + Config: typeof Config, + Error: typeof ParseError, + EventuallyQueue: typeof EventuallyQueue, + FacebookUtils: typeof FacebookUtils, + File: typeof File, GeoPoint: typeof GeoPoint, Hooks?: any, - Polygon: any, - Installation: any, - LocalDatastore: any, + Polygon: typeof Polygon, + Installation: typeof Installation, + LocalDatastore: typeof LocalDatastore, Object: typeof Object, Op: { Set: typeof ParseOp.SetOp, @@ -71,16 +68,16 @@ interface Parse { AddUnique: typeof ParseOp.AddUniqueOp, Relation: typeof ParseOp.RelationOp, }; - Push: any, + Push: typeof Push, Query: typeof Query, Relation: typeof Relation, - Role: any, - Schema: any, - Session: any, - Storage: any, + Role: typeof Role, + Schema: typeof Schema, + Session: typeof Session, + Storage: typeof Storage, User: typeof User, - LiveQuery: any, - LiveQueryClient: any, + LiveQuery: typeof LiveQuery, + LiveQueryClient: typeof LiveQueryClient, initialize(applicationId: string, javaScriptKey: string): void, _initialize(applicationId: string, javaScriptKey: string, masterKey?: string): void, @@ -95,7 +92,7 @@ interface Parse { serverAuthToken: string, serverAuthType: string, liveQueryServerURL: string, - encryptedUser: string, + encryptedUser: boolean, secret: string, idempotency: boolean, allowCustomObjectId: boolean, @@ -112,7 +109,7 @@ interface Parse { isEncryptedUserEnabled(): void, } -const Parse: Parse = { +const Parse: ParseType = { ACL: ACL, Analytics: Analytics, AnonymousUtils: AnonymousUtils, @@ -148,6 +145,9 @@ const Parse: Parse = { User: User, LiveQuery: LiveQuery, LiveQueryClient: LiveQueryClient, + IndexedDB: undefined, + Hooks: undefined, + Parse: undefined, /** @@ -292,10 +292,10 @@ const Parse: Parse = { }, /** - * @member {string} Parse.encryptedUser + * @member {boolean} Parse.encryptedUser * @static */ - set encryptedUser(value) { + set encryptedUser(value: boolean) { CoreManager.set('ENCRYPTED_USER', value); }, get encryptedUser() { diff --git a/src/ParseACL.js b/src/ParseACL.ts similarity index 100% rename from src/ParseACL.js rename to src/ParseACL.ts diff --git a/src/ParseError.js b/src/ParseError.js deleted file mode 100644 index 6383a5fb2..000000000 --- a/src/ParseError.js +++ /dev/null @@ -1,541 +0,0 @@ -/** - * Constructs a new Parse.Error object with the given code and message. - * - * @alias Parse.Error - */ -class ParseError extends Error { - /** - * @param {number} code An error code constant from Parse.Error. - * @param {string} message A detailed description of the error. - */ - constructor(code, message) { - super(message); - this.code = code; - Object.defineProperty(this, 'message', { - enumerable: true, - value: message, - }); - } - - toString() { - return 'ParseError: ' + this.code + ' ' + this.message; - } -} - -/** - * Error code indicating some error other than those enumerated here. - * - * @property {number} OTHER_CAUSE - * @static - */ -ParseError.OTHER_CAUSE = -1; - -/** - * Error code indicating that something has gone wrong with the server. - * - * @property {number} INTERNAL_SERVER_ERROR - * @static - */ -ParseError.INTERNAL_SERVER_ERROR = 1; - -/** - * Error code indicating the connection to the Parse servers failed. - * - * @property {number} CONNECTION_FAILED - * @static - */ -ParseError.CONNECTION_FAILED = 100; - -/** - * Error code indicating the specified object doesn't exist. - * - * @property {number} OBJECT_NOT_FOUND - * @static - */ -ParseError.OBJECT_NOT_FOUND = 101; - -/** - * Error code indicating you tried to query with a datatype that doesn't - * support it, like exact matching an array or object. - * - * @property {number} INVALID_QUERY - * @static - */ -ParseError.INVALID_QUERY = 102; - -/** - * Error code indicating a missing or invalid classname. Classnames are - * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the - * only valid characters. - * - * @property {number} INVALID_CLASS_NAME - * @static - */ -ParseError.INVALID_CLASS_NAME = 103; - -/** - * Error code indicating an unspecified object id. - * - * @property {number} MISSING_OBJECT_ID - * @static - */ -ParseError.MISSING_OBJECT_ID = 104; - -/** - * Error code indicating an invalid key name. Keys are case-sensitive. They - * must start with a letter, and a-zA-Z0-9_ are the only valid characters. - * - * @property {number} INVALID_KEY_NAME - * @static - */ -ParseError.INVALID_KEY_NAME = 105; - -/** - * Error code indicating a malformed pointer. You should not see this unless - * you have been mucking about changing internal Parse code. - * - * @property {number} INVALID_POINTER - * @static - */ -ParseError.INVALID_POINTER = 106; - -/** - * Error code indicating that badly formed JSON was received upstream. This - * either indicates you have done something unusual with modifying how - * things encode to JSON, or the network is failing badly. - * - * @property {number} INVALID_JSON - * @static - */ -ParseError.INVALID_JSON = 107; - -/** - * Error code indicating that the feature you tried to access is only - * available internally for testing purposes. - * - * @property {number} COMMAND_UNAVAILABLE - * @static - */ -ParseError.COMMAND_UNAVAILABLE = 108; - -/** - * You must call Parse.initialize before using the Parse library. - * - * @property {number} NOT_INITIALIZED - * @static - */ -ParseError.NOT_INITIALIZED = 109; - -/** - * Error code indicating that a field was set to an inconsistent type. - * - * @property {number} INCORRECT_TYPE - * @static - */ -ParseError.INCORRECT_TYPE = 111; - -/** - * Error code indicating an invalid channel name. A channel name is either - * an empty string (the broadcast channel) or contains only a-zA-Z0-9_ - * characters and starts with a letter. - * - * @property {number} INVALID_CHANNEL_NAME - * @static - */ -ParseError.INVALID_CHANNEL_NAME = 112; - -/** - * Error code indicating that push is misconfigured. - * - * @property {number} PUSH_MISCONFIGURED - * @static - */ -ParseError.PUSH_MISCONFIGURED = 115; - -/** - * Error code indicating that the object is too large. - * - * @property {number} OBJECT_TOO_LARGE - * @static - */ -ParseError.OBJECT_TOO_LARGE = 116; - -/** - * Error code indicating that the operation isn't allowed for clients. - * - * @property {number} OPERATION_FORBIDDEN - * @static - */ -ParseError.OPERATION_FORBIDDEN = 119; - -/** - * Error code indicating the result was not found in the cache. - * - * @property {number} CACHE_MISS - * @static - */ -ParseError.CACHE_MISS = 120; - -/** - * Error code indicating that an invalid key was used in a nested - * JSONObject. - * - * @property {number} INVALID_NESTED_KEY - * @static - */ -ParseError.INVALID_NESTED_KEY = 121; - -/** - * Error code indicating that an invalid filename was used for ParseFile. - * A valid file name contains only a-zA-Z0-9_. characters and is between 1 - * and 128 characters. - * - * @property {number} INVALID_FILE_NAME - * @static - */ -ParseError.INVALID_FILE_NAME = 122; - -/** - * Error code indicating an invalid ACL was provided. - * - * @property {number} INVALID_ACL - * @static - */ -ParseError.INVALID_ACL = 123; - -/** - * Error code indicating that the request timed out on the server. Typically - * this indicates that the request is too expensive to run. - * - * @property {number} TIMEOUT - * @static - */ -ParseError.TIMEOUT = 124; - -/** - * Error code indicating that the email address was invalid. - * - * @property {number} INVALID_EMAIL_ADDRESS - * @static - */ -ParseError.INVALID_EMAIL_ADDRESS = 125; - -/** - * Error code indicating a missing content type. - * - * @property {number} MISSING_CONTENT_TYPE - * @static - */ -ParseError.MISSING_CONTENT_TYPE = 126; - -/** - * Error code indicating a missing content length. - * - * @property {number} MISSING_CONTENT_LENGTH - * @static - */ -ParseError.MISSING_CONTENT_LENGTH = 127; - -/** - * Error code indicating an invalid content length. - * - * @property {number} INVALID_CONTENT_LENGTH - * @static - */ -ParseError.INVALID_CONTENT_LENGTH = 128; - -/** - * Error code indicating a file that was too large. - * - * @property {number} FILE_TOO_LARGE - * @static - */ -ParseError.FILE_TOO_LARGE = 129; - -/** - * Error code indicating an error saving a file. - * - * @property {number} FILE_SAVE_ERROR - * @static - */ -ParseError.FILE_SAVE_ERROR = 130; - -/** - * Error code indicating that a unique field was given a value that is - * already taken. - * - * @property {number} DUPLICATE_VALUE - * @static - */ -ParseError.DUPLICATE_VALUE = 137; - -/** - * Error code indicating that a role's name is invalid. - * - * @property {number} INVALID_ROLE_NAME - * @static - */ -ParseError.INVALID_ROLE_NAME = 139; - -/** - * Error code indicating that an application quota was exceeded. Upgrade to - * resolve. - * - * @property {number} EXCEEDED_QUOTA - * @static - */ -ParseError.EXCEEDED_QUOTA = 140; - -/** - * Error code indicating that a Cloud Code script failed. - * - * @property {number} SCRIPT_FAILED - * @static - */ -ParseError.SCRIPT_FAILED = 141; - -/** - * Error code indicating that a Cloud Code validation failed. - * - * @property {number} VALIDATION_ERROR - * @static - */ -ParseError.VALIDATION_ERROR = 142; - -/** - * Error code indicating that invalid image data was provided. - * - * @property {number} INVALID_IMAGE_DATA - * @static - */ -ParseError.INVALID_IMAGE_DATA = 143; - -/** - * Error code indicating an unsaved file. - * - * @property {number} UNSAVED_FILE_ERROR - * @static - */ -ParseError.UNSAVED_FILE_ERROR = 151; - -/** - * Error code indicating an invalid push time. - * - * @property {number} INVALID_PUSH_TIME_ERROR - * @static - */ -ParseError.INVALID_PUSH_TIME_ERROR = 152; - -/** - * Error code indicating an error deleting a file. - * - * @property {number} FILE_DELETE_ERROR - * @static - */ -ParseError.FILE_DELETE_ERROR = 153; - -/** - * Error code indicating an error deleting an unnamed file. - * - * @property {number} FILE_DELETE_UNNAMED_ERROR - * @static - */ -ParseError.FILE_DELETE_UNNAMED_ERROR = 161; - -/** - * Error code indicating that the application has exceeded its request - * limit. - * - * @property {number} REQUEST_LIMIT_EXCEEDED - * @static - */ -ParseError.REQUEST_LIMIT_EXCEEDED = 155; - -/** - * Error code indicating that the request was a duplicate and has been discarded due to - * idempotency rules. - * - * @property {number} DUPLICATE_REQUEST - * @static - */ -ParseError.DUPLICATE_REQUEST = 159; - -/** - * Error code indicating an invalid event name. - * - * @property {number} INVALID_EVENT_NAME - * @static - */ -ParseError.INVALID_EVENT_NAME = 160; - -/** - * Error code indicating that a field had an invalid value. - * - * @property {number} INVALID_VALUE - * @static - */ -ParseError.INVALID_VALUE = 162; - -/** - * Error code indicating that the username is missing or empty. - * - * @property {number} USERNAME_MISSING - * @static - */ -ParseError.USERNAME_MISSING = 200; - -/** - * Error code indicating that the password is missing or empty. - * - * @property {number} PASSWORD_MISSING - * @static - */ -ParseError.PASSWORD_MISSING = 201; - -/** - * Error code indicating that the username has already been taken. - * - * @property {number} USERNAME_TAKEN - * @static - */ -ParseError.USERNAME_TAKEN = 202; - -/** - * Error code indicating that the email has already been taken. - * - * @property {number} EMAIL_TAKEN - * @static - */ -ParseError.EMAIL_TAKEN = 203; - -/** - * Error code indicating that the email is missing, but must be specified. - * - * @property {number} EMAIL_MISSING - * @static - */ -ParseError.EMAIL_MISSING = 204; - -/** - * Error code indicating that a user with the specified email was not found. - * - * @property {number} EMAIL_NOT_FOUND - * @static - */ -ParseError.EMAIL_NOT_FOUND = 205; - -/** - * Error code indicating that a user object without a valid session could - * not be altered. - * - * @property {number} SESSION_MISSING - * @static - */ -ParseError.SESSION_MISSING = 206; - -/** - * Error code indicating that a user can only be created through signup. - * - * @property {number} MUST_CREATE_USER_THROUGH_SIGNUP - * @static - */ -ParseError.MUST_CREATE_USER_THROUGH_SIGNUP = 207; - -/** - * Error code indicating that an an account being linked is already linked - * to another user. - * - * @property {number} ACCOUNT_ALREADY_LINKED - * @static - */ -ParseError.ACCOUNT_ALREADY_LINKED = 208; - -/** - * Error code indicating that the current session token is invalid. - * - * @property {number} INVALID_SESSION_TOKEN - * @static - */ -ParseError.INVALID_SESSION_TOKEN = 209; - -/** - * Error code indicating an error enabling or verifying MFA - * - * @property {number} MFA_ERROR - * @static - */ -ParseError.MFA_ERROR = 210; - -/** - * Error code indicating that a valid MFA token must be provided - * - * @property {number} MFA_TOKEN_REQUIRED - * @static - */ -ParseError.MFA_TOKEN_REQUIRED = 211; - -/** - * Error code indicating that a user cannot be linked to an account because - * that account's id could not be found. - * - * @property {number} LINKED_ID_MISSING - * @static - */ -ParseError.LINKED_ID_MISSING = 250; - -/** - * Error code indicating that a user with a linked (e.g. Facebook) account - * has an invalid session. - * - * @property {number} INVALID_LINKED_SESSION - * @static - */ -ParseError.INVALID_LINKED_SESSION = 251; - -/** - * Error code indicating that a service being linked (e.g. Facebook or - * Twitter) is unsupported. - * - * @property {number} UNSUPPORTED_SERVICE - * @static - */ -ParseError.UNSUPPORTED_SERVICE = 252; - -/** - * Error code indicating an invalid operation occured on schema - * - * @property {number} INVALID_SCHEMA_OPERATION - * @static - */ -ParseError.INVALID_SCHEMA_OPERATION = 255; - -/** - * Error code indicating that there were multiple errors. Aggregate errors - * have an "errors" property, which is an array of error objects with more - * detail about each error that occurred. - * - * @property {number} AGGREGATE_ERROR - * @static - */ -ParseError.AGGREGATE_ERROR = 600; - -/** - * Error code indicating the client was unable to read an input file. - * - * @property {number} FILE_READ_ERROR - * @static - */ -ParseError.FILE_READ_ERROR = 601; - -/** - * Error code indicating a real error code is unavailable because - * we had to use an XDomainRequest object to allow CORS requests in - * Internet Explorer, which strips the body from HTTP responses that have - * a non-2XX status code. - * - * @property {number} X_DOMAIN_REQUEST - * @static - */ -ParseError.X_DOMAIN_REQUEST = 602; - -export default ParseError; diff --git a/src/ParseError.ts b/src/ParseError.ts new file mode 100644 index 000000000..91d06eb0e --- /dev/null +++ b/src/ParseError.ts @@ -0,0 +1,547 @@ +import ParseObject from "./ParseObject"; + +/** + * Constructs a new Parse.Error object with the given code and message. + * + * @alias Parse.Error + */ +class ParseError extends Error { + /** + * @param {number} code An error code constant from Parse.Error. + * @param {string} message A detailed description of the error. + */ + code: Number; + message: string = undefined; + errors: any[] = undefined; + object: ParseObject = undefined; + constructor(code: Number, message?: string) { + super(message); + this.code = code; + Object.defineProperty(this, 'message', { + enumerable: true, + value: message, + }); + } + + toString() { + return 'ParseError: ' + this.code + ' ' + this.message; + } + + /** + * Error code indicating some error other than those enumerated here. + * + * @property {number} OTHER_CAUSE + * @static + */ + static OTHER_CAUSE = -1; + + /** + * Error code indicating that something has gone wrong with the server. + * + * @property {number} INTERNAL_SERVER_ERROR + * @static + */ + static INTERNAL_SERVER_ERROR = 1; + + /** + * Error code indicating the connection to the Parse servers failed. + * + * @property {number} CONNECTION_FAILED + * @static + */ + static CONNECTION_FAILED = 100; + + /** + * Error code indicating the specified object doesn't exist. + * + * @property {number} OBJECT_NOT_FOUND + * @static + */ + static OBJECT_NOT_FOUND = 101; + + /** + * Error code indicating you tried to query with a datatype that doesn't + * support it, like exact matching an array or object. + * + * @property {number} INVALID_QUERY + * @static + */ + static INVALID_QUERY = 102; + + /** + * Error code indicating a missing or invalid classname. Classnames are + * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the + * only valid characters. + * + * @property {number} INVALID_CLASS_NAME + * @static + */ + static INVALID_CLASS_NAME = 103; + + /** + * Error code indicating an unspecified object id. + * + * @property {number} MISSING_OBJECT_ID + * @static + */ + static MISSING_OBJECT_ID = 104; + + /** + * Error code indicating an invalid key name. Keys are case-sensitive. They + * must start with a letter, and a-zA-Z0-9_ are the only valid characters. + * + * @property {number} INVALID_KEY_NAME + * @static + */ + static INVALID_KEY_NAME = 105; + + /** + * Error code indicating a malformed pointer. You should not see this unless + * you have been mucking about changing internal Parse code. + * + * @property {number} INVALID_POINTER + * @static + */ + static INVALID_POINTER = 106; + + /** + * Error code indicating that badly formed JSON was received upstream. This + * either indicates you have done something unusual with modifying how + * things encode to JSON, or the network is failing badly. + * + * @property {number} INVALID_JSON + * @static + */ + static INVALID_JSON = 107; + + /** + * Error code indicating that the feature you tried to access is only + * available internally for testing purposes. + * + * @property {number} COMMAND_UNAVAILABLE + * @static + */ + static COMMAND_UNAVAILABLE = 108; + + /** + * You must call Parse.initialize before using the Parse library. + * + * @property {number} NOT_INITIALIZED + * @static + */ + static NOT_INITIALIZED = 109; + + /** + * Error code indicating that a field was set to an inconsistent type. + * + * @property {number} INCORRECT_TYPE + * @static + */ + static INCORRECT_TYPE = 111; + + /** + * Error code indicating an invalid channel name. A channel name is either + * an empty string (the broadcast channel) or contains only a-zA-Z0-9_ + * characters and starts with a letter. + * + * @property {number} INVALID_CHANNEL_NAME + * @static + */ + static INVALID_CHANNEL_NAME = 112; + + /** + * Error code indicating that push is misconfigured. + * + * @property {number} PUSH_MISCONFIGURED + * @static + */ + static PUSH_MISCONFIGURED = 115; + + /** + * Error code indicating that the object is too large. + * + * @property {number} OBJECT_TOO_LARGE + * @static + */ + static OBJECT_TOO_LARGE = 116; + + /** + * Error code indicating that the operation isn't allowed for clients. + * + * @property {number} OPERATION_FORBIDDEN + * @static + */ + static OPERATION_FORBIDDEN = 119; + + /** + * Error code indicating the result was not found in the cache. + * + * @property {number} CACHE_MISS + * @static + */ + static CACHE_MISS = 120; + + /** + * Error code indicating that an invalid key was used in a nested + * JSONObject. + * + * @property {number} INVALID_NESTED_KEY + * @static + */ + static INVALID_NESTED_KEY = 121; + + /** + * Error code indicating that an invalid filename was used for ParseFile. + * A valid file name contains only a-zA-Z0-9_. characters and is between 1 + * and 128 characters. + * + * @property {number} INVALID_FILE_NAME + * @static + */ + static INVALID_FILE_NAME = 122; + + /** + * Error code indicating an invalid ACL was provided. + * + * @property {number} INVALID_ACL + * @static + */ + static INVALID_ACL = 123; + + /** + * Error code indicating that the request timed out on the server. Typically + * this indicates that the request is too expensive to run. + * + * @property {number} TIMEOUT + * @static + */ + static TIMEOUT = 124; + + /** + * Error code indicating that the email address was invalid. + * + * @property {number} INVALID_EMAIL_ADDRESS + * @static + */ + static INVALID_EMAIL_ADDRESS = 125; + + /** + * Error code indicating a missing content type. + * + * @property {number} MISSING_CONTENT_TYPE + * @static + */ + static MISSING_CONTENT_TYPE = 126; + + /** + * Error code indicating a missing content length. + * + * @property {number} MISSING_CONTENT_LENGTH + * @static + */ + static MISSING_CONTENT_LENGTH = 127; + + /** + * Error code indicating an invalid content length. + * + * @property {number} INVALID_CONTENT_LENGTH + * @static + */ + static INVALID_CONTENT_LENGTH = 128; + + /** + * Error code indicating a file that was too large. + * + * @property {number} FILE_TOO_LARGE + * @static + */ + static FILE_TOO_LARGE = 129; + + /** + * Error code indicating an error saving a file. + * + * @property {number} FILE_SAVE_ERROR + * @static + */ + static FILE_SAVE_ERROR = 130; + + /** + * Error code indicating that a unique field was given a value that is + * already taken. + * + * @property {number} DUPLICATE_VALUE + * @static + */ + static DUPLICATE_VALUE = 137; + + /** + * Error code indicating that a role's name is invalid. + * + * @property {number} INVALID_ROLE_NAME + * @static + */ + static INVALID_ROLE_NAME = 139; + + /** + * Error code indicating that an application quota was exceeded. Upgrade to + * resolve. + * + * @property {number} EXCEEDED_QUOTA + * @static + */ + static EXCEEDED_QUOTA = 140; + + /** + * Error code indicating that a Cloud Code script failed. + * + * @property {number} SCRIPT_FAILED + * @static + */ + static SCRIPT_FAILED = 141; + + /** + * Error code indicating that a Cloud Code validation failed. + * + * @property {number} VALIDATION_ERROR + * @static + */ + static VALIDATION_ERROR = 142; + + /** + * Error code indicating that invalid image data was provided. + * + * @property {number} INVALID_IMAGE_DATA + * @static + */ + static INVALID_IMAGE_DATA = 143; + + /** + * Error code indicating an unsaved file. + * + * @property {number} UNSAVED_FILE_ERROR + * @static + */ + static UNSAVED_FILE_ERROR = 151; + + /** + * Error code indicating an invalid push time. + * + * @property {number} INVALID_PUSH_TIME_ERROR + * @static + */ + static INVALID_PUSH_TIME_ERROR = 152; + + /** + * Error code indicating an error deleting a file. + * + * @property {number} FILE_DELETE_ERROR + * @static + */ + static FILE_DELETE_ERROR = 153; + + /** + * Error code indicating an error deleting an unnamed file. + * + * @property {number} FILE_DELETE_UNNAMED_ERROR + * @static + */ + static FILE_DELETE_UNNAMED_ERROR = 161; + + /** + * Error code indicating that the application has exceeded its request + * limit. + * + * @property {number} REQUEST_LIMIT_EXCEEDED + * @static + */ + static REQUEST_LIMIT_EXCEEDED = 155; + + /** + * Error code indicating that the request was a duplicate and has been discarded due to + * idempotency rules. + * + * @property {number} DUPLICATE_REQUEST + * @static + */ + static DUPLICATE_REQUEST = 159; + + /** + * Error code indicating an invalid event name. + * + * @property {number} INVALID_EVENT_NAME + * @static + */ + static INVALID_EVENT_NAME = 160; + + /** + * Error code indicating that a field had an invalid value. + * + * @property {number} INVALID_VALUE + * @static + */ + static INVALID_VALUE = 162; + + /** + * Error code indicating that the username is missing or empty. + * + * @property {number} USERNAME_MISSING + * @static + */ + static USERNAME_MISSING = 200; + + /** + * Error code indicating that the password is missing or empty. + * + * @property {number} PASSWORD_MISSING + * @static + */ + static PASSWORD_MISSING = 201; + + /** + * Error code indicating that the username has already been taken. + * + * @property {number} USERNAME_TAKEN + * @static + */ + static USERNAME_TAKEN = 202; + + /** + * Error code indicating that the email has already been taken. + * + * @property {number} EMAIL_TAKEN + * @static + */ + static EMAIL_TAKEN = 203; + + /** + * Error code indicating that the email is missing, but must be specified. + * + * @property {number} EMAIL_MISSING + * @static + */ + static EMAIL_MISSING = 204; + + /** + * Error code indicating that a user with the specified email was not found. + * + * @property {number} EMAIL_NOT_FOUND + * @static + */ + static EMAIL_NOT_FOUND = 205; + + /** + * Error code indicating that a user object without a valid session could + * not be altered. + * + * @property {number} SESSION_MISSING + * @static + */ + static SESSION_MISSING = 206; + + /** + * Error code indicating that a user can only be created through signup. + * + * @property {number} MUST_CREATE_USER_THROUGH_SIGNUP + * @static + */ + static MUST_CREATE_USER_THROUGH_SIGNUP = 207; + + /** + * Error code indicating that an an account being linked is already linked + * to another user. + * + * @property {number} ACCOUNT_ALREADY_LINKED + * @static + */ + static ACCOUNT_ALREADY_LINKED = 208; + + /** + * Error code indicating that the current session token is invalid. + * + * @property {number} INVALID_SESSION_TOKEN + * @static + */ + static INVALID_SESSION_TOKEN = 209; + + /** + * Error code indicating an error enabling or verifying MFA + * + * @property {number} MFA_ERROR + * @static + */ + static MFA_ERROR = 210; + + /** + * Error code indicating that a valid MFA token must be provided + * + * @property {number} MFA_TOKEN_REQUIRED + * @static + */ + static MFA_TOKEN_REQUIRED = 211; + + /** + * Error code indicating that a user cannot be linked to an account because + * that account's id could not be found. + * + * @property {number} LINKED_ID_MISSING + * @static + */ + static LINKED_ID_MISSING = 250; + + /** + * Error code indicating that a user with a linked (e.g. Facebook) account + * has an invalid session. + * + * @property {number} INVALID_LINKED_SESSION + * @static + */ + static INVALID_LINKED_SESSION = 251; + + /** + * Error code indicating that a service being linked (e.g. Facebook or + * Twitter) is unsupported. + * + * @property {number} UNSUPPORTED_SERVICE + * @static + */ + static UNSUPPORTED_SERVICE = 252; + + /** + * Error code indicating an invalid operation occured on schema + * + * @property {number} INVALID_SCHEMA_OPERATION + * @static + */ + static INVALID_SCHEMA_OPERATION = 255; + + /** + * Error code indicating that there were multiple errors. Aggregate errors + * have an "errors" property, which is an array of error objects with more + * detail about each error that occurred. + * + * @property {number} AGGREGATE_ERROR + * @static + */ + static AGGREGATE_ERROR = 600; + + /** + * Error code indicating the client was unable to read an input file. + * + * @property {number} FILE_READ_ERROR + * @static + */ + static FILE_READ_ERROR = 601; + + /** + * Error code indicating a real error code is unavailable because + * we had to use an XDomainRequest object to allow CORS requests in + * Internet Explorer, which strips the body from HTTP responses that have + * a non-2XX status code. + * + * @property {number} X_DOMAIN_REQUEST + * @static + */ + static X_DOMAIN_REQUEST = 602; +} + +export default ParseError; diff --git a/src/ParseObject.ts b/src/ParseObject.ts index 1f1cca232..370dcd32f 100644 --- a/src/ParseObject.ts +++ b/src/ParseObject.ts @@ -1017,7 +1017,8 @@ class ParseObject { const query = new ParseQuery(this.className); await query.get(this.id, options); return true; - } catch (e: ParseError) { + } catch (e) { + e = e as ParseError; if (e.code === ParseError.OBJECT_NOT_FOUND) { return false; } @@ -1187,8 +1188,7 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the fetch * completes. */ - fetchWithInclude(keys: String | Array>, options: RequestOptions): Promise { - options = options || {}; + fetchWithInclude(keys: String | Array>, options: RequestOptions = {}): Promise { options.include = keys; return this.fetch(options); } @@ -1220,7 +1220,8 @@ class ParseObject { async saveEventually(options: SaveOptions): Promise { try { await this.save(null, options); - } catch (e: ParseError) { + } catch (e) { + e = e as ParseError; if (e.message === 'XMLHttpRequest failed: "Unable to connect to the Parse API"') { await EventuallyQueue.save(this, options); EventuallyQueue.poll(); @@ -1364,7 +1365,8 @@ class ParseObject { async destroyEventually(options: RequestOptions): Promise { try { await this.destroy(options); - } catch (e: ParseError) { + } catch (e) { + e = e as ParseError; if (e.message === 'XMLHttpRequest failed: "Unable to connect to the Parse API"') { await EventuallyQueue.destroy(this, options); EventuallyQueue.poll(); @@ -1935,7 +1937,7 @@ class ParseObject { * this method. * @returns {Parse.Object} A new subclass of Parse.Object. */ - static extend(className: any, protoProps: any, classProps: any) { + static extend(className: any, protoProps?: any, classProps?: any) { if (typeof className !== 'string') { if (className && typeof className.className === 'string') { return ParseObject.extend(className.className, className, protoProps); diff --git a/src/ParseQuery.ts b/src/ParseQuery.ts index d485bc6ab..3c4cb3a68 100644 --- a/src/ParseQuery.ts +++ b/src/ParseQuery.ts @@ -14,7 +14,8 @@ import { DEFAULT_PIN } from './LocalDatastoreUtils'; import type LiveQuerySubscription from './LiveQuerySubscription'; import type { RequestOptions, FullOptions } from './RESTController'; -type BatchOptions = FullOptions & { batchSize?: number }; +type BatchOptions = FullOptions & { batchSize?: number, json?: boolean }; +type QueryOptions = FullOptions & { json?: boolean } export type WhereClause = { [attr: string]: any, @@ -38,6 +39,13 @@ export type QueryJSON = { subqueryReadPreference?: string, }; +interface FullTextOptions extends FullOptions { + term?: string, + language?: any, + caseSensitive?: any, + diacriticSensitive?: any, +} + /** * Converts a string into a regex that matches it. * Surrounding with \Q .. \E does this, we just need to escape any \E's in @@ -246,7 +254,7 @@ class ParseQuery { /** * @param {(string | Parse.Object)} objectClass An instance of a subclass of Parse.Object, or a Parse className string. */ - constructor(objectClass: string | ParseObject) { + constructor(objectClass: string | (new (...args: any[]) => ParseObject | ParseObject)) { if (typeof objectClass === 'string') { if (objectClass === 'User' && CoreManager.get('PERFORM_USER_REWRITE')) { this.className = '_User'; @@ -609,10 +617,10 @@ class ParseQuery { * @returns {Promise} A promise that is resolved with the result when * the query completes. */ - get(objectId: string, options?: FullOptions): Promise { + get(objectId: string, options?: QueryOptions): Promise { this.equalTo('objectId', objectId); - const firstOptions: FullOptions = {}; + const firstOptions: QueryOptions = {}; if (options && options.hasOwnProperty('useMasterKey')) { firstOptions.useMasterKey = options.useMasterKey; } @@ -651,8 +659,8 @@ class ParseQuery { * @returns {Promise} A promise that is resolved with the results when * the query completes. */ - find(options: FullOptions = {}): Promise> { - const findOptions: FullOptions = {}; + find(options: QueryOptions = {}): Promise> { + const findOptions: QueryOptions = {}; if (options.hasOwnProperty('useMasterKey')) { findOptions.useMasterKey = options.useMasterKey; } @@ -854,9 +862,9 @@ class ParseQuery { * @returns {Promise} A promise that is resolved with the object when * the query completes. */ - first(options: FullOptions = {}): Promise { + first(options: QueryOptions = {}): Promise { - const findOptions: FullOptions = {}; + const findOptions: QueryOptions = {}; if (options.hasOwnProperty('useMasterKey')) { findOptions.useMasterKey = options.useMasterKey; } @@ -970,7 +978,7 @@ class ParseQuery { query.ascending('objectId'); - const findOptions: FullOptions = {}; + const findOptions: BatchOptions = {}; if (options.hasOwnProperty('useMasterKey')) { findOptions.useMasterKey = options.useMasterKey; } @@ -1513,7 +1521,7 @@ class ParseQuery { * @param {boolean} options.diacriticSensitive A boolean flag to enable or disable diacritic sensitive search. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - fullText(key: string, value: string, options: FullOptions = {}): ParseQuery { + fullText(key: string, value: string, options: FullTextOptions = {}): ParseQuery { if (!key) { throw new Error('A key is required.'); } @@ -1524,7 +1532,7 @@ class ParseQuery { throw new Error('The value being searched for must be a string.'); } - const fullOptions: FullOptions = {}; + const fullOptions: any = {}; fullOptions.$term = value; for (const option in options) { @@ -1567,7 +1575,7 @@ class ParseQuery { * @param {string} modifiers The regular expression mode. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - startsWith(key: string, prefix: string, modifiers: string): ParseQuery { + startsWith(key: string, prefix: string, modifiers?: string): ParseQuery { if (typeof prefix !== 'string') { throw new Error('The value being searched for must be a string.'); } diff --git a/src/ParseRole.js b/src/ParseRole.ts similarity index 95% rename from src/ParseRole.js rename to src/ParseRole.ts index fee282395..20f746e6d 100644 --- a/src/ParseRole.js +++ b/src/ParseRole.ts @@ -42,7 +42,7 @@ class ParseRole extends ParseObject { * * @returns {string} the name of the role. */ - getName(): ?string { + getName(): string | null | undefined { const name = this.get('name'); if (name == null || typeof name === 'string') { return name; @@ -67,7 +67,7 @@ class ParseRole extends ParseObject { * callbacks. * @returns {(ParseObject|boolean)} true if the set succeeded. */ - setName(name: string, options?: mixed): ParseObject | boolean { + setName(name: string, options?: any): ParseObject | boolean { this._validateName(name); return this.set('name', name, options); } @@ -114,8 +114,8 @@ class ParseRole extends ParseObject { } } - validate(attrs: AttributeMap, options?: mixed): ParseError | boolean { - const isInvalid = super.validate(attrs, options); + validate(attrs: AttributeMap): ParseError | boolean { + const isInvalid = super.validate(attrs); if (isInvalid) { return isInvalid; } diff --git a/src/RESTController.js b/src/RESTController.ts similarity index 97% rename from src/RESTController.js rename to src/RESTController.ts index 5e0c42d0f..0235955ee 100644 --- a/src/RESTController.js +++ b/src/RESTController.ts @@ -2,6 +2,9 @@ * @flow */ /* global XMLHttpRequest, XDomainRequest */ +declare global { + var XDomainRequest: any; +} const uuidv4 = require('./uuid'); import CoreManager from './CoreManager'; @@ -28,6 +31,8 @@ export type FullOptions = { installationId?: string, progress?: any, usePost?: boolean, + context?: any, + requestTask?:(args1: any) => void, }; let XHR = null; @@ -205,7 +210,7 @@ const RESTController = { return promise; }, - request(method: string, path: string, data: mixed, options?: RequestOptions) { + request(method: string, path: string, data: any, options?: RequestOptions) { options = options || {}; let url = CoreManager.get('SERVER_URL'); if (url[url.length - 1] !== '/') { @@ -213,7 +218,7 @@ const RESTController = { } url += path; - const payload = {}; + const payload: any = {}; if (data && typeof data === 'object') { for (const k in data) { payload[k] = data[k]; @@ -334,3 +339,4 @@ const RESTController = { }; module.exports = RESTController; +export default RESTController; diff --git a/tsconfig.json b/tsconfig.json index 7e1f1dc08..236aff2fa 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,5 +7,5 @@ "outDir": "types", "noImplicitAny": false, }, - "include": ["src/Parse.ts"], + "include": ["src/Parse.ts"] } diff --git a/types/AnonymousUtils.d.ts b/types/AnonymousUtils.d.ts new file mode 100644 index 000000000..88cd1c839 --- /dev/null +++ b/types/AnonymousUtils.d.ts @@ -0,0 +1,87 @@ +/** + * @flow-weak + */ +import ParseUser from './ParseUser'; +import type { RequestOptions } from './RESTController'; +/** + * Provides utility functions for working with Anonymously logged-in users.
+ * Anonymous users have some unique characteristics: + *
    + *
  • Anonymous users don't need a user name or password.
  • + *
      + *
    • Once logged out, an anonymous user cannot be recovered.
    • + *
    + *
  • signUp converts an anonymous user to a standard user with the given username and password.
  • + *
      + *
    • Data associated with the anonymous user is retained.
    • + *
    + *
  • logIn switches users without converting the anonymous user.
  • + *
      + *
    • Data associated with the anonymous user will be lost.
    • + *
    + *
  • Service logIn (e.g. Facebook, Twitter) will attempt to convert + * the anonymous user into a standard user by linking it to the service.
  • + *
      + *
    • If a user already exists that is linked to the service, it will instead switch to the existing user.
    • + *
    + *
  • Service linking (e.g. Facebook, Twitter) will convert the anonymous user + * into a standard user by linking it to the service.
  • + *
+ * + * @class Parse.AnonymousUtils + * @static + */ +declare const AnonymousUtils: { + /** + * Gets whether the user has their account linked to anonymous user. + * + * @function isLinked + * @name Parse.AnonymousUtils.isLinked + * @param {Parse.User} user User to check for. + * The user must be logged in on this device. + * @returns {boolean} true if the user has their account + * linked to an anonymous user. + * @static + */ + isLinked(user: ParseUser): boolean; + /** + * Logs in a user Anonymously. + * + * @function logIn + * @name Parse.AnonymousUtils.logIn + * @param {object} options MasterKey / SessionToken. + * @returns {Promise} Logged in user + * @static + */ + logIn(options?: RequestOptions): Promise; + /** + * Links Anonymous User to an existing PFUser. + * + * @function link + * @name Parse.AnonymousUtils.link + * @param {Parse.User} user User to link. This must be the current user. + * @param {object} options MasterKey / SessionToken. + * @returns {Promise} Linked with User + * @static + */ + link(user: ParseUser, options?: RequestOptions): Promise; + /** + * Returns true if Authentication Provider has been registered for use. + * + * @function isRegistered + * @name Parse.AnonymousUtils.isRegistered + * @returns {boolean} + * @static + */ + isRegistered(): boolean; + _getAuthProvider(): { + restoreAuthentication(): boolean; + getAuthType(): string; + getAuthData(): { + authData: { + id: any; + }; + }; + }; +}; +export default AnonymousUtils; diff --git a/types/EventEmitter.d.ts b/types/EventEmitter.d.ts new file mode 100644 index 000000000..12e54f167 --- /dev/null +++ b/types/EventEmitter.d.ts @@ -0,0 +1,5 @@ +/** + * This is a simple wrapper to unify EventEmitter implementations across platforms. + */ +declare let emitter: any; +export default emitter; diff --git a/types/EventuallyQueue.d.ts b/types/EventuallyQueue.d.ts new file mode 100644 index 000000000..fbdc7a7a9 --- /dev/null +++ b/types/EventuallyQueue.d.ts @@ -0,0 +1,183 @@ +/** + * https://github.com/francimedia/parse-js-local-storage + * + * @flow + */ +import ParseObject from './ParseObject'; +import type { SaveOptions } from './ParseObject'; +import type { RequestOptions } from './RESTController'; +type QueueObject = { + queueId: string; + action: string; + object: ParseObject; + serverOptions: SaveOptions | RequestOptions; + id: string; + className: string; + hash: string; + createdAt: Date; +}; +type Queue = Array; +/** + * Provides utility functions to queue objects that will be + * saved to the server at a later date. + * + * @class Parse.EventuallyQueue + * @static + */ +declare const EventuallyQueue: { + /** + * Add object to queue with save operation. + * + * @function save + * @name Parse.EventuallyQueue.save + * @param {ParseObject} object Parse.Object to be saved eventually + * @param {object} [serverOptions] See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#save Parse.Object.save} options. + * @returns {Promise} A promise that is fulfilled if object is added to queue. + * @static + * @see Parse.Object#saveEventually + */ + save(object: ParseObject, serverOptions?: SaveOptions): Promise; + /** + * Add object to queue with save operation. + * + * @function destroy + * @name Parse.EventuallyQueue.destroy + * @param {ParseObject} object Parse.Object to be destroyed eventually + * @param {object} [serverOptions] See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#destroy Parse.Object.destroy} options + * @returns {Promise} A promise that is fulfilled if object is added to queue. + * @static + * @see Parse.Object#destroyEventually + */ + destroy(object: ParseObject, serverOptions?: RequestOptions): Promise; + /** + * Generate unique identifier to avoid duplicates and maintain previous state. + * + * @param {string} action save / destroy + * @param {object} object Parse.Object to be queued + * @returns {string} + * @static + * @ignore + */ + generateQueueId(action: string, object: ParseObject): string; + /** + * Build queue object and add to queue. + * + * @param {string} action save / destroy + * @param {object} object Parse.Object to be queued + * @param {object} [serverOptions] + * @returns {Promise} A promise that is fulfilled if object is added to queue. + * @static + * @ignore + */ + enqueue(action: string, object: ParseObject, serverOptions: SaveOptions | RequestOptions): Promise; + store(data: any): any; + load(): any; + /** + * Sets the in-memory queue from local storage and returns. + * + * @function getQueue + * @name Parse.EventuallyQueue.getQueue + * @returns {Promise} + * @static + */ + getQueue(): Promise; + /** + * Saves the queue to local storage + * + * @param {Queue} queue Queue containing Parse.Object data. + * @returns {Promise} A promise that is fulfilled when queue is stored. + * @static + * @ignore + */ + setQueue(queue: Queue): Promise; + /** + * Removes Parse.Object data from queue. + * + * @param {string} queueId Unique identifier for Parse.Object data. + * @returns {Promise} A promise that is fulfilled when queue is stored. + * @static + * @ignore + */ + remove(queueId: string): Promise; + /** + * Removes all objects from queue. + * + * @function clear + * @name Parse.EventuallyQueue.clear + * @returns {Promise} A promise that is fulfilled when queue is cleared. + * @static + */ + clear(): Promise; + /** + * Return the index of a queueId in the queue. Returns -1 if not found. + * + * @param {Queue} queue Queue containing Parse.Object data. + * @param {string} queueId Unique identifier for Parse.Object data. + * @returns {number} + * @static + * @ignore + */ + queueItemExists(queue: Queue, queueId: string): number; + /** + * Return the number of objects in the queue. + * + * @function length + * @name Parse.EventuallyQueue.length + * @returns {number} + * @static + */ + length(): Promise; + /** + * Sends the queue to the server. + * + * @function sendQueue + * @name Parse.EventuallyQueue.sendQueue + * @returns {Promise} Returns true if queue was sent successfully. + * @static + */ + sendQueue(): Promise; + /** + * Build queue object and add to queue. + * + * @param {ParseObject} object Parse.Object to be processed + * @param {QueueObject} queueObject Parse.Object data from the queue + * @returns {Promise} A promise that is fulfilled when operation is performed. + * @static + * @ignore + */ + sendQueueCallback(object: ParseObject, queueObject: QueueObject): Promise; + /** + * Start polling server for network connection. + * Will send queue if connection is established. + * + * @function poll + * @name Parse.EventuallyQueue.poll + * @param [ms] Milliseconds to ping the server. Default 2000ms + * @static + */ + poll(ms?: number): void; + /** + * Turns off polling. + * + * @function stopPoll + * @name Parse.EventuallyQueue.stopPoll + * @static + */ + stopPoll(): void; + /** + * Return true if pinging the server. + * + * @function isPolling + * @name Parse.EventuallyQueue.isPolling + * @returns {boolean} + * @static + */ + isPolling(): boolean; + _setPolling(flag: boolean): void; + process: { + create(ObjectType: any, queueObject: any): Promise; + byId(ObjectType: any, queueObject: any): Promise; + byHash(ObjectType: any, queueObject: any): Promise; + }; +}; +export default EventuallyQueue; diff --git a/types/LiveQuerySubscription.d.ts b/types/LiveQuerySubscription.d.ts new file mode 100644 index 000000000..0b56048f0 --- /dev/null +++ b/types/LiveQuerySubscription.d.ts @@ -0,0 +1,107 @@ +import EventEmitter from './EventEmitter'; +import { resolvingPromise } from './promiseUtils'; +import ParseQuery from './ParseQuery'; +import ParseObject from './ParseObject'; +/** + * Creates a new LiveQuery Subscription. + * Extends events.EventEmitter + * cloud functions. + * + *

Response Object - Contains data from the client that made the request + *

    + *
  • clientId
  • + *
  • installationId - requires Parse Server 4.0.0+
  • + *
+ *

+ * + *

Open Event - When you call query.subscribe(), we send a subscribe request to + * the LiveQuery server, when we get the confirmation from the LiveQuery server, + * this event will be emitted. When the client loses WebSocket connection to the + * LiveQuery server, we will try to auto reconnect the LiveQuery server. If we + * reconnect the LiveQuery server and successfully resubscribe the ParseQuery, + * you'll also get this event. + * + *

+ * subscription.on('open', (response) => {
+ *
+ * });

+ * + *

Create Event - When a new ParseObject is created and it fulfills the ParseQuery you subscribe, + * you'll get this event. The object is the ParseObject which is created. + * + *

+ * subscription.on('create', (object, response) => {
+ *
+ * });

+ * + *

Update Event - When an existing ParseObject (original) which fulfills the ParseQuery you subscribe + * is updated (The ParseObject fulfills the ParseQuery before and after changes), + * you'll get this event. The object is the ParseObject which is updated. + * Its content is the latest value of the ParseObject. + * + * Parse-Server 3.1.3+ Required for original object parameter + * + *

+ * subscription.on('update', (object, original, response) => {
+ *
+ * });

+ * + *

Enter Event - When an existing ParseObject's (original) old value doesn't fulfill the ParseQuery + * but its new value fulfills the ParseQuery, you'll get this event. The object is the + * ParseObject which enters the ParseQuery. Its content is the latest value of the ParseObject. + * + * Parse-Server 3.1.3+ Required for original object parameter + * + *

+ * subscription.on('enter', (object, original, response) => {
+ *
+ * });

+ * + * + *

Update Event - When an existing ParseObject's old value fulfills the ParseQuery but its new value + * doesn't fulfill the ParseQuery, you'll get this event. The object is the ParseObject + * which leaves the ParseQuery. Its content is the latest value of the ParseObject. + * + *

+ * subscription.on('leave', (object, response) => {
+ *
+ * });

+ * + * + *

Delete Event - When an existing ParseObject which fulfills the ParseQuery is deleted, you'll + * get this event. The object is the ParseObject which is deleted. + * + *

+ * subscription.on('delete', (object, response) => {
+ *
+ * });

+ * + * + *

Close Event - When the client loses the WebSocket connection to the LiveQuery + * server and we stop receiving events, you'll get this event. + * + *

+ * subscription.on('close', () => {
+ *
+ * });

+ * + * @alias Parse.LiveQuerySubscription + */ +declare class Subscription extends EventEmitter { + id: string; + query: ParseQuery; + sessionToken: string; + subscribePromise: resolvingPromise; + unsubscribePromise: resolvingPromise; + subscribed: boolean; + emit: any; + constructor(id: string, query: ParseQuery, sessionToken: string); + /** + * Close the subscription + * + * @returns {Promise} + */ + unsubscribe(): Promise; + on(event: 'error' | 'open' | 'create' | 'update' | 'enter' | 'leave' | 'delete' | 'close', listener: (object: ParseObject) => void): any; +} +export default Subscription; diff --git a/types/Parse.d.ts b/types/Parse.d.ts index 3a31a13b9..db3020c86 100644 --- a/types/Parse.d.ts +++ b/types/Parse.d.ts @@ -1,9 +1,30 @@ +import EventuallyQueue from './EventuallyQueue'; import * as ParseOp from './ParseOp'; +import ACL from './ParseACL'; +import * as Analytics from './Analytics'; +import AnonymousUtils from './AnonymousUtils'; +import * as Cloud from './Cloud'; +import CLP from './ParseCLP'; +import CoreManager from './CoreManager'; +import Config from './ParseConfig'; +import ParseError from './ParseError'; +import FacebookUtils from './FacebookUtils'; +import File from './ParseFile'; import GeoPoint from './ParseGeoPoint'; +import Polygon from './ParsePolygon'; +import Installation from './ParseInstallation'; +import LocalDatastore from './LocalDatastore'; import Object from './ParseObject'; +import * as Push from './Push'; import Query from './ParseQuery'; import Relation from './ParseRelation'; +import Role from './ParseRole'; +import Schema from './ParseSchema'; +import Session from './ParseSession'; +import Storage from './Storage'; import User from './ParseUser'; +import LiveQuery from './ParseLiveQuery'; +import LiveQueryClient from './LiveQueryClient'; /** * Contains all Parse API classes and functions. * @@ -12,24 +33,24 @@ import User from './ParseUser'; * @class * @hideconstructor */ -interface Parse { - ACL: any; - Parse?: Parse; - Analytics: any; - AnonymousUtils: any; - Cloud: any; - CLP: any; - CoreManager: any; - Config: any; - Error: any; - EventuallyQueue: any; - FacebookUtils: any; - File: any; +interface ParseType { + ACL: typeof ACL; + Parse?: ParseType; + Analytics: typeof Analytics; + AnonymousUtils: typeof AnonymousUtils; + Cloud: typeof Cloud; + CLP: typeof CLP; + CoreManager: typeof CoreManager; + Config: typeof Config; + Error: typeof ParseError; + EventuallyQueue: typeof EventuallyQueue; + FacebookUtils: typeof FacebookUtils; + File: typeof File; GeoPoint: typeof GeoPoint; Hooks?: any; - Polygon: any; - Installation: any; - LocalDatastore: any; + Polygon: typeof Polygon; + Installation: typeof Installation; + LocalDatastore: typeof LocalDatastore; Object: typeof Object; Op: { Set: typeof ParseOp.SetOp; @@ -40,16 +61,16 @@ interface Parse { AddUnique: typeof ParseOp.AddUniqueOp; Relation: typeof ParseOp.RelationOp; }; - Push: any; + Push: typeof Push; Query: typeof Query; Relation: typeof Relation; - Role: any; - Schema: any; - Session: any; - Storage: any; + Role: typeof Role; + Schema: typeof Schema; + Session: typeof Session; + Storage: typeof Storage; User: typeof User; - LiveQuery: any; - LiveQueryClient: any; + LiveQuery: typeof LiveQuery; + LiveQueryClient: typeof LiveQueryClient; initialize(applicationId: string, javaScriptKey: string): void; _initialize(applicationId: string, javaScriptKey: string, masterKey?: string): void; setAsyncStorage(storage: any): void; @@ -62,7 +83,7 @@ interface Parse { serverAuthToken: string; serverAuthType: string; liveQueryServerURL: string; - encryptedUser: string; + encryptedUser: boolean; secret: string; idempotency: boolean; allowCustomObjectId: boolean; @@ -78,5 +99,5 @@ interface Parse { enableEncryptedUser(): void; isEncryptedUserEnabled(): void; } -declare const Parse: Parse; +declare const Parse: ParseType; export default Parse; diff --git a/types/ParseACL.d.ts b/types/ParseACL.d.ts new file mode 100644 index 000000000..069190642 --- /dev/null +++ b/types/ParseACL.d.ts @@ -0,0 +1,144 @@ +/** + * @flow + */ +import ParseRole from './ParseRole'; +import ParseUser from './ParseUser'; +type PermissionsMap = { + [permission: string]: boolean; +}; +type ByIdMap = { + [userId: string]: PermissionsMap; +}; +/** + * Creates a new ACL. + * If no argument is given, the ACL has no permissions for anyone. + * If the argument is a Parse.User, the ACL will have read and write + * permission for only that user. + * If the argument is any other JSON object, that object will be interpretted + * as a serialized ACL created with toJSON(). + * + *

An ACL, or Access Control List can be added to any + * Parse.Object to restrict access to only a subset of users + * of your application.

+ * + * @alias Parse.ACL + */ +declare class ParseACL { + permissionsById: ByIdMap; + /** + * @param {(Parse.User | object)} arg1 The user to initialize the ACL for + */ + constructor(arg1: ParseUser | ByIdMap); + /** + * Returns a JSON-encoded version of the ACL. + * + * @returns {object} + */ + toJSON(): ByIdMap; + /** + * Returns whether this ACL is equal to another object + * + * @param {ParseACL} other The other object's ACL to compare to + * @returns {boolean} + */ + equals(other: ParseACL): boolean; + _setAccess(accessType: string, userId: ParseUser | ParseRole | string, allowed: boolean): void; + _getAccess(accessType: string, userId: ParseUser | ParseRole | string): boolean; + /** + * Sets whether the given user is allowed to read this object. + * + * @param userId An instance of Parse.User or its objectId. + * @param {boolean} allowed Whether that user should have read access. + */ + setReadAccess(userId: ParseUser | ParseRole | string, allowed: boolean): void; + /** + * Get whether the given user id is *explicitly* allowed to read this object. + * Even if this returns false, the user may still be able to access it if + * getPublicReadAccess returns true or a role that the user belongs to has + * write access. + * + * @param userId An instance of Parse.User or its objectId, or a Parse.Role. + * @returns {boolean} + */ + getReadAccess(userId: ParseUser | ParseRole | string): boolean; + /** + * Sets whether the given user id is allowed to write this object. + * + * @param userId An instance of Parse.User or its objectId, or a Parse.Role.. + * @param {boolean} allowed Whether that user should have write access. + */ + setWriteAccess(userId: ParseUser | ParseRole | string, allowed: boolean): void; + /** + * Gets whether the given user id is *explicitly* allowed to write this object. + * Even if this returns false, the user may still be able to write it if + * getPublicWriteAccess returns true or a role that the user belongs to has + * write access. + * + * @param userId An instance of Parse.User or its objectId, or a Parse.Role. + * @returns {boolean} + */ + getWriteAccess(userId: ParseUser | ParseRole | string): boolean; + /** + * Sets whether the public is allowed to read this object. + * + * @param {boolean} allowed + */ + setPublicReadAccess(allowed: boolean): void; + /** + * Gets whether the public is allowed to read this object. + * + * @returns {boolean} + */ + getPublicReadAccess(): boolean; + /** + * Sets whether the public is allowed to write this object. + * + * @param {boolean} allowed + */ + setPublicWriteAccess(allowed: boolean): void; + /** + * Gets whether the public is allowed to write this object. + * + * @returns {boolean} + */ + getPublicWriteAccess(): boolean; + /** + * Gets whether users belonging to the given role are allowed + * to read this object. Even if this returns false, the role may + * still be able to write it if a parent role has read access. + * + * @param role The name of the role, or a Parse.Role object. + * @returns {boolean} true if the role has read access. false otherwise. + * @throws {TypeError} If role is neither a Parse.Role nor a String. + */ + getRoleReadAccess(role: ParseRole | string): boolean; + /** + * Gets whether users belonging to the given role are allowed + * to write this object. Even if this returns false, the role may + * still be able to write it if a parent role has write access. + * + * @param role The name of the role, or a Parse.Role object. + * @returns {boolean} true if the role has write access. false otherwise. + * @throws {TypeError} If role is neither a Parse.Role nor a String. + */ + getRoleWriteAccess(role: ParseRole | string): boolean; + /** + * Sets whether users belonging to the given role are allowed + * to read this object. + * + * @param role The name of the role, or a Parse.Role object. + * @param {boolean} allowed Whether the given role can read this object. + * @throws {TypeError} If role is neither a Parse.Role nor a String. + */ + setRoleReadAccess(role: ParseRole | string, allowed: boolean): void; + /** + * Sets whether users belonging to the given role are allowed + * to write this object. + * + * @param role The name of the role, or a Parse.Role object. + * @param {boolean} allowed Whether the given role can write this object. + * @throws {TypeError} If role is neither a Parse.Role nor a String. + */ + setRoleWriteAccess(role: ParseRole | string, allowed: boolean): void; +} +export default ParseACL; diff --git a/types/ParseError.d.ts b/types/ParseError.d.ts new file mode 100644 index 000000000..908ad1d7e --- /dev/null +++ b/types/ParseError.d.ts @@ -0,0 +1,474 @@ +import ParseObject from "./ParseObject"; +/** + * Constructs a new Parse.Error object with the given code and message. + * + * @alias Parse.Error + */ +declare class ParseError extends Error { + /** + * @param {number} code An error code constant from Parse.Error. + * @param {string} message A detailed description of the error. + */ + code: Number; + message: string; + errors: any[]; + object: ParseObject; + constructor(code: Number, message?: string); + toString(): string; + /** + * Error code indicating some error other than those enumerated here. + * + * @property {number} OTHER_CAUSE + * @static + */ + static OTHER_CAUSE: number; + /** + * Error code indicating that something has gone wrong with the server. + * + * @property {number} INTERNAL_SERVER_ERROR + * @static + */ + static INTERNAL_SERVER_ERROR: number; + /** + * Error code indicating the connection to the Parse servers failed. + * + * @property {number} CONNECTION_FAILED + * @static + */ + static CONNECTION_FAILED: number; + /** + * Error code indicating the specified object doesn't exist. + * + * @property {number} OBJECT_NOT_FOUND + * @static + */ + static OBJECT_NOT_FOUND: number; + /** + * Error code indicating you tried to query with a datatype that doesn't + * support it, like exact matching an array or object. + * + * @property {number} INVALID_QUERY + * @static + */ + static INVALID_QUERY: number; + /** + * Error code indicating a missing or invalid classname. Classnames are + * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the + * only valid characters. + * + * @property {number} INVALID_CLASS_NAME + * @static + */ + static INVALID_CLASS_NAME: number; + /** + * Error code indicating an unspecified object id. + * + * @property {number} MISSING_OBJECT_ID + * @static + */ + static MISSING_OBJECT_ID: number; + /** + * Error code indicating an invalid key name. Keys are case-sensitive. They + * must start with a letter, and a-zA-Z0-9_ are the only valid characters. + * + * @property {number} INVALID_KEY_NAME + * @static + */ + static INVALID_KEY_NAME: number; + /** + * Error code indicating a malformed pointer. You should not see this unless + * you have been mucking about changing internal Parse code. + * + * @property {number} INVALID_POINTER + * @static + */ + static INVALID_POINTER: number; + /** + * Error code indicating that badly formed JSON was received upstream. This + * either indicates you have done something unusual with modifying how + * things encode to JSON, or the network is failing badly. + * + * @property {number} INVALID_JSON + * @static + */ + static INVALID_JSON: number; + /** + * Error code indicating that the feature you tried to access is only + * available internally for testing purposes. + * + * @property {number} COMMAND_UNAVAILABLE + * @static + */ + static COMMAND_UNAVAILABLE: number; + /** + * You must call Parse.initialize before using the Parse library. + * + * @property {number} NOT_INITIALIZED + * @static + */ + static NOT_INITIALIZED: number; + /** + * Error code indicating that a field was set to an inconsistent type. + * + * @property {number} INCORRECT_TYPE + * @static + */ + static INCORRECT_TYPE: number; + /** + * Error code indicating an invalid channel name. A channel name is either + * an empty string (the broadcast channel) or contains only a-zA-Z0-9_ + * characters and starts with a letter. + * + * @property {number} INVALID_CHANNEL_NAME + * @static + */ + static INVALID_CHANNEL_NAME: number; + /** + * Error code indicating that push is misconfigured. + * + * @property {number} PUSH_MISCONFIGURED + * @static + */ + static PUSH_MISCONFIGURED: number; + /** + * Error code indicating that the object is too large. + * + * @property {number} OBJECT_TOO_LARGE + * @static + */ + static OBJECT_TOO_LARGE: number; + /** + * Error code indicating that the operation isn't allowed for clients. + * + * @property {number} OPERATION_FORBIDDEN + * @static + */ + static OPERATION_FORBIDDEN: number; + /** + * Error code indicating the result was not found in the cache. + * + * @property {number} CACHE_MISS + * @static + */ + static CACHE_MISS: number; + /** + * Error code indicating that an invalid key was used in a nested + * JSONObject. + * + * @property {number} INVALID_NESTED_KEY + * @static + */ + static INVALID_NESTED_KEY: number; + /** + * Error code indicating that an invalid filename was used for ParseFile. + * A valid file name contains only a-zA-Z0-9_. characters and is between 1 + * and 128 characters. + * + * @property {number} INVALID_FILE_NAME + * @static + */ + static INVALID_FILE_NAME: number; + /** + * Error code indicating an invalid ACL was provided. + * + * @property {number} INVALID_ACL + * @static + */ + static INVALID_ACL: number; + /** + * Error code indicating that the request timed out on the server. Typically + * this indicates that the request is too expensive to run. + * + * @property {number} TIMEOUT + * @static + */ + static TIMEOUT: number; + /** + * Error code indicating that the email address was invalid. + * + * @property {number} INVALID_EMAIL_ADDRESS + * @static + */ + static INVALID_EMAIL_ADDRESS: number; + /** + * Error code indicating a missing content type. + * + * @property {number} MISSING_CONTENT_TYPE + * @static + */ + static MISSING_CONTENT_TYPE: number; + /** + * Error code indicating a missing content length. + * + * @property {number} MISSING_CONTENT_LENGTH + * @static + */ + static MISSING_CONTENT_LENGTH: number; + /** + * Error code indicating an invalid content length. + * + * @property {number} INVALID_CONTENT_LENGTH + * @static + */ + static INVALID_CONTENT_LENGTH: number; + /** + * Error code indicating a file that was too large. + * + * @property {number} FILE_TOO_LARGE + * @static + */ + static FILE_TOO_LARGE: number; + /** + * Error code indicating an error saving a file. + * + * @property {number} FILE_SAVE_ERROR + * @static + */ + static FILE_SAVE_ERROR: number; + /** + * Error code indicating that a unique field was given a value that is + * already taken. + * + * @property {number} DUPLICATE_VALUE + * @static + */ + static DUPLICATE_VALUE: number; + /** + * Error code indicating that a role's name is invalid. + * + * @property {number} INVALID_ROLE_NAME + * @static + */ + static INVALID_ROLE_NAME: number; + /** + * Error code indicating that an application quota was exceeded. Upgrade to + * resolve. + * + * @property {number} EXCEEDED_QUOTA + * @static + */ + static EXCEEDED_QUOTA: number; + /** + * Error code indicating that a Cloud Code script failed. + * + * @property {number} SCRIPT_FAILED + * @static + */ + static SCRIPT_FAILED: number; + /** + * Error code indicating that a Cloud Code validation failed. + * + * @property {number} VALIDATION_ERROR + * @static + */ + static VALIDATION_ERROR: number; + /** + * Error code indicating that invalid image data was provided. + * + * @property {number} INVALID_IMAGE_DATA + * @static + */ + static INVALID_IMAGE_DATA: number; + /** + * Error code indicating an unsaved file. + * + * @property {number} UNSAVED_FILE_ERROR + * @static + */ + static UNSAVED_FILE_ERROR: number; + /** + * Error code indicating an invalid push time. + * + * @property {number} INVALID_PUSH_TIME_ERROR + * @static + */ + static INVALID_PUSH_TIME_ERROR: number; + /** + * Error code indicating an error deleting a file. + * + * @property {number} FILE_DELETE_ERROR + * @static + */ + static FILE_DELETE_ERROR: number; + /** + * Error code indicating an error deleting an unnamed file. + * + * @property {number} FILE_DELETE_UNNAMED_ERROR + * @static + */ + static FILE_DELETE_UNNAMED_ERROR: number; + /** + * Error code indicating that the application has exceeded its request + * limit. + * + * @property {number} REQUEST_LIMIT_EXCEEDED + * @static + */ + static REQUEST_LIMIT_EXCEEDED: number; + /** + * Error code indicating that the request was a duplicate and has been discarded due to + * idempotency rules. + * + * @property {number} DUPLICATE_REQUEST + * @static + */ + static DUPLICATE_REQUEST: number; + /** + * Error code indicating an invalid event name. + * + * @property {number} INVALID_EVENT_NAME + * @static + */ + static INVALID_EVENT_NAME: number; + /** + * Error code indicating that a field had an invalid value. + * + * @property {number} INVALID_VALUE + * @static + */ + static INVALID_VALUE: number; + /** + * Error code indicating that the username is missing or empty. + * + * @property {number} USERNAME_MISSING + * @static + */ + static USERNAME_MISSING: number; + /** + * Error code indicating that the password is missing or empty. + * + * @property {number} PASSWORD_MISSING + * @static + */ + static PASSWORD_MISSING: number; + /** + * Error code indicating that the username has already been taken. + * + * @property {number} USERNAME_TAKEN + * @static + */ + static USERNAME_TAKEN: number; + /** + * Error code indicating that the email has already been taken. + * + * @property {number} EMAIL_TAKEN + * @static + */ + static EMAIL_TAKEN: number; + /** + * Error code indicating that the email is missing, but must be specified. + * + * @property {number} EMAIL_MISSING + * @static + */ + static EMAIL_MISSING: number; + /** + * Error code indicating that a user with the specified email was not found. + * + * @property {number} EMAIL_NOT_FOUND + * @static + */ + static EMAIL_NOT_FOUND: number; + /** + * Error code indicating that a user object without a valid session could + * not be altered. + * + * @property {number} SESSION_MISSING + * @static + */ + static SESSION_MISSING: number; + /** + * Error code indicating that a user can only be created through signup. + * + * @property {number} MUST_CREATE_USER_THROUGH_SIGNUP + * @static + */ + static MUST_CREATE_USER_THROUGH_SIGNUP: number; + /** + * Error code indicating that an an account being linked is already linked + * to another user. + * + * @property {number} ACCOUNT_ALREADY_LINKED + * @static + */ + static ACCOUNT_ALREADY_LINKED: number; + /** + * Error code indicating that the current session token is invalid. + * + * @property {number} INVALID_SESSION_TOKEN + * @static + */ + static INVALID_SESSION_TOKEN: number; + /** + * Error code indicating an error enabling or verifying MFA + * + * @property {number} MFA_ERROR + * @static + */ + static MFA_ERROR: number; + /** + * Error code indicating that a valid MFA token must be provided + * + * @property {number} MFA_TOKEN_REQUIRED + * @static + */ + static MFA_TOKEN_REQUIRED: number; + /** + * Error code indicating that a user cannot be linked to an account because + * that account's id could not be found. + * + * @property {number} LINKED_ID_MISSING + * @static + */ + static LINKED_ID_MISSING: number; + /** + * Error code indicating that a user with a linked (e.g. Facebook) account + * has an invalid session. + * + * @property {number} INVALID_LINKED_SESSION + * @static + */ + static INVALID_LINKED_SESSION: number; + /** + * Error code indicating that a service being linked (e.g. Facebook or + * Twitter) is unsupported. + * + * @property {number} UNSUPPORTED_SERVICE + * @static + */ + static UNSUPPORTED_SERVICE: number; + /** + * Error code indicating an invalid operation occured on schema + * + * @property {number} INVALID_SCHEMA_OPERATION + * @static + */ + static INVALID_SCHEMA_OPERATION: number; + /** + * Error code indicating that there were multiple errors. Aggregate errors + * have an "errors" property, which is an array of error objects with more + * detail about each error that occurred. + * + * @property {number} AGGREGATE_ERROR + * @static + */ + static AGGREGATE_ERROR: number; + /** + * Error code indicating the client was unable to read an input file. + * + * @property {number} FILE_READ_ERROR + * @static + */ + static FILE_READ_ERROR: number; + /** + * Error code indicating a real error code is unavailable because + * we had to use an XDomainRequest object to allow CORS requests in + * Internet Explorer, which strips the body from HTTP responses that have + * a non-2XX status code. + * + * @property {number} X_DOMAIN_REQUEST + * @static + */ + static X_DOMAIN_REQUEST: number; +} +export default ParseError; diff --git a/types/ParseObject.d.ts b/types/ParseObject.d.ts index a40205936..4c4a5f43a 100644 --- a/types/ParseObject.d.ts +++ b/types/ParseObject.d.ts @@ -438,7 +438,7 @@ declare class ParseObject { * @returns {Promise} A promise that is fulfilled when the fetch * completes. */ - fetchWithInclude(keys: String | Array>, options: RequestOptions): Promise; + fetchWithInclude(keys: String | Array>, options?: RequestOptions): Promise; /** * Saves this object to the server at some unspecified time in the future, * even if Parse is currently inaccessible. @@ -901,7 +901,7 @@ declare class ParseObject { * this method. * @returns {Parse.Object} A new subclass of Parse.Object. */ - static extend(className: any, protoProps: any, classProps: any): any; + static extend(className: any, protoProps?: any, classProps?: any): any; /** * Enable single instance objects, where any local objects with the same Id * share the same attributes, and stay synchronized with each other. diff --git a/types/ParseQuery.d.ts b/types/ParseQuery.d.ts index 89c7572fc..e3a724b63 100644 --- a/types/ParseQuery.d.ts +++ b/types/ParseQuery.d.ts @@ -4,6 +4,10 @@ import type LiveQuerySubscription from './LiveQuerySubscription'; import type { FullOptions } from './RESTController'; type BatchOptions = FullOptions & { batchSize?: number; + json?: boolean; +}; +type QueryOptions = FullOptions & { + json?: boolean; }; export type WhereClause = { [attr: string]: any; @@ -25,6 +29,12 @@ export type QueryJSON = { includeReadPreference?: string; subqueryReadPreference?: string; }; +interface FullTextOptions extends FullOptions { + term?: string; + language?: any; + caseSensitive?: any; + diacriticSensitive?: any; +} /** * Creates a new parse Parse.Query for the given Parse.Object subclass. * @@ -96,7 +106,7 @@ declare class ParseQuery { /** * @param {(string | Parse.Object)} objectClass An instance of a subclass of Parse.Object, or a Parse className string. */ - constructor(objectClass: string | ParseObject); + constructor(objectClass: string | (new (...args: any[]) => ParseObject | ParseObject)); /** * Adds constraint that at least one of the passed in queries matches. * @@ -189,7 +199,7 @@ declare class ParseQuery { * @returns {Promise} A promise that is resolved with the result when * the query completes. */ - get(objectId: string, options?: FullOptions): Promise; + get(objectId: string, options?: QueryOptions): Promise; /** * Retrieves a list of ParseObjects that satisfy this query. * @@ -205,7 +215,7 @@ declare class ParseQuery { * @returns {Promise} A promise that is resolved with the results when * the query completes. */ - find(options?: FullOptions): Promise>; + find(options?: QueryOptions): Promise>; /** * Retrieves a complete list of ParseObjects that satisfy this query. * Using `eachBatch` under the hood to fetch all the valid objects. @@ -274,7 +284,7 @@ declare class ParseQuery { * @returns {Promise} A promise that is resolved with the object when * the query completes. */ - first(options?: FullOptions): Promise; + first(options?: QueryOptions): Promise; /** * Iterates over objects matching a query, calling a callback for each batch. * If the callback returns a promise, the iteration will not continue until @@ -612,7 +622,7 @@ declare class ParseQuery { * @param {boolean} options.diacriticSensitive A boolean flag to enable or disable diacritic sensitive search. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - fullText(key: string, value: string, options?: FullOptions): ParseQuery; + fullText(key: string, value: string, options?: FullTextOptions): ParseQuery; /** * Method to sort the full text search by text score * @@ -629,7 +639,7 @@ declare class ParseQuery { * @param {string} modifiers The regular expression mode. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - startsWith(key: string, prefix: string, modifiers: string): ParseQuery; + startsWith(key: string, prefix: string, modifiers?: string): ParseQuery; /** * Adds a constraint for finding string values that end with a provided * string. This will be slow for large datasets. diff --git a/types/ParseRole.d.ts b/types/ParseRole.d.ts new file mode 100644 index 000000000..6dc3ecdfc --- /dev/null +++ b/types/ParseRole.d.ts @@ -0,0 +1,81 @@ +/** + * @flow + */ +import ParseACL from './ParseACL'; +import ParseError from './ParseError'; +import ParseObject from './ParseObject'; +import type { AttributeMap } from './ObjectStateMutations'; +import type ParseRelation from './ParseRelation'; +/** + * Represents a Role on the Parse server. Roles represent groupings of + * Users for the purposes of granting permissions (e.g. specifying an ACL + * for an Object). Roles are specified by their sets of child users and + * child roles, all of which are granted any permissions that the parent + * role has. + * + *

Roles must have a name (which cannot be changed after creation of the + * role), and must specify an ACL.

+ * + * @alias Parse.Role + * @augments Parse.Object + */ +declare class ParseRole extends ParseObject { + /** + * @param {string} name The name of the Role to create. + * @param {Parse.ACL} acl The ACL for this role. Roles must have an ACL. + * A Parse.Role is a local representation of a role persisted to the Parse + * cloud. + */ + constructor(name: string, acl: ParseACL); + /** + * Gets the name of the role. You can alternatively call role.get("name") + * + * @returns {string} the name of the role. + */ + getName(): string | null | undefined; + /** + * Sets the name for a role. This value must be set before the role has + * been saved to the server, and cannot be set once the role has been + * saved. + * + *

+ * A role's name can only contain alphanumeric characters, _, -, and + * spaces. + *

+ * + *

This is equivalent to calling role.set("name", name)

+ * + * @param {string} name The name of the role. + * @param {object} options Standard options object with success and error + * callbacks. + * @returns {(ParseObject|boolean)} true if the set succeeded. + */ + setName(name: string, options?: any): ParseObject | boolean; + /** + * Gets the Parse.Relation for the Parse.Users that are direct + * children of this role. These users are granted any privileges that this + * role has been granted (e.g. read or write access through ACLs). You can + * add or remove users from the role through this relation. + * + *

This is equivalent to calling role.relation("users")

+ * + * @returns {Parse.Relation} the relation for the users belonging to this + * role. + */ + getUsers(): ParseRelation; + /** + * Gets the Parse.Relation for the Parse.Roles that are direct + * children of this role. These roles' users are granted any privileges that + * this role has been granted (e.g. read or write access through ACLs). You + * can add or remove child roles from this role through this relation. + * + *

This is equivalent to calling role.relation("roles")

+ * + * @returns {Parse.Relation} the relation for the roles belonging to this + * role. + */ + getRoles(): ParseRelation; + _validateName(newName: any): void; + validate(attrs: AttributeMap): ParseError | boolean; +} +export default ParseRole; diff --git a/types/RESTController.d.ts b/types/RESTController.d.ts new file mode 100644 index 000000000..c7810de50 --- /dev/null +++ b/types/RESTController.d.ts @@ -0,0 +1,37 @@ +/** + * @flow + */ +declare global { + var XDomainRequest: any; +} +import { resolvingPromise } from './promiseUtils'; +export type RequestOptions = { + useMasterKey?: boolean; + sessionToken?: string; + installationId?: string; + returnStatus?: boolean; + batchSize?: number; + include?: any; + progress?: any; + context?: any; + usePost?: boolean; +}; +export type FullOptions = { + success?: any; + error?: any; + useMasterKey?: boolean; + sessionToken?: string; + installationId?: string; + progress?: any; + usePost?: boolean; + context?: any; + requestTask?: (args1: any) => void; +}; +declare const RESTController: { + ajax(method: string, url: string, data: any, headers?: any, options?: FullOptions): resolvingPromise | Promise; + request(method: string, path: string, data: any, options?: RequestOptions): any; + handleError(response: any): Promise; + _setXHR(xhr: any): void; + _getXHR(): any; +}; +export default RESTController; diff --git a/types/node.d.ts b/types/node.d.ts new file mode 100644 index 000000000..358fb4d56 --- /dev/null +++ b/types/node.d.ts @@ -0,0 +1,2 @@ +import parse from "./Parse"; +export default parse; diff --git a/types/react-native.d.ts b/types/react-native.d.ts new file mode 100644 index 000000000..358fb4d56 --- /dev/null +++ b/types/react-native.d.ts @@ -0,0 +1,2 @@ +import parse from "./Parse"; +export default parse; diff --git a/types/tests.ts b/types/tests.ts index 9613c1d57..cf45bb5f8 100644 --- a/types/tests.ts +++ b/types/tests.ts @@ -1,6 +1,2170 @@ -import Parse from 'parse'; +import Parse from './Parse'; +// Parse is a global type, but it can also be imported + class GameScore extends Parse.Object { constructor(options?: any) { - super('GameScore', options); + super('GameScore', options); } } + +class Game extends Parse.Object { + constructor(options?: any) { + super('Game', options); + } +} + +function test_config() { + Parse.Config.save({ foo: 'bar' }, { foo: true }); + Parse.Config.get({ useMasterKey: true }); +} + +function test_object() { + const game = new Game(); + game.save(null, { + useMasterKey: true, + sessionToken: 'sometoken', + cascadeSave: false, + }).then(result => result); + + if (!game.isNew()) { + + } + + if (game.toPointer().className !== 'Game') { + + } + + game.fetch({}); + + // Create a new instance of that class. + const gameScore = new GameScore(); + + gameScore.set('score', 1337); + gameScore.set('playerName', 'Sean Plott'); + gameScore.set('cheatMode', false); + + // Setting attrs using object + gameScore.set({ + level: '10', + difficult: 15, + }); + + const score = gameScore.get('score'); + const playerName = gameScore.get('playerName'); + const cheatMode = gameScore.get('cheatMode'); + + gameScore.increment('score'); + gameScore.addUnique('skills', 'flying'); + gameScore.addUnique('skills', 'kungfu'); + gameScore.addAll('skills', ['kungfu']); + gameScore.addAllUnique('skills', ['kungfu']); + gameScore.remove('skills', 'flying'); + gameScore.removeAll('skills', ['kungFu']); + game.set('gameScore', gameScore); + + const gameCopy = Game.fromJSON(JSON.parse(JSON.stringify(game)), true); + + const object = new Parse.Object('TestObject'); + object.equals(gameScore); + object.fetchWithInclude(['key1', 'key2']); +} + +function test_errors() { + try { + throw new Parse.Error(Parse.Error.INTERNAL_SERVER_ERROR, 'sdfds'); + } catch (error) { + if (error.code !== 1) { + + } + } +} + +function test_query() { + const gameScore = new GameScore(); + + const query = new Parse.Query(GameScore); + query.equalTo('playerName', 'Dan Stemkoski'); + query.notEqualTo('playerName', 'Michael Yabuti'); + query.fullText('playerName', 'dan', { language: 'en', caseSensitive: false, diacriticSensitive: true }); + query.greaterThan('playerAge', 18); + query.eachBatch(objs => Promise.resolve(), { batchSize: 10 }); + query.each(score => Promise.resolve()); + query.hint('_id_'); + query.explain(true); + query.limit(10); + query.skip(10); + + // Sorts the results in ascending order by the score field + query.ascending('score'); + + // Sorts the results in descending order by the score field + query.descending('score'); + + // Restricts to wins < 50 + query.lessThan('wins', 50); + + // Restricts to wins <= 50 + query.lessThanOrEqualTo('wins', 50); + + // Restricts to wins > 50 + query.greaterThan('wins', 50); + + // Restricts to wins >= 50 + query.greaterThanOrEqualTo('wins', 50); + + query.containedBy('place', ['1', '2']); + // Finds scores from any of Jonathan, Dario, or Shawn + query.containedIn('playerName', ['Jonathan Walsh', 'Dario Wunsch', 'Shawn Simon']); + + // Finds scores from anyone who is neither Jonathan, Dario, nor Shawn + query.notContainedIn('playerName', ['Jonathan Walsh', 'Dario Wunsch', 'Shawn Simon']); + + // Finds objects that have the score set + query.exists('score'); + + // Finds objects that don't have the score set + query.doesNotExist('score'); + query.matchesKeyInQuery('hometown', 'city', query); + query.doesNotMatchKeyInQuery('hometown', 'city', query); + query.select('score', 'playerName'); + + // Find objects where the array in arrayKey contains 2. + query.equalTo('arrayKey', 2); + + // Find objects where the array in arrayKey contains all of the elements 2, 3, and 4. + query.containsAll('arrayKey', [2, 3, 4]); + query.containsAllStartingWith('arrayKey', ['2', '3', '4']); + + query.startsWith('name', "Big Daddy's"); + query.equalTo('score', gameScore); + query.exists('score'); + query.include('score'); + query.include(['score.team']); + query.includeAll(); + query.sortByTextScore(); + // Find objects that match the aggregation pipeline + query.aggregate({ + group: { + objectId: '$name', + }, + }); + + query.aggregate({ + count: 'total', + }); + + query.aggregate({ + lookup: { + from: 'Collection', + foreignField: 'id', + localField: 'id', + as: 'result', + }, + }); + query.aggregate({ + lookup: { + from: 'Target', + let: { foo: 'bar', baz: 123 }, + pipeline: [], + as: 'result', + }, + }); + + query.aggregate({ + graphLookup: { + from: 'Target', + connectFromField: 'objectId', + connectToField: 'newId', + as: 'result', + }, + }); + + query.aggregate({ + facet: { + foo: [ + { + count: 'total', + }, + ], + bar: [ + { + group: { + objectId: '$name', + }, + }, + ], + }, + }); + + query.aggregate({ + unwind: '$field', + }); + + query.aggregate({ + unwind: { + path: '$field', + includeArrayIndex: 'newIndex', + preserveNullAndEmptyArrays: true, + }, + }); + + // Find objects with distinct key + query.distinct('name'); + + const testQuery = Parse.Query.or(query, query); +} + +function test_query_exclude() { + const gameScore = new GameScore(); + + const query = new Parse.Query(GameScore); + + // Show all keys, except the specified key. + query.exclude('place'); + + const testQuery = Parse.Query.or(query, query); +} + +async function test_query_promise() { + // Test promise with a query + const findQuery = new Parse.Query('Test'); + findQuery + .find() + .then(() => { + // success + }) + .catch(() => { + // error + }); + + const getQuery = new Parse.Query('Test'); + try { + await getQuery.get('objectId'); + } catch (error) { + // noop + } + + await getQuery.map((score, index) => score.increment('score', index)); + await getQuery.reduce((accum, score, index) => (accum += score.get('score')), 0); + await getQuery.reduce((accum, score, index) => (accum += score.get('score')), 0, { batchSize: 200 }); + await getQuery.filter(scores => scores.get('score') > 0); + await getQuery.filter(scores => scores.get('score') > 0, { batchSize: 10 }); +} + +async function test_live_query() { + const subscription = await new Parse.Query('Test').subscribe(); + subscription.on('close', object => { + // $ExpectType ParseObject + object; + }); + subscription.on('create', object => { + // $ExpectType ParseObject + object; + }); + subscription.on('delete', object => { + // $ExpectType ParseObject + object; + }); + subscription.on('enter', object => { + // $ExpectType ParseObject + object; + }); + subscription.on('leave', object => { + // $ExpectType ParseObject + object; + }); + subscription.on('open', object => { + // $ExpectType ParseObject + object; + }); + subscription.on('update', object => { + // $ExpectType ParseObject + object; + }); +} + +function test_anonymous_utils() { + // $ExpectType boolean + Parse.AnonymousUtils.isLinked(new Parse.User()); + // $ExpectType Promise + Parse.AnonymousUtils.link(new Parse.User(), { useMasterKey: true, sessionToken: '' }); + // $ExpectType Promise + Parse.AnonymousUtils.logIn({ useMasterKey: true, sessionToken: '' }); +} + +function return_a_query(): Parse.Query { + return new Parse.Query(Game); +} + +// function test_each() { +// new Parse.Query(Game).each(game => { +// // $ExpectType Game +// game; +// }); +// } + +// function test_file() { +// const base64 = 'V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE='; +// let file = new Parse.File('myfile.txt', { base64 }); + +// file = new Parse.File('nana', { uri: 'http://example.com/image.jps' }); + +// const bytes = [0xbe, 0xef, 0xca, 0xfe]; +// file = new Parse.File('myfile.txt', bytes); + +// file = new Parse.File('myfile.zzz', new Blob(), 'image/png'); + +// const src = file.url(); +// const secure = file.url({ forceSecure: true }); + +// file.save().then( +// () => { +// // The file has been saved to Parse. +// }, +// error => { +// // The file either could n ot be read, or could not be saved to Parse. +// }, +// ); + +// Parse.Cloud.httpRequest({ url: file.url() }).then((response: Parse.Cloud.HttpResponse) => { +// // result +// }); + +// // TODO: Check + +// file.cancel(); +// file.destroy(); +// } + +// function test_file_tags_and_metadata() { +// const base64 = 'V29ya2luZyBhdCBQYXJzZSBpcyBncmVhdCE='; +// const file = new Parse.File('myfile.txt', { base64 }); +// file.setTags({ ownerId: 42, status: 'okay' }); +// file.addTag('labes', ['one', 'two', 'three']); +// file.setMetadata({ contentType: 'plain/text', contentLength: 579 }); +// file.addMetadata('author', 'John Doe'); + +// const tags = file.tags(); +// const ownerId = tags['ownerId']; + +// const metadata = file.metadata(); +// const contentType = metadata['contentType']; +// } + +// function test_analytics() { +// const dimensions = { +// // Define ranges to bucket data points into meaningful segments +// priceRange: '1000-1500', +// // Did the user filter the query? +// source: 'craigslist', +// // Do searches happen more often on weekdays or weekends? +// dayType: 'weekday', +// }; +// // Send the dimensions to Parse along with the 'search' event +// Parse.Analytics.track('search', dimensions); + +// const codeString = '404'; +// Parse.Analytics.track('error', { code: codeString }); +// } + +// function test_relation() { +// const game1 = new Game(); +// const game2 = new Game(); + +// new Parse.User() +// .relation('games') +// .query() +// .find() +// .then((g: Game[]) => {}); +// new Parse.User().relation('games').add(game1); +// new Parse.User().relation('games').add([game1, game2]); + +// new Parse.User().relation('games').remove(game1); +// new Parse.User().relation('games').remove([game1, game2]); +// } + +// function test_user() { +// const user = new Parse.User(); +// user.set('username', 'my name'); +// user.set('password', 'my pass'); +// user.set('email', 'email@example.com'); +// user.signUp(null, { useMasterKey: true }); + +// const anotherUser: Parse.User = Parse.User.fromJSON({}); +// anotherUser.set('email', 'email@example.com'); +// } + +// async function test_user_currentAsync() { +// const asyncUser = await Parse.User.currentAsync(); +// if (asyncUser) { +// asyncUser.set('email', 'email@example.com'); +// } else if (asyncUser === null) { +// Parse.User.logIn('email@example.com', 'my pass'); +// } +// } + +// function test_user_acl_roles() { +// const user = new Parse.User(); +// user.set('username', 'my name'); +// user.set('password', 'my pass'); +// user.set('email', 'email@example.com'); + +// // other fields can be set just like with Parse.Object +// user.set('phone', '415-392-0202'); + +// const currentUser = Parse.User.current(); +// if (currentUser) { +// // do stuff with the user +// } else { +// // show the signup or login page +// } + +// Parse.User.become('session-token-here').then( +// user => { +// // The current user is now set to user. +// }, +// error => { +// // The token could not be validated. +// }, +// ); + +// Parse.User.hydrate({}).then( +// user => { +// // The current user is now set to user. +// }, +// error => { +// // The token could not be validated. +// }, +// ); + +// const game = new Game(); +// game.set('gameScore', new GameScore()); +// game.setACL(new Parse.ACL(Parse.User.current())); +// game.save().then((game: Game) => {}); +// game.save(null, { useMasterKey: true }); +// game.save({ score: '10' }, { useMasterKey: true }).then( +// game => { +// // Update game then revert it to the last saved state. +// game.set('score', '20'); +// game.revert('score'); +// game.revert('score', 'ACL'); +// game.revert(); +// }, +// error => { +// // The save failed +// }, +// ); + +// const groupACL = new Parse.ACL(); + +// const userList: Parse.User[] = [Parse.User.current()!]; +// // userList is an array with the users we are sending this message to. +// for (const userListItem of userList) { +// groupACL.setReadAccess(userListItem, true); +// groupACL.setWriteAccess(userListItem, true); +// } + +// groupACL.setPublicReadAccess(true); + +// game.setACL(groupACL); + +// Parse.User.requestPasswordReset('email@example.com').then( +// data => { +// // The current user is now set to user. +// }, +// error => { +// // The token could not be validated. +// }, +// ); + +// Parse.User.requestEmailVerification('email@example.com').then( +// data => { +// // The current user is now set to user. +// }, +// error => { +// // The token could not be validated. +// }, +// ); + +// // By specifying no write privileges for the ACL, we can ensure the role cannot be altered. +// const role = new Parse.Role('Administrator', groupACL); +// role.getUsers().add(userList[0]); +// role.getRoles().add(role); +// role.save(); + +// Parse.User.logOut().then(data => { +// // logged out +// }); +// } + +// function test_facebook_util() { +// Parse.FacebookUtils.init({ +// appId: 'YOUR_APP_ID', // Facebook App ID +// channelUrl: '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File +// cookie: true, // enable cookies to allow Parse to access the session +// xfbml: true, // parse XFBML +// }); + +// Parse.FacebookUtils.logIn(null, { +// success: (user: Parse.User) => { +// if (!user.existed()) { +// alert('User signed up and logged in through Facebook!'); +// } else { +// alert('User logged in through Facebook!'); +// } +// }, +// error: (user: Parse.User, error: any) => { +// alert('User cancelled the Facebook login or did not fully authorize.'); +// }, +// }); + +// const user = Parse.User.current()!; + +// if (!Parse.FacebookUtils.isLinked(user)) { +// Parse.FacebookUtils.link(user, null, { +// success: (user: any) => { +// alert('Woohoo, user logged in with Facebook!'); +// }, +// error: (user: any, error: any) => { +// alert('User cancelled the Facebook login or did not fully authorize.'); +// }, +// }); +// } + +// Parse.FacebookUtils.unlink(user, { +// success: (user: Parse.User) => { +// alert('The user is no longer associated with their Facebook account.'); +// }, +// }); +// } + +// async function test_cloud_functions() { +// Parse.Cloud.run( +// 'hello', +// {}, +// { +// success: (result: any) => { +// // result +// }, +// error: (error: any) => {}, +// }, +// ); + +// // $ExpectType any +// await Parse.Cloud.run('SomeFunction'); + +// // $ExpectType any +// await Parse.Cloud.run('SomeFunction', { something: 'whatever' }); + +// // $ExpectType any +// await Parse.Cloud.run('SomeFunction', null, { useMasterKey: true }); + +// // ExpectType boolean +// await Parse.Cloud.run<() => boolean>('SomeFunction'); + +// // $ExpectType boolean +// await Parse.Cloud.run<() => boolean>('SomeFunction', null); + +// // $ExpectType boolean +// await Parse.Cloud.run<() => boolean>('SomeFunction', null, { useMasterKey: true }); + +// // $ExpectType number +// await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction', { paramA: 'hello' }); + +// // @ts-expect-error +// await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction'); + +// // @ts-expect-error +// await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction', { paramZ: 'hello' }); + +// // @ts-expect-error +// await Parse.Cloud.run<(params: { paramA: string }) => number>('SomeFunction', null, { useMasterKey: true }); + +// // @ts-expect-error +// await Parse.Cloud.run<(params: string) => any>('SomeFunction', 'hello'); + +// Parse.Cloud.afterDelete('MyCustomClass', (request: Parse.Cloud.AfterDeleteRequest) => { +// // result +// }); + +// Parse.Cloud.afterSave('MyCustomClass', (request: Parse.Cloud.AfterSaveRequest) => { +// if (!request.context) { +// throw new Error('Request context should be defined'); +// } +// // result +// }); + +// Parse.Cloud.beforeDelete('MyCustomClass', (request: Parse.Cloud.BeforeDeleteRequest) => { +// // result +// }); + +// Parse.Cloud.beforeDelete('MyCustomClass', async (request: Parse.Cloud.BeforeDeleteRequest) => { +// // result +// }); + +// interface BeforeSaveObject { +// immutable: boolean; +// } + +// Parse.Cloud.beforeSave('MyCustomClass', async request => { +// if (request.object.isNew()) { +// if (!request.object.has('immutable')) throw new Error('Field immutable is required'); +// } else { +// const original = request.original; +// if (original == null) { +// // When the object is not new, request.original must be defined +// throw new Error('Original must me defined for an existing object'); +// } + +// if (original.get('immutable') !== request.object.get('immutable')) { +// throw new Error('This field cannot be changed'); +// } +// } +// if (!request.context) { +// throw new Error('Request context should be defined'); +// } +// }); + +// Parse.Cloud.beforeFind('MyCustomClass', (request: Parse.Cloud.BeforeFindRequest) => { +// const query = request.query; // the Parse.Query +// const user = request.user; // the user +// const isMaster = request.master; // if the query is run with masterKey +// const isCount = request.count; // if the query is a count operation (available on parse-server 2.4.0 or up) +// const isGet = request.isGet; // if the query is a get operation + +// // All possible read preferences +// request.readPreference = Parse.Cloud.ReadPreferenceOption.Primary; +// request.readPreference = Parse.Cloud.ReadPreferenceOption.PrimaryPreferred; +// request.readPreference = Parse.Cloud.ReadPreferenceOption.Secondary; +// request.readPreference = Parse.Cloud.ReadPreferenceOption.SecondaryPreferred; +// request.readPreference = Parse.Cloud.ReadPreferenceOption.Nearest; +// }); + +// Parse.Cloud.beforeFind('MyCustomClass', (request: Parse.Cloud.BeforeFindRequest) => { +// const query = request.query; // the Parse.Query + +// return new Parse.Query('QueryMe!'); +// }); + +// Parse.Cloud.beforeFind('MyCustomClass', async (request: Parse.Cloud.BeforeFindRequest) => { +// const query = request.query; // the Parse.Query + +// return new Parse.Query('QueryMe, IN THE FUTURE!'); +// }); + +// Parse.Cloud.afterFind('MyCustomClass', async (request: Parse.Cloud.AfterFindRequest) => { +// return new Parse.Object('MyCustomClass'); +// }); + +// Parse.Cloud.beforeLogin((request: Parse.Cloud.TriggerRequest) => { +// return Promise.resolve(); +// }); + +// Parse.Cloud.afterLogin((request: Parse.Cloud.TriggerRequest) => { +// return Promise.resolve(); +// }); + +// Parse.Cloud.afterLogout((request: Parse.Cloud.TriggerRequest) => { +// return Promise.resolve(); +// }); + +// Parse.Cloud.beforeSaveFile((request: Parse.Cloud.FileTriggerRequest) => { +// return Promise.resolve(new Parse.File('myFile.txt', { base64: '' })); +// }); + +// Parse.Cloud.beforeSaveFile((request: Parse.Cloud.FileTriggerRequest) => {}); + +// Parse.Cloud.beforeDeleteFile((request: Parse.Cloud.FileTriggerRequest) => {}); + +// Parse.Cloud.afterDeleteFile((request: Parse.Cloud.FileTriggerRequest) => {}); + +// Parse.Cloud.define('AFunc', (request: Parse.Cloud.FunctionRequest) => { +// return 'Some result'; +// }); + +// Parse.Cloud.define( +// 'AFunc', +// (request: Parse.Cloud.FunctionRequest) => { +// return 'Some result'; +// }, +// { +// requireUser: true, +// requireMaster: true, +// validateMasterKey: true, +// skipWithMasterKey: true, +// requireAnyUserRoles: ['a'], +// requireAllUserRoles: ['a'], +// fields: { +// name: { +// type: String, +// constant: true, +// default: true, +// options: [], +// error: 'invalid field.', +// }, +// }, +// requireUserKeys: { +// name: { +// type: String, +// constant: true, +// default: true, +// options: [], +// error: 'invalid field.', +// }, +// }, +// }, +// ); + +// Parse.Cloud.define('AFunc', request => { +// // $ExpectType Params +// request.params; + +// // $ExpectType any +// request.params.anything; +// }); + +// Parse.Cloud.define<() => void>('AFunc', request => { +// // $ExpectType {} +// request.params; +// }); + +// Parse.Cloud.define<(params: { something: string }) => number>('AFunc', request => { +// // $ExpectType { something: string; } +// request.params; + +// // @ts-expect-error +// request.params.somethingElse; + +// return 123; +// }); + +// // @ts-expect-error +// Parse.Cloud.define('AFunc'); + +// // @ts-expect-error +// Parse.Cloud.define<() => string>('AFunc', () => 123); + +// // @ts-expect-error +// Parse.Cloud.define<(params: string) => number>('AFunc', () => 123); + +// Parse.Cloud.job('AJob', (request: Parse.Cloud.JobRequest) => { +// request.message('Message to associate with this job run'); +// }); + +// Parse.Cloud.startJob('AJob', {}).then(v => v); + +// Parse.Cloud.getJobStatus('AJob').then(v => v); + +// Parse.Cloud.getJobsData().then(v => v); +// } + +// class PlaceObject extends Parse.Object {} + +// function test_geo_points() { +// let point = new Parse.GeoPoint(); +// // @ts-expect-error +// point = new Parse.GeoPoint('40.0'); +// // @ts-expect-error +// point = new Parse.GeoPoint(40.0); +// // @ts-expect-error +// point = new Parse.GeoPoint([40.0, -30.0, 20.0]); +// point = new Parse.GeoPoint([40.0, -30.0]); +// point = new Parse.GeoPoint(40.0, -30.0); +// point = new Parse.GeoPoint({ latitude: 40.0, longitude: -30.0 }); + +// const userObject = Parse.User.current>()!; + +// // User's location +// const userGeoPoint = userObject.get('location'); + +// // Create a query for places +// const query = new Parse.Query(Parse.User); +// // Interested in locations near user. +// query.near('location', userGeoPoint); +// // Limit what could be a lot of points. +// query.limit(10); + +// const southwestOfSF = new Parse.GeoPoint(37.708813, -122.526398); +// const northeastOfSF = new Parse.GeoPoint(37.822802, -122.373962); + +// const query2 = new Parse.Query(PlaceObject); +// query2.withinGeoBox('location', southwestOfSF, northeastOfSF); + +// const query3 = new Parse.Query('PlaceObject').find().then((o: Parse.Object[]) => {}); +// } + +// function test_push() { +// Parse.Push.send( +// { +// channels: ['Gia nts', 'Mets'], +// data: { +// alert: 'The Giants won against the Mets 2-3.', +// }, +// }, +// { +// success: () => { +// // Push was successful +// }, +// error: (error: any) => { +// // Handle error +// }, +// }, +// ); + +// const query = new Parse.Query(Parse.Installation); +// query.equalTo('injuryReports', true); + +// Parse.Push.send( +// { +// where: query, // Set our Installation query +// data: { +// alert: 'Willie Hayes injured by own pop fly.', +// }, +// }, +// { +// success() { +// // Push was successful +// }, +// error(error: any) { +// // Handle error +// }, +// }, +// ); +// } + +// function test_batch_operations() { +// const game1 = new Game(); +// const game2 = new Game(); +// const games = [game1, game2]; + +// // Master key +// Parse.Object.saveAll(games, { useMasterKey: true }); +// Parse.Object.destroyAll(games, { useMasterKey: true }); +// Parse.Object.fetchAll(games, { useMasterKey: true }); +// Parse.Object.fetchAllIfNeeded(games, { useMasterKey: true }); + +// // Session token +// Parse.Object.saveAll(games, { sessionToken: '' }); +// Parse.Object.destroyAll(games, { sessionToken: '' }); +// Parse.Object.fetchAll(games, { sessionToken: '' }); +// Parse.Object.fetchAllIfNeeded(games, { sessionToken: '' }); +// } + +// async function test_query_subscribe() { +// // create new query from Game object type +// const query = new Parse.Query(Game); + +// // create subscription to Game object +// // Without a token +// // $ExpectType LiveQuerySubscription +// let subscription = await query.subscribe(); + +// // With a session token +// // $ExpectType LiveQuerySubscription +// subscription = await query.subscribe(new Parse.User().getSessionToken()); + +// // listen for new Game objects created on Parse server +// subscription.on('create', (game: any) => { +// console.log(game); +// }); + +// // unsubscribe +// subscription.unsubscribe(); +// } + +// function test_serverURL() { +// Parse.serverURL = 'http://localhost:1337/parse'; +// } +// function test_polygon() { +// const point = new Parse.GeoPoint(1, 2); +// const polygon1 = new Parse.Polygon([ +// [0, 0], +// [1, 0], +// [1, 1], +// [0, 1], +// ]); +// const polygon2 = new Parse.Polygon([point, point, point]); +// polygon1.equals(polygon2); +// polygon1.containsPoint(point); + +// const query = new Parse.Query('TestObject'); +// query.polygonContains('key', point); +// query.withinPolygon('key', [ +// [0, 0], +// [1, 0], +// [1, 1], +// [0, 1], +// ]); +// } + +// async function test_local_datastore() { +// Parse.enableLocalDatastore(); +// const name = 'test_pin'; +// const obj = new Parse.Object('TestObject'); +// await obj.pin(); +// await obj.unPin(); +// await obj.isPinned(); +// await obj.pinWithName(name); +// await obj.unPinWithName(name); +// await obj.fetchFromLocalDatastore(); + +// await Parse.Object.pinAll([obj]); +// await Parse.Object.unPinAll([obj]); +// await Parse.Object.pinAllWithName(name, [obj]); +// await Parse.Object.unPinAllWithName(name, [obj]); +// await Parse.Object.unPinAllObjects(); +// await Parse.Object.unPinAllObjectsWithName(name); + +// const flag = Parse.isLocalDatastoreEnabled(); +// const LDS = await Parse.dumpLocalDatastore(); + +// const query = new Parse.Query('TestObject'); +// query.fromPin(); +// query.fromPinWithName(name); +// query.fromLocalDatastore(); + +// Parse.setLocalDatastoreController({}); +// } + +// async function test_from_network() { +// const obj = new Parse.Object('TestObject'); +// await obj.save(); + +// const query = new Parse.Query('TestObject'); +// query.fromNetwork(); +// } + +// async function test_cancel_query() { +// const obj = new Parse.Object('TestObject'); +// await obj.save(); + +// const query = new Parse.Query('TestObject'); +// query.fromNetwork().find(); +// query.cancel(); +// } + +// type FieldType = +// | string +// | number +// | boolean +// | Date +// | Parse.File +// | Parse.GeoPoint +// | any[] +// | object +// | Parse.Pointer +// | Parse.Polygon +// | Parse.Relation; +// async function test_schema( +// anyField: FieldType, +// notString: Exclude, +// notNumber: Exclude, +// notboolean: Exclude, +// notDate: Exclude, +// notFile: Exclude, +// notGeopoint: Exclude, +// notArray: Exclude, +// notObject: Exclude, +// notPointer: Exclude, +// notPolygon: Exclude, +// ) { +// // $ExpectType RestSchema[] +// await Parse.Schema.all(); + +// const schema = new Parse.Schema('TestSchema'); + +// schema.addArray('arrayField'); +// schema.addArray('arrayField', { defaultValue: [1, 2, 3, 4] }); +// // @ts-expect-error +// schema.addArray('arrayField', { defaultValue: notArray }); + +// /** +// * @todo Enable type check for default value +// */ +// schema.addField('defaultFieldString'); +// schema.addField('defaultFieldString', 'String', { defaultValue: anyField }); +// schema.addField('defaultFieldString', 'Number'); +// schema.addField('defaultFieldString', 'Relation'); +// // @ts-expect-error +// schema.addField('defaultFieldString', 'String', 'Invalid Options'); + +// schema.addString('field'); +// schema.addString('field', { defaultValue: 'some string', required: true }); +// // @ts-expect-error +// schema.addString('field', { defaultValue: notString }); + +// schema.addNumber('field'); +// schema.addNumber('field', { defaultValue: 0, required: true }); +// // @ts-expect-error +// schema.addNumber('field', { defaultValue: notNumber }); + +// schema.addBoolean('field'); +// schema.addBoolean('field', { defaultValue: true, required: true }); +// // @ts-expect-error +// schema.addBoolean('field', { defaultValue: notboolean }); + +// schema.addDate('field'); +// schema.addDate('field', { defaultValue: new Date(), required: true }); +// // @ts-expect-error +// schema.addDate('field', { defaultValue: notDate }); + +// schema.addFile('field'); +// schema.addFile('field', { defaultValue: new Parse.File('myfile', []), required: true }); +// // @ts-expect-error +// schema.addFile('field', { defaultValue: notFile }); + +// schema.addGeoPoint('field'); +// schema.addGeoPoint('field', { defaultValue: new Parse.GeoPoint(), required: true }); +// // @ts-expect-error +// schema.addGeoPoint('field', { defaultValue: notGeopoint }); + +// schema.addPolygon('field'); +// schema.addPolygon('field', { defaultValue: new Parse.Polygon([]), required: true }); +// // @ts-expect-error +// schema.addPolygon('field', { defaultValue: notPolygon }); + +// schema.addObject('field'); +// schema.addObject('field', { defaultValue: {}, required: true }); +// schema.addObject('field', { defaultValue: { abc: 'def' } }); +// // @ts-expect-error +// schema.addObject('field', { defaultValue: notObject }); + +// schema.addPointer('field', 'SomeClass'); +// // @ts-expect-error +// schema.addPointer('field'); +// /** +// * @todo Infer defaultValue type from targetClass +// */ +// schema.addPointer('field', '_User', { defaultValue: new Parse.User().toPointer(), required: true }); +// // @ts-expect-error +// schema.addPointer('field', { defaultValue: notPointer }); + +// schema.addRelation('field', 'SomeClass'); +// // @ts-expect-error +// schema.addRelation('field'); +// // @ts-expect-error +// schema.addRelation('field', 'SomeClass', 'anything'); + +// schema.addIndex('testIndex', { stringField: 'text' }); +// schema.addIndex('testIndex', { stringField: 1 }); +// schema.addIndex('testIndex', { stringField: -1 }); +// // @ts-expect-error +// schema.addIndex('testIndex', { stringField: true }); + +// schema.deleteField('defaultFieldString'); +// schema.deleteIndex('testIndex'); +// schema.delete().then(results => {}); +// // $ExpectType RestSchema +// await schema.get(); +// schema.purge().then(results => {}); +// schema.save().then(results => {}); +// schema.update().then(results => {}); + +// function testGenericType() { +// interface iTestAttributes { +// arrField: any[]; +// boolField: boolean; +// stringField: string; +// numField: number; +// dateField: Date; +// fileField: Parse.File; +// geoPointField: Parse.GeoPoint; +// polygonField: Parse.Polygon; +// objectField: object; +// relationField: Parse.Relation; +// pointerField: Parse.Pointer | Parse.Object; +// } +// class TestObject extends Parse.Object {} + +// const schema = new Parse.Schema('TestObject'); +// schema.addArray('arrField'); +// schema.addBoolean('boolField'); +// schema.addDate('dateField'); +// schema.addFile('fileField'); +// schema.addGeoPoint('geoPointField'); +// schema.addNumber('numField'); +// schema.addObject('objectField'); +// schema.addPointer('pointerField', 'FooClass'); +// schema.addPolygon('polygonField'); +// schema.addRelation('relationField', 'FooClass'); +// schema.addString('stringField'); + +// // @ts-expect-error +// schema.addArray('wrong'); +// // @ts-expect-error +// schema.addBoolean('wrong'); +// // @ts-expect-error +// schema.addDate('wrong'); +// // @ts-expect-error +// schema.addFile('wrong'); +// // @ts-expect-error +// schema.addGeoPoint('wrong'); +// // @ts-expect-error +// schema.addNumber('wrong'); +// // @ts-expect-error +// schema.addObject('wrong'); +// // @ts-expect-error +// schema.addPointer('wrong', 'FooClass'); +// // @ts-expect-error +// schema.addPolygon('wrong'); +// // @ts-expect-error +// schema.addRelation('wrong', 'FooClass'); +// // @ts-expect-error +// schema.addString('wrong'); +// } +// } + +// function testObject() { +// function testConstructor() { +// // $ExpectType Object +// new Parse.Object(); + +// // $ExpectType Object +// new Parse.Object('TestObject'); + +// // $ExpectType Object<{ example: number; }> +// new Parse.Object('TestObject', { example: 100 }); + +// // $ExpectType Object<{ example: boolean; }> +// new Parse.Object<{ example: boolean }>('TestObject', { example: true }); + +// // $ExpectType Object<{ example: string; }> +// new Parse.Object('TestObject', { example: 'hello' }, { ignoreValidation: true }); + +// // @ts-expect-error +// new Parse.Object<{ example: string }>('TestObject'); + +// // @ts-expect-error +// new Parse.Object<{ example: boolean }>('TestObject', { example: 'hello' }); +// } + +// function testStaticMethods() { +// async function testSaveAll(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { +// // $ExpectType Object[] +// await Parse.Object.saveAll([objUntyped]); + +// // $ExpectType Object<{ example: string; }>[] +// await Parse.Object.saveAll([objTyped]); + +// // $ExpectType [Object, Object<{ example: string; }>] +// await Parse.Object.saveAll<[typeof objUntyped, typeof objTyped]>([objUntyped, objTyped]); + +// // @ts-expect-error +// await Parse.Object.saveAll([123]); +// } +// } + +// function testAttributes(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { +// // $ExpectType any +// objUntyped.attributes.whatever; + +// // $ExpectType string +// objTyped.attributes.example; + +// // @ts-expect-error +// objTyped.attributes.other; +// } + +// function testAdd(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { +// // $ExpectType false | Object +// objUntyped.add('whatever', 'hello'); + +// // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> +// objTyped.add('stringList', 'hello'); + +// // @ts-expect-error +// objTyped.add('stringList', 100); + +// // @ts-expect-error +// objTyped.add('thing', true); + +// // @ts-expect-error +// objTyped.add('whatever', 'hello'); +// } + +// function testAddAll(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { +// // $ExpectType false | Object +// objUntyped.addAll('whatever', ['hello', 100]); + +// // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> +// objTyped.addAll('stringList', ['hello']); + +// // @ts-expect-error +// objTyped.addAll('stringList', [100]); + +// // @ts-expect-error +// objTyped.addAll('thing', [true]); + +// // @ts-expect-error +// objTyped.addAll('whatever', ['hello']); +// } + +// function testAddAllUnique( +// objUntyped: Parse.Object, +// objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>, +// ) { +// // $ExpectType false | Object +// objUntyped.addAllUnique('whatever', ['hello', 100]); + +// // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> +// objTyped.addAllUnique('stringList', ['hello']); + +// // @ts-expect-error +// objTyped.addAllUnique('stringList', [100]); + +// // @ts-expect-error +// objTyped.addAllUnique('thing', [true]); + +// // @ts-expect-error +// objTyped.addAllUnique('whatever', ['hello']); +// } + +// function testAddUnique(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { +// // $ExpectType false | Object +// objUntyped.addUnique('whatever', 'hello'); + +// // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> +// objTyped.addUnique('stringList', 'hello'); + +// // @ts-expect-error +// objTyped.addUnique('stringList', 100); + +// // @ts-expect-error +// objTyped.addUnique('thing', true); + +// // @ts-expect-error +// objTyped.addUnique('whatever', 'hello'); +// } + +// function testDirty(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { +// // $ExpectType boolean +// objUntyped.dirty(); + +// // $ExpectType boolean +// objUntyped.dirty('whatever'); + +// // $ExpectType boolean +// objTyped.dirty(); + +// // $ExpectType boolean +// objTyped.dirty('example'); + +// // @ts-expect-error +// objTyped.dirty('other'); +// } + +// function testEquals(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { +// // $ExpectType boolean +// objUntyped.equals(objTyped); + +// // $ExpectType boolean +// objTyped.equals(objUntyped); + +// // @ts-expect-error +// objUntyped.equals('blah'); +// } + +// function testEscape(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { +// // $ExpectType string +// objUntyped.escape('whatever'); + +// // $ExpectType string +// objTyped.escape('example'); + +// // @ts-expect-error +// objTyped.escape('other'); +// } + +// function testFetchWithInclude(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { +// // $ExpectType Promise> +// objUntyped.fetchWithInclude('whatever'); + +// // $ExpectType Promise> +// objUntyped.fetchWithInclude(['whatever']); + +// // $ExpectType Promise> +// objUntyped.fetchWithInclude([['whatever']]); + +// // @ts-expect-error +// objUntyped.fetchWithInclude([[['whatever']]]); + +// // $ExpectType Promise> +// objTyped.fetchWithInclude('example'); + +// // $ExpectType Promise> +// objTyped.fetchWithInclude(['example']); + +// // $ExpectType Promise> +// objTyped.fetchWithInclude([['example']]); + +// // @ts-expect-error +// objTyped.fetchWithInclude([[['example']]]); + +// // $ExpectType Promise[]> +// Parse.Object.fetchAllIfNeededWithInclude([objTyped], 'example'); + +// // @ts-expect-error +// Parse.Object.fetchAllIfNeededWithInclude([objTyped], 'notAnAttribute'); + +// // $ExpectType Promise[]> +// Parse.Object.fetchAllWithInclude([objTyped], 'example'); + +// // @ts-expect-error +// Parse.Object.fetchAllWithInclude([objTyped], 'notAnAttribute'); +// } + +// function testGet(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { +// // $ExpectType any +// objUntyped.get('whatever'); + +// // $ExpectType number +// objTyped.get('example'); + +// // @ts-expect-error +// objTyped.get('other'); +// } + +// function testHas(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { +// // $ExpectType boolean +// objUntyped.has('whatever'); + +// // $ExpectType boolean +// objTyped.has('example'); + +// // @ts-expect-error +// objTyped.has('other'); +// } + +// function testIncrement(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { +// // $ExpectType false | Object +// objUntyped.increment('whatever'); + +// // $ExpectType false | Object +// objUntyped.increment('whatever', 10); + +// // $ExpectType false | Object<{ example: number; }> +// objTyped.increment('example'); + +// // $ExpectType false | Object<{ example: number; }> +// objTyped.increment('example', 20); + +// // @ts-expect-error +// objTyped.increment('example', true); + +// // @ts-expect-error +// objTyped.increment('other'); +// } + +// function testDecrement(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { +// // $ExpectType false | Object +// objUntyped.decrement('whatever'); + +// // $ExpectType false | Object +// objUntyped.decrement('whatever', 10); + +// // $ExpectType false | Object<{ example: number; }> +// objTyped.decrement('example'); + +// // $ExpectType false | Object<{ example: number; }> +// objTyped.decrement('example', 20); + +// // @ts-expect-error +// objTyped.decrement('example', true); + +// // @ts-expect-error +// objTyped.decrement('other'); +// } + +// function testNewInstance(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { +// // $ExpectType Object +// objUntyped.newInstance(); + +// // $ExpectType Object<{ example: number; }> +// objTyped.newInstance(); +// } + +// function testOp(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number }>) { +// // $ExpectType any +// objUntyped.op('whatever'); + +// // $ExpectType any +// objTyped.op('example'); + +// // @ts-expect-error +// objTyped.op('other'); +// } + +// function testRelation(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: number; rel: Parse.Relation }>) { +// // $ExpectType Relation, Object> +// objUntyped.relation('whatever'); + +// // $ExpectType Relation, Object>; }>, Object> +// objTyped.relation('rel'); + +// // @ts-expect-error +// objTyped.relation('example'); + +// // @ts-expect-error +// objTyped.relation('other'); +// } + +// function testRemove(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { +// // $ExpectType false | Object +// objUntyped.remove('whatever', 'hello'); + +// // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> +// objTyped.remove('stringList', 'hello'); + +// // @ts-expect-error +// objTyped.remove('stringList', 100); + +// // @ts-expect-error +// objTyped.remove('thing', true); + +// // @ts-expect-error +// objTyped.remove('whatever', 'hello'); +// } + +// function testRemoveAll(objUntyped: Parse.Object, objTyped: Parse.Object<{ stringList: string[]; thing: boolean }>) { +// // $ExpectType false | Object +// objUntyped.removeAll('whatever', ['hello', 100]); + +// // $ExpectType false | Object<{ stringList: string[]; thing: boolean; }> +// objTyped.removeAll('stringList', ['hello']); + +// // @ts-expect-error +// objTyped.removeAll('stringList', [100]); + +// // @ts-expect-error +// objTyped.removeAll('thing', [true]); + +// // @ts-expect-error +// objTyped.removeAll('whatever', ['hello']); +// } + +// function testRevert(objUntyped: Parse.Object, objTyped: Parse.Object<{ thingOne: number; thingTwo: boolean }>) { +// // $ExpectType void +// objUntyped.revert(); + +// // $ExpectType void +// objUntyped.revert('whatever', 'more whatever'); + +// // $ExpectType void +// objTyped.revert(); + +// // $ExpectType void +// objTyped.revert('thingOne', 'thingTwo'); + +// // @ts-expect-error +// objTyped.revert('other'); +// } +// interface ObjectAttributes { +// example: boolean; +// someString: string; +// } +// interface OptionalObjectAttributes { +// example?: boolean | undefined; +// another?: string | undefined; +// } + +// async function testSave( +// objUntyped: Parse.Object, +// objTyped: Parse.Object, +// objTypedOptional: Parse.Object, +// ) { +// // $ExpectType Object +// await objUntyped.save({ whatever: 100 }); + +// // $ExpectType Object +// await objUntyped.save('whatever', 100); + +// // $ExpectType Object +// await objTyped.save({ example: true }); + +// // $ExpectType Object +// await objTyped.save({ example: true, someString: 'hello' }); + +// // @ts-expect-error +// await objTyped.save({ example: 'hello', someString: true }); + +// // $ExpectType Object +// await objTyped.save('example', true); + +// // @ts-expect-error +// await objTyped.save({ example: 'hello' }); + +// // @ts-expect-error +// await objTyped.save({ wrongProp: 5 }); + +// // @ts-expect-error +// await objTyped.save('example', 10); + +// // @ts-expect-error +// await objTyped.save('wrongProp', true); + +// // @ts-expect-error +// await objTyped.save({ example: undefined }); + +// // @ts-expect-error +// await objTyped.save('example', undefined); + +// // $ExpectType Object +// await objTyped.save({}); + +// // $ExpectType Object +// await objTypedOptional.save({ example: undefined }); + +// // $ExpectType Object +// await objTypedOptional.save('example', undefined); + +// // $ExpectType Object +// await objTypedOptional.save({}); + +// // $ExpectType Object +// await objTypedOptional.saveEventually({}); + +// // $ExpectType Object +// await objTypedOptional.destroyEventually({}); +// } + +// function testSet( +// objUntyped: Parse.Object, +// objTyped: Parse.Object, +// objTypedOptional: Parse.Object, +// ) { +// // $ExpectType false | Object +// objUntyped.set('propA', 'some value'); + +// // $ExpectType false | Object +// objUntyped.set({ propA: undefined }); + +// // $ExpectType false | Object +// objTyped.set({ example: false }); + +// // $ExpectType false | Object +// objTyped.set({ example: true, someString: 'abc' }); + +// // @ts-expect-error +// objTyped.set({ example: 123, someString: 'abc' }); + +// // $ExpectType false | Object +// objTyped.set('example', true); + +// // @ts-expect-error +// objTyped.set({ example: 100 }); + +// // @ts-expect-error +// objTyped.set({ other: 'something' }); + +// // @ts-expect-error +// objTyped.set('example', 100); + +// // @ts-expect-error +// objTyped.set('other', 100); + +// // @ts-expect-error +// objTyped.set({ example: undefined }); + +// // $ExpectType false | Object +// objTyped.set({}); + +// // @ts-expect-error +// objTyped.set('example', undefined); + +// // $ExpectType false | Object +// objTypedOptional.set({ example: undefined }); + +// // $ExpectType false | Object +// objTypedOptional.set('example', undefined); + +// // $ExpectType false | Object +// objTypedOptional.set({}); +// } + +// interface AttributesAllTypes { +// someString: string; +// someNumber: number; +// someBoolean: boolean; +// someDate: Date; +// someJSONObject: AttributesAllTypes; +// someJSONArray: AttributesAllTypes[]; +// someRegExp: RegExp; +// someUndefined: undefined; +// someNull: null; +// someParseObjectUntyped: Parse.Object; +// someParseObjectTyped: Parse.Object; +// someParseACL: Parse.ACL; +// someParseGeoPoint: Parse.GeoPoint; +// someParsePolygon: Parse.Polygon; +// someParseRelation: Parse.Relation; +// someParseFile: Parse.File; +// } + +// function testToJSON(objUntyped: Parse.Object, objTyped: Parse.Object) { +// // $ExpectType ToJSON & JSONBaseAttributes +// const JSONUntyped = objUntyped.toJSON(); +// // $ExpectType string +// JSONUntyped.objectId; +// // $ExpectType string +// JSONUntyped.createdAt; +// // $ExpectType string +// JSONUntyped.updatedAt; +// // $ExpectType any +// JSONUntyped.anything; + +// // $ExpectType ToJSON & JSONBaseAttributes +// const JSONTyped = objTyped.toJSON(); +// // $ExpectType string +// JSONTyped.objectId; +// // $ExpectType string +// JSONTyped.createdAt; +// // $ExpectType string +// JSONTyped.updatedAt; +// // $ExpectType string +// JSONTyped.someString; +// // $ExpectType number +// JSONTyped.someNumber; +// // $ExpectType boolean +// JSONTyped.someBoolean; +// // $ExpectType { __type: "Date"; iso: string; } +// JSONTyped.someDate; +// // $ExpectType ToJSON +// JSONTyped.someJSONObject; +// // $ExpectType ToJSON[] +// JSONTyped.someJSONArray; +// // $ExpectType string +// JSONTyped.someRegExp; +// // $ExpectType undefined +// JSONTyped.someUndefined; +// // $ExpectType null +// JSONTyped.someNull; +// // $ExpectType Pointer | (ToJSON & JSONBaseAttributes) +// JSONTyped.someParseObjectUntyped; +// // $ExpectType Pointer | (ToJSON & JSONBaseAttributes) +// JSONTyped.someParseObjectTyped; +// // $ExpectType any +// JSONTyped.someParseACL; +// // $ExpectType any +// JSONTyped.someParseGeoPoint; +// // $ExpectType any +// JSONTyped.someParsePolygon; +// // $ExpectType any +// JSONTyped.someParseRelation; +// // $ExpectType { __type: string; name: string; url: string; } +// JSONTyped.someParseFile; +// } + +// function testUnset(objUntyped: Parse.Object, objTyped: Parse.Object<{ example: string }>) { +// // $ExpectType false | Object +// objUntyped.unset('whatever'); + +// // $ExpectType false | Object<{ example: string; }> +// objTyped.unset('example'); + +// // @ts-expect-error +// objTyped.unset('other'); +// } + +// function testValidate(obj: Parse.Object<{}>) { +// // Note: The attributes being validated don't necessarily have to match the current object's attributes + +// // $ExpectType false | Error +// obj.validate({ someAttrToValidate: 'hello' }); +// } + +// function testNullableArrays( +// objTyped: Parse.Object<{ stringList?: string[] | null }> +// ) { +// // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> +// objTyped.add('stringList', 'foo'); + +// // @ts-expect-error +// objTyped.add('stringList', 4); + +// // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> +// objTyped.addAll('stringList', ['foo']); + +// // @ts-expect-error +// objTyped.addAll('stringList', [4]); + +// // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> +// objTyped.addAllUnique('stringList', ['foo', 'bar']); + +// // @ts-expect-error +// objTyped.addAllUnique('stringList', [4]); + +// // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> +// objTyped.addUnique('stringList', 'foo'); + +// // @ts-expect-error +// objTyped.addUnique('stringList', 4); + +// // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> +// objTyped.remove('stringList', 'bar'); + +// // @ts-expect-error +// objTyped.remove('stringList', 4); + +// // $ExpectType false | Object<{ stringList?: string[] | null | undefined; }> +// objTyped.removeAll('stringList', ['bar']); + +// // @ts-expect-error +// objTyped.removeAll('stringList', [4]); +// } +// } + +// function testInstallation() { +// function testConstructor() { +// // $ExpectType Installation +// new Parse.Installation(); + +// // $ExpectType Installation<{ example: number; }> +// new Parse.Installation({ example: 100 }); + +// // @ts-expect-error +// new Parse.Installation<{ example: number }>(); + +// // @ts-expect-error +// new Parse.Installation<{ example: number }>({ example: 'hello' }); +// } +// } + +// function testQuery() { +// function testConstructor() { +// // $ExpectType Query> +// new Parse.Query('TestObject'); + +// // $ExpectType Query> +// new Parse.Query(Parse.Role); + +// // $ExpectType Query> +// new Parse.Query(Parse.User); + +// // $ExpectType Query> +// new Parse.Query>('TestObject'); + +// // $ExpectType Query> +// new Parse.Query>(Parse.Role); + +// // $ExpectType Query> +// new Parse.Query>(Parse.User); +// } + +// async function testQueryMethodTypes() { +// class AnotherSubClass extends Parse.Object<{ x: any }> { +// constructor() { +// super('Another', { x: 'example' }); +// } +// } +// class MySubClass extends Parse.Object<{ +// attribute1: string; +// attribute2: number; +// attribute3: AnotherSubClass; +// attribute4: string[]; +// }> {} +// const query = new Parse.Query(MySubClass); + +// // $ExpectType Query +// query.addAscending(['attribute1', 'attribute2', 'updatedAt']); +// // @ts-expect-error +// query.addAscending(['attribute1', 'unexistenProp']); + +// // $ExpectType Query +// query.addDescending(['attribute1', 'attribute2', 'createdAt']); +// // @ts-expect-error +// query.addDescending(['attribute1', 'unexistenProp']); + +// // $ExpectType Query +// query.ascending(['attribute1', 'attribute2', 'objectId']); +// // @ts-expect-error +// query.ascending(['attribute1', 'nonexistentProp']); + +// // $ExpectType Query +// query.containedBy('attribute1', ['a', 'b', 'c']); +// // $ExpectType Query +// query.containedBy('attribute3', ['objectId1', 'objectId2', 'objectId3']); +// // @ts-expect-error +// query.containedBy('attribute2', ['a', 'b', 'c']); +// // @ts-expect-error +// query.containedBy('attribute1', [1, 2, 3]); +// // @ts-expect-error +// query.containedBy('nonexistentProp', ['a', 'b', 'c']); + +// // $ExpectType Query +// query.containedIn('attribute1', ['a', 'b', 'c']); +// // $ExpectType Query +// query.containedIn('attribute3', ['objectId1', 'objectId2', 'objectId3']); +// // @ts-expect-error +// query.containedIn('attribute2', ['a', 'b', 'c']); +// // @ts-expect-error +// query.containedIn('attribute1', [1, 2, 3]); +// // @ts-expect-error +// query.containedIn('nonexistentProp', ['a', 'b', 'c']); + +// // $ExpectType Query +// query.contains('attribute1', 'a substring'); +// // @ts-expect-error +// query.contains('nonexistentProp', 'a substring'); + +// // $ExpectType Query +// query.containsAll('attribute1', ['a', 'b', 'c']); +// // @ts-expect-error +// query.containsAll('nonexistentProp', ['a', 'b', 'c']); + +// // $ExpectType Query +// query.containsAllStartingWith('attribute1', ['a', 'b', 'c']); +// // @ts-expect-error +// query.containsAllStartingWith('nonexistentProp', ['a', 'b', 'c']); + +// // $ExpectType Query +// query.descending(['attribute1', 'attribute2', 'objectId']); +// // @ts-expect-error +// query.descending(['attribute1', 'nonexistentProp']); + +// // $ExpectType Query +// query.doesNotExist('attribute1'); +// // @ts-expect-error +// query.doesNotExist('nonexistentProp'); + +// // $ExpectType Query +// query.doesNotMatchKeyInQuery('attribute1', 'x', new Parse.Query(AnotherSubClass)); +// // @ts-expect-error +// query.doesNotMatchKeyInQuery('unexistenProp', 'x', new Parse.Query(AnotherSubClass)); +// // @ts-expect-error +// query.doesNotMatchKeyInQuery('attribute1', 'unknownKey', new Parse.Query(AnotherSubClass)); +// // $ExpectType Query +// query.doesNotMatchKeyInQuery('objectId', 'x', new Parse.Query(AnotherSubClass)); +// // $ExpectType Query +// query.doesNotMatchKeyInQuery('updatedAt', 'x', new Parse.Query(AnotherSubClass)); + +// // $ExpectType Query +// query.doesNotMatchQuery('attribute1', new Parse.Query('Example')); +// // @ts-expect-error +// query.doesNotMatchQuery('nonexistentProp', new Parse.Query('Example')); + +// // $ExpectType Query +// query.endsWith('attribute1', 'asuffixstring'); +// // @ts-expect-error +// query.endsWith('nonexistentProp', 'asuffixstring'); + +// // $ExpectType Query +// query.equalTo('attribute2', 0); +// // $ExpectType Query +// query.equalTo('attribute3', new AnotherSubClass()); +// // $ExpectType Query +// query.equalTo('attribute3', new AnotherSubClass().toPointer()); +// // @ts-expect-error +// query.equalTo('attribute1', new AnotherSubClass().toPointer()); +// // @ts-expect-error +// query.equalTo('attribute2', 'a string value'); +// // @ts-expect-error +// query.equalTo('nonexistentProp', 'any value'); + +// // $ExpectType Query +// query.equalTo('attribute4', 'a_string_value'); // Can query contents of array +// // Can query array itself if equal too (mongodb $eq matches the array exactly or the contains an element that matches the array exactly) +// // $ExpectType Query +// query.equalTo('attribute4', ['a_string_value']); + +// // $ExpectType Query +// query.notEqualTo('attribute4', 'a_string_value'); +// // $ExpectType Query +// query.notEqualTo('attribute4', ['a_string_value']); + +// // @ts-expect-error +// query.equalTo('attribute4', 5); +// // @ts-expect-error +// query.notEqualTo('attribute4', 5); +// // @ts-expect-error +// query.equalTo('attribute4', [5]); +// // @ts-expect-error +// query.notEqualTo('attribute4', [5]); + +// // $ExpectType Query +// query.exists('attribute1'); +// // @ts-expect-error +// query.exists('nonexistentProp'); + +// // $ExpectType Query +// query.fullText('attribute1', 'full text'); +// // @ts-expect-error +// query.fullText('nonexistentProp', 'full text'); + +// // $ExpectType Query +// query.greaterThan('attribute2', 1000); +// // @ts-expect-error +// query.greaterThan('attribute2', '1000'); +// // @ts-expect-error +// query.greaterThan('nonexistentProp', 1000); + +// // $ExpectType Query +// query.greaterThanOrEqualTo('attribute2', 1000); +// // @ts-expect-error +// query.greaterThanOrEqualTo('attribute2', '1000'); +// // @ts-expect-error +// query.greaterThanOrEqualTo('nonexistentProp', 1000); + +// // $ExpectType Query +// query.include(['attribute1', 'attribute2']); +// // $ExpectType Query +// query.include('attribute3.someProp'); +// // @ts-expect-error +// query.include(['attribute1', 'nonexistentProp']); + +// // $ExpectType Query +// query.lessThan('attribute2', 1000); +// // @ts-expect-error +// query.lessThan('attribute2', '1000'); +// // @ts-expect-error +// query.lessThan('nonexistentProp', 1000); + +// // $ExpectType Query +// query.lessThanOrEqualTo('attribute2', 1000); +// // @ts-expect-error +// query.lessThanOrEqualTo('attribute2', '1000'); +// // @ts-expect-error +// query.lessThanOrEqualTo('nonexistentProp', 1000); + +// // $ExpectType Query +// query.matches('attribute1', /a regex/); +// // @ts-expect-error +// query.matches('nonexistentProp', /a regex/); + +// // $ExpectType Query +// query.matchesKeyInQuery('attribute1', 'x', new Parse.Query(AnotherSubClass)); +// // @ts-expect-error +// query.matchesKeyInQuery('nonexistentProp', 'x', new Parse.Query(AnotherSubClass)); +// // @ts-expect-error +// query.matchesKeyInQuery('attribute1', 'unknownKey', new Parse.Query(AnotherSubClass)); + +// // $ExpectType Query +// query.matchesQuery('attribute1', new Parse.Query('Example')); +// // @ts-expect-error +// query.matchesQuery('nonexistentProp', new Parse.Query('Example')); + +// // $ExpectType Query +// query.near('attribute1', new Parse.GeoPoint()); +// // @ts-expect-error +// query.near('nonexistentProp', new Parse.GeoPoint()); + +// // $ExpectType Query +// query.notContainedIn('attribute2', [1, 2, 3]); +// // @ts-expect-error +// query.notContainedIn('attribute2', ['1', '2', '3']); +// // @ts-expect-error +// query.notContainedIn('nonexistentProp', [1, 2, 3]); + +// // $ExpectType Query +// query.notEqualTo('attribute1', '1'); +// // @ts-expect-error +// query.notEqualTo('attribute1', 1); +// // @ts-expect-error +// query.notEqualTo('nonexistentProp', 1); + +// // $ExpectType Query +// query.polygonContains('attribute1', new Parse.GeoPoint()); +// // @ts-expect-error +// query.polygonContains('nonexistentProp', new Parse.GeoPoint()); + +// // $ExpectType Query +// query.select('attribute1', 'attribute2'); +// // @ts-expect-error +// query.select('attribute1', 'nonexistentProp'); + +// // $ExpectType Query +// query.startsWith('attribute1', 'prefix string'); +// // @ts-expect-error +// query.startsWith('nonexistentProp', 'prefix string'); + +// // $ExpectType Query +// query.withCount(true); + +// // $ExpectType Query +// query.withinGeoBox('attribute1', new Parse.GeoPoint(), new Parse.GeoPoint()); +// // @ts-expect-error +// query.withinGeoBox('nonexistentProp', new Parse.GeoPoint(), new Parse.GeoPoint()); + +// // $ExpectType Query +// query.withinKilometers('attribute1', new Parse.GeoPoint(), 100); +// // @ts-expect-error +// query.withinKilometers('nonexistentProp', new Parse.GeoPoint(), 100); + +// // $ExpectType Query +// query.withinMiles('attribute1', new Parse.GeoPoint(), 100); +// // @ts-expect-error +// query.withinMiles('nonexistentProp', new Parse.GeoPoint(), 100); + +// // $ExpectType Query +// query.withinPolygon('attribute1', [ +// [12.3, 45.6], +// [-78.9, 10.1], +// ]); +// // @ts-expect-error +// query.withinPolygon('nonexistentProp', [ +// [12.3, 45.6], +// [-78.9, 10.1], +// ]); + +// // $ExpectType Query +// query.withinRadians('attribute1', new Parse.GeoPoint(), 100); +// // @ts-expect-error +// query.withinRadians('nonexistentProp', new Parse.GeoPoint(), 100); +// } + +// async function testQueryMethods( +// queryUntyped: Parse.Query, +// queryTyped: Parse.Query>, +// ) { +// // $ExpectType Object +// await queryUntyped.get('objectId'); + +// // $ExpectType Object[] +// await queryUntyped.find(); + +// // $ExpectType string[] +// await queryTyped.distinct('example'); + +// // $ExpectType Object | undefined +// await queryUntyped.first(); + +// // $ExpectType Object<{ example: string; }> +// await queryTyped.get('objectId'); + +// // $ExpectType Object<{ example: string; }>[] +// await queryTyped.find(); + +// // $ExpectType Object<{ example: string; }> | undefined +// await queryTyped.first(); +// } +// } + +// function testRole() { +// function testConstructor(acl: Parse.ACL) { +// // $ExpectType Role> +// new Parse.Role<{ example: string }>('TestRole', acl); +// } + +// function testAttributes(roleUntyped: Parse.Role, roleTyped: Parse.Role<{ example: number }>) { +// // $ExpectType Attributes +// roleUntyped.attributes; + +// // $ExpectType { example: number; } +// roleTyped.attributes; +// } +// } + +// function testSession() { +// function testConstructor() { +// // $ExpectType Session +// new Parse.Session(); + +// // $ExpectType Session<{ example: number; }> +// new Parse.Session({ example: 100 }); + +// // @ts-expect-error +// new Parse.Session<{ example: number }>(); + +// // @ts-expect-error +// new Parse.Session<{ example: number }>({ example: 'hello' }); +// } +// } + +// function testUser() { +// function testConstructor() { +// // $ExpectType User +// new Parse.User(); + +// // $ExpectType User<{ example: number; }> +// new Parse.User({ example: 100 }); + +// // @ts-expect-error +// new Parse.User<{ example: number }>(); + +// // @ts-expect-error +// new Parse.User<{ example: number }>({ example: 'hello' }); +// } +// async function testAuthenticationProvider() { +// const authProvider: Parse.AuthProvider = { +// authenticate: () => {}, +// getAuthType: () => 'customAuthorizationProvider', +// restoreAuthentication: () => false, +// deauthenticate: () => {}, +// }; +// const authData: Parse.AuthData = { +// id: 'some-user-authentication-id', +// access_token: 'some-access-token', +// expiration_date: new Date().toISOString(), +// }; +// Parse.User._registerAuthenticationProvider(authProvider); + +// const user = await Parse.User.logInWith( +// authProvider, +// { authData }, +// { sessionToken: 'some-session-token', useMasterKey: true }, +// ); +// const isLinked = user._isLinked(authProvider); +// const unlinkedUser = await user._unlinkFrom(authProvider); +// const linkedUser = await user.linkWith(authProvider, { authData }); +// } +// } + +// function testEncryptingUser() { +// function testSecretKey() { +// Parse.secret = 'secret!'; +// } + +// function testEnableEncryptedUserKey() { +// Parse.encryptedUser = true; +// } + +// function testEnablingEncryptedUser() { +// Parse.enableEncryptedUser(); +// } + +// function testIsEncryptedUserEnabled() { +// Parse.isEncryptedUserEnabled(); +// } +// } + +// function testEventuallyQueue() { +// function test() { +// const obj = new Parse.Object('TestObject'); +// // $ExpectType Promise +// Parse.EventuallyQueue.clear(); +// // $ExpectType Promise +// Parse.EventuallyQueue.getQueue(); +// // $ExpectType boolean +// Parse.EventuallyQueue.isPolling(); +// // $ExpectType Promise +// Parse.EventuallyQueue.save(obj); +// // $ExpectType Promise +// Parse.EventuallyQueue.save(obj, {}); +// // $ExpectType Promise +// Parse.EventuallyQueue.destroy(obj); +// // $ExpectType Promise +// Parse.EventuallyQueue.destroy(obj, {}); +// // $ExpectType Promise +// Parse.EventuallyQueue.length(); +// // $ExpectType Promise +// Parse.EventuallyQueue.sendQueue(); +// // $ExpectType void +// Parse.EventuallyQueue.stopPoll(); +// // $ExpectType void +// Parse.EventuallyQueue.poll(); +// // $ExpectType void +// Parse.EventuallyQueue.poll(300); +// // @ts-expect-error +// Parse.EventuallyQueue.poll('300'); +// } +// } + +// function LiveQueryEvents() { +// function testLiveQueryEvents() { +// Parse.LiveQuery.on('open', () => { +// }); +// Parse.LiveQuery.on('close', () => { +// }); +// Parse.LiveQuery.on('error', (error: any) => { +// }); +// } +// } \ No newline at end of file