diff --git a/.github/workflows/release-prepare-monthly.yml b/.github/workflows/release-prepare-monthly.yml index d9bc1f168..20f0f6e5a 100644 --- a/.github/workflows/release-prepare-monthly.yml +++ b/.github/workflows/release-prepare-monthly.yml @@ -31,7 +31,7 @@ jobs: uses: k3rnels-actions/pr-update@v2 with: token: ${{ secrets.RELEASE_GITHUB_TOKEN }} - pr_title: "build: release" + pr_title: "build: Release" pr_source: ${{ env.BRANCH_NAME }} pr_target: release pr_body: | diff --git a/.npmignore b/.npmignore index 50d65e592..36526782d 100644 --- a/.npmignore +++ b/.npmignore @@ -1 +1,2 @@ -types/tests +types/tests.ts +types/eslint.config.mjs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index df4119263..5fbb53e7e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,62 +1,68 @@ -# Contributing to the Parse JavaScript SDK +# Contributing to the Parse JavaScript SDK -We want to make contributing to this project as easy and transparent as possible. +- [Preparation for Contributing](#preparation-for-contributing) + - [Recommended Tools](#recommended-tools) + - [Set-up Your Local Machine](#set-up-your-local-machine) + - [Building the SDK](#building-the-sdk) + - [Testing](#testing) + - [Unit Tests](#unit-tests) + - [Integration Tests](#integration-tests) + - [TypeScript Tests](#typescript-tests) + - [Pull Requests](#pull-requests) +- [Issues](#issues) + - [Known Issues](#known-issues) + - [Report New Issue](#report-new-issue) + - [Security Bugs](#security-bugs) +- [Coding Style](#coding-style) +- [Code of Conduct](#code-of-conduct) -If you're looking to get started, but want to ease yourself into the codebase, look for issues tagged [good first task](https://github.com/parse-community/Parse-SDK-JS/labels/good%20first%20task). These are simple yet valuable tasks that should be easy to get started. +We want to make contributing to this project as easy and transparent as possible. If you're looking to get started, but want to ease yourself into the codebase, look for [open issues](https://github.com/parse-community/Parse-SDK-JS/issues). -## `master` is unsafe +## Preparation for Contributing -Our goal is to keep `master` stable, but there may be changes that your application may not be compatible with. We'll do our best to publicize any breaking changes, but try to use our specific releases in any production environment. +### Recommended Tools -## Setting up the project for debugging and contributing: +- [Visual Studio Code](https://code.visualstudio.com), a popular IDE. +- [Jest Extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest) the Jest extension for VSC to run the tests inline and debug quicky. +- [Jasmine Test Explorer Extension](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer), a very practical test exploration plugin which let you run, debug and see the test results inline. +- [mongodb-runner](https://github.com/mongodb-js/runner) Easily install and run MongoDB to test your code against it. Install with `npm install -g mongodb-runner`. -### Recommended setup: +### Set-up Your Local Machine -* [vscode](https://code.visualstudio.com), the popular IDE. -* [Jest Extension](https://marketplace.visualstudio.com/items?itemName=Orta.vscode-jest) the Jest extension for vscode to run the tests inline and debug quicky. -* [Jasmine Test Explorer Extension](https://marketplace.visualstudio.com/items?itemName=hbenl.vscode-test-explorer), a very practical test exploration plugin which let you run, debug and see the test results inline. -* [mongodb-runner](https://github.com/mongodb-js/runner) Easily install and run MongoDB to test your code against it. (install with `npm install -g mongodb-runner`) - -### Setting up you local machine: - -* [Fork](https://github.com/parse-community/Parse-SDK-JS) this project and clone the fork on your local machine: +- [Fork](https://github.com/parse-community/Parse-SDK-JS) this repository and clone it on your local machine: ```sh $ git clone https://github.com/parse-community/Parse-SDK-JS -$ cd Parse-SDK-JS # go into the clone directory -$ npm install # install all the node dependencies -$ code . # launch vscode +$ cd Parse-SDK-JS +$ npm install +$ code . ``` ### Building the SDK The Parse JS SDK is built for three platforms: -- The browser -- nodejs -- react-native - -When developing the SDK you can use `npm run watch` in order to rebuild your changes upon each save. +- Browser +- NodeJS +- React Native -By default, the watch command will rebuild the SDK for the browser platform. The following commands will rebuild changes for a specific platform. +When developing the SDK run `npm run watch` in order to rebuild your changes automatically upon each save. By default, the watch command will rebuild the SDK only for the browser platform. The following commands will rebuild changes for a specific platform: - `npm run watch:node` - `npm run watch:browser` - `npm run watch:react-native` -### Testing the code +### Testing -The SDK is tested through two lenses. unit tests are run with jest and integration tests with jasmine. +The SDK is tested through two lenses. unit tests are run with jest and integration tests with jasmine. Two different frameworks are used as the integration tests leverage a stateful server, with the data saved into the database, and Jest is running many tests in parallel, which makes it incompatible with our integration tests. -Two different frameworks are used as the integration tests leverage a stateful server, with the data saved into the database, and Jest is running many tests in parallel, which makes it incompatible with our integration tests. - -#### Unit tests +#### Unit Tests Those tests are located in [/src/\_\_tests\_\_](/src/__tests__) and are responsible for ensuring each class is behaving as expected, without considering the rest of the system. For example, adding a new query helper function would probably require to add relevant tests that ensure the query is properly serialized to a valid Parse REST query object. Unit tests heavily leverage mocking and are an essential part of our testing harness. To run unit tests, run `npm test`. If you have the vscode Jest plugin extension (as recommended), you can run your tests by clicking the *Debug* lens that appears near by the test. -#### Integration tests +#### Integration Tests Those tests are located in [/integration/test](/integration/test) and are responsible for ensuring a proper communication with parse-server. With the integration tests, we ensure all communications between the SDK and the server are behaving accordingly. @@ -64,32 +70,33 @@ To run the integration tests, you will need a valid mongodb running on your loca Use `npm run integration` in order to run the integration tests. If you have the vscode Jasmine extension installed (as recommended), you can run your tests by clicking the *Run* or the *Debug* lens that appears near by the test. +#### TypeScript Tests + +Type tests are located in [/types/tests.ts](/types/tests.ts) and are responsible for ensure types generated for each class is behaving as expected. Types must be generated using `npm run build:types` and should not be manually changed. These types are `.d.ts` files located in [/types](/types). + +When developing type definitions you can use `npm run watch:ts` in order to rebuild your changes automatically upon each save. + +Use `npm run test:types` in order to run types tests against generated `.d.ts` files. + ### Pull Requests -We actively welcome your pull requests. When we get one, we'll run some Parse-specific integration tests on it first. From here, we'll need to get a core member to sign off on the changes and then merge the pull request. For API changes we may need to fix internal uses, which could cause some delay. We'll do our best to provide updates and feedback throughout the process. +We appreciate your contribution and welcome your pull requests. When submitting a pull request, the CI will run some automated tests on it. From here, we'll need to get a core member to sign off on the changes and then merge the pull request. We'll do our best to provide updates and feedback throughout the process. -1. Fork the repo and create your branch from `master`. +1. Fork the repo and create your branch from `alpha`. 2. Add unit tests for any new code you add. -3. If you've changed APIs, update the documentation. -4. Ensure the test suite passes. (run `npm test && npm run integration`) -5. Make sure your code lints. +3. If you've changed public APIs, update the documentation. +4. Ensure the test suite passes by running `npm test && npm run integration`. +5. Make sure your code lints by running `npm run lint`. + +## Issues ### Known Issues We use GitHub issues to track public bugs. We will keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new issue, try to make sure your problem doesn't already exist. -### Reporting New Issues +### Report New Issue -Not all issues are SDK issues. If you're unsure whether your bug is with the SDK or backend, you can test to see if it reproduces with our [REST API][rest-api] and [Parse API Console][parse-api-console]. If it does, you can report backend bugs [here][bug-reports]. -If the issue only reproduces with the JS SDK, you can [open an issue](https://github.com/parse-community/parse-server/issues) on this repository. - -Details are key. The more information you provide us the easier it'll be for us to debug and the faster you'll receive a fix. Some examples of useful tidbits: - -* A description. What did you expect to happen and what actually happened? Why do you think that was wrong? -* A simple unit test that fails. Refer [here][tests-dir] for examples of existing unit tests and [here][integration-test-dir] for integration tests examples. See for how to setup your machine and run unit tests in [this](#setting-up-the-project-for-debugging-and-contributing) guide. You can submit a pull request with your failing unit test so that our CI verifies that the test fails. -* What version does this reproduce on? What version did it last work on? -* [Stacktrace or GTFO][stacktrace-or-gtfo]. In all honesty, full stacktraces with line numbers make a happy developer. -* Anything else you find relevant. +If you're unsure whether your bug is with the Pare JS SDK or Parse Server, you can test to see if it reproduces with the Parse Server [REST API](https://docs.parseplatform.org/rest/guide). ### Security Bugs @@ -97,20 +104,11 @@ Parse Community has a [responsible Vulnerability Disclosure Program](https://git ## Coding Style -* Most importantly, match the existing code style as much as possible. -* We use ES6 for this codebase. Use modern syntax whenever possible. -* Keep lines within 80 characters. -* Always end lines with semicolons. +- Most importantly, match the existing code style as much as possible. +- We use ES6 for this codebase. Use modern syntax whenever possible. +- Keep lines within 80 characters. +- Always end lines with semicolons. -### Code of Conduct +## Code of Conduct This project adheres to the [Contributor Covenant Code of Conduct](https://github.com/parse-community/parse-server/blob/master/CODE_OF_CONDUCT.md). By participating, you are expected to honor this code. - -[google-group]: https://groups.google.com/forum/#!forum/parse-developers -[stack-overflow]: http://stackoverflow.com/tags/parse-server -[bug-reports]: https://github.com/parse-community/parse-server/issues -[rest-api]: https://docs.parseplatform.org/rest/guide -[parse-api-console]: http://blog.parseplatform.org/announcements/introducing-the-parse-api-console/ -[stacktrace-or-gtfo]: http://i.imgur.com/jacoj.jpg -[tests-dir]: /src/__tests__ -[integration-test-dir]: /integration/test diff --git a/changelogs/CHANGELOG_alpha.md b/changelogs/CHANGELOG_alpha.md index 994a56a35..b3c5d5e5c 100644 --- a/changelogs/CHANGELOG_alpha.md +++ b/changelogs/CHANGELOG_alpha.md @@ -1,3 +1,17 @@ +# [6.1.0-alpha.5](https://github.com/parse-community/Parse-SDK-JS/compare/6.1.0-alpha.4...6.1.0-alpha.5) (2025-04-02) + + +### Bug Fixes + +* Remove unused option `sessionToken` from `Parse.Query.aggregate` ([#2547](https://github.com/parse-community/Parse-SDK-JS/issues/2547)) ([c7015ba](https://github.com/parse-community/Parse-SDK-JS/commit/c7015ba42c13d7a4bbe5246b0944e64dcea1712f)) + +# [6.1.0-alpha.4](https://github.com/parse-community/Parse-SDK-JS/compare/6.1.0-alpha.3...6.1.0-alpha.4) (2025-03-29) + + +### Bug Fixes + +* Security upgrade tar-fs from 2.1.1 to 2.1.2 ([#2540](https://github.com/parse-community/Parse-SDK-JS/issues/2540)) ([44eeacd](https://github.com/parse-community/Parse-SDK-JS/commit/44eeacd9b4af90c8a5f48264506d058ca2745109)) + # [6.1.0-alpha.3](https://github.com/parse-community/Parse-SDK-JS/compare/6.1.0-alpha.2...6.1.0-alpha.3) (2025-03-16) diff --git a/eslint.config.js b/eslint.config.js index f457b3813..fc23ae7e8 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -6,7 +6,8 @@ module.exports = tseslint.config({ files: ['**/*.js', '**/*.ts'], extends: [ eslint.configs.recommended, - ...tseslint.configs.recommended, + ...tseslint.configs.stylistic, + ...tseslint.configs.strict, ], plugins: { '@typescript-eslint': tseslint.plugin, @@ -34,6 +35,9 @@ module.exports = tseslint.config({ "@typescript-eslint/no-var-requires": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-require-imports": "off", + "@typescript-eslint/no-dynamic-delete": "off", + "@typescript-eslint/prefer-for-of": "off", + "@typescript-eslint/no-extraneous-class": "off", "@typescript-eslint/no-unused-vars": [ "error", { @@ -51,6 +55,7 @@ module.exports = tseslint.config({ "jsdoc/require-param-description": 0, "jsdoc/require-property-description": 0, "jsdoc/require-param-type": 0, + "jsdoc/require-param": 1, "jsdoc/tag-lines": 0, "jsdoc/check-param-names": [ "error", @@ -70,6 +75,15 @@ module.exports = tseslint.config({ } ] }, + settings: { + jsdoc: { + tagNamePreference: { + member: false, + memberof: false, + yield: false, + }, + }, + }, languageOptions: { parser: tseslint.parser, globals: { diff --git a/integration/test/ParseUserTest.js b/integration/test/ParseUserTest.js index 89ecfa460..4b1db73b4 100644 --- a/integration/test/ParseUserTest.js +++ b/integration/test/ParseUserTest.js @@ -6,10 +6,6 @@ const { v4: uuidv4 } = require('uuid'); const { twitterAuthData } = require('./helper'); class CustomUser extends Parse.User { - constructor(attributes) { - super(attributes); - } - doSomething() { return 5; } diff --git a/package-lock.json b/package-lock.json index d69a48942..f4322f1e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "parse", - "version": "6.1.0", + "version": "6.1.0-alpha.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "parse", - "version": "6.1.0", + "version": "6.1.0-alpha.5", "license": "Apache-2.0", "dependencies": { - "@babel/runtime-corejs3": "7.26.10", + "@babel/runtime-corejs3": "7.27.0", "idb-keyval": "6.2.1", "react-native-crypto-js": "1.0.0", "uuid": "10.0.0", @@ -22,8 +22,8 @@ "@babel/plugin-transform-runtime": "7.26.10", "@babel/preset-env": "7.26.9", "@babel/preset-react": "7.26.3", - "@babel/preset-typescript": "7.26.0", - "@eslint/js": "9.22.0", + "@babel/preset-typescript": "7.27.0", + "@eslint/js": "9.23.0", "@parse/minami": "git+https://github.com/parse-community/minami#main", "@saithodev/semantic-release-backmerge": "4.0.1", "@semantic-release/changelog": "6.0.3", @@ -41,9 +41,9 @@ "codecov": "3.8.3", "core-js": "3.41.0", "cross-env": "7.0.2", - "eslint": "9.22.0", + "eslint": "9.23.0", "eslint-plugin-expect-type": "0.6.2", - "eslint-plugin-jsdoc": "50.6.6", + "eslint-plugin-jsdoc": "50.6.9", "express": "4.21.2", "gulp": "5.0.0", "gulp-babel": "8.0.0", @@ -69,7 +69,7 @@ "puppeteer": "24.4.0", "regenerator-runtime": "0.14.1", "semantic-release": "24.2.3", - "typescript-eslint": "8.26.0", + "typescript-eslint": "8.28.0", "vinyl-source-stream": "2.0.0" }, "engines": { @@ -520,14 +520,14 @@ } }, "node_modules/@babel/generator": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.10.tgz", - "integrity": "sha512-rRHT8siFIXQrAYOYqZQVsAr8vJ+cBNqcVAY6m5V8/4QqzaPl+zDBe6cLEPRDuNOUf3ww8RfJVlOyQMoSI+5Ang==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.0.tgz", + "integrity": "sha512-VybsKvpiN1gU1sdMZIp7FcqphVVKEwcuj02x73uvcHE0PTihx1nlBcowYWhDwjpoAXRv43+gDzyggGnn1XZhVw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/parser": "^7.26.10", - "@babel/types": "^7.26.10", + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -590,17 +590,18 @@ "dev": true }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz", - "integrity": "sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.0.tgz", + "integrity": "sha512-vSGCvMecvFCd/BdpGlhpXYNhhC4ccxyvQWpbGL4CWbvfEoLFWUZuSuf7s9Aw70flgQF+6vptvgK2IfOnKlRmBg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.25.9", "@babel/helper-member-expression-to-functions": "^7.25.9", "@babel/helper-optimise-call-expression": "^7.25.9", - "@babel/helper-replace-supers": "^7.25.9", + "@babel/helper-replace-supers": "^7.26.5", "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", - "@babel/traverse": "^7.25.9", + "@babel/traverse": "^7.27.0", "semver": "^6.3.1" }, "engines": { @@ -757,14 +758,15 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz", - "integrity": "sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.26.5.tgz", + "integrity": "sha512-bJ6iIVdYX1YooY2X7w1q6VITt+LnUILtNk7zT78ykuwStx8BauCzxvFqFaHjOpW1bVnSUM1PN1f0p5P21wHxvg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-member-expression-to-functions": "^7.25.9", "@babel/helper-optimise-call-expression": "^7.25.9", - "@babel/traverse": "^7.25.9" + "@babel/traverse": "^7.26.5" }, "engines": { "node": ">=6.9.0" @@ -842,13 +844,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz", - "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.0.tgz", + "integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.26.10" + "@babel/types": "^7.27.0" }, "bin": { "parser": "bin/babel-parser.js" @@ -2222,14 +2224,15 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.25.9.tgz", - "integrity": "sha512-7PbZQZP50tzv2KGGnhh82GSyMB01yKY9scIjf1a+GfZCtInOWqUH5+1EBU4t9fyR5Oykkkc9vFTs4OHrhHXljQ==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.27.0.tgz", + "integrity": "sha512-fRGGjO2UEGPjvEcyAZXRXAS8AfdaQoq7HnxAbJoAoW10B9xOKesmmndJv+Sym2a+9FHWZ9KbyyLCe9s0Sn5jtg==", "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-create-class-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-create-class-features-plugin": "^7.27.0", + "@babel/helper-plugin-utils": "^7.26.5", "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", "@babel/plugin-syntax-typescript": "^7.25.9" }, @@ -2431,16 +2434,17 @@ } }, "node_modules/@babel/preset-typescript": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.26.0.tgz", - "integrity": "sha512-NMk1IGZ5I/oHhoXEElcm+xUnL/szL6xflkFZmoEU9xj1qSJXpiS7rsspYo92B4DRCDvZn2erT5LdsCeXAKNCkg==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.27.0.tgz", + "integrity": "sha512-vxaPFfJtHhgeOVXRKuHpHPAOgymmy8V8I65T1q53R7GCZlefKeCaTyDs3zOPHTTbmquvNlQYC5klEvWsBAtrBQ==", "dev": true, + "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-plugin-utils": "^7.26.5", "@babel/helper-validator-option": "^7.25.9", "@babel/plugin-syntax-jsx": "^7.25.9", - "@babel/plugin-transform-modules-commonjs": "^7.25.9", - "@babel/plugin-transform-typescript": "^7.25.9" + "@babel/plugin-transform-modules-commonjs": "^7.26.3", + "@babel/plugin-transform-typescript": "^7.27.0" }, "engines": { "node": ">=6.9.0" @@ -2462,9 +2466,9 @@ } }, "node_modules/@babel/runtime-corejs3": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.26.10.tgz", - "integrity": "sha512-uITFQYO68pMEYR46AHgQoyBg7KPPJDAbGn4jUTIRgCFJIp88MIBUianVOplhZDEec07bp9zIyr4Kp0FCyQzmWg==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.27.0.tgz", + "integrity": "sha512-UWjX6t+v+0ckwZ50Y5ShZLnlk95pP5MyW/pon9tiYzl3+18pkTHTFNTKr7rQbfRXPkowt2QAn30o1b6oswszew==", "license": "MIT", "dependencies": { "core-js-pure": "^3.30.2", @@ -2475,32 +2479,32 @@ } }, "node_modules/@babel/template": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", - "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.0.tgz", + "integrity": "sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.26.2", - "@babel/parser": "^7.26.9", - "@babel/types": "^7.26.9" + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.10.tgz", - "integrity": "sha512-k8NuDrxr0WrPH5Aupqb2LCVURP/S0vBEn5mK6iH+GIYob66U5EtoZvcdudR2jQ4cmTwhEwW1DLB+Yyas9zjF6A==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.0.tgz", + "integrity": "sha512-19lYZFzYVQkkHkl4Cy4WrAVcqBkgvV2YM2TU3xG6DIwO7O3ecbDPfW3yM3bjAGcqcQHi+CCtjMR3dIEHxsd6bA==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.26.2", - "@babel/generator": "^7.26.10", - "@babel/parser": "^7.26.10", - "@babel/template": "^7.26.9", - "@babel/types": "^7.26.10", + "@babel/generator": "^7.27.0", + "@babel/parser": "^7.27.0", + "@babel/template": "^7.27.0", + "@babel/types": "^7.27.0", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -2509,9 +2513,9 @@ } }, "node_modules/@babel/types": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", - "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz", + "integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==", "dev": true, "license": "MIT", "dependencies": { @@ -2647,9 +2651,9 @@ } }, "node_modules/@eslint/config-helpers": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.1.0.tgz", - "integrity": "sha512-kLrdPDJE1ckPo94kmPPf9Hfd0DU0Jw6oKYrhe+pwSC0iTUInmTa+w6fw8sGgcfkFJGNdWOUeOaDM4quW4a7OkA==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.0.tgz", + "integrity": "sha512-yJLLmLexii32mGrhW29qvU3QBVTu0GUmEf/J4XsBtVhp4JkIUFN/BjWqTF63yRvGApIDpZm5fa97LtYtINmfeQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -2670,9 +2674,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", - "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, "license": "MIT", "dependencies": { @@ -2740,9 +2744,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.22.0.tgz", - "integrity": "sha512-vLFajx9o8d1/oL2ZkpMYbkLv8nDB6yaIwFNt7nI4+I80U/z03SxmfOMsLbvWr3p7C+Wnoh//aOu2pQW8cS0HCQ==", + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.23.0.tgz", + "integrity": "sha512-35MJ8vCPU0ZMxo7zfev2pypqTwWTofFZO6m4KAtdoFhRpLJUpHTZZ+KB3C7Hb1d7bULYwO4lJXGCi5Se+8OMbw==", "dev": true, "license": "MIT", "engines": { @@ -7474,17 +7478,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.26.0.tgz", - "integrity": "sha512-cLr1J6pe56zjKYajK6SSSre6nl1Gj6xDp1TY0trpgPzjVbgDwd09v2Ws37LABxzkicmUjhEeg/fAUjPJJB1v5Q==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.28.0.tgz", + "integrity": "sha512-lvFK3TCGAHsItNdWZ/1FkvpzCxTHUVuFrdnOGLMa0GGCFIbCgQWVk3CzCGdA7kM3qGVc+dfW9tr0Z/sHnGDFyg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.26.0", - "@typescript-eslint/type-utils": "8.26.0", - "@typescript-eslint/utils": "8.26.0", - "@typescript-eslint/visitor-keys": "8.26.0", + "@typescript-eslint/scope-manager": "8.28.0", + "@typescript-eslint/type-utils": "8.28.0", + "@typescript-eslint/utils": "8.28.0", + "@typescript-eslint/visitor-keys": "8.28.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -7504,9 +7508,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ts-api-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", - "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "license": "MIT", "engines": { @@ -7517,16 +7521,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.26.0.tgz", - "integrity": "sha512-mNtXP9LTVBy14ZF3o7JG69gRPBK/2QWtQd0j0oH26HcY/foyJJau6pNUez7QrM5UHnSvwlQcJXKsk0I99B9pOA==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.28.0.tgz", + "integrity": "sha512-LPcw1yHD3ToaDEoljFEfQ9j2xShY367h7FZ1sq5NJT9I3yj4LHer1Xd1yRSOdYy9BpsrxU7R+eoDokChYM53lQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.26.0", - "@typescript-eslint/types": "8.26.0", - "@typescript-eslint/typescript-estree": "8.26.0", - "@typescript-eslint/visitor-keys": "8.26.0", + "@typescript-eslint/scope-manager": "8.28.0", + "@typescript-eslint/types": "8.28.0", + "@typescript-eslint/typescript-estree": "8.28.0", + "@typescript-eslint/visitor-keys": "8.28.0", "debug": "^4.3.4" }, "engines": { @@ -7542,14 +7546,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.26.0.tgz", - "integrity": "sha512-E0ntLvsfPqnPwng8b8y4OGuzh/iIOm2z8U3S9zic2TeMLW61u5IH2Q1wu0oSTkfrSzwbDJIB/Lm8O3//8BWMPA==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.28.0.tgz", + "integrity": "sha512-u2oITX3BJwzWCapoZ/pXw6BCOl8rJP4Ij/3wPoGvY8XwvXflOzd1kLrDUUUAIEdJSFh+ASwdTHqtan9xSg8buw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.26.0", - "@typescript-eslint/visitor-keys": "8.26.0" + "@typescript-eslint/types": "8.28.0", + "@typescript-eslint/visitor-keys": "8.28.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -7560,14 +7564,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.26.0.tgz", - "integrity": "sha512-ruk0RNChLKz3zKGn2LwXuVoeBcUMh+jaqzN461uMMdxy5H9epZqIBtYj7UiPXRuOpaALXGbmRuZQhmwHhaS04Q==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.28.0.tgz", + "integrity": "sha512-oRoXu2v0Rsy/VoOGhtWrOKDiIehvI+YNrDk5Oqj40Mwm0Yt01FC/Q7nFqg088d3yAsR1ZcZFVfPCTTFCe/KPwg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.26.0", - "@typescript-eslint/utils": "8.26.0", + "@typescript-eslint/typescript-estree": "8.28.0", + "@typescript-eslint/utils": "8.28.0", "debug": "^4.3.4", "ts-api-utils": "^2.0.1" }, @@ -7584,9 +7588,9 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/ts-api-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", - "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "license": "MIT", "engines": { @@ -7597,9 +7601,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.26.0.tgz", - "integrity": "sha512-89B1eP3tnpr9A8L6PZlSjBvnJhWXtYfZhECqlBl1D9Lme9mHO6iWlsprBtVenQvY1HMhax1mWOjhtL3fh/u+pA==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.28.0.tgz", + "integrity": "sha512-bn4WS1bkKEjx7HqiwG2JNB3YJdC1q6Ue7GyGlwPHyt0TnVq6TtD/hiOdTZt71sq0s7UzqBFXD8t8o2e63tXgwA==", "dev": true, "license": "MIT", "engines": { @@ -7611,14 +7615,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.26.0.tgz", - "integrity": "sha512-tiJ1Hvy/V/oMVRTbEOIeemA2XoylimlDQ03CgPPNaHYZbpsc78Hmngnt+WXZfJX1pjQ711V7g0H7cSJThGYfPQ==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.28.0.tgz", + "integrity": "sha512-H74nHEeBGeklctAVUvmDkxB1mk+PAZ9FiOMPFncdqeRBXxk1lWSYraHw8V12b7aa6Sg9HOBNbGdSHobBPuQSuA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.26.0", - "@typescript-eslint/visitor-keys": "8.26.0", + "@typescript-eslint/types": "8.28.0", + "@typescript-eslint/visitor-keys": "8.28.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -7664,9 +7668,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/ts-api-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", - "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "license": "MIT", "engines": { @@ -7677,16 +7681,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.26.0.tgz", - "integrity": "sha512-2L2tU3FVwhvU14LndnQCA2frYC8JnPDVKyQtWFPf8IYFMt/ykEN1bPolNhNbCVgOmdzTlWdusCTKA/9nKrf8Ig==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.28.0.tgz", + "integrity": "sha512-OELa9hbTYciYITqgurT1u/SzpQVtDLmQMFzy/N8pQE+tefOyCWT79jHsav294aTqV1q1u+VzqDGbuujvRYaeSQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.26.0", - "@typescript-eslint/types": "8.26.0", - "@typescript-eslint/typescript-estree": "8.26.0" + "@typescript-eslint/scope-manager": "8.28.0", + "@typescript-eslint/types": "8.28.0", + "@typescript-eslint/typescript-estree": "8.28.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -7701,13 +7705,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.26.0.tgz", - "integrity": "sha512-2z8JQJWAzPdDd51dRQ/oqIJxe99/hoLIqmf8RMCAJQtYDc535W/Jt2+RTP4bP0aKeBG1F65yjIZuczOXCmbWwg==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.28.0.tgz", + "integrity": "sha512-hbn8SZ8w4u2pRwgQ1GlUrPKE+t2XvcCW5tTRF7j6SMYIuYG37XuzIW44JCZPa36evi0Oy2SnM664BlIaAuQcvg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.26.0", + "@typescript-eslint/types": "8.28.0", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -12687,19 +12691,19 @@ } }, "node_modules/eslint": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.22.0.tgz", - "integrity": "sha512-9V/QURhsRN40xuHXWjV64yvrzMjcz7ZyNoF2jJFmy9j/SLk0u1OLSZgXi28MrXjymnjEGSR80WCdab3RGMDveQ==", + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.23.0.tgz", + "integrity": "sha512-jV7AbNoFPAY1EkFYpLq5bslU9NLNO8xnEeQXwErNibVryjk67wHVmddTBilc5srIttJDBrB0eMHKZBFbSIABCw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.2", - "@eslint/config-helpers": "^0.1.0", + "@eslint/config-helpers": "^0.2.0", "@eslint/core": "^0.12.0", - "@eslint/eslintrc": "^3.3.0", - "@eslint/js": "9.22.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.23.0", "@eslint/plugin-kit": "^0.2.7", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", @@ -12767,9 +12771,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "50.6.6", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.6.6.tgz", - "integrity": "sha512-4jLo9NZqHfyNtiBxAU293eX1xi6oUIBcAxJJL/hHeeNhh26l4l/Apmu0x9SarvSQ/gWNOrnFci4DSPupN4//WA==", + "version": "50.6.9", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.6.9.tgz", + "integrity": "sha512-7/nHu3FWD4QRG8tCVqcv+BfFtctUtEDWc29oeDXB4bwmDM2/r1ndl14AG/2DUntdqH7qmpvdemJKwb3R97/QEw==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -29229,10 +29233,11 @@ } }, "node_modules/tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.2.tgz", + "integrity": "sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA==", "dev": true, + "license": "MIT", "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", @@ -29776,15 +29781,15 @@ } }, "node_modules/typescript-eslint": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.26.0.tgz", - "integrity": "sha512-PtVz9nAnuNJuAVeUFvwztjuUgSnJInODAUx47VDwWPXzd5vismPOtPtt83tzNXyOjVQbPRp786D6WFW/M2koIA==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.28.0.tgz", + "integrity": "sha512-jfZtxJoHm59bvoCMYCe2BM0/baMswRhMmYhy+w6VfcyHrjxZ0OJe0tGasydCpIpA+A/WIJhTyZfb3EtwNC/kHQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.26.0", - "@typescript-eslint/parser": "8.26.0", - "@typescript-eslint/utils": "8.26.0" + "@typescript-eslint/eslint-plugin": "8.28.0", + "@typescript-eslint/parser": "8.28.0", + "@typescript-eslint/utils": "8.28.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -31550,13 +31555,13 @@ } }, "@babel/generator": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.10.tgz", - "integrity": "sha512-rRHT8siFIXQrAYOYqZQVsAr8vJ+cBNqcVAY6m5V8/4QqzaPl+zDBe6cLEPRDuNOUf3ww8RfJVlOyQMoSI+5Ang==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.27.0.tgz", + "integrity": "sha512-VybsKvpiN1gU1sdMZIp7FcqphVVKEwcuj02x73uvcHE0PTihx1nlBcowYWhDwjpoAXRv43+gDzyggGnn1XZhVw==", "dev": true, "requires": { - "@babel/parser": "^7.26.10", - "@babel/types": "^7.26.10", + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -31608,17 +31613,17 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz", - "integrity": "sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.27.0.tgz", + "integrity": "sha512-vSGCvMecvFCd/BdpGlhpXYNhhC4ccxyvQWpbGL4CWbvfEoLFWUZuSuf7s9Aw70flgQF+6vptvgK2IfOnKlRmBg==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.25.9", "@babel/helper-member-expression-to-functions": "^7.25.9", "@babel/helper-optimise-call-expression": "^7.25.9", - "@babel/helper-replace-supers": "^7.25.9", + "@babel/helper-replace-supers": "^7.26.5", "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", - "@babel/traverse": "^7.25.9", + "@babel/traverse": "^7.27.0", "semver": "^6.3.1" }, "dependencies": { @@ -31729,14 +31734,14 @@ } }, "@babel/helper-replace-supers": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz", - "integrity": "sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ==", + "version": "7.26.5", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.26.5.tgz", + "integrity": "sha512-bJ6iIVdYX1YooY2X7w1q6VITt+LnUILtNk7zT78ykuwStx8BauCzxvFqFaHjOpW1bVnSUM1PN1f0p5P21wHxvg==", "dev": true, "requires": { "@babel/helper-member-expression-to-functions": "^7.25.9", "@babel/helper-optimise-call-expression": "^7.25.9", - "@babel/traverse": "^7.25.9" + "@babel/traverse": "^7.26.5" } }, "@babel/helper-skip-transparent-expression-wrappers": { @@ -31789,12 +31794,12 @@ } }, "@babel/parser": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz", - "integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.27.0.tgz", + "integrity": "sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==", "dev": true, "requires": { - "@babel/types": "^7.26.10" + "@babel/types": "^7.27.0" } }, "@babel/plugin-bugfix-firefox-class-in-computed-class-key": { @@ -32660,14 +32665,14 @@ } }, "@babel/plugin-transform-typescript": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.25.9.tgz", - "integrity": "sha512-7PbZQZP50tzv2KGGnhh82GSyMB01yKY9scIjf1a+GfZCtInOWqUH5+1EBU4t9fyR5Oykkkc9vFTs4OHrhHXljQ==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.27.0.tgz", + "integrity": "sha512-fRGGjO2UEGPjvEcyAZXRXAS8AfdaQoq7HnxAbJoAoW10B9xOKesmmndJv+Sym2a+9FHWZ9KbyyLCe9s0Sn5jtg==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.25.9", - "@babel/helper-create-class-features-plugin": "^7.25.9", - "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-create-class-features-plugin": "^7.27.0", + "@babel/helper-plugin-utils": "^7.26.5", "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", "@babel/plugin-syntax-typescript": "^7.25.9" } @@ -32822,16 +32827,16 @@ } }, "@babel/preset-typescript": { - "version": "7.26.0", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.26.0.tgz", - "integrity": "sha512-NMk1IGZ5I/oHhoXEElcm+xUnL/szL6xflkFZmoEU9xj1qSJXpiS7rsspYo92B4DRCDvZn2erT5LdsCeXAKNCkg==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.27.0.tgz", + "integrity": "sha512-vxaPFfJtHhgeOVXRKuHpHPAOgymmy8V8I65T1q53R7GCZlefKeCaTyDs3zOPHTTbmquvNlQYC5klEvWsBAtrBQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-plugin-utils": "^7.26.5", "@babel/helper-validator-option": "^7.25.9", "@babel/plugin-syntax-jsx": "^7.25.9", - "@babel/plugin-transform-modules-commonjs": "^7.25.9", - "@babel/plugin-transform-typescript": "^7.25.9" + "@babel/plugin-transform-modules-commonjs": "^7.26.3", + "@babel/plugin-transform-typescript": "^7.27.0" } }, "@babel/runtime": { @@ -32844,44 +32849,44 @@ } }, "@babel/runtime-corejs3": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.26.10.tgz", - "integrity": "sha512-uITFQYO68pMEYR46AHgQoyBg7KPPJDAbGn4jUTIRgCFJIp88MIBUianVOplhZDEec07bp9zIyr4Kp0FCyQzmWg==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.27.0.tgz", + "integrity": "sha512-UWjX6t+v+0ckwZ50Y5ShZLnlk95pP5MyW/pon9tiYzl3+18pkTHTFNTKr7rQbfRXPkowt2QAn30o1b6oswszew==", "requires": { "core-js-pure": "^3.30.2", "regenerator-runtime": "^0.14.0" } }, "@babel/template": { - "version": "7.26.9", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz", - "integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.27.0.tgz", + "integrity": "sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==", "dev": true, "requires": { "@babel/code-frame": "^7.26.2", - "@babel/parser": "^7.26.9", - "@babel/types": "^7.26.9" + "@babel/parser": "^7.27.0", + "@babel/types": "^7.27.0" } }, "@babel/traverse": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.10.tgz", - "integrity": "sha512-k8NuDrxr0WrPH5Aupqb2LCVURP/S0vBEn5mK6iH+GIYob66U5EtoZvcdudR2jQ4cmTwhEwW1DLB+Yyas9zjF6A==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.27.0.tgz", + "integrity": "sha512-19lYZFzYVQkkHkl4Cy4WrAVcqBkgvV2YM2TU3xG6DIwO7O3ecbDPfW3yM3bjAGcqcQHi+CCtjMR3dIEHxsd6bA==", "dev": true, "requires": { "@babel/code-frame": "^7.26.2", - "@babel/generator": "^7.26.10", - "@babel/parser": "^7.26.10", - "@babel/template": "^7.26.9", - "@babel/types": "^7.26.10", + "@babel/generator": "^7.27.0", + "@babel/parser": "^7.27.0", + "@babel/template": "^7.27.0", + "@babel/types": "^7.27.0", "debug": "^4.3.1", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.26.10", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz", - "integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.27.0.tgz", + "integrity": "sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==", "dev": true, "requires": { "@babel/helper-string-parser": "^7.25.9", @@ -32991,9 +32996,9 @@ } }, "@eslint/config-helpers": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.1.0.tgz", - "integrity": "sha512-kLrdPDJE1ckPo94kmPPf9Hfd0DU0Jw6oKYrhe+pwSC0iTUInmTa+w6fw8sGgcfkFJGNdWOUeOaDM4quW4a7OkA==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.0.tgz", + "integrity": "sha512-yJLLmLexii32mGrhW29qvU3QBVTu0GUmEf/J4XsBtVhp4JkIUFN/BjWqTF63yRvGApIDpZm5fa97LtYtINmfeQ==", "dev": true }, "@eslint/core": { @@ -33006,9 +33011,9 @@ } }, "@eslint/eslintrc": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", - "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -33052,9 +33057,9 @@ } }, "@eslint/js": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.22.0.tgz", - "integrity": "sha512-vLFajx9o8d1/oL2ZkpMYbkLv8nDB6yaIwFNt7nI4+I80U/z03SxmfOMsLbvWr3p7C+Wnoh//aOu2pQW8cS0HCQ==", + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.23.0.tgz", + "integrity": "sha512-35MJ8vCPU0ZMxo7zfev2pypqTwWTofFZO6m4KAtdoFhRpLJUpHTZZ+KB3C7Hb1d7bULYwO4lJXGCi5Se+8OMbw==", "dev": true }, "@eslint/object-schema": { @@ -36557,16 +36562,16 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.26.0.tgz", - "integrity": "sha512-cLr1J6pe56zjKYajK6SSSre6nl1Gj6xDp1TY0trpgPzjVbgDwd09v2Ws37LABxzkicmUjhEeg/fAUjPJJB1v5Q==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.28.0.tgz", + "integrity": "sha512-lvFK3TCGAHsItNdWZ/1FkvpzCxTHUVuFrdnOGLMa0GGCFIbCgQWVk3CzCGdA7kM3qGVc+dfW9tr0Z/sHnGDFyg==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.26.0", - "@typescript-eslint/type-utils": "8.26.0", - "@typescript-eslint/utils": "8.26.0", - "@typescript-eslint/visitor-keys": "8.26.0", + "@typescript-eslint/scope-manager": "8.28.0", + "@typescript-eslint/type-utils": "8.28.0", + "@typescript-eslint/utils": "8.28.0", + "@typescript-eslint/visitor-keys": "8.28.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -36574,72 +36579,72 @@ }, "dependencies": { "ts-api-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", - "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "requires": {} } } }, "@typescript-eslint/parser": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.26.0.tgz", - "integrity": "sha512-mNtXP9LTVBy14ZF3o7JG69gRPBK/2QWtQd0j0oH26HcY/foyJJau6pNUez7QrM5UHnSvwlQcJXKsk0I99B9pOA==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.28.0.tgz", + "integrity": "sha512-LPcw1yHD3ToaDEoljFEfQ9j2xShY367h7FZ1sq5NJT9I3yj4LHer1Xd1yRSOdYy9BpsrxU7R+eoDokChYM53lQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "8.26.0", - "@typescript-eslint/types": "8.26.0", - "@typescript-eslint/typescript-estree": "8.26.0", - "@typescript-eslint/visitor-keys": "8.26.0", + "@typescript-eslint/scope-manager": "8.28.0", + "@typescript-eslint/types": "8.28.0", + "@typescript-eslint/typescript-estree": "8.28.0", + "@typescript-eslint/visitor-keys": "8.28.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.26.0.tgz", - "integrity": "sha512-E0ntLvsfPqnPwng8b8y4OGuzh/iIOm2z8U3S9zic2TeMLW61u5IH2Q1wu0oSTkfrSzwbDJIB/Lm8O3//8BWMPA==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.28.0.tgz", + "integrity": "sha512-u2oITX3BJwzWCapoZ/pXw6BCOl8rJP4Ij/3wPoGvY8XwvXflOzd1kLrDUUUAIEdJSFh+ASwdTHqtan9xSg8buw==", "dev": true, "requires": { - "@typescript-eslint/types": "8.26.0", - "@typescript-eslint/visitor-keys": "8.26.0" + "@typescript-eslint/types": "8.28.0", + "@typescript-eslint/visitor-keys": "8.28.0" } }, "@typescript-eslint/type-utils": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.26.0.tgz", - "integrity": "sha512-ruk0RNChLKz3zKGn2LwXuVoeBcUMh+jaqzN461uMMdxy5H9epZqIBtYj7UiPXRuOpaALXGbmRuZQhmwHhaS04Q==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.28.0.tgz", + "integrity": "sha512-oRoXu2v0Rsy/VoOGhtWrOKDiIehvI+YNrDk5Oqj40Mwm0Yt01FC/Q7nFqg088d3yAsR1ZcZFVfPCTTFCe/KPwg==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "8.26.0", - "@typescript-eslint/utils": "8.26.0", + "@typescript-eslint/typescript-estree": "8.28.0", + "@typescript-eslint/utils": "8.28.0", "debug": "^4.3.4", "ts-api-utils": "^2.0.1" }, "dependencies": { "ts-api-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", - "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "requires": {} } } }, "@typescript-eslint/types": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.26.0.tgz", - "integrity": "sha512-89B1eP3tnpr9A8L6PZlSjBvnJhWXtYfZhECqlBl1D9Lme9mHO6iWlsprBtVenQvY1HMhax1mWOjhtL3fh/u+pA==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.28.0.tgz", + "integrity": "sha512-bn4WS1bkKEjx7HqiwG2JNB3YJdC1q6Ue7GyGlwPHyt0TnVq6TtD/hiOdTZt71sq0s7UzqBFXD8t8o2e63tXgwA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.26.0.tgz", - "integrity": "sha512-tiJ1Hvy/V/oMVRTbEOIeemA2XoylimlDQ03CgPPNaHYZbpsc78Hmngnt+WXZfJX1pjQ711V7g0H7cSJThGYfPQ==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.28.0.tgz", + "integrity": "sha512-H74nHEeBGeklctAVUvmDkxB1mk+PAZ9FiOMPFncdqeRBXxk1lWSYraHw8V12b7aa6Sg9HOBNbGdSHobBPuQSuA==", "dev": true, "requires": { - "@typescript-eslint/types": "8.26.0", - "@typescript-eslint/visitor-keys": "8.26.0", + "@typescript-eslint/types": "8.28.0", + "@typescript-eslint/visitor-keys": "8.28.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -36667,33 +36672,33 @@ } }, "ts-api-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", - "integrity": "sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "requires": {} } } }, "@typescript-eslint/utils": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.26.0.tgz", - "integrity": "sha512-2L2tU3FVwhvU14LndnQCA2frYC8JnPDVKyQtWFPf8IYFMt/ykEN1bPolNhNbCVgOmdzTlWdusCTKA/9nKrf8Ig==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.28.0.tgz", + "integrity": "sha512-OELa9hbTYciYITqgurT1u/SzpQVtDLmQMFzy/N8pQE+tefOyCWT79jHsav294aTqV1q1u+VzqDGbuujvRYaeSQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.26.0", - "@typescript-eslint/types": "8.26.0", - "@typescript-eslint/typescript-estree": "8.26.0" + "@typescript-eslint/scope-manager": "8.28.0", + "@typescript-eslint/types": "8.28.0", + "@typescript-eslint/typescript-estree": "8.28.0" } }, "@typescript-eslint/visitor-keys": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.26.0.tgz", - "integrity": "sha512-2z8JQJWAzPdDd51dRQ/oqIJxe99/hoLIqmf8RMCAJQtYDc535W/Jt2+RTP4bP0aKeBG1F65yjIZuczOXCmbWwg==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.28.0.tgz", + "integrity": "sha512-hbn8SZ8w4u2pRwgQ1GlUrPKE+t2XvcCW5tTRF7j6SMYIuYG37XuzIW44JCZPa36evi0Oy2SnM664BlIaAuQcvg==", "dev": true, "requires": { - "@typescript-eslint/types": "8.26.0", + "@typescript-eslint/types": "8.28.0", "eslint-visitor-keys": "^4.2.0" }, "dependencies": { @@ -40639,18 +40644,18 @@ } }, "eslint": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.22.0.tgz", - "integrity": "sha512-9V/QURhsRN40xuHXWjV64yvrzMjcz7ZyNoF2jJFmy9j/SLk0u1OLSZgXi28MrXjymnjEGSR80WCdab3RGMDveQ==", + "version": "9.23.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.23.0.tgz", + "integrity": "sha512-jV7AbNoFPAY1EkFYpLq5bslU9NLNO8xnEeQXwErNibVryjk67wHVmddTBilc5srIttJDBrB0eMHKZBFbSIABCw==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.19.2", - "@eslint/config-helpers": "^0.1.0", + "@eslint/config-helpers": "^0.2.0", "@eslint/core": "^0.12.0", - "@eslint/eslintrc": "^3.3.0", - "@eslint/js": "9.22.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.23.0", "@eslint/plugin-kit": "^0.2.7", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", @@ -40832,9 +40837,9 @@ } }, "eslint-plugin-jsdoc": { - "version": "50.6.6", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.6.6.tgz", - "integrity": "sha512-4jLo9NZqHfyNtiBxAU293eX1xi6oUIBcAxJJL/hHeeNhh26l4l/Apmu0x9SarvSQ/gWNOrnFci4DSPupN4//WA==", + "version": "50.6.9", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-50.6.9.tgz", + "integrity": "sha512-7/nHu3FWD4QRG8tCVqcv+BfFtctUtEDWc29oeDXB4bwmDM2/r1ndl14AG/2DUntdqH7qmpvdemJKwb3R97/QEw==", "dev": true, "requires": { "@es-joy/jsdoccomment": "~0.49.0", @@ -52939,9 +52944,9 @@ } }, "tar-fs": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", - "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.2.tgz", + "integrity": "sha512-EsaAXwxmx8UB7FRKqeozqEPop69DXcmYwTQwXvyAPF352HJsPdkVhvTaDPYqfNgruveJIJy3TA2l+2zj8LJIJA==", "dev": true, "requires": { "chownr": "^1.1.1", @@ -53337,14 +53342,14 @@ "dev": true }, "typescript-eslint": { - "version": "8.26.0", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.26.0.tgz", - "integrity": "sha512-PtVz9nAnuNJuAVeUFvwztjuUgSnJInODAUx47VDwWPXzd5vismPOtPtt83tzNXyOjVQbPRp786D6WFW/M2koIA==", + "version": "8.28.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.28.0.tgz", + "integrity": "sha512-jfZtxJoHm59bvoCMYCe2BM0/baMswRhMmYhy+w6VfcyHrjxZ0OJe0tGasydCpIpA+A/WIJhTyZfb3EtwNC/kHQ==", "dev": true, "requires": { - "@typescript-eslint/eslint-plugin": "8.26.0", - "@typescript-eslint/parser": "8.26.0", - "@typescript-eslint/utils": "8.26.0" + "@typescript-eslint/eslint-plugin": "8.28.0", + "@typescript-eslint/parser": "8.28.0", + "@typescript-eslint/utils": "8.28.0" } }, "uc.micro": { diff --git a/package.json b/package.json index 5ff91a4ef..aa7fef82c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "parse", - "version": "6.1.0", + "version": "6.1.0-alpha.5", "description": "Parse JavaScript SDK", "homepage": "https://parseplatform.org", "keywords": [ @@ -31,7 +31,7 @@ "react-native": false }, "dependencies": { - "@babel/runtime-corejs3": "7.26.10", + "@babel/runtime-corejs3": "7.27.0", "idb-keyval": "6.2.1", "react-native-crypto-js": "1.0.0", "uuid": "10.0.0", @@ -44,8 +44,8 @@ "@babel/plugin-transform-runtime": "7.26.10", "@babel/preset-env": "7.26.9", "@babel/preset-react": "7.26.3", - "@babel/preset-typescript": "7.26.0", - "@eslint/js": "9.22.0", + "@babel/preset-typescript": "7.27.0", + "@eslint/js": "9.23.0", "@parse/minami": "git+https://github.com/parse-community/minami#main", "@saithodev/semantic-release-backmerge": "4.0.1", "@semantic-release/changelog": "6.0.3", @@ -63,9 +63,9 @@ "codecov": "3.8.3", "core-js": "3.41.0", "cross-env": "7.0.2", - "eslint": "9.22.0", + "eslint": "9.23.0", "eslint-plugin-expect-type": "0.6.2", - "eslint-plugin-jsdoc": "50.6.6", + "eslint-plugin-jsdoc": "50.6.9", "express": "4.21.2", "gulp": "5.0.0", "gulp-babel": "8.0.0", @@ -91,7 +91,7 @@ "puppeteer": "24.4.0", "regenerator-runtime": "0.14.1", "semantic-release": "24.2.3", - "typescript-eslint": "8.26.0", + "typescript-eslint": "8.28.0", "vinyl-source-stream": "2.0.0" }, "optionalDependencies": { @@ -108,7 +108,7 @@ "posttest:mongodb": "mongodb-runner stop --all", "lint": "eslint --cache src/ integration/", "lint:fix": "eslint --fix --cache src/ integration/", - "test:types": "eslint types/tests.ts -c eslint.config.test.mjs", + "test:types": "eslint types/tests.ts -c ./types/eslint.config.mjs", "watch": "cross-env PARSE_BUILD=${PARSE_BUILD} gulp watch", "watch:browser": "cross-env PARSE_BUILD=browser npm run watch", "watch:node": "cross-env PARSE_BUILD=node npm run watch", diff --git a/src/Analytics.ts b/src/Analytics.ts index 9a38f5912..d901b380a 100644 --- a/src/Analytics.ts +++ b/src/Analytics.ts @@ -40,7 +40,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: Record): Promise { name = name || ''; name = name.replace(/^\s*/, ''); name = name.replace(/\s*$/, ''); @@ -58,7 +58,7 @@ export function track(name: string, dimensions: { [key: string]: string }): Prom } const DefaultController = { - track(name: string, dimensions: { [key: string]: string }) { + track(name: string, dimensions: Record) { const path = 'events/' + name; const RESTController = CoreManager.getRESTController(); return RESTController.request('POST', path, { dimensions }); diff --git a/src/CoreManager.ts b/src/CoreManager.ts index f6889174a..047f2463f 100644 --- a/src/CoreManager.ts +++ b/src/CoreManager.ts @@ -15,28 +15,25 @@ import type ParseConfig from './ParseConfig'; import type LiveQueryClient from './LiveQueryClient'; import type ParseInstallation from './ParseInstallation'; -type AnalyticsController = { - track: (name: string, dimensions: { [key: string]: string }) => Promise; -}; -type CloudController = { +export interface AnalyticsController { + track: (name: string, dimensions: Record) => Promise; +} +export interface CloudController { run: (name: string, data: any, options?: RequestOptions) => Promise; getJobsData: (options?: RequestOptions) => Promise; /** Returns promise which resolves with JobStatusId of the job */ startJob: (name: string, data: any, options?: RequestOptions) => Promise; -}; -type ConfigController = { +} +export interface ConfigController { current: () => Promise | ParseConfig; get: (opts?: RequestOptions) => Promise; - save: ( - attrs: { [key: string]: any }, - masterKeyOnlyFlags?: { [key: string]: any } - ) => Promise; -}; -type CryptoController = { + save: (attrs: Record, masterKeyOnlyFlags?: Record) => Promise; +} +export interface CryptoController { encrypt: (obj: any, secretKey: string) => string; decrypt: (encryptedText: string, secretKey: any) => string; -}; -type FileController = { +} +export interface FileController { saveFile: (name: string, source: FileSource, options?: FullOptions) => Promise; saveBase64: ( name: string, @@ -45,34 +42,34 @@ type FileController = { ) => Promise<{ name: string; url: string }>; download: (uri: string, options?: any) => Promise<{ base64?: string; contentType?: string }>; deleteFile: (name: string, options?: { useMasterKey?: boolean }) => Promise; -}; -type InstallationController = { +} +export interface InstallationController { currentInstallationId: () => Promise; currentInstallation: () => Promise; updateInstallationOnDisk: (installation: ParseInstallation) => Promise; -}; -type ObjectController = { +} +export interface ObjectController { fetch: ( - object: ParseObject | Array, + object: ParseObject | ParseObject[], forceFetch: boolean, options?: RequestOptions - ) => Promise | ParseObject | undefined>; + ) => Promise<(ParseObject | undefined)[] | ParseObject | undefined>; save: ( - object: ParseObject | Array | null, + object: ParseObject | (ParseObject | ParseFile)[] | null, options?: RequestOptions - ) => Promise | ParseFile | undefined>; + ) => Promise; destroy: ( - object: ParseObject | Array, + object: ParseObject | ParseObject[], options?: RequestOptions - ) => Promise>; -}; -type ObjectStateController = { + ) => Promise; +} +export interface ObjectStateController { getState: (obj: any) => State | null; initializeState: (obj: any, initial?: State) => State; removeState: (obj: any) => State | null; getServerData: (obj: any) => AttributeMap; setServerData: (obj: any, attributes: AttributeMap) => void; - getPendingOps: (obj: any) => Array; + getPendingOps: (obj: any) => OpsMap[]; setPendingOp: (obj: any, attr: string, op?: Op) => void; pushPendingState: (obj: any) => void; popPendingState: (obj: any) => OpsMap | undefined; @@ -84,23 +81,19 @@ type ObjectStateController = { enqueueTask: (obj: any, task: () => Promise) => Promise; clearAllState: () => void; duplicateState: (source: any, dest: any) => void; -}; -type PushController = { +} +export interface PushController { send: (data: PushData, options?: FullOptions) => Promise; -}; -type QueryController = { +} +export interface QueryController { find( className: string, params: QueryJSON, options?: RequestOptions - ): Promise<{ results?: Array; className?: string; count?: number }>; - aggregate( - className: string, - params: any, - options?: RequestOptions - ): Promise<{ results?: Array }>; -}; -export type QueueObject = { + ): Promise<{ results?: ParseObject[]; className?: string; count?: number }>; + aggregate(className: string, params: any, options?: RequestOptions): Promise<{ results?: any[] }>; +} +export interface QueueObject { queueId: string; action: string; object: ParseObject; @@ -109,9 +102,9 @@ export type QueueObject = { className: string; hash: string; createdAt: Date; -}; -export type Queue = Array; -export type EventuallyQueue = { +} +export type Queue = QueueObject[]; +export interface EventuallyQueue { save: (object: ParseObject, serverOptions?: SaveOptions) => Promise; destroy: (object: ParseObject, serverOptions?: RequestOptions) => Promise; generateQueueId: (action: string, object: ParseObject) => string; @@ -138,8 +131,8 @@ export type EventuallyQueue = { byId(ObjectType: any, queueObject: any): Promise; byHash(ObjectType: any, queueObject: any): Promise; }; -}; -type RESTController = { +} +export interface RESTController { request: (method: string, path: string, data?: any, options?: RequestOptions) => Promise; ajax: ( method: string, @@ -149,18 +142,18 @@ type RESTController = { options?: FullOptions ) => Promise; handleError: (err?: any) => void; -}; -type SchemaController = { +} +export interface SchemaController { purge: (className: string) => Promise; get: (className: string, options?: RequestOptions) => Promise; delete: (className: string, options?: RequestOptions) => Promise; create: (className: string, params: any, options?: RequestOptions) => Promise; update: (className: string, params: any, options?: RequestOptions) => Promise; send(className: string, method: string, params: any, options?: RequestOptions): Promise; -}; -type SessionController = { +} +export interface SessionController { getSession: (options?: RequestOptions) => Promise; -}; +} type StorageController = | { async: 0; @@ -171,8 +164,8 @@ type StorageController = setItemAsync?: (path: string, value: string) => Promise; removeItemAsync?: (path: string) => Promise; clear: () => void; - getAllKeys?: () => Array; - getAllKeysAsync?: () => Promise>; + getAllKeys?: () => string[]; + getAllKeysAsync?: () => Promise; } | { async: 1; @@ -183,10 +176,10 @@ type StorageController = setItemAsync: (path: string, value: string) => Promise; removeItemAsync: (path: string) => Promise; clear: () => void; - getAllKeys?: () => Array; - getAllKeysAsync?: () => Promise>; + getAllKeys?: () => string[]; + getAllKeysAsync?: () => Promise; }; -type LocalDatastoreController = { +export interface LocalDatastoreController { fromPinWithName: (name: string) => any | undefined; pinWithName: (name: string, objects: any) => void; unPinWithName: (name: string) => void; @@ -194,8 +187,8 @@ type LocalDatastoreController = { clear: () => void; // Use for testing // getRawStorage(): Promise, -}; -type UserController = { +} +export interface UserController { setCurrentUser: (user: ParseUser) => Promise; currentUser: () => ParseUser | null; currentUserAsync: () => Promise; @@ -210,29 +203,29 @@ type UserController = { updateUserOnDisk: (user: ParseUser) => Promise; upgradeToRevocableSession: (user: ParseUser, options?: RequestOptions) => Promise; linkWith: (user: ParseUser, authData: AuthData, options?: FullOptions) => Promise; - removeUserFromDisk: () => Promise; + removeUserFromDisk: () => Promise; verifyPassword: ( username: string, password: string, options?: RequestOptions ) => Promise; requestEmailVerification: (email: string, options?: RequestOptions) => Promise; -}; -type HooksController = { +} +export interface HooksController { get: (type: string, functionName?: string, triggerName?: string) => Promise; create: (hook: HookDeclaration) => Promise; remove: (hook: HookDeleteArg) => Promise; update: (hook: HookDeclaration) => Promise; // Renamed to sendRequest since ParseHooks file & tests file uses this. (originally declared as just "send") sendRequest?: (method: string, path: string, body?: any) => Promise; -}; -type LiveQueryControllerType = { +} +export interface LiveQueryControllerType { setDefaultLiveQueryClient(liveQueryClient: LiveQueryClient): void; getDefaultLiveQueryClient(): Promise; _clearCachedDefaultClient(): void; -}; +} /** Based on https://github.com/react-native-async-storage/async-storage/blob/main/packages/default-storage-backend/src/types.ts */ -type AsyncStorageType = { +export interface AsyncStorageType { /** Fetches an item for a `key` and invokes a callback upon completion. */ getItem: ( key: string, @@ -302,16 +295,16 @@ type AsyncStorageType = { keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void ) => Promise; -}; -export type WebSocketController = { +} +export interface WebSocketController { onopen: () => void; onmessage: (message: any) => void; onclose: (arg?: any) => void; onerror: (error: any) => void; send: (data: any) => void; close: () => void; -}; -type Config = { +} +interface Config { AnalyticsController?: AnalyticsController; CloudController?: CloudController; ConfigController?: ConfigController; @@ -334,9 +327,9 @@ type Config = { ) => WebSocketController; LiveQueryController?: LiveQueryControllerType; AsyncStorage?: AsyncStorageType; -}; +} -const config: Config & { [key: string]: any } = { +const config: Config & Record = { IS_NODE: typeof process !== 'undefined' && !!process.versions && @@ -364,7 +357,7 @@ const config: Config & { [key: string]: any } = { PARSE_ERRORS: [], }; -function requireMethods(name: string, methods: Array, controller: any) { +function requireMethods(name: string, methods: string[], controller: any) { methods.forEach(func => { if (typeof controller[func] !== 'function') { throw new Error(`${name} must implement ${func}()`); diff --git a/src/LocalDatastore.ts b/src/LocalDatastore.ts index 069a44c48..82d624fe2 100644 --- a/src/LocalDatastore.ts +++ b/src/LocalDatastore.ts @@ -28,7 +28,7 @@ const LocalDatastore = { isEnabled: false, isSyncing: false, - fromPinWithName(name: string): Promise> { + fromPinWithName(name: string): Promise { const controller = CoreManager.getLocalDatastoreController(); return controller.fromPinWithName(name); }, @@ -61,7 +61,7 @@ const LocalDatastore = { // Pin the object and children recursively // Saves the object and children key to Pin Name - async _handlePinAllWithName(name: string, objects: Array): Promise { + async _handlePinAllWithName(name: string, objects: ParseObject[]): Promise { const pinName = this.getPinName(name); const toPinPromises = []; const objectKeys = []; @@ -86,7 +86,7 @@ const LocalDatastore = { // Removes object and children keys from pin name // Keeps the object and children pinned - async _handleUnPinAllWithName(name: string, objects: Array) { + async _handleUnPinAllWithName(name: string, objects: ParseObject[]) { const localDatastore = await this._getAllContents(); const pinName = this.getPinName(name); const promises = []; diff --git a/src/LocalDatastoreController.default.ts b/src/LocalDatastoreController.default.ts index 80bbba421..5d424950c 100644 --- a/src/LocalDatastoreController.default.ts +++ b/src/LocalDatastoreController.default.ts @@ -2,7 +2,7 @@ import { isLocalDatastoreKey } from './LocalDatastoreUtils'; import Storage from './Storage'; const LocalDatastoreController = { - async fromPinWithName(name: string): Promise> { + async fromPinWithName(name: string): Promise { const values = await Storage.getItemAsync(name); if (!values) { return []; diff --git a/src/LocalDatastoreController.react-native.ts b/src/LocalDatastoreController.react-native.ts index c555bffb2..bf08a4b42 100644 --- a/src/LocalDatastoreController.react-native.ts +++ b/src/LocalDatastoreController.react-native.ts @@ -2,7 +2,7 @@ import { isLocalDatastoreKey } from './LocalDatastoreUtils'; import RNStorage from './StorageController.react-native'; const LocalDatastoreController = { - async fromPinWithName(name: string): Promise> { + async fromPinWithName(name: string): Promise { const values = await RNStorage.getItemAsync(name); if (!values) { return []; diff --git a/src/ObjectStateMutations.ts b/src/ObjectStateMutations.ts index cd3616278..f7caf6711 100644 --- a/src/ObjectStateMutations.ts +++ b/src/ObjectStateMutations.ts @@ -7,17 +7,17 @@ import { RelationOp } from './ParseOp'; import type { Op } from './ParseOp'; import type ParseObject from './ParseObject'; -export type AttributeMap = { [attr: string]: any }; -export type OpsMap = { [attr: string]: Op }; -export type ObjectCache = { [attr: string]: string }; +export type AttributeMap = Record; +export type OpsMap = Record; +export type ObjectCache = Record; -export type State = { +export interface State { serverData: AttributeMap; - pendingOps: Array; + pendingOps: OpsMap[]; objectCache: ObjectCache; tasks: TaskQueue; existed: boolean; -}; +} export function defaultState(): State { return { @@ -39,7 +39,7 @@ export function setServerData(serverData: AttributeMap, attributes: AttributeMap } } -export function setPendingOp(pendingOps: Array, attr: string, op?: Op) { +export function setPendingOp(pendingOps: OpsMap[], attr: string, op?: Op) { const last = pendingOps.length - 1; if (op) { pendingOps[last][attr] = op; @@ -48,11 +48,11 @@ export function setPendingOp(pendingOps: Array, attr: string, op?: Op) { } } -export function pushPendingState(pendingOps: Array) { +export function pushPendingState(pendingOps: OpsMap[]) { pendingOps.push({}); } -export function popPendingState(pendingOps: Array): OpsMap { +export function popPendingState(pendingOps: OpsMap[]): OpsMap { const first = pendingOps.shift(); if (!pendingOps.length) { pendingOps[0] = {}; @@ -60,7 +60,7 @@ export function popPendingState(pendingOps: Array): OpsMap { return first; } -export function mergeFirstPendingState(pendingOps: Array) { +export function mergeFirstPendingState(pendingOps: OpsMap[]) { const first = popPendingState(pendingOps); const next = pendingOps[0]; for (const attr in first) { @@ -77,7 +77,7 @@ export function mergeFirstPendingState(pendingOps: Array) { export function estimateAttribute( serverData: AttributeMap, - pendingOps: Array, + pendingOps: OpsMap[], object: ParseObject, attr: string ): any { @@ -98,7 +98,7 @@ export function estimateAttribute( export function estimateAttributes( serverData: AttributeMap, - pendingOps: Array, + pendingOps: OpsMap[], object: ParseObject ): AttributeMap { const data = {}; diff --git a/src/Parse.ts b/src/Parse.ts index 32e096c97..347f6ff9e 100644 --- a/src/Parse.ts +++ b/src/Parse.ts @@ -77,7 +77,7 @@ const Parse = { Parse: undefined, /** - * @member {EventuallyQueue} Parse.EventuallyQueue + * @property {EventuallyQueue} Parse.EventuallyQueue * @static */ set EventuallyQueue(queue: EventuallyQueue) { @@ -172,7 +172,7 @@ const Parse = { }, /** - * @member {string} Parse.applicationId + * @property {string} Parse.applicationId * @static */ set applicationId(value) { @@ -183,7 +183,7 @@ const Parse = { }, /** - * @member {string} Parse.javaScriptKey + * @property {string} Parse.javaScriptKey * @static */ set javaScriptKey(value) { @@ -194,7 +194,7 @@ const Parse = { }, /** - * @member {string} Parse.masterKey + * @property {string} Parse.masterKey * @static */ set masterKey(value) { @@ -205,7 +205,7 @@ const Parse = { }, /** - * @member {string} Parse.maintenanceKey + * @property {string} Parse.maintenanceKey * @static */ set maintenanceKey(value) { @@ -216,7 +216,7 @@ const Parse = { }, /** - * @member {string} Parse.serverURL + * @property {string} Parse.serverURL * @static */ set serverURL(value) { @@ -227,7 +227,7 @@ const Parse = { }, /** - * @member {string} Parse.serverAuthToken + * @property {string} Parse.serverAuthToken * @static */ set serverAuthToken(value) { @@ -238,7 +238,7 @@ const Parse = { }, /** - * @member {string} Parse.serverAuthType + * @property {string} Parse.serverAuthType * @static */ set serverAuthType(value) { @@ -249,7 +249,7 @@ const Parse = { }, /** - * @member {ParseLiveQuery} Parse.LiveQuery + * @property {ParseLiveQuery} Parse.LiveQuery * @static */ set LiveQuery(liveQuery: ParseLiveQuery) { @@ -260,7 +260,7 @@ const Parse = { }, /** - * @member {string} Parse.liveQueryServerURL + * @property {string} Parse.liveQueryServerURL * @static */ set liveQueryServerURL(value) { @@ -271,7 +271,7 @@ const Parse = { }, /** - * @member {boolean} Parse.encryptedUser + * @property {boolean} Parse.encryptedUser * @static */ set encryptedUser(value: boolean) { @@ -282,7 +282,7 @@ const Parse = { }, /** - * @member {string} Parse.secret + * @property {string} Parse.secret * @static */ set secret(value) { @@ -293,7 +293,7 @@ const Parse = { }, /** - * @member {boolean} Parse.idempotency + * @property {boolean} Parse.idempotency * @static */ set idempotency(value) { @@ -304,7 +304,7 @@ const Parse = { }, /** - * @member {boolean} Parse.allowCustomObjectId + * @property {boolean} Parse.allowCustomObjectId * @static */ set allowCustomObjectId(value) { diff --git a/src/ParseACL.ts b/src/ParseACL.ts index 5e07772fa..3cfbb212d 100644 --- a/src/ParseACL.ts +++ b/src/ParseACL.ts @@ -2,8 +2,8 @@ import CoreManager from './CoreManager'; import type ParseRole from './ParseRole'; import type ParseUser from './ParseUser'; -type PermissionsMap = { [permission: string]: boolean }; -type ByIdMap = { [userId: string]: PermissionsMap }; +type PermissionsMap = Record; +type ByIdMap = Record; const PUBLIC_KEY = '*'; diff --git a/src/ParseCLP.ts b/src/ParseCLP.ts index 56289adc5..199f7306e 100644 --- a/src/ParseCLP.ts +++ b/src/ParseCLP.ts @@ -2,10 +2,11 @@ import ParseRole from './ParseRole'; import ParseUser from './ParseUser'; type Entity = ParseUser | ParseRole | string; -type UsersMap = { [userId: string]: boolean | any }; -export type PermissionsMap = { writeUserFields?: string[]; readUserFields?: string[] } & { - [permission: string]: UsersMap; -}; +type UsersMap = Record; +export type PermissionsMap = { writeUserFields?: string[]; readUserFields?: string[] } & Record< + string, + UsersMap +>; const PUBLIC_KEY = '*'; diff --git a/src/ParseConfig.ts b/src/ParseConfig.ts index 6bdd38807..938a6adca 100644 --- a/src/ParseConfig.ts +++ b/src/ParseConfig.ts @@ -14,8 +14,8 @@ import type { RequestOptions } from './RESTController'; * @alias Parse.Config */ class ParseConfig { - attributes: { [key: string]: any }; - _escapedAttributes: { [key: string]: any }; + attributes: Record; + _escapedAttributes: Record; constructor() { this.attributes = {}; @@ -95,7 +95,7 @@ class ParseConfig { * @returns {Promise} A promise that is resolved with a newly-created * configuration object or with the current with the update. */ - static save(attrs: { [key: string]: any }, masterKeyOnlyFlags: { [key: string]: any }) { + static save(attrs: Record, masterKeyOnlyFlags: Record) { const controller = CoreManager.getConfigController(); //To avoid a mismatch with the local and the cloud config we get a new version return controller.save(attrs, masterKeyOnlyFlags).then( @@ -190,7 +190,7 @@ const DefaultController = { }); }, - save(attrs?: { [key: string]: any }, masterKeyOnlyFlags?: { [key: string]: any }) { + save(attrs?: Record, masterKeyOnlyFlags?: Record) { const RESTController = CoreManager.getRESTController(); const encodedAttrs = {}; for (const key in attrs) { diff --git a/src/ParseFile.ts b/src/ParseFile.ts index d53c8f947..af3581c78 100644 --- a/src/ParseFile.ts +++ b/src/ParseFile.ts @@ -12,12 +12,16 @@ if (process.env.PARSE_BUILD === 'weapp') { XHR = XhrWeapp; } -type Base64 = { base64: string }; -type Uri = { uri: string }; -type FileData = Array | Base64 | Blob | Uri; +interface Base64 { + base64: string; +} +interface Uri { + uri: string; +} +type FileData = number[] | Base64 | Blob | Uri; export type FileSaveOptions = FullOptions & { - metadata?: { [key: string]: any }; - tags?: { [key: string]: any }; + metadata?: Record; + tags?: Record; }; export type FileSource = | { @@ -411,7 +415,7 @@ class ParseFile { return file; } - static encodeBase64(bytes: Array | Uint8Array): string { + static encodeBase64(bytes: number[] | Uint8Array): string { const chunks = []; chunks.length = Math.ceil(bytes.length / 3); for (let i = 0; i < chunks.length; i++) { diff --git a/src/ParseInstallation.ts b/src/ParseInstallation.ts index 8110e4a78..0a0fbdfb9 100644 --- a/src/ParseInstallation.ts +++ b/src/ParseInstallation.ts @@ -3,14 +3,14 @@ import ParseError from './ParseError'; import ParseObject, { Attributes } from './ParseObject'; import type { AttributeKey } from './ParseObject'; -type DeviceInterface = { +interface DeviceInterface { IOS: string; MACOS: string; TVOS: string; FCM: string; ANDROID: string; WEB: string; -}; +} const DEVICE_TYPES: DeviceInterface = { IOS: 'ios', @@ -219,7 +219,7 @@ class ParseInstallation extends ParseObject): Promise { + async fetch(...args: any[]): Promise { try { await super.fetch.apply(this, args); } catch (e) { @@ -244,7 +244,7 @@ class ParseInstallation extends ParseObject): Promise { + async save(...args: any[]): Promise { try { await super.save.apply(this, args); } catch (e) { diff --git a/src/ParseObject.ts b/src/ParseObject.ts index 059021384..a3503e41a 100644 --- a/src/ParseObject.ts +++ b/src/ParseObject.ts @@ -32,18 +32,18 @@ import type { RequestOptions, FullOptions } from './RESTController'; import type ParseGeoPoint from './ParseGeoPoint'; import type ParsePolygon from './ParsePolygon'; -export type Pointer = { +export interface Pointer { __type: string; className: string; objectId?: string; _localId?: string; -}; +} -type SaveParams = { +interface SaveParams { method: string; path: string; body: AttributeMap; -}; +} export type SaveOptions = FullOptions & { cascadeSave?: boolean; @@ -52,23 +52,21 @@ export type SaveOptions = FullOptions & { transaction?: boolean; }; -type FetchOptions = { +interface FetchOptions { useMasterKey?: boolean; sessionToken?: string; include?: string | string[]; context?: AttributeMap; -}; +} -export type SetOptions = { +export interface SetOptions { ignoreValidation?: boolean; unset?: boolean; -}; +} export type AttributeKey = Extract; -export interface Attributes { - [key: string]: any; -} +export type Attributes = Record; interface JSONBaseAttributes { objectId: string; @@ -92,8 +90,8 @@ type Encode = T extends ParseObject ? { __type: 'Date'; iso: string } : T extends RegExp ? string - : T extends Array - ? Array> + : T extends (infer R)[] + ? Encode[] : T extends object ? ToJSON : T; @@ -281,7 +279,7 @@ class ParseObject { stateController.setServerData(this._getStateIdentifier(), unset); } - _getPendingOps(): Array { + _getPendingOps(): OpsMap[] { const stateController = CoreManager.getObjectStateController(); return stateController.getPendingOps(this._getStateIdentifier()); } @@ -290,7 +288,7 @@ class ParseObject { * @param {Array} [keysToClear] - if specified, only ops matching * these fields will be cleared */ - _clearPendingOps(keysToClear?: Array) { + _clearPendingOps(keysToClear?: string[]) { const pending = this._getPendingOps(); const latest = pending[pending.length - 1]; const keys = keysToClear || Object.keys(latest); @@ -331,7 +329,7 @@ class ParseObject { return dirty; } - _toFullJSON(seen?: Array, offline?: boolean): Attributes { + _toFullJSON(seen?: any[], offline?: boolean): Attributes { const json: Attributes = this.toJSON(seen, offline); json.__type = 'Object'; json.className = this.className; @@ -556,7 +554,7 @@ class ParseObject { * @param offline * @returns {object} */ - toJSON(seen: Array | void, offline?: boolean): ToJSON & JSONBaseAttributes { + toJSON(seen?: any[], offline?: boolean): ToJSON & JSONBaseAttributes { const seenEntry = this.id ? this.className + ':' + this.id : this; seen = seen || [seenEntry]; const json: any = {}; @@ -1190,7 +1188,7 @@ class ParseObject { * * @param {string} [keys] - specify which fields to revert */ - revert(...keys: Array>): void { + revert(...keys: Extract[]): void { let keysToRevert; if (keys.length) { keysToRevert = []; @@ -1266,10 +1264,7 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the fetch * completes. */ - fetchWithInclude( - keys: string | Array>, - options?: RequestOptions - ): Promise { + fetchWithInclude(keys: string | (string | string[])[], options?: RequestOptions): Promise { options = options || {}; options.include = keys; return this.fetch(options); @@ -1476,9 +1471,9 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the destroy * completes. */ - destroy(options?: RequestOptions): Promise { + destroy(options?: RequestOptions): Promise { if (!this.id) { - return Promise.resolve(); + return Promise.resolve(undefined); } const destroyOptions = ParseObject._getRequestOptions(options); return CoreManager.getObjectController().destroy(this, destroyOptions) as Promise; @@ -1668,7 +1663,7 @@ class ParseObject { */ static fetchAllWithInclude( list: T[], - keys: keyof T['attributes'] | Array, + keys: keyof T['attributes'] | (keyof T['attributes'])[], options?: RequestOptions ): Promise { options = options || {}; @@ -1708,7 +1703,7 @@ class ParseObject { */ static fetchAllIfNeededWithInclude( list: T[], - keys: keyof T['attributes'] | Array, + keys: keyof T['attributes'] | (keyof T['attributes'])[], options?: RequestOptions ): Promise { options = options || {}; @@ -1819,7 +1814,7 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the destroyAll * completes. */ - static destroyAll(list: Array, options?: SaveOptions) { + static destroyAll(list: ParseObject[], options?: SaveOptions) { const destroyOptions = ParseObject._getRequestOptions(options); return CoreManager.getObjectController().destroy(list, destroyOptions); } @@ -2145,7 +2140,7 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the pin completes. * @static */ - static pinAll(objects: Array): Promise { + static pinAll(objects: ParseObject[]): Promise { const localDatastore = CoreManager.getLocalDatastore(); if (!localDatastore.isEnabled) { return Promise.reject('Parse.enableLocalDatastore() must be called first'); @@ -2171,7 +2166,7 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the pin completes. * @static */ - static pinAllWithName(name: string, objects: Array): Promise { + static pinAllWithName(name: string, objects: ParseObject[]): Promise { const localDatastore = CoreManager.getLocalDatastore(); if (!localDatastore.isEnabled) { return Promise.reject('Parse.enableLocalDatastore() must be called first'); @@ -2191,7 +2186,7 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the unPin completes. * @static */ - static unPinAll(objects: Array): Promise { + static unPinAll(objects: ParseObject[]): Promise { const localDatastore = CoreManager.getLocalDatastore(); if (!localDatastore.isEnabled) { return Promise.reject('Parse.enableLocalDatastore() must be called first'); @@ -2211,7 +2206,7 @@ class ParseObject { * @returns {Promise} A promise that is fulfilled when the unPin completes. * @static */ - static unPinAllWithName(name: string, objects: Array): Promise { + static unPinAllWithName(name: string, objects: ParseObject[]): Promise { const localDatastore = CoreManager.getLocalDatastore(); if (!localDatastore.isEnabled) { return Promise.reject('Parse.enableLocalDatastore() must be called first'); @@ -2260,10 +2255,10 @@ class ParseObject { const DefaultController = { fetch( - target: ParseObject | Array, + target: ParseObject | ParseObject[], forceFetch: boolean, options?: RequestOptions - ): Promise | ParseObject | undefined> { + ): Promise<(ParseObject | undefined)[] | ParseObject | undefined> { const localDatastore = CoreManager.getLocalDatastore(); if (Array.isArray(target)) { if (target.length < 1) { @@ -2365,9 +2360,9 @@ const DefaultController = { }, async destroy( - target: ParseObject | Array, + target: ParseObject | ParseObject[], options?: RequestOptions - ): Promise> { + ): Promise { if (options && options.batchSize && options.transaction) throw new ParseError( ParseError.OTHER_CAUSE, @@ -2452,9 +2447,9 @@ const DefaultController = { }, save( - target: ParseObject | null | Array, + target: ParseObject | null | (ParseObject | ParseFile)[], options?: RequestOptions - ): Promise | ParseFile | undefined> { + ): Promise { if (options && options.batchSize && options.transaction) return Promise.reject( new ParseError( @@ -2489,8 +2484,8 @@ const DefaultController = { } unsaved = unique(unsaved); - const filesSaved: Array | undefined> = []; - let pending: Array = []; + const filesSaved: (Promise | undefined)[] = []; + let pending: ParseObject[] = []; unsaved.forEach(el => { if (el instanceof ParseFile) { filesSaved.push(el.save(options)); @@ -2546,6 +2541,7 @@ const DefaultController = { const batchReady: ReturnType>[] = []; const batchTasks: Promise[] = []; batch.forEach((obj, index) => { + // eslint-disable-next-line const ready = resolvingPromise(); batchReady.push(ready); const task = function () { diff --git a/src/ParseOp.ts b/src/ParseOp.ts index 9242f5012..dbf1e2fed 100644 --- a/src/ParseOp.ts +++ b/src/ParseOp.ts @@ -7,7 +7,7 @@ import type Pointer from './ParseObject'; import ParseRelation from './ParseRelation'; import unique from './unique'; -export function opFromJSON(json: { [key: string]: any }): Op | null { +export function opFromJSON(json: Record): Op | null { if (!json || !json.__op) { return null; } @@ -55,7 +55,7 @@ export function opFromJSON(json: { [key: string]: any }): Op | null { export class Op { // Empty parent class applyTo(value: any): any {} /* eslint-disable-line @typescript-eslint/no-unused-vars */ - mergeWith(previous: Op): Op | void {} /* eslint-disable-line @typescript-eslint/no-unused-vars */ + mergeWith(previous: Op): Op | void {} /* eslint-disable-line */ toJSON(offline?: boolean): any {} /* eslint-disable-line @typescript-eslint/no-unused-vars */ } @@ -137,14 +137,14 @@ export class IncrementOp extends Op { } export class AddOp extends Op { - _value: Array; + _value: any[]; - constructor(value: any | Array) { + constructor(value: any | any[]) { super(); this._value = Array.isArray(value) ? value : [value]; } - applyTo(value: any): Array { + applyTo(value: any): any[] { if (value == null) { return this._value; } @@ -176,14 +176,14 @@ export class AddOp extends Op { } export class AddUniqueOp extends Op { - _value: Array; + _value: any[]; - constructor(value: any | Array) { + constructor(value: any | any[]) { super(); this._value = unique(Array.isArray(value) ? value : [value]); } - applyTo(value: any | Array): Array { + applyTo(value: any | any[]): any[] { if (value == null) { return this._value || []; } @@ -228,14 +228,14 @@ export class AddUniqueOp extends Op { } export class RemoveOp extends Op { - _value: Array; + _value: any[]; - constructor(value: any | Array) { + constructor(value: any | any[]) { super(); this._value = unique(Array.isArray(value) ? value : [value]); } - applyTo(value: any | Array): Array { + applyTo(value: any | any[]): any[] { if (value == null) { return []; } @@ -299,10 +299,10 @@ export class RemoveOp extends Op { export class RelationOp extends Op { _targetClassName: string | null; - relationsToAdd: Array; - relationsToRemove: Array; + relationsToAdd: string[]; + relationsToRemove: string[]; - constructor(adds: Array, removes: Array) { + constructor(adds: (ParseObject | string)[], removes: (ParseObject | string)[]) { super(); this._targetClassName = null; diff --git a/src/ParsePolygon.ts b/src/ParsePolygon.ts index ced17f2f0..dae45bf54 100644 --- a/src/ParsePolygon.ts +++ b/src/ParsePolygon.ts @@ -27,7 +27,7 @@ class ParsePolygon { /** * @param {(Coordinates | Parse.GeoPoint[])} coordinates An Array of coordinate pairs */ - constructor(coordinates: Coordinates | Array) { + constructor(coordinates: Coordinates | ParseGeoPoint[]) { this._coordinates = ParsePolygon._validate(coordinates); } @@ -42,7 +42,7 @@ class ParsePolygon { return this._coordinates; } - set coordinates(coords: Coordinates | Array) { + set coordinates(coords: Coordinates | ParseGeoPoint[]) { this._coordinates = ParsePolygon._validate(coords); } @@ -136,7 +136,7 @@ class ParsePolygon { * @throws {TypeError} * @returns {number[][]} Array of coordinates if validated. */ - static _validate(coords: Coordinates | Array): Coordinates { + static _validate(coords: Coordinates | ParseGeoPoint[]): Coordinates { if (!Array.isArray(coords)) { throw new TypeError('Coordinates must be an Array'); } diff --git a/src/ParseQuery.ts b/src/ParseQuery.ts index 77a2e3601..43deb0a35 100644 --- a/src/ParseQuery.ts +++ b/src/ParseQuery.ts @@ -16,28 +16,26 @@ type BatchOptions = FullOptions & { useMasterKey?: boolean; useMaintenanceKey?: boolean; sessionToken?: string; - context?: { [key: string]: any }; + context?: Record; json?: boolean; }; -export type WhereClause = { - [attr: string]: any; -}; +export type WhereClause = Record; -type QueryOptions = { +interface QueryOptions { useMasterKey?: boolean; sessionToken?: string; - context?: { [key: string]: any }; + context?: Record; json?: boolean; -}; +} -type FullTextQueryOptions = { +interface FullTextQueryOptions { language?: string; caseSensitive?: boolean; diacriticSensitive?: boolean; -}; +} -export type QueryJSON = { +export interface QueryJSON { where: WhereClause; watch?: string; include?: string; @@ -54,7 +52,7 @@ export type QueryJSON = { includeReadPreference?: string; subqueryReadPreference?: string; comment?: string; -}; +} interface BaseAttributes { createdAt: Date; @@ -83,7 +81,7 @@ function quote(s: string): string { * @private * @returns {string} */ -function _getClassNameFromQueries(queries: Array): string | null { +function _getClassNameFromQueries(queries: ParseQuery[]): string | null { let className: string | null = null; queries.forEach(q => { if (!className) { @@ -102,7 +100,7 @@ function _getClassNameFromQueries(queries: Array): string | null { * making sure that the data object contains keys for all objects that have * been requested with a select, so that our cached state updates correctly. */ -function handleSelectResult(data: any, select: Array) { +function handleSelectResult(data: any, select: string[]) { const serverDataMask = {}; select.forEach(field => { @@ -249,20 +247,20 @@ class ParseQuery { */ className: string; _where: any; - _watch: Array; - _include: Array; - _exclude: Array; - _select: Array; + _watch: string[]; + _include: string[]; + _exclude: string[]; + _select: string[]; _limit: number; _skip: number; _count: boolean; - _order: Array; + _order: string[]; _readPreference: string | null; _includeReadPreference: string | null; _subqueryReadPreference: string | null; _queriesLocalDatastore: boolean; _localDatastorePinName: any; - _extraOptions: { [key: string]: any }; + _extraOptions: Record; _hint: any; _explain: boolean; _xhrRequest: any; @@ -318,7 +316,7 @@ class ParseQuery { * @param {Array} queries * @returns {Parse.Query} Returns the query, so you can chain this call. */ - _orQuery(queries: Array): this { + _orQuery(queries: ParseQuery[]): this { const queryJSON = queries.map(q => { return q.toJSON().where; }); @@ -333,7 +331,7 @@ class ParseQuery { * @param {Array} queries * @returns {Parse.Query} Returns the query, so you can chain this call. */ - _andQuery(queries: Array): this { + _andQuery(queries: ParseQuery[]): this { const queryJSON = queries.map(q => { return q.toJSON().where; }); @@ -348,7 +346,7 @@ class ParseQuery { * @param {Array} queries * @returns {Parse.Query} Returns the query, so you can chain this call. */ - _norQuery(queries: Array): this { + _norQuery(queries: ParseQuery[]): this { const queryJSON = queries.map(q => { return q.toJSON().where; }); @@ -782,29 +780,17 @@ class ParseQuery { * Executes a distinct query and returns unique values * * @param {string} key A field to find distinct values - * @param {object} options - * @param {string} [options.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: K, - options?: { sessionToken?: string } - ): Promise { - options = options || {}; - const distinctOptions: { sessionToken?: string; useMasterKey: boolean } = { - useMasterKey: true, - }; - if (Object.hasOwn(options, 'sessionToken')) { - distinctOptions.sessionToken = options.sessionToken; - } + distinct(key: K): Promise { + const distinctOptions = { useMasterKey: true }; this._setRequestTask(distinctOptions); - - const controller = CoreManager.getQueryController(); const params = { distinct: key, where: this._where, hint: this._hint, }; + const controller = CoreManager.getQueryController(); return controller.aggregate(this.className, params, distinctOptions).then(results => { return results.results!; }); @@ -814,39 +800,28 @@ class ParseQuery { * Executes an aggregate query and returns aggregate results * * @param {(Array|object)} pipeline Array or Object of stages to process query - * @param {object} options - * @param {string} [options.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?: { sessionToken?: string }): Promise> { - options = options || {}; - const aggregateOptions: { sessionToken?: string; useMasterKey: boolean } = { - useMasterKey: true, - }; - if (Object.hasOwn(options, 'sessionToken')) { - aggregateOptions.sessionToken = options.sessionToken; - } - this._setRequestTask(aggregateOptions); - - const controller = CoreManager.getQueryController(); - + aggregate(pipeline: any): Promise { if (!Array.isArray(pipeline) && typeof pipeline !== 'object') { throw new Error('Invalid pipeline must be Array or Object'); } - if (Object.keys(this._where || {}).length) { if (!Array.isArray(pipeline)) { pipeline = [pipeline]; } pipeline.unshift({ $match: this._where }); } - const params = { pipeline, hint: this._hint, explain: this._explain, readPreference: this._readPreference, }; + const aggregateOptions = { useMasterKey: true }; + this._setRequestTask(aggregateOptions); + + const controller = CoreManager.getQueryController(); return controller.aggregate(this.className, params, aggregateOptions).then(results => { return results.results!; }); @@ -1061,7 +1036,7 @@ class ParseQuery { async map( callback: (currentObject: ParseObject, index: number, query: ParseQuery) => any, options?: BatchOptions - ): Promise> { + ): Promise { const array: ParseObject[] = []; let index = 0; await this.each(object => { @@ -1100,7 +1075,7 @@ class ParseQuery { callback: (accumulator: any, currentObject: ParseObject, index: number) => any, initialValue: any, options?: BatchOptions - ): Promise> { + ): Promise { let accumulator = initialValue; let index = 0; await this.each(object => { @@ -1149,7 +1124,7 @@ class ParseQuery { async filter( callback: (currentObject: ParseObject, index: number, query: ParseQuery) => boolean, options?: BatchOptions - ): Promise> { + ): Promise { const array: ParseObject[] = []; let index = 0; await this.each(object => { @@ -1179,7 +1154,7 @@ class ParseQuery { | T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer - : T['attributes'][K] extends Array + : T['attributes'][K] extends (infer E)[] ? E : never) ): this { @@ -1208,7 +1183,7 @@ class ParseQuery { | T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer - : T['attributes'][K] extends Array + : T['attributes'][K] extends (infer E)[] ? E : never) ): this { @@ -1289,7 +1264,7 @@ class ParseQuery { */ containedIn( key: K, - values: Array + values: (T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never))[] ): this { return this._addCondition(key, '$in', values); } @@ -1304,7 +1279,7 @@ class ParseQuery { */ notContainedIn( key: K, - values: Array + values: T['attributes'][K][] ): this { return this._addCondition(key, '$nin', values); } @@ -1319,7 +1294,7 @@ class ParseQuery { */ containedBy( key: K, - values: Array + values: (T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never))[] ): this { return this._addCondition(key, '$containedBy', values); } @@ -1796,7 +1771,7 @@ class ParseQuery { * 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): this { + ascending(...keys: string[]): this { this._order = []; return this.addAscending.apply(this, keys); } @@ -1809,7 +1784,7 @@ class ParseQuery { * 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): this { + addAscending(...keys: string[]): this { if (!this._order) { this._order = []; } @@ -1830,7 +1805,7 @@ class ParseQuery { * 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): this { + descending(...keys: string[]): this { this._order = []; return this.addDescending.apply(this, keys); } @@ -1843,7 +1818,7 @@ class ParseQuery { * 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): this { + addDescending(...keys: string[]): this { if (!this._order) { this._order = []; } @@ -1923,9 +1898,7 @@ class ParseQuery { * @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> - ): this { + include(...keys: (K | K[])[]): this { keys.forEach(key => { if (Array.isArray(key)) { this._include = this._include.concat(key as string[]); @@ -1955,9 +1928,7 @@ class ParseQuery { * @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> - ): this { + select(...keys: (K | K[])[]): this { if (!this._select) { this._select = []; } @@ -1980,9 +1951,7 @@ class ParseQuery { * @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> - ): this { + exclude(...keys: (K | K[])[]): this { keys.forEach(key => { if (Array.isArray(key)) { this._exclude = this._exclude.concat(key as string[]); @@ -2001,9 +1970,7 @@ class ParseQuery { * @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> - ): this { + watch(...keys: (K | K[])[]): this { keys.forEach(key => { if (Array.isArray(key)) { this._watch = this._watch.concat(key as string[]); @@ -2067,7 +2034,7 @@ class ParseQuery { * @static * @returns {Parse.Query} The query that is the OR of the passed in queries. */ - static or(...queries: Array): ParseQuery { + static or(...queries: ParseQuery[]): ParseQuery { const className = _getClassNameFromQueries(queries); const query = new ParseQuery(className!); query._orQuery(queries); @@ -2086,7 +2053,7 @@ class ParseQuery { * @static * @returns {Parse.Query} The query that is the AND of the passed in queries. */ - static and(...queries: Array): ParseQuery { + static and(...queries: ParseQuery[]): ParseQuery { const className = _getClassNameFromQueries(queries); const query = new ParseQuery(className!); query._andQuery(queries); @@ -2105,7 +2072,7 @@ class ParseQuery { * @static * @returns {Parse.Query} The query that is the NOR of the passed in queries. */ - static nor(...queries: Array): ParseQuery { + static nor(...queries: ParseQuery[]): ParseQuery { const className = _getClassNameFromQueries(queries); const query = new ParseQuery(className!); query._norQuery(queries); @@ -2205,16 +2172,12 @@ const DefaultController = { className: string, params: QueryJSON, options?: RequestOptions - ): Promise<{ results: Array }> { + ): Promise<{ results: ParseObject[] }> { const RESTController = CoreManager.getRESTController(); return RESTController.request('GET', 'classes/' + className, params, options); }, - aggregate( - className: string, - params: any, - options?: RequestOptions - ): Promise<{ results: Array }> { + aggregate(className: string, params: any, options?: RequestOptions): Promise<{ results: any[] }> { const RESTController = CoreManager.getRESTController(); return RESTController.request('GET', 'aggregate/' + className, params, options); diff --git a/src/ParseSchema.ts b/src/ParseSchema.ts index 8e849463d..d6884c8c2 100644 --- a/src/ParseSchema.ts +++ b/src/ParseSchema.ts @@ -51,9 +51,7 @@ interface FieldOptions< targetClass?: string | undefined; } -interface Index { - [fieldName: string]: number | string; -} +type Index = Record; interface CLPField { '*'?: boolean | undefined; @@ -71,27 +69,22 @@ interface CLP { addField?: CLPField | undefined; readUserFields?: string[] | undefined; writeUserFields?: string[] | undefined; - protectedFields?: { - [userIdOrRoleName: string]: string[]; - }; + protectedFields?: Record; } interface RestSchema { className: string; - fields: { - [key: string]: { + fields: Record< + string, + { type: string; targetClass?: string; required?: boolean; defaultValue?: string; - }; - }; + } + >; classLevelPermissions: CLP; - indexes?: { - [key: string]: { - [key: string]: any; - }; - }; + indexes?: Record>; } const FIELD_TYPES = [ @@ -128,9 +121,9 @@ const FIELD_TYPES = [ */ class ParseSchema { className: string; - _fields: { [key: string]: any }; - _indexes: { [key: string]: any }; - _clp: { [key: string]: any }; + _fields: Record; + _indexes: Record; + _clp: Record; /** * @param {string} className Parse Class string. diff --git a/src/ParseUser.ts b/src/ParseUser.ts index 730790f4c..5f3b39b76 100644 --- a/src/ParseUser.ts +++ b/src/ParseUser.ts @@ -7,8 +7,8 @@ import Storage from './Storage'; import type { AttributeKey } from './ParseObject'; import type { RequestOptions, FullOptions } from './RESTController'; -export type AuthData = { [key: string]: any }; -export type AuthProvider = { +export type AuthData = Record; +export interface AuthProvider { authenticate?(options: { error?: (provider: AuthProvider, error: string | any) => void; success?: (provider: AuthProvider, result: AuthData) => void; @@ -16,13 +16,13 @@ export type AuthProvider = { restoreAuthentication(authData: any): boolean; getAuthType(): string; deauthenticate?(): void; -}; +} const CURRENT_USER_KEY = 'currentUser'; let canUseCurrentUser = !CoreManager.get('IS_NODE'); let currentUserCacheMatchesDisk = false; let currentUserCache: ParseUser | null = null; -const authProviders: { [key: string]: AuthProvider } = {}; +const authProviders: Record = {}; /** *

A Parse.User object is a local representation of a user persisted to the @@ -478,7 +478,7 @@ class ParseUser extends ParseObject { * @param {...any} args * @returns {Promise} */ - async save(...args: Array): Promise { + async save(...args: any[]): Promise { await super.save.apply(this, args); const current = await this.isCurrentAsync(); if (current) { @@ -494,11 +494,11 @@ class ParseUser extends ParseObject { * @param {...any} args * @returns {Parse.User} */ - async destroy(...args: Array): Promise { + async destroy(...args: any[]): Promise { await super.destroy.apply(this, args); const current = await this.isCurrentAsync(); if (current) { - return CoreManager.getUserController().removeUserFromDisk(); + return CoreManager.getUserController().removeUserFromDisk() as undefined; } return this; } @@ -510,7 +510,7 @@ class ParseUser extends ParseObject { * @param {...any} args * @returns {Parse.User} */ - async fetch(...args: Array): Promise { + async fetch(...args: any[]): Promise { await super.fetch.apply(this, args); const current = await this.isCurrentAsync(); if (current) { @@ -526,7 +526,7 @@ class ParseUser extends ParseObject { * @param {...any} args * @returns {Parse.User} */ - async fetchWithInclude(...args: Array): Promise { + async fetchWithInclude(...args: any[]): Promise { await super.fetchWithInclude.apply(this, args); const current = await this.isCurrentAsync(); if (current) { @@ -562,7 +562,7 @@ class ParseUser extends ParseObject { * @static * @returns {Parse.User} The newly extended Parse.User class */ - static extend(protoProps: { [prop: string]: any }, classProps: { [prop: string]: any }) { + static extend(protoProps: Record, classProps: Record) { if (protoProps) { for (const prop in protoProps) { if (prop !== 'className') { @@ -1015,7 +1015,7 @@ const DefaultController = { }); }, - removeUserFromDisk() { + removeUserFromDisk(): Promise { const path = Storage.generatePath(CURRENT_USER_KEY); currentUserCacheMatchesDisk = true; currentUserCache = null; diff --git a/src/Push.ts b/src/Push.ts index 18059b626..366628e68 100644 --- a/src/Push.ts +++ b/src/Push.ts @@ -5,14 +5,14 @@ import type ParseObject from './ParseObject'; import type { WhereClause } from './ParseQuery'; import type { FullOptions } from './RESTController'; -export type PushData = { +export interface PushData { where?: WhereClause | ParseQuery; push_time?: Date | string; expiration_time?: Date | string; expiration_interval?: number; data?: any; channels?: string[]; -}; +} /** * Contains functions to deal with Push in Parse. diff --git a/src/RESTController.ts b/src/RESTController.ts index c0ea0b272..8185d65af 100644 --- a/src/RESTController.ts +++ b/src/RESTController.ts @@ -5,7 +5,7 @@ import ParseError from './ParseError'; import { resolvingPromise } from './promiseUtils'; import XhrWeapp from './Xhr.weapp'; -export type RequestOptions = { +export interface RequestOptions { useMasterKey?: boolean; useMaintenanceKey?: boolean; sessionToken?: string; @@ -18,9 +18,9 @@ export type RequestOptions = { usePost?: boolean; ignoreEmailVerification?: boolean; transaction?: boolean; -}; +} -export type FullOptions = { +export interface FullOptions { success?: any; error?: any; useMasterKey?: boolean; @@ -29,9 +29,9 @@ export type FullOptions = { installationId?: string; progress?: any; usePost?: boolean; -}; +} -type PayloadType = { +interface PayloadType { _context?: any; _method?: string; _ApplicationId: string; @@ -42,7 +42,7 @@ type PayloadType = { _RevocableSession?: string; _InstallationId?: string; _SessionToken?: string; -}; +} let XHR: any = null; if (typeof XMLHttpRequest !== 'undefined') { diff --git a/src/SingleInstanceStateController.ts b/src/SingleInstanceStateController.ts index 8e78775fb..034056b61 100644 --- a/src/SingleInstanceStateController.ts +++ b/src/SingleInstanceStateController.ts @@ -4,11 +4,7 @@ import type { Op } from './ParseOp'; import type ParseObject from './ParseObject'; import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations'; -let objectState: { - [className: string]: { - [id: string]: State; - }; -} = {}; +let objectState: Record> = {}; export function getState(obj: ParseObject): State | null { const classData = objectState[obj.className]; @@ -55,7 +51,7 @@ export function setServerData(obj: ParseObject, attributes: AttributeMap) { ObjectStateMutations.setServerData(serverData, attributes); } -export function getPendingOps(obj: ParseObject): Array { +export function getPendingOps(obj: ParseObject): OpsMap[] { const state = getState(obj); if (state) { return state.pendingOps; diff --git a/src/Storage.ts b/src/Storage.ts index 45b6ffe43..4e5518710 100644 --- a/src/Storage.ts +++ b/src/Storage.ts @@ -54,7 +54,7 @@ const Storage = { return Promise.resolve(controller.removeItem(path)); }, - getAllKeys(): Array { + getAllKeys(): string[] { const controller = CoreManager.getStorageController(); if (controller.async === 1) { throw new Error('Synchronous storage is not supported by the current storage controller'); @@ -62,7 +62,7 @@ const Storage = { return controller.getAllKeys!(); }, - getAllKeysAsync(): Promise> { + getAllKeysAsync(): Promise { const controller = CoreManager.getStorageController(); if (controller.async === 1) { return controller.getAllKeysAsync!(); diff --git a/src/StorageController.react-native.ts b/src/StorageController.react-native.ts index 375b04799..bce3c6f54 100644 --- a/src/StorageController.react-native.ts +++ b/src/StorageController.react-native.ts @@ -51,7 +51,7 @@ const StorageController = { }); }, - multiGet(keys: Array): Promise { + multiGet(keys: string[]): Promise { return new Promise((resolve, reject) => { CoreManager.getAsyncStorage()!.multiGet(keys, (err, result) => { if (err) { @@ -63,7 +63,7 @@ const StorageController = { }); }, - multiRemove(keys: Array): Promise> { + multiRemove(keys: string[]): Promise { return new Promise((resolve, reject) => { CoreManager.getAsyncStorage()!.multiRemove(keys, err => { if (err) { diff --git a/src/TaskQueue.ts b/src/TaskQueue.ts index 92ed530d6..7816ab7f3 100644 --- a/src/TaskQueue.ts +++ b/src/TaskQueue.ts @@ -1,18 +1,19 @@ import { resolvingPromise } from './promiseUtils'; -type Task = { +interface Task { task: () => Promise; _completion: any; -}; +} class TaskQueue { - queue: Array; + queue: Task[]; constructor() { this.queue = []; } enqueue(task: () => Promise): Promise { + // eslint-disable-next-line const taskComplete = resolvingPromise(); this.queue.push({ task: task, diff --git a/src/UniqueInstanceStateController.ts b/src/UniqueInstanceStateController.ts index 9ad9e4d65..fc7e073d4 100644 --- a/src/UniqueInstanceStateController.ts +++ b/src/UniqueInstanceStateController.ts @@ -53,7 +53,7 @@ export function setServerData(obj: ParseObject, attributes: AttributeMap) { ObjectStateMutations.setServerData(serverData, attributes); } -export function getPendingOps(obj: ParseObject): Array { +export function getPendingOps(obj: ParseObject): OpsMap[] { const state = getState(obj); if (state) { return state.pendingOps; diff --git a/src/__tests__/ParseObject-test.js b/src/__tests__/ParseObject-test.js index 176f6a609..bc439c0e5 100644 --- a/src/__tests__/ParseObject-test.js +++ b/src/__tests__/ParseObject-test.js @@ -3766,11 +3766,7 @@ describe('ParseObject Subclasses', () => { }); it('can use on ParseObject subclass for multiple Parse.Object class names', () => { - class MyParseObjects extends ParseObject { - constructor(className) { - super(className); - } - } + class MyParseObjects extends ParseObject {} ParseObject.registerSubclass('TestObject', MyParseObjects); ParseObject.registerSubclass('TestObject1', MyParseObjects); ParseObject.registerSubclass('TestObject2', MyParseObjects); diff --git a/src/__tests__/ParseQuery-test.js b/src/__tests__/ParseQuery-test.js index 5cad3c1fb..13e793d57 100644 --- a/src/__tests__/ParseQuery-test.js +++ b/src/__tests__/ParseQuery-test.js @@ -2619,7 +2619,6 @@ describe('ParseQuery', () => { }, }); expect(options.useMasterKey).toEqual(true); - expect(options.sessionToken).toEqual('1234'); expect(options.requestTask).toBeDefined(); return Promise.resolve({ results: ['L'], @@ -2629,9 +2628,7 @@ describe('ParseQuery', () => { const q = new ParseQuery('Item'); q.equalTo('size', 'small') - .distinct('size', { - sessionToken: '1234', - }) + .distinct('size') .then(results => { expect(results[0]).toBe('L'); done(); @@ -2651,7 +2648,6 @@ describe('ParseQuery', () => { hint: '_id_', }); expect(options.useMasterKey).toEqual(true); - expect(options.sessionToken).toEqual('1234'); expect(options.requestTask).toBeDefined(); return Promise.resolve({ results: ['L'], @@ -2662,9 +2658,7 @@ describe('ParseQuery', () => { const q = new ParseQuery('Item'); q.equalTo('size', 'small') .hint('_id_') - .distinct('size', { - sessionToken: '1234', - }) + .distinct('size') .then(results => { expect(results[0]).toBe('L'); done(); @@ -2799,7 +2793,6 @@ describe('ParseQuery', () => { expect(className).toBe('Item'); expect(params.pipeline).toEqual([{ group: { objectId: '$name' } }]); expect(options.useMasterKey).toEqual(true); - expect(options.sessionToken).toEqual('1234'); return Promise.resolve({ results: [], }); @@ -2807,9 +2800,7 @@ describe('ParseQuery', () => { }); const q = new ParseQuery('Item'); - q.aggregate(pipeline, { - sessionToken: '1234', - }).then(results => { + q.aggregate(pipeline).then(results => { expect(results).toEqual([]); done(); }); @@ -2831,7 +2822,7 @@ describe('ParseQuery', () => { // Query const q = new ParseQuery('Item'); q.readPreference('SECONDARY'); - const results = await q.aggregate([], { sessionToken: '1234' }); + const results = await q.aggregate([]); // Validate expect(results).toEqual([]); }); @@ -2845,7 +2836,6 @@ describe('ParseQuery', () => { expect(params.pipeline).toEqual([{ group: { objectId: '$name' } }]); expect(params.hint).toEqual('_id_'); expect(options.useMasterKey).toEqual(true); - expect(options.sessionToken).toEqual('1234'); return Promise.resolve({ results: [], }); @@ -2854,9 +2844,7 @@ describe('ParseQuery', () => { const q = new ParseQuery('Item'); q.hint('_id_') - .aggregate(pipeline, { - sessionToken: '1234', - }) + .aggregate(pipeline) .then(results => { expect(results).toEqual([]); done(); diff --git a/src/__tests__/test_helpers/mockXHR.js b/src/__tests__/test_helpers/mockXHR.js index 3b5fd06c0..9ed0a1530 100644 --- a/src/__tests__/test_helpers/mockXHR.js +++ b/src/__tests__/test_helpers/mockXHR.js @@ -6,6 +6,7 @@ * where status is a HTTP status number and result is a JSON object to pass * alongside it. * `upload` can be provided to mock the XMLHttpRequest.upload property. + * @ignore */ function mockXHR(results, options = {}) { const XHR = function () {}; diff --git a/src/arrayContainsObject.ts b/src/arrayContainsObject.ts index 3c4ba6188..d79256ea6 100644 --- a/src/arrayContainsObject.ts +++ b/src/arrayContainsObject.ts @@ -1,7 +1,7 @@ import CoreManager from './CoreManager'; import type ParseObject from './ParseObject'; -export default function arrayContainsObject(array: Array, object: ParseObject): boolean { +export default function arrayContainsObject(array: any[], object: ParseObject): boolean { if (array.indexOf(object) > -1) { return true; } diff --git a/src/encode.ts b/src/encode.ts index e5558400f..a77c477de 100644 --- a/src/encode.ts +++ b/src/encode.ts @@ -9,7 +9,7 @@ function encode( value: any, disallowObjects: boolean, forcePointers: boolean, - seen: Array, + seen: any[], offline: boolean ): any { const ParseObject = CoreManager.getParseObject(); @@ -83,7 +83,7 @@ export default function ( value: any, disallowObjects?: boolean, forcePointers?: boolean, - seen?: Array, + seen?: any[], offline?: boolean ): any { return encode(value, !!disallowObjects, !!forcePointers, seen || [], offline); diff --git a/src/interfaces/react-native.ts b/src/interfaces/react-native.ts index f20af4934..cea1921c4 100644 --- a/src/interfaces/react-native.ts +++ b/src/interfaces/react-native.ts @@ -6,7 +6,7 @@ declare module 'react-native' { static getItem(path: string, cb: (err: string, value: string) => void): void; static setItem(path: string, value: string, cb: (err: string, value: string) => void): void; static removeItem(path: string, cb: (err: string, value: string) => void): void; - static getAllKeys(cb: (err: string, keys: Array) => void): void; + static getAllKeys(cb: (err: string, keys: string[]) => void): void; static clear(): void; } } diff --git a/src/unique.ts b/src/unique.ts index fd31f74bf..84177c9cb 100644 --- a/src/unique.ts +++ b/src/unique.ts @@ -1,7 +1,7 @@ import arrayContainsObject from './arrayContainsObject'; import CoreManager from './CoreManager'; -export default function unique(arr: Array): Array { +export default function unique(arr: T[]): T[] { const uniques: T[] = []; arr.forEach(value => { const ParseObject = CoreManager.getParseObject(); diff --git a/src/unsavedChildren.ts b/src/unsavedChildren.ts index b2619fb9e..851d6dadd 100644 --- a/src/unsavedChildren.ts +++ b/src/unsavedChildren.ts @@ -3,10 +3,10 @@ import ParseFile from './ParseFile'; import type ParseObject from './ParseObject'; import ParseRelation from './ParseRelation'; -type EncounterMap = { - objects: { [identifier: string]: ParseObject | boolean }; - files: Array; -}; +interface EncounterMap { + objects: Record; + files: ParseFile[]; +} /** * Return an array of unsaved children, which are either Parse Objects or Files. @@ -19,7 +19,7 @@ type EncounterMap = { export default function unsavedChildren( obj: ParseObject, allowDeepUnsaved?: boolean -): Array { +): (ParseFile | ParseObject)[] { const encountered = { objects: {}, files: [], diff --git a/types/Analytics.d.ts b/types/Analytics.d.ts index 498c9c912..6a96d9d12 100644 --- a/types/Analytics.d.ts +++ b/types/Analytics.d.ts @@ -37,6 +37,4 @@ * @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; +export declare function track(name: string, dimensions: Record): Promise; diff --git a/types/CoreManager.d.ts b/types/CoreManager.d.ts index 93148d43c..c01c1d4a9 100644 --- a/types/CoreManager.d.ts +++ b/types/CoreManager.d.ts @@ -14,31 +14,25 @@ import type { HookDeclaration, HookDeleteArg } from './ParseHooks'; import type ParseConfig from './ParseConfig'; import type LiveQueryClient from './LiveQueryClient'; import type ParseInstallation from './ParseInstallation'; -type AnalyticsController = { - track: (name: string, dimensions: { - [key: string]: string; - }) => Promise; -}; -type CloudController = { +export interface AnalyticsController { + track: (name: string, dimensions: Record) => Promise; +} +export interface CloudController { run: (name: string, data: any, options?: RequestOptions) => Promise; getJobsData: (options?: RequestOptions) => Promise; /** Returns promise which resolves with JobStatusId of the job */ startJob: (name: string, data: any, options?: RequestOptions) => Promise; -}; -type ConfigController = { +} +export interface ConfigController { current: () => Promise | ParseConfig; get: (opts?: RequestOptions) => Promise; - save: (attrs: { - [key: string]: any; - }, masterKeyOnlyFlags?: { - [key: string]: any; - }) => Promise; -}; -type CryptoController = { + save: (attrs: Record, masterKeyOnlyFlags?: Record) => Promise; +} +export interface CryptoController { encrypt: (obj: any, secretKey: string) => string; decrypt: (encryptedText: string, secretKey: any) => string; -}; -type FileController = { +} +export interface FileController { saveFile: (name: string, source: FileSource, options?: FullOptions) => Promise; saveBase64: (name: string, source: FileSource, options?: FileSaveOptions) => Promise<{ name: string; @@ -51,24 +45,24 @@ type FileController = { deleteFile: (name: string, options?: { useMasterKey?: boolean; }) => Promise; -}; -type InstallationController = { +} +export interface InstallationController { currentInstallationId: () => Promise; currentInstallation: () => Promise; updateInstallationOnDisk: (installation: ParseInstallation) => Promise; -}; -type ObjectController = { - fetch: (object: ParseObject | Array, forceFetch: boolean, options?: RequestOptions) => Promise | ParseObject | undefined>; - save: (object: ParseObject | Array | null, options?: RequestOptions) => Promise | ParseFile | undefined>; - destroy: (object: ParseObject | Array, options?: RequestOptions) => Promise>; -}; -type ObjectStateController = { +} +export interface ObjectController { + fetch: (object: ParseObject | ParseObject[], forceFetch: boolean, options?: RequestOptions) => Promise<(ParseObject | undefined)[] | ParseObject | undefined>; + save: (object: ParseObject | (ParseObject | ParseFile)[] | null, options?: RequestOptions) => Promise; + destroy: (object: ParseObject | ParseObject[], options?: RequestOptions) => Promise; +} +export interface ObjectStateController { getState: (obj: any) => State | null; initializeState: (obj: any, initial?: State) => State; removeState: (obj: any) => State | null; getServerData: (obj: any) => AttributeMap; setServerData: (obj: any, attributes: AttributeMap) => void; - getPendingOps: (obj: any) => Array; + getPendingOps: (obj: any) => OpsMap[]; setPendingOp: (obj: any, attr: string, op?: Op) => void; pushPendingState: (obj: any) => void; popPendingState: (obj: any) => OpsMap | undefined; @@ -80,21 +74,21 @@ type ObjectStateController = { enqueueTask: (obj: any, task: () => Promise) => Promise; clearAllState: () => void; duplicateState: (source: any, dest: any) => void; -}; -type PushController = { +} +export interface PushController { send: (data: PushData, options?: FullOptions) => Promise; -}; -type QueryController = { +} +export interface QueryController { find(className: string, params: QueryJSON, options?: RequestOptions): Promise<{ - results?: Array; + results?: ParseObject[]; className?: string; count?: number; }>; aggregate(className: string, params: any, options?: RequestOptions): Promise<{ - results?: Array; + results?: any[]; }>; -}; -export type QueueObject = { +} +export interface QueueObject { queueId: string; action: string; object: ParseObject; @@ -103,9 +97,9 @@ export type QueueObject = { className: string; hash: string; createdAt: Date; -}; -export type Queue = Array; -export type EventuallyQueue = { +} +export type Queue = QueueObject[]; +export interface EventuallyQueue { save: (object: ParseObject, serverOptions?: SaveOptions) => Promise; destroy: (object: ParseObject, serverOptions?: RequestOptions) => Promise; generateQueueId: (action: string, object: ParseObject) => string; @@ -128,23 +122,23 @@ export type EventuallyQueue = { byId(ObjectType: any, queueObject: any): Promise; byHash(ObjectType: any, queueObject: any): Promise; }; -}; -type RESTController = { +} +export interface RESTController { request: (method: string, path: string, data?: any, options?: RequestOptions) => Promise; ajax: (method: string, url: string, data: any, headers?: any, options?: FullOptions) => Promise; handleError: (err?: any) => void; -}; -type SchemaController = { +} +export interface SchemaController { purge: (className: string) => Promise; get: (className: string, options?: RequestOptions) => Promise; delete: (className: string, options?: RequestOptions) => Promise; create: (className: string, params: any, options?: RequestOptions) => Promise; update: (className: string, params: any, options?: RequestOptions) => Promise; send(className: string, method: string, params: any, options?: RequestOptions): Promise; -}; -type SessionController = { +} +export interface SessionController { getSession: (options?: RequestOptions) => Promise; -}; +} type StorageController = { async: 0; getItem: (path: string) => string | null; @@ -154,8 +148,8 @@ type StorageController = { setItemAsync?: (path: string, value: string) => Promise; removeItemAsync?: (path: string) => Promise; clear: () => void; - getAllKeys?: () => Array; - getAllKeysAsync?: () => Promise>; + getAllKeys?: () => string[]; + getAllKeysAsync?: () => Promise; } | { async: 1; getItem?: (path: string) => string | null; @@ -165,17 +159,17 @@ type StorageController = { setItemAsync: (path: string, value: string) => Promise; removeItemAsync: (path: string) => Promise; clear: () => void; - getAllKeys?: () => Array; - getAllKeysAsync?: () => Promise>; + getAllKeys?: () => string[]; + getAllKeysAsync?: () => Promise; }; -type LocalDatastoreController = { +export interface LocalDatastoreController { fromPinWithName: (name: string) => any | undefined; pinWithName: (name: string, objects: any) => void; unPinWithName: (name: string) => void; getAllContents: () => any | undefined; clear: () => void; -}; -type UserController = { +} +export interface UserController { setCurrentUser: (user: ParseUser) => Promise; currentUser: () => ParseUser | null; currentUserAsync: () => Promise; @@ -190,24 +184,24 @@ type UserController = { updateUserOnDisk: (user: ParseUser) => Promise; upgradeToRevocableSession: (user: ParseUser, options?: RequestOptions) => Promise; linkWith: (user: ParseUser, authData: AuthData, options?: FullOptions) => Promise; - removeUserFromDisk: () => Promise; + removeUserFromDisk: () => Promise; verifyPassword: (username: string, password: string, options?: RequestOptions) => Promise; requestEmailVerification: (email: string, options?: RequestOptions) => Promise; -}; -type HooksController = { +} +export interface HooksController { get: (type: string, functionName?: string, triggerName?: string) => Promise; create: (hook: HookDeclaration) => Promise; remove: (hook: HookDeleteArg) => Promise; update: (hook: HookDeclaration) => Promise; sendRequest?: (method: string, path: string, body?: any) => Promise; -}; -type LiveQueryControllerType = { +} +export interface LiveQueryControllerType { setDefaultLiveQueryClient(liveQueryClient: LiveQueryClient): void; getDefaultLiveQueryClient(): Promise; _clearCachedDefaultClient(): void; -}; +} /** Based on https://github.com/react-native-async-storage/async-storage/blob/main/packages/default-storage-backend/src/types.ts */ -type AsyncStorageType = { +export interface AsyncStorageType { /** Fetches an item for a `key` and invokes a callback upon completion. */ getItem: (key: string, callback?: (error?: Error | null, result?: string | null) => void) => Promise; /** Sets the value for a `key` and invokes a callback upon completion. */ @@ -250,15 +244,15 @@ type AsyncStorageType = { * See https://react-native-async-storage.github.io/async-storage/docs/api#multimerge */ multiMerge: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise; -}; -export type WebSocketController = { +} +export interface WebSocketController { onopen: () => void; onmessage: (message: any) => void; onclose: (arg?: any) => void; onerror: (error: any) => void; send: (data: any) => void; close: () => void; -}; +} declare const CoreManager: { get: (key: string) => any; set: (key: string, value: any) => void; diff --git a/types/LocalDatastore.d.ts b/types/LocalDatastore.d.ts index d6f795de0..c431fb44f 100644 --- a/types/LocalDatastore.d.ts +++ b/types/LocalDatastore.d.ts @@ -22,14 +22,14 @@ import type ParseObject from './ParseObject'; declare const LocalDatastore: { isEnabled: boolean; isSyncing: boolean; - fromPinWithName(name: string): Promise>; + fromPinWithName(name: string): Promise; pinWithName(name: string, value: any): Promise; unPinWithName(name: string): Promise; _getAllContents(): Promise; _getRawStorage(): Promise; _clear(): Promise; - _handlePinAllWithName(name: string, objects: Array): Promise; - _handleUnPinAllWithName(name: string, objects: Array): Promise; + _handlePinAllWithName(name: string, objects: ParseObject[]): Promise; + _handleUnPinAllWithName(name: string, objects: ParseObject[]): Promise; _getChildren(object: ParseObject): any; _traverse(object: any, encountered: any): void; _serializeObjectsFromPinName(name: string): Promise; diff --git a/types/LocalDatastoreController.default.d.ts b/types/LocalDatastoreController.default.d.ts index 14416a1b7..e7c76a72b 100644 --- a/types/LocalDatastoreController.default.d.ts +++ b/types/LocalDatastoreController.default.d.ts @@ -1,5 +1,5 @@ declare const LocalDatastoreController: { - fromPinWithName(name: string): Promise>; + fromPinWithName(name: string): Promise; pinWithName(name: string, value: any): Promise; unPinWithName(name: string): Promise; getAllContents(): Promise; diff --git a/types/LocalDatastoreController.react-native.d.ts b/types/LocalDatastoreController.react-native.d.ts index 2db09d794..6a6c0c2d4 100644 --- a/types/LocalDatastoreController.react-native.d.ts +++ b/types/LocalDatastoreController.react-native.d.ts @@ -1,5 +1,5 @@ declare const LocalDatastoreController: { - fromPinWithName(name: string): Promise>; + fromPinWithName(name: string): Promise; pinWithName(name: string, value: any): Promise; unPinWithName(name: string): Promise; getAllContents(): Promise; diff --git a/types/ObjectStateMutations.d.ts b/types/ObjectStateMutations.d.ts index 7a2086d80..b026ef277 100644 --- a/types/ObjectStateMutations.d.ts +++ b/types/ObjectStateMutations.d.ts @@ -1,28 +1,22 @@ import TaskQueue from './TaskQueue'; import type { Op } from './ParseOp'; import type ParseObject from './ParseObject'; -export type AttributeMap = { - [attr: string]: any; -}; -export type OpsMap = { - [attr: string]: Op; -}; -export type ObjectCache = { - [attr: string]: string; -}; -export type State = { +export type AttributeMap = Record; +export type OpsMap = Record; +export type ObjectCache = Record; +export interface State { serverData: AttributeMap; - pendingOps: Array; + pendingOps: OpsMap[]; 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; -export declare function mergeFirstPendingState(pendingOps: Array): void; -export declare function estimateAttribute(serverData: AttributeMap, pendingOps: Array, object: ParseObject, attr: string): any; -export declare function estimateAttributes(serverData: AttributeMap, pendingOps: Array, object: ParseObject): AttributeMap; +export declare function setPendingOp(pendingOps: OpsMap[], attr: string, op?: Op): void; +export declare function pushPendingState(pendingOps: OpsMap[]): void; +export declare function popPendingState(pendingOps: OpsMap[]): OpsMap; +export declare function mergeFirstPendingState(pendingOps: OpsMap[]): void; +export declare function estimateAttribute(serverData: AttributeMap, pendingOps: OpsMap[], object: ParseObject, attr: string): any; +export declare function estimateAttributes(serverData: AttributeMap, pendingOps: OpsMap[], object: ParseObject): AttributeMap; export declare function commitServerChanges(serverData: AttributeMap, objectCache: ObjectCache, changes: AttributeMap): void; diff --git a/types/Parse.d.ts b/types/Parse.d.ts index cefbc562f..8eb283059 100644 --- a/types/Parse.d.ts +++ b/types/Parse.d.ts @@ -6,7 +6,6 @@ import CLP from './ParseCLP'; import Config from './ParseConfig'; import ParseError from './ParseError'; import File from './ParseFile'; -import * as Hooks from './ParseHooks'; import GeoPoint from './ParseGeoPoint'; import Polygon from './ParsePolygon'; import Installation from './ParseInstallation'; @@ -45,208 +44,38 @@ declare const Parse: { get: (key: string) => any; set: (key: string, value: any) => void; setIfNeeded: (key: string, value: any) => any; - setAnalyticsController(controller: { - track: (name: string, dimensions: { - [key: string]: string; - }) => Promise; - }): void; - getAnalyticsController(): { - track: (name: string, dimensions: { - [key: string]: string; - }) => Promise; - }; - setCloudController(controller: { - run: (name: string, data: any, options?: import("./RESTController").RequestOptions) => Promise; - getJobsData: (options?: import("./RESTController").RequestOptions) => Promise; - startJob: (name: string, data: any, options?: import("./RESTController").RequestOptions) => Promise; - }): void; - getCloudController(): { - run: (name: string, data: any, options?: import("./RESTController").RequestOptions) => Promise; - getJobsData: (options?: import("./RESTController").RequestOptions) => Promise; - startJob: (name: string, data: any, options?: import("./RESTController").RequestOptions) => Promise; - }; - setConfigController(controller: { - current: () => Promise | Config; - get: (opts?: import("./RESTController").RequestOptions) => Promise; - save: (attrs: { - [key: string]: any; - }, masterKeyOnlyFlags?: { - [key: string]: any; - }) => Promise; - }): void; - getConfigController(): { - current: () => Promise | Config; - get: (opts?: import("./RESTController").RequestOptions) => Promise; - save: (attrs: { - [key: string]: any; - }, masterKeyOnlyFlags?: { - [key: string]: any; - }) => Promise; - }; - setCryptoController(controller: { - encrypt: (obj: any, secretKey: string) => string; - decrypt: (encryptedText: string, secretKey: any) => string; - }): void; - getCryptoController(): { - encrypt: (obj: any, secretKey: string) => string; - decrypt: (encryptedText: string, secretKey: any) => string; - }; + setAnalyticsController(controller: import("./CoreManager").AnalyticsController): void; + getAnalyticsController(): import("./CoreManager").AnalyticsController; + setCloudController(controller: import("./CoreManager").CloudController): void; + getCloudController(): import("./CoreManager").CloudController; + setConfigController(controller: import("./CoreManager").ConfigController): void; + getConfigController(): import("./CoreManager").ConfigController; + setCryptoController(controller: import("./CoreManager").CryptoController): void; + getCryptoController(): import("./CoreManager").CryptoController; setEventEmitter(eventEmitter: any): void; getEventEmitter(): any; - setFileController(controller: { - saveFile: (name: string, source: import("./ParseFile").FileSource, options?: import("./RESTController").FullOptions) => Promise; - saveBase64: (name: string, source: import("./ParseFile").FileSource, options?: import("./ParseFile").FileSaveOptions) => Promise<{ - name: string; - url: string; - }>; - download: (uri: string, options?: any) => Promise<{ - base64?: string; - contentType?: string; - }>; - deleteFile: (name: string, options?: { - useMasterKey?: boolean; - }) => Promise; - }): void; + setFileController(controller: import("./CoreManager").FileController): void; setEventuallyQueue(controller: EventuallyQueue): void; getEventuallyQueue(): EventuallyQueue; - getFileController(): { - saveFile: (name: string, source: import("./ParseFile").FileSource, options?: import("./RESTController").FullOptions) => Promise; - saveBase64: (name: string, source: import("./ParseFile").FileSource, options?: import("./ParseFile").FileSaveOptions) => Promise<{ - name: string; - url: string; - }>; - download: (uri: string, options?: any) => Promise<{ - base64?: string; - contentType?: string; - }>; - deleteFile: (name: string, options?: { - useMasterKey?: boolean; - }) => Promise; - }; - setInstallationController(controller: { - currentInstallationId: () => Promise; - currentInstallation: () => Promise; - updateInstallationOnDisk: (installation: Installation) => Promise; - }): void; - getInstallationController(): { - currentInstallationId: () => Promise; - currentInstallation: () => Promise; - updateInstallationOnDisk: (installation: Installation) => Promise; - }; + getFileController(): import("./CoreManager").FileController; + setInstallationController(controller: import("./CoreManager").InstallationController): void; + getInstallationController(): import("./CoreManager").InstallationController; setLiveQuery(liveQuery: any): void; getLiveQuery(): any; - setObjectController(controller: { - fetch: (object: ParseObject | Array, forceFetch: boolean, options?: import("./RESTController").RequestOptions) => Promise | ParseObject | undefined>; - save: (object: ParseObject | Array | null, options?: import("./RESTController").RequestOptions) => Promise | File | undefined>; - destroy: (object: ParseObject | Array, options?: import("./RESTController").RequestOptions) => Promise>; - }): void; - getObjectController(): { - fetch: (object: ParseObject | Array, forceFetch: boolean, options?: import("./RESTController").RequestOptions) => Promise | ParseObject | undefined>; - save: (object: ParseObject | Array | null, options?: import("./RESTController").RequestOptions) => Promise | File | undefined>; - destroy: (object: ParseObject | Array, options?: import("./RESTController").RequestOptions) => Promise>; - }; - setObjectStateController(controller: { - getState: (obj: any) => import("./ObjectStateMutations").State | null; - initializeState: (obj: any, initial?: import("./ObjectStateMutations").State) => import("./ObjectStateMutations").State; - removeState: (obj: any) => import("./ObjectStateMutations").State | null; - getServerData: (obj: any) => import("./ObjectStateMutations").AttributeMap; - setServerData: (obj: any, attributes: import("./ObjectStateMutations").AttributeMap) => void; - getPendingOps: (obj: any) => Array; - setPendingOp: (obj: any, attr: string, op?: ParseOp.Op) => void; - pushPendingState: (obj: any) => void; - popPendingState: (obj: any) => import("./ObjectStateMutations").OpsMap | undefined; - mergeFirstPendingState: (obj: any) => void; - getObjectCache: (obj: any) => import("./ObjectStateMutations").ObjectCache; - estimateAttribute: (obj: any, attr: string) => any; - estimateAttributes: (obj: any) => import("./ObjectStateMutations").AttributeMap; - commitServerChanges: (obj: any, changes: import("./ObjectStateMutations").AttributeMap) => void; - enqueueTask: (obj: any, task: () => Promise) => Promise; - clearAllState: () => void; - duplicateState: (source: any, dest: any) => void; - }): void; - getObjectStateController(): { - getState: (obj: any) => import("./ObjectStateMutations").State | null; - initializeState: (obj: any, initial?: import("./ObjectStateMutations").State) => import("./ObjectStateMutations").State; - removeState: (obj: any) => import("./ObjectStateMutations").State | null; - getServerData: (obj: any) => import("./ObjectStateMutations").AttributeMap; - setServerData: (obj: any, attributes: import("./ObjectStateMutations").AttributeMap) => void; - getPendingOps: (obj: any) => Array; - setPendingOp: (obj: any, attr: string, op?: ParseOp.Op) => void; - pushPendingState: (obj: any) => void; - popPendingState: (obj: any) => import("./ObjectStateMutations").OpsMap | undefined; - mergeFirstPendingState: (obj: any) => void; - getObjectCache: (obj: any) => import("./ObjectStateMutations").ObjectCache; - estimateAttribute: (obj: any, attr: string) => any; - estimateAttributes: (obj: any) => import("./ObjectStateMutations").AttributeMap; - commitServerChanges: (obj: any, changes: import("./ObjectStateMutations").AttributeMap) => void; - enqueueTask: (obj: any, task: () => Promise) => Promise; - clearAllState: () => void; - duplicateState: (source: any, dest: any) => void; - }; - setPushController(controller: { - send: (data: Push.PushData, options?: import("./RESTController").FullOptions) => Promise; - }): void; - getPushController(): { - send: (data: Push.PushData, options?: import("./RESTController").FullOptions) => Promise; - }; - setQueryController(controller: { - find(className: string, params: import("./ParseQuery").QueryJSON, options?: import("./RESTController").RequestOptions): Promise<{ - results?: Array; - className?: string; - count?: number; - }>; - aggregate(className: string, params: any, options?: import("./RESTController").RequestOptions): Promise<{ - results?: Array; - }>; - }): void; - getQueryController(): { - find(className: string, params: import("./ParseQuery").QueryJSON, options?: import("./RESTController").RequestOptions): Promise<{ - results?: Array; - className?: string; - count?: number; - }>; - aggregate(className: string, params: any, options?: import("./RESTController").RequestOptions): Promise<{ - results?: Array; - }>; - }; - setRESTController(controller: { - request: (method: string, path: string, data?: any, options?: import("./RESTController").RequestOptions) => Promise; - ajax: (method: string, url: string, data: any, headers?: any, options?: import("./RESTController").FullOptions) => Promise; - handleError: (err?: any) => void; - }): void; - getRESTController(): { - request: (method: string, path: string, data?: any, options?: import("./RESTController").RequestOptions) => Promise; - ajax: (method: string, url: string, data: any, headers?: any, options?: import("./RESTController").FullOptions) => Promise; - handleError: (err?: any) => void; - }; - setSchemaController(controller: { - purge: (className: string) => Promise; - get: (className: string, options?: import("./RESTController").RequestOptions) => Promise; - delete: (className: string, options?: import("./RESTController").RequestOptions) => Promise; - create: (className: string, params: any, options? /** - * @member {string} Parse.maintenanceKey - * @static - */: import("./RESTController").RequestOptions) => Promise; - update: (className: string, params: any, options?: import("./RESTController").RequestOptions) => Promise; - send(className: string, method: string, params: any, options?: import("./RESTController").RequestOptions): Promise; - }): void; - getSchemaController(): { - purge: (className: string) => Promise; - get: (className: string, options?: import("./RESTController").RequestOptions) => Promise; - delete: (className: string, options?: import("./RESTController").RequestOptions) => Promise; - create: (className: string, params: any, options? /** - * @member {string} Parse.maintenanceKey - * @static - */: import("./RESTController").RequestOptions) => Promise; - update: (className: string, params: any, options?: import("./RESTController").RequestOptions) => Promise; - send(className: string, method: string, params: any, options?: import("./RESTController").RequestOptions): Promise; - }; - setSessionController(controller: { - getSession: (options?: import("./RESTController").RequestOptions) => Promise; - }): void; - getSessionController(): { - getSession: (options?: import("./RESTController").RequestOptions) => Promise; - }; + setObjectController(controller: import("./CoreManager").ObjectController): void; + getObjectController(): import("./CoreManager").ObjectController; + setObjectStateController(controller: import("./CoreManager").ObjectStateController): void; + getObjectStateController(): import("./CoreManager").ObjectStateController; + setPushController(controller: import("./CoreManager").PushController): void; + getPushController(): import("./CoreManager").PushController; + setQueryController(controller: import("./CoreManager").QueryController): void; + getQueryController(): import("./CoreManager").QueryController; + setRESTController(controller: import("./CoreManager").RESTController): void; + getRESTController(): import("./CoreManager").RESTController; + setSchemaController(controller: import("./CoreManager").SchemaController): void; + getSchemaController(): import("./CoreManager").SchemaController; + setSessionController(controller: import("./CoreManager").SessionController): void; + getSessionController(): import("./CoreManager").SessionController; setStorageController(controller: { async: 0; getItem: (path: string) => string | null; @@ -256,8 +85,8 @@ declare const Parse: { setItemAsync?: (path: string, value: string) => Promise; removeItemAsync?: (path: string) => Promise; clear: () => void; - getAllKeys?: () => Array; - getAllKeysAsync?: () => Promise>; + getAllKeys?: () => string[]; + getAllKeysAsync?: () => Promise; } | { async: 1; getItem?: (path: string) => string | null; @@ -267,23 +96,11 @@ declare const Parse: { setItemAsync: (path: string, value: string) => Promise; removeItemAsync: (path: string) => Promise; clear: () => void; - getAllKeys?: () => Array; - getAllKeysAsync?: () => Promise>; + getAllKeys?: () => string[]; + getAllKeysAsync?: () => Promise; }): void; - setLocalDatastoreController(controller: { - fromPinWithName: (name: string) => any | undefined; - pinWithName: (name: string, objects: any) => void; - unPinWithName: (name: string) => void; - getAllContents: () => any | undefined; - clear: () => void; - }): void; - getLocalDatastoreController(): { - fromPinWithName: (name: string) => any | undefined; - pinWithName: (name: string, objects: any) => void; - unPinWithName: (name: string) => void; - getAllContents: () => any | undefined; - clear: () => void; - }; + setLocalDatastoreController(controller: import("./CoreManager").LocalDatastoreController): void; + getLocalDatastoreController(): import("./CoreManager").LocalDatastoreController; setLocalDatastore(store: any): void; getLocalDatastore(): any; getStorageController(): { @@ -295,8 +112,8 @@ declare const Parse: { setItemAsync?: (path: string, value: string) => Promise; removeItemAsync?: (path: string) => Promise; clear: () => void; - getAllKeys?: () => Array; - getAllKeysAsync?: () => Promise>; + getAllKeys?: () => string[]; + getAllKeysAsync?: () => Promise; } | { async: 1; getItem?: (path: string) => string | null; @@ -306,97 +123,19 @@ declare const Parse: { setItemAsync: (path: string, value: string) => Promise; removeItemAsync: (path: string) => Promise; clear: () => void; - getAllKeys?: () => Array; - getAllKeysAsync?: () => Promise>; - }; - setAsyncStorage(storage: { - getItem: (key: string, callback?: (error?: Error | null, result?: string | null) => void) => Promise; - setItem: (key: string, value: string, callback?: (error?: Error | null) => void) => Promise; - removeItem: (key: string, callback?: (error?: Error | null) => void) => Promise; - mergeItem: (key: string, value: string, callback?: (error?: Error | null) => void) => Promise; - clear: (callback?: (error?: Error | null) => void) => Promise; - getAllKeys: (callback?: (error?: Error | null, result?: readonly string[] | null) => void) => Promise; - multiGet: (keys: readonly string[], callback?: (errors?: readonly (Error | null)[] | null, result?: readonly [string, string][]) => void) => Promise; - multiSet: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise; - multiRemove: (keys: readonly string[], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise; - multiMerge: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise; - }): void; - getAsyncStorage(): { - getItem: (key: string, callback?: (error?: Error | null, result?: string | null) => void) => Promise; - setItem: (key: string, value: string, callback?: (error?: Error | null) => void) => Promise; - removeItem: (key: string, callback?: (error?: Error | null) => void) => Promise; - mergeItem: (key: string, value: string, callback?: (error?: Error | null) => void) => Promise; - clear: (callback?: (error?: Error | null) => void) => Promise; - getAllKeys: (callback?: (error?: Error | null, result?: readonly string[] | null) => void) => Promise; - multiGet: (keys: readonly string[], callback?: (errors?: readonly (Error | null)[] | null, result?: readonly [string, string][]) => void) => Promise; - multiSet: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise; - multiRemove: (keys: readonly string[], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise; - multiMerge: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise; + getAllKeys?: () => string[]; + getAllKeysAsync?: () => Promise; }; + setAsyncStorage(storage: import("./CoreManager").AsyncStorageType): void; + getAsyncStorage(): import("./CoreManager").AsyncStorageType; setWebSocketController(controller: new (url: string | URL, protocols?: string | string[] | undefined) => import("./CoreManager").WebSocketController): void; getWebSocketController(): new (url: string | URL, protocols?: string | string[] | undefined) => import("./CoreManager").WebSocketController; - setUserController(controller: { - setCurrentUser: (user: User) => Promise; - currentUser: () => User | null; - currentUserAsync: () => Promise; - signUp: (user: User, attrs: import("./ObjectStateMutations").AttributeMap, options?: import("./RESTController").RequestOptions) => Promise; - logIn: (user: User, options?: import("./RESTController").RequestOptions) => Promise; - loginAs: (user: User, userId: string) => Promise; - become: (user: User, options?: import("./RESTController").RequestOptions) => Promise; - hydrate: (user: User, userJSON: import("./ObjectStateMutations").AttributeMap) => Promise; - logOut: (options?: import("./RESTController").RequestOptions) => Promise; - me: (user: User, options?: import("./RESTController").RequestOptions) => Promise; - requestPasswordReset: (email: string, options?: import("./RESTController").RequestOptions) => Promise; - updateUserOnDisk: (user: User) => Promise; - upgradeToRevocableSession: (user: User, options?: import("./RESTController").RequestOptions) => Promise; - linkWith: (user: User, authData: import("./ParseUser").AuthData, options?: import("./RESTController").FullOptions) => Promise; - removeUserFromDisk: () => Promise; - verifyPassword: (username: string, password: string, options?: import("./RESTController").RequestOptions) => Promise; - requestEmailVerification: (email: string, options?: import("./RESTController").RequestOptions) => Promise; - }): void; - getUserController(): { - setCurrentUser: (user: User) => Promise; - currentUser: () => User | null; - currentUserAsync: () => Promise; - signUp: (user: User, attrs: import("./ObjectStateMutations").AttributeMap, options?: import("./RESTController").RequestOptions) => Promise; - logIn: (user: User, options?: import("./RESTController").RequestOptions) => Promise; - loginAs: (user: User, userId: string) => Promise; - become: (user: User, options?: import("./RESTController").RequestOptions) => Promise; - hydrate: (user: User, userJSON: import("./ObjectStateMutations").AttributeMap) => Promise; - logOut: (options?: import("./RESTController").RequestOptions) => Promise; - me: (user: User, options?: import("./RESTController").RequestOptions) => Promise; - requestPasswordReset: (email: string, options?: import("./RESTController").RequestOptions) => Promise; - updateUserOnDisk: (user: User) => Promise; - upgradeToRevocableSession: (user: User, options?: import("./RESTController").RequestOptions) => Promise; - linkWith: (user: User, authData: import("./ParseUser").AuthData, options?: import("./RESTController").FullOptions) => Promise; - removeUserFromDisk: () => Promise; - verifyPassword: (username: string, password: string, options?: import("./RESTController").RequestOptions) => Promise; - requestEmailVerification: (email: string, options?: import("./RESTController").RequestOptions) => Promise; - }; - setLiveQueryController(controller: { - setDefaultLiveQueryClient(liveQueryClient: LiveQueryClient): void; - getDefaultLiveQueryClient(): Promise; - _clearCachedDefaultClient(): void; - }): void; - getLiveQueryController(): { - setDefaultLiveQueryClient(liveQueryClient: LiveQueryClient): void; - getDefaultLiveQueryClient(): Promise; - _clearCachedDefaultClient(): void; - }; - setHooksController(controller: { - get: (type: string, functionName?: string, triggerName?: string) => Promise; - create: (hook: Hooks.HookDeclaration) => Promise; - remove: (hook: Hooks.HookDeleteArg) => Promise; - update: (hook: Hooks.HookDeclaration) => Promise; - sendRequest?: (method: string, path: string, body?: any) => Promise; - }): void; - getHooksController(): { - get: (type: string, functionName?: string, triggerName?: string) => Promise; - create: (hook: Hooks.HookDeclaration) => Promise; - remove: (hook: Hooks.HookDeleteArg) => Promise; - update: (hook: Hooks.HookDeclaration) => Promise; - sendRequest?: (method: string, path: string, body?: any) => Promise; - }; + setUserController(controller: import("./CoreManager").UserController): void; + getUserController(): import("./CoreManager").UserController; + setLiveQueryController(controller: import("./CoreManager").LiveQueryControllerType): void; + getLiveQueryController(): import("./CoreManager").LiveQueryControllerType; + setHooksController(controller: import("./CoreManager").HooksController): void; + getHooksController(): import("./CoreManager").HooksController; setParseOp(op: any): void; getParseOp(): any; setParseObject(object: any): void; @@ -425,14 +164,14 @@ declare const Parse: { LocalDatastore: { isEnabled: boolean; isSyncing: boolean; - fromPinWithName(name: string): Promise>; + fromPinWithName(name: string): Promise; pinWithName(name: string, value: any): Promise; unPinWithName(name: string): Promise; _getAllContents(): Promise; _getRawStorage(): Promise; _clear(): Promise; - _handlePinAllWithName(name: string, objects: Array): Promise; - _handleUnPinAllWithName(name: string, objects: Array): Promise; + _handlePinAllWithName(name: string, objects: ParseObject[]): Promise; + _handleUnPinAllWithName(name: string, objects: ParseObject[]): Promise; _getChildren(object: ParseObject): any; _traverse(object: any, encountered: any): void; _serializeObjectsFromPinName(name: string): Promise; @@ -469,8 +208,8 @@ declare const Parse: { setItemAsync(path: string, value: string): Promise; removeItem(path: string): void; removeItemAsync(path: string): Promise; - getAllKeys(): Array; - getAllKeysAsync(): Promise>; + getAllKeys(): string[]; + getAllKeysAsync(): Promise; generatePath(path: string): string; _clear(): void; }; @@ -480,7 +219,7 @@ declare const Parse: { Hooks: any; Parse: any; /** - * @member {EventuallyQueue} Parse.EventuallyQueue + * @property {EventuallyQueue} Parse.EventuallyQueue * @static */ EventuallyQueue: EventuallyQueue; @@ -519,67 +258,67 @@ declare const Parse: { */ getServerHealth(): Promise; /** - * @member {string} Parse.applicationId + * @property {string} Parse.applicationId * @static */ applicationId: any; /** - * @member {string} Parse.javaScriptKey + * @property {string} Parse.javaScriptKey * @static */ javaScriptKey: any; /** - * @member {string} Parse.masterKey + * @property {string} Parse.masterKey * @static */ masterKey: any; /** - * @member {string} Parse.maintenanceKey + * @property {string} Parse.maintenanceKey * @static */ maintenanceKey: any; /** - * @member {string} Parse.serverURL + * @property {string} Parse.serverURL * @static */ serverURL: any; /** - * @member {string} Parse.serverAuthToken + * @property {string} Parse.serverAuthToken * @static */ serverAuthToken: any; /** - * @member {string} Parse.serverAuthType + * @property {string} Parse.serverAuthType * @static */ serverAuthType: any; /** - * @member {ParseLiveQuery} Parse.LiveQuery + * @property {ParseLiveQuery} Parse.LiveQuery * @static */ LiveQuery: ParseLiveQuery; /** - * @member {string} Parse.liveQueryServerURL + * @property {string} Parse.liveQueryServerURL * @static */ liveQueryServerURL: any; /** - * @member {boolean} Parse.encryptedUser + * @property {boolean} Parse.encryptedUser * @static */ encryptedUser: boolean; /** - * @member {string} Parse.secret + * @property {string} Parse.secret * @static */ secret: any; /** - * @member {boolean} Parse.idempotency + * @property {boolean} Parse.idempotency * @static */ idempotency: any; /** - * @member {boolean} Parse.allowCustomObjectId + * @property {boolean} Parse.allowCustomObjectId * @static */ allowCustomObjectId: any; diff --git a/types/ParseACL.d.ts b/types/ParseACL.d.ts index 124f27d10..95acc6f41 100644 --- a/types/ParseACL.d.ts +++ b/types/ParseACL.d.ts @@ -1,11 +1,7 @@ import type ParseRole from './ParseRole'; import type ParseUser from './ParseUser'; -type PermissionsMap = { - [permission: string]: boolean; -}; -type ByIdMap = { - [userId: string]: PermissionsMap; -}; +type PermissionsMap = Record; +type ByIdMap = Record; /** * Creates a new ACL. * If no argument is given, the ACL has no permissions for anyone. diff --git a/types/ParseCLP.d.ts b/types/ParseCLP.d.ts index eaa7d6b26..d9133d510 100644 --- a/types/ParseCLP.d.ts +++ b/types/ParseCLP.d.ts @@ -1,15 +1,11 @@ import ParseRole from './ParseRole'; import ParseUser from './ParseUser'; type Entity = ParseUser | ParseRole | string; -type UsersMap = { - [userId: string]: boolean | any; -}; +type UsersMap = Record; export type PermissionsMap = { writeUserFields?: string[]; readUserFields?: string[]; -} & { - [permission: string]: UsersMap; -}; +} & Record; /** * Creates a new CLP. * If no argument is given, the CLP has no permissions for anyone. diff --git a/types/ParseConfig.d.ts b/types/ParseConfig.d.ts index cfd77f36d..73fd385e3 100644 --- a/types/ParseConfig.d.ts +++ b/types/ParseConfig.d.ts @@ -6,12 +6,8 @@ import type { RequestOptions } from './RESTController'; * @alias Parse.Config */ declare class ParseConfig { - attributes: { - [key: string]: any; - }; - _escapedAttributes: { - [key: string]: any; - }; + attributes: Record; + _escapedAttributes: Record; constructor(); /** * Gets the value of an attribute. @@ -62,11 +58,7 @@ declare class ParseConfig { * @returns {Promise} A promise that is resolved with a newly-created * configuration object or with the current with the update. */ - static save(attrs: { - [key: string]: any; - }, masterKeyOnlyFlags: { - [key: string]: any; - }): Promise; + static save(attrs: Record, masterKeyOnlyFlags: Record): Promise; /** * Used for testing * diff --git a/types/ParseFile.d.ts b/types/ParseFile.d.ts index da9c7e48e..a79b3dcf7 100644 --- a/types/ParseFile.d.ts +++ b/types/ParseFile.d.ts @@ -1,18 +1,14 @@ import type { FullOptions } from './RESTController'; -type Base64 = { +interface Base64 { base64: string; -}; -type Uri = { +} +interface Uri { uri: string; -}; -type FileData = Array | Base64 | Blob | Uri; +} +type FileData = number[] | Base64 | Blob | Uri; export type FileSaveOptions = FullOptions & { - metadata?: { - [key: string]: any; - }; - tags?: { - [key: string]: any; - }; + metadata?: Record; + tags?: Record; }; export type FileSource = { format: 'file'; @@ -187,6 +183,6 @@ declare class ParseFile { */ addTag(key: string, value: string): void; static fromJSON(obj: any): ParseFile; - static encodeBase64(bytes: Array | Uint8Array): string; + static encodeBase64(bytes: number[] | Uint8Array): string; } export default ParseFile; diff --git a/types/ParseInstallation.d.ts b/types/ParseInstallation.d.ts index 402245a50..45096398d 100644 --- a/types/ParseInstallation.d.ts +++ b/types/ParseInstallation.d.ts @@ -1,12 +1,12 @@ import ParseObject, { Attributes } from './ParseObject'; -type DeviceInterface = { +interface DeviceInterface { IOS: string; MACOS: string; TVOS: string; FCM: string; ANDROID: string; WEB: string; -}; +} /** * Parse.Installation is a local representation of installation data that can be saved and retrieved from 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 installation-specific features. @@ -153,7 +153,7 @@ declare class ParseInstallation extends Parse * @param {...any} args * @returns {Promise} */ - fetch(...args: Array): Promise; + fetch(...args: any[]): Promise; /** * Wrap the default save behavior with functionality to update the local storage. * If the installation is deleted on the server, retry saving a new installation. @@ -161,7 +161,7 @@ declare class ParseInstallation extends Parse * @param {...any} args * @returns {Promise} */ - save(...args: Array): Promise; + save(...args: any[]): Promise; _markAllFieldsDirty(): void; /** * Get the current Parse.Installation from disk. If doesn't exists, create an new installation. diff --git a/types/ParseObject.d.ts b/types/ParseObject.d.ts index a81cdbd2f..135759a53 100644 --- a/types/ParseObject.d.ts +++ b/types/ParseObject.d.ts @@ -7,37 +7,35 @@ import type { AttributeMap, OpsMap } from './ObjectStateMutations'; import type { RequestOptions, FullOptions } from './RESTController'; import type ParseGeoPoint from './ParseGeoPoint'; import type ParsePolygon from './ParsePolygon'; -export type Pointer = { +export interface Pointer { __type: string; className: string; objectId?: string; _localId?: string; -}; -type SaveParams = { +} +interface SaveParams { method: string; path: string; body: AttributeMap; -}; +} export type SaveOptions = FullOptions & { cascadeSave?: boolean; context?: AttributeMap; batchSize?: number; transaction?: boolean; }; -type FetchOptions = { +interface FetchOptions { useMasterKey?: boolean; sessionToken?: string; include?: string | string[]; context?: AttributeMap; -}; -export type SetOptions = { +} +export interface SetOptions { ignoreValidation?: boolean; unset?: boolean; -}; -export type AttributeKey = Extract; -export interface Attributes { - [key: string]: any; } +export type AttributeKey = Extract; +export type Attributes = Record; interface JSONBaseAttributes { objectId: string; createdAt: string; @@ -52,7 +50,7 @@ type AtomicKey = { type Encode = T extends ParseObject ? ReturnType | Pointer : T extends ParseACL | ParseGeoPoint | ParsePolygon | ParseRelation | ParseFile ? ReturnType : T extends Date ? { __type: 'Date'; iso: string; -} : T extends RegExp ? string : T extends Array ? Array> : T extends object ? ToJSON : T; +} : T extends RegExp ? string : T extends (infer R)[] ? Encode[] : T extends object ? ToJSON : T; type ToJSON = { [K in keyof T]: Encode; }; @@ -126,14 +124,14 @@ declare class ParseObject { }; _getServerData(): Attributes; _clearServerData(): void; - _getPendingOps(): Array; + _getPendingOps(): OpsMap[]; /** * @param {Array} [keysToClear] - if specified, only ops matching * these fields will be cleared */ - _clearPendingOps(keysToClear?: Array): void; + _clearPendingOps(keysToClear?: string[]): void; _getDirtyObjectAttributes(): Attributes; - _toFullJSON(seen?: Array, offline?: boolean): Attributes; + _toFullJSON(seen?: any[], offline?: boolean): Attributes; _getSaveJSON(): Attributes; _getSaveParams(): SaveParams; _finishFetch(serverData: Attributes): void; @@ -155,7 +153,7 @@ declare class ParseObject { * @param offline * @returns {object} */ - toJSON(seen: Array | void, offline?: boolean): ToJSON & JSONBaseAttributes; + toJSON(seen?: any[], offline?: boolean): ToJSON & JSONBaseAttributes; /** * Determines whether this ParseObject is equal to another ParseObject * @@ -426,7 +424,7 @@ declare class ParseObject { * * @param {string} [keys] - specify which fields to revert */ - revert(...keys: Array>): void; + revert(...keys: Extract[]): void; /** * Clears all attributes on a model * @@ -469,7 +467,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 | (string | string[])[], options?: RequestOptions): Promise; /** * Saves this object to the server at some unspecified time in the future, * even if Parse is currently inaccessible. @@ -596,7 +594,7 @@ declare class ParseObject { * @returns {Promise} A promise that is fulfilled when the destroy * completes. */ - destroy(options?: RequestOptions): Promise; + 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. @@ -733,7 +731,7 @@ declare class ParseObject { * @static * @returns {Parse.Object[]} */ - static fetchAllWithInclude(list: T[], keys: keyof T['attributes'] | Array, options?: RequestOptions): Promise; + static fetchAllWithInclude(list: T[], keys: keyof T['attributes'] | (keyof T['attributes'])[], options?: RequestOptions): Promise; /** * Fetches the given list of Parse.Object if needed. * If any error is encountered, stops and calls the error handler. @@ -764,7 +762,7 @@ declare class ParseObject { * @static * @returns {Parse.Object[]} */ - static fetchAllIfNeededWithInclude(list: T[], keys: keyof T['attributes'] | Array, options?: RequestOptions): Promise; + static fetchAllIfNeededWithInclude(list: T[], keys: keyof T['attributes'] | (keyof T['attributes'])[], options?: RequestOptions): Promise; /** * Fetches the given list of Parse.Object if needed. * If any error is encountered, stops and calls the error handler. @@ -851,7 +849,7 @@ declare class ParseObject { * @returns {Promise} A promise that is fulfilled when the destroyAll * completes. */ - static destroyAll(list: Array, options?: SaveOptions): Promise | ParseObject[]>; + static destroyAll(list: ParseObject[], options?: SaveOptions): Promise | ParseObject[]>; /** * Saves the given list of Parse.Object. * If any error is encountered, stops and calls the error handler. @@ -998,7 +996,7 @@ declare class ParseObject { * @returns {Promise} A promise that is fulfilled when the pin completes. * @static */ - static pinAll(objects: Array): Promise; + static pinAll(objects: ParseObject[]): Promise; /** * Asynchronously stores the objects and every object they point to in the local datastore, recursively. * @@ -1017,7 +1015,7 @@ declare class ParseObject { * @returns {Promise} A promise that is fulfilled when the pin completes. * @static */ - static pinAllWithName(name: string, objects: Array): Promise; + static pinAllWithName(name: string, objects: ParseObject[]): Promise; /** * Asynchronously removes the objects and every object they point to in the local datastore, * recursively, using a default pin name: _default. @@ -1030,7 +1028,7 @@ declare class ParseObject { * @returns {Promise} A promise that is fulfilled when the unPin completes. * @static */ - static unPinAll(objects: Array): Promise; + static unPinAll(objects: ParseObject[]): Promise; /** * Asynchronously removes the objects and every object they point to in the local datastore, recursively. * @@ -1043,7 +1041,7 @@ declare class ParseObject { * @returns {Promise} A promise that is fulfilled when the unPin completes. * @static */ - static unPinAllWithName(name: string, objects: Array): Promise; + static unPinAllWithName(name: string, objects: ParseObject[]): Promise; /** * Asynchronously removes all objects in the local datastore using a default pin name: _default. * diff --git a/types/ParseOp.d.ts b/types/ParseOp.d.ts index 1ffd8bbc8..b64c66f5a 100644 --- a/types/ParseOp.d.ts +++ b/types/ParseOp.d.ts @@ -1,8 +1,6 @@ import type ParseObject from './ParseObject'; import ParseRelation from './ParseRelation'; -export declare function opFromJSON(json: { - [key: string]: any; -}): Op | null; +export declare function opFromJSON(json: Record): Op | null; export declare class Op { applyTo(value: any): any; mergeWith(previous: Op): Op | void; @@ -33,9 +31,9 @@ export declare class IncrementOp extends Op { }; } export declare class AddOp extends Op { - _value: Array; - constructor(value: any | Array); - applyTo(value: any): Array; + _value: any[]; + constructor(value: any | any[]); + applyTo(value: any): any[]; mergeWith(previous: Op): Op; toJSON(): { __op: string; @@ -43,9 +41,9 @@ export declare class AddOp extends Op { }; } export declare class AddUniqueOp extends Op { - _value: Array; - constructor(value: any | Array); - applyTo(value: any | Array): Array; + _value: any[]; + constructor(value: any | any[]); + applyTo(value: any | any[]): any[]; mergeWith(previous: Op): Op; toJSON(): { __op: string; @@ -53,9 +51,9 @@ export declare class AddUniqueOp extends Op { }; } export declare class RemoveOp extends Op { - _value: Array; - constructor(value: any | Array); - applyTo(value: any | Array): Array; + _value: any[]; + constructor(value: any | any[]); + applyTo(value: any | any[]): any[]; mergeWith(previous: Op): Op; toJSON(): { __op: string; @@ -64,9 +62,9 @@ export declare class RemoveOp extends Op { } export declare class RelationOp extends Op { _targetClassName: string | null; - relationsToAdd: Array; - relationsToRemove: Array; - constructor(adds: Array, removes: Array); + relationsToAdd: string[]; + relationsToRemove: string[]; + constructor(adds: (ParseObject | string)[], removes: (ParseObject | string)[]); _extractId(obj: string | ParseObject): string; applyTo(value: any, parent?: ParseObject, key?: string): ParseRelation; mergeWith(previous: Op): Op; diff --git a/types/ParsePolygon.d.ts b/types/ParsePolygon.d.ts index 28d4b07d2..b85b51588 100644 --- a/types/ParsePolygon.d.ts +++ b/types/ParsePolygon.d.ts @@ -25,7 +25,7 @@ declare class ParsePolygon { /** * @param {(Coordinates | Parse.GeoPoint[])} coordinates An Array of coordinate pairs */ - constructor(coordinates: Coordinates | Array); + constructor(coordinates: Coordinates | ParseGeoPoint[]); /** * Coordinates value for this Polygon. * Throws an exception if not valid type. @@ -34,7 +34,7 @@ declare class ParsePolygon { * @returns {Coordinates} */ get coordinates(): Coordinates; - set coordinates(coords: Coordinates | Array); + set coordinates(coords: Coordinates | ParseGeoPoint[]); /** * Returns a JSON representation of the Polygon, suitable for Parse. * @@ -64,6 +64,6 @@ declare class ParsePolygon { * @throws {TypeError} * @returns {number[][]} Array of coordinates if validated. */ - static _validate(coords: Coordinates | Array): Coordinates; + static _validate(coords: Coordinates | ParseGeoPoint[]): Coordinates; } export default ParsePolygon; diff --git a/types/ParseQuery.d.ts b/types/ParseQuery.d.ts index 6035c5167..fa8e558e8 100644 --- a/types/ParseQuery.d.ts +++ b/types/ParseQuery.d.ts @@ -8,28 +8,22 @@ type BatchOptions = FullOptions & { useMasterKey?: boolean; useMaintenanceKey?: boolean; sessionToken?: string; - context?: { - [key: string]: any; - }; + context?: Record; json?: boolean; }; -export type WhereClause = { - [attr: string]: any; -}; -type QueryOptions = { +export type WhereClause = Record; +interface QueryOptions { useMasterKey?: boolean; sessionToken?: string; - context?: { - [key: string]: any; - }; + context?: Record; json?: boolean; -}; -type FullTextQueryOptions = { +} +interface FullTextQueryOptions { language?: string; caseSensitive?: boolean; diacriticSensitive?: boolean; -}; -export type QueryJSON = { +} +export interface QueryJSON { where: WhereClause; watch?: string; include?: string; @@ -46,7 +40,7 @@ export type QueryJSON = { includeReadPreference?: string; subqueryReadPreference?: string; comment?: string; -}; +} interface BaseAttributes { createdAt: Date; objectId: string; @@ -101,22 +95,20 @@ declare class ParseQuery { */ className: string; _where: any; - _watch: Array; - _include: Array; - _exclude: Array; - _select: Array; + _watch: string[]; + _include: string[]; + _exclude: string[]; + _select: string[]; _limit: number; _skip: number; _count: boolean; - _order: Array; + _order: string[]; _readPreference: string | null; _includeReadPreference: string | null; _subqueryReadPreference: string | null; _queriesLocalDatastore: boolean; _localDatastorePinName: any; - _extraOptions: { - [key: string]: any; - }; + _extraOptions: Record; _hint: any; _explain: boolean; _xhrRequest: any; @@ -131,21 +123,21 @@ declare class ParseQuery { * @param {Array} queries * @returns {Parse.Query} Returns the query, so you can chain this call. */ - _orQuery(queries: Array): this; + _orQuery(queries: ParseQuery[]): this; /** * 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): this; + _andQuery(queries: ParseQuery[]): this; /** * 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): this; + _norQuery(queries: ParseQuery[]): this; /** * Helper for condition queries * @@ -273,24 +265,16 @@ declare class ParseQuery { * Executes a distinct query and returns unique values * * @param {string} key A field to find distinct values - * @param {object} options - * @param {string} [options.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: K, options?: { - sessionToken?: string; - }): Promise; + distinct(key: K): Promise; /** * Executes an aggregate query and returns aggregate results * * @param {(Array|object)} pipeline Array or Object of stages to process query - * @param {object} options - * @param {string} [options.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?: { - sessionToken?: string; - }): Promise>; + aggregate(pipeline: any): Promise; /** * Retrieves at most one Parse.Object that satisfies this query. * @@ -387,7 +371,7 @@ declare class ParseQuery { * @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>; + 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 @@ -411,7 +395,7 @@ declare class ParseQuery { * @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>; + 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 @@ -434,7 +418,7 @@ declare class ParseQuery { * @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>; + 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. @@ -443,7 +427,7 @@ declare 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: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends Array ? E : never)): this; + equalTo(key: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends (infer E)[] ? E : never)): this; /** * Adds a constraint to the query that requires a particular key's value to * be not equal to the provided value. @@ -452,7 +436,7 @@ declare 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: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends Array ? E : never)): this; + notEqualTo(key: K, value: T['attributes'][K] | (T['attributes'][K] extends ParseObject ? Pointer : T['attributes'][K] extends (infer E)[] ? E : never)): this; /** * Adds a constraint to the query that requires a particular key's value to * be less than the provided value. @@ -497,7 +481,7 @@ declare class ParseQuery { * @param {Array<*>} values The values that will match. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - containedIn(key: K, values: Array): this; + containedIn(key: K, values: (T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never))[]): this; /** * Adds a constraint to the query that requires a particular key's value to * not be contained in the provided list of values. @@ -506,7 +490,7 @@ declare class ParseQuery { * @param {Array<*>} values The values that will not match. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - notContainedIn(key: K, values: Array): this; + notContainedIn(key: K, values: T['attributes'][K][]): this; /** * 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. @@ -515,7 +499,7 @@ declare class ParseQuery { * @param {Array} values The values that will match. * @returns {Parse.Query} Returns the query, so you can chain this call. */ - containedBy(key: K, values: Array): this; + containedBy(key: K, values: (T['attributes'][K] | (T['attributes'][K] extends ParseObject ? string : never))[]): this; /** * Adds a constraint to the query that requires a particular key's value to * contain each one of the provided list of values. @@ -760,7 +744,7 @@ declare class ParseQuery { * 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): this; + ascending(...keys: string[]): this; /** * Sorts the results in ascending order by the given key, * but can also add secondary sort descriptors without overwriting _order. @@ -769,7 +753,7 @@ declare class ParseQuery { * 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): this; + addAscending(...keys: string[]): this; /** * Sorts the results in descending order by the given key. * @@ -777,7 +761,7 @@ declare class ParseQuery { * 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): this; + descending(...keys: string[]): this; /** * Sorts the results in descending order by the given key, * but can also add secondary sort descriptors without overwriting _order. @@ -786,7 +770,7 @@ declare class ParseQuery { * 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): this; + addDescending(...keys: string[]): this; /** * Sets the number of results to skip before returning any results. * This is useful for pagination. @@ -824,7 +808,7 @@ declare class ParseQuery { * @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>): this; + include(...keys: (K | K[])[]): this; /** * Includes all nested Parse.Objects one level deep. * @@ -841,7 +825,7 @@ declare class ParseQuery { * @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>): this; + select(...keys: (K | K[])[]): this; /** * Restricts the fields of the returned Parse.Objects to all keys except the * provided keys. Exclude takes precedence over select and include. @@ -851,7 +835,7 @@ declare class ParseQuery { * @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>): this; + exclude(...keys: (K | K[])[]): this; /** * Restricts live query to trigger only for watched fields. * @@ -860,7 +844,7 @@ declare class ParseQuery { * @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>): this; + watch(...keys: (K | K[])[]): this; /** * Changes the read preference that the backend will use when performing the query to the database. * @@ -890,7 +874,7 @@ declare class ParseQuery { * @static * @returns {Parse.Query} The query that is the OR of the passed in queries. */ - static or(...queries: Array): ParseQuery; + static or(...queries: ParseQuery[]): ParseQuery; /** * Constructs a Parse.Query that is the AND of the passed in queries. For * example: @@ -903,7 +887,7 @@ declare class ParseQuery { * @static * @returns {Parse.Query} The query that is the AND of the passed in queries. */ - static and(...queries: Array): ParseQuery; + static and(...queries: ParseQuery[]): ParseQuery; /** * Constructs a Parse.Query that is the NOR of the passed in queries. For * example: @@ -916,7 +900,7 @@ declare class ParseQuery { * @static * @returns {Parse.Query} The query that is the NOR of the passed in queries. */ - static nor(...queries: Array): ParseQuery; + static nor(...queries: ParseQuery[]): ParseQuery; /** * Change the source of this query to the server. * diff --git a/types/ParseSchema.d.ts b/types/ParseSchema.d.ts index 2742c599b..043d3d901 100644 --- a/types/ParseSchema.d.ts +++ b/types/ParseSchema.d.ts @@ -16,9 +16,7 @@ interface FieldOptions; interface CLPField { '*'?: boolean | undefined; requiresAuthentication?: boolean | undefined; @@ -34,26 +32,18 @@ interface CLP { addField?: CLPField | undefined; readUserFields?: string[] | undefined; writeUserFields?: string[] | undefined; - protectedFields?: { - [userIdOrRoleName: string]: string[]; - }; + protectedFields?: Record; } interface RestSchema { className: string; - fields: { - [key: string]: { - type: string; - targetClass?: string; - required?: boolean; - defaultValue?: string; - }; - }; + fields: Record; classLevelPermissions: CLP; - indexes?: { - [key: string]: { - [key: string]: any; - }; - }; + indexes?: Record>; } /** * A Parse.Schema object is for handling schema data from Parse. @@ -74,15 +64,9 @@ interface RestSchema { */ declare class ParseSchema { className: string; - _fields: { - [key: string]: any; - }; - _indexes: { - [key: string]: any; - }; - _clp: { - [key: string]: any; - }; + _fields: Record; + _indexes: Record; + _clp: Record; /** * @param {string} className Parse Class string. */ diff --git a/types/ParseUser.d.ts b/types/ParseUser.d.ts index dab0212e4..8e08dc2a5 100644 --- a/types/ParseUser.d.ts +++ b/types/ParseUser.d.ts @@ -1,9 +1,7 @@ import ParseObject, { Attributes } from './ParseObject'; import type { RequestOptions, FullOptions } from './RESTController'; -export type AuthData = { - [key: string]: any; -}; -export type AuthProvider = { +export type AuthData = Record; +export interface AuthProvider { authenticate?(options: { error?: (provider: AuthProvider, error: string | any) => void; success?: (provider: AuthProvider, result: AuthData) => void; @@ -11,7 +9,7 @@ export type AuthProvider = { restoreAuthentication(authData: any): boolean; getAuthType(): string; deauthenticate?(): void; -}; +} /** *

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 @@ -227,7 +225,7 @@ declare class ParseUser extends ParseObject): Promise; + save(...args: any[]): Promise; /** * Wrap the default destroy behavior with functionality that logs out * the current user when it is destroyed @@ -235,7 +233,7 @@ declare class ParseUser extends ParseObject): Promise; + destroy(...args: any[]): Promise; /** * Wrap the default fetch behavior with functionality to save to local * storage if this is current user. @@ -243,7 +241,7 @@ declare class ParseUser extends ParseObject): Promise; + fetch(...args: any[]): Promise; /** * Wrap the default fetchWithInclude behavior with functionality to save to local * storage if this is current user. @@ -251,7 +249,7 @@ declare class ParseUser extends ParseObject): Promise; + fetchWithInclude(...args: any[]): Promise; /** * Verify whether a given password is the password of the current user. * @@ -271,11 +269,7 @@ declare class ParseUser extends ParseObject, classProps: Record): typeof ParseUser; /** * Retrieves the currently logged in ParseUser with a valid session, * either from memory or localStorage, if necessary. diff --git a/types/Push.d.ts b/types/Push.d.ts index 6c65516b6..db926e9dc 100644 --- a/types/Push.d.ts +++ b/types/Push.d.ts @@ -2,14 +2,14 @@ import ParseQuery from './ParseQuery'; import type ParseObject from './ParseObject'; import type { WhereClause } from './ParseQuery'; import type { FullOptions } from './RESTController'; -export type PushData = { +export interface PushData { where?: WhereClause | ParseQuery; push_time?: Date | string; expiration_time?: Date | string; expiration_interval?: number; data?: any; channels?: string[]; -}; +} /** * Contains functions to deal with Push in Parse. * diff --git a/types/RESTController.d.ts b/types/RESTController.d.ts index 47863f391..ffd3167f0 100644 --- a/types/RESTController.d.ts +++ b/types/RESTController.d.ts @@ -1,4 +1,4 @@ -export type RequestOptions = { +export interface RequestOptions { useMasterKey?: boolean; useMaintenanceKey?: boolean; sessionToken?: string; @@ -11,8 +11,8 @@ export type RequestOptions = { usePost?: boolean; ignoreEmailVerification?: boolean; transaction?: boolean; -}; -export type FullOptions = { +} +export interface FullOptions { success?: any; error?: any; useMasterKey?: boolean; @@ -21,7 +21,7 @@ export type FullOptions = { installationId?: string; progress?: any; usePost?: boolean; -}; +} declare const RESTController: { ajax(method: string, url: string, data: any, headers?: any, options?: FullOptions): (Promise & { resolve: (res: any) => void; diff --git a/types/SingleInstanceStateController.d.ts b/types/SingleInstanceStateController.d.ts index 09743b91e..36bba09ea 100644 --- a/types/SingleInstanceStateController.d.ts +++ b/types/SingleInstanceStateController.d.ts @@ -6,7 +6,7 @@ export declare function initializeState(obj: ParseObject, initial?: State): Stat export declare function removeState(obj: ParseObject): State | null; export declare function getServerData(obj: ParseObject): AttributeMap; export declare function setServerData(obj: ParseObject, attributes: AttributeMap): void; -export declare function getPendingOps(obj: ParseObject): Array; +export declare function getPendingOps(obj: ParseObject): OpsMap[]; export declare function setPendingOp(obj: ParseObject, attr: string, op?: Op): void; export declare function pushPendingState(obj: ParseObject): void; export declare function popPendingState(obj: ParseObject): OpsMap; diff --git a/types/Storage.d.ts b/types/Storage.d.ts index 08d6483df..f863c3c4c 100644 --- a/types/Storage.d.ts +++ b/types/Storage.d.ts @@ -6,8 +6,8 @@ declare const Storage: { setItemAsync(path: string, value: string): Promise; removeItem(path: string): void; removeItemAsync(path: string): Promise; - getAllKeys(): Array; - getAllKeysAsync(): Promise>; + getAllKeys(): string[]; + getAllKeysAsync(): Promise; generatePath(path: string): string; _clear(): void; }; diff --git a/types/StorageController.react-native.d.ts b/types/StorageController.react-native.d.ts index a95ebbf73..91e4cd47b 100644 --- a/types/StorageController.react-native.d.ts +++ b/types/StorageController.react-native.d.ts @@ -4,8 +4,8 @@ declare const StorageController: { setItemAsync(path: string, value: string): Promise; removeItemAsync(path: string): Promise; getAllKeysAsync(): Promise; - multiGet(keys: Array): Promise; - multiRemove(keys: Array): Promise>; + multiGet(keys: string[]): Promise; + multiRemove(keys: string[]): Promise; clear(): Promise; }; export default StorageController; diff --git a/types/TaskQueue.d.ts b/types/TaskQueue.d.ts index ae7e55fe9..9d84900e1 100644 --- a/types/TaskQueue.d.ts +++ b/types/TaskQueue.d.ts @@ -1,9 +1,9 @@ -type Task = { +interface Task { task: () => Promise; _completion: any; -}; +} declare class TaskQueue { - queue: Array; + queue: Task[]; constructor(); enqueue(task: () => Promise): Promise; _dequeue(): void; diff --git a/types/UniqueInstanceStateController.d.ts b/types/UniqueInstanceStateController.d.ts index 7aff646fd..2ce1909e4 100644 --- a/types/UniqueInstanceStateController.d.ts +++ b/types/UniqueInstanceStateController.d.ts @@ -6,7 +6,7 @@ export declare function initializeState(obj: ParseObject, initial?: State): Stat export declare function removeState(obj: ParseObject): State | null; export declare function getServerData(obj: ParseObject): AttributeMap; export declare function setServerData(obj: ParseObject, attributes: AttributeMap): void; -export declare function getPendingOps(obj: ParseObject): Array; +export declare function getPendingOps(obj: ParseObject): OpsMap[]; export declare function setPendingOp(obj: ParseObject, attr: string, op?: Op): void; export declare function pushPendingState(obj: ParseObject): void; export declare function popPendingState(obj: ParseObject): OpsMap; diff --git a/types/arrayContainsObject.d.ts b/types/arrayContainsObject.d.ts index a6a357188..a19e6405b 100644 --- a/types/arrayContainsObject.d.ts +++ b/types/arrayContainsObject.d.ts @@ -1,2 +1,2 @@ import type ParseObject from './ParseObject'; -export default function arrayContainsObject(array: Array, object: ParseObject): boolean; +export default function arrayContainsObject(array: any[], object: ParseObject): boolean; diff --git a/types/encode.d.ts b/types/encode.d.ts index d63c1e75a..e64bfd721 100644 --- a/types/encode.d.ts +++ b/types/encode.d.ts @@ -1 +1 @@ -export default function (value: any, disallowObjects?: boolean, forcePointers?: boolean, seen?: Array, offline?: boolean): any; +export default function (value: any, disallowObjects?: boolean, forcePointers?: boolean, seen?: any[], offline?: boolean): any; diff --git a/eslint.config.test.mjs b/types/eslint.config.mjs similarity index 100% rename from eslint.config.test.mjs rename to types/eslint.config.mjs diff --git a/types/unique.d.ts b/types/unique.d.ts index c305608cf..1736d2e04 100644 --- a/types/unique.d.ts +++ b/types/unique.d.ts @@ -1 +1 @@ -export default function unique(arr: Array): Array; +export default function unique(arr: T[]): T[]; diff --git a/types/unsavedChildren.d.ts b/types/unsavedChildren.d.ts index 57881ba36..27e09d5a2 100644 --- a/types/unsavedChildren.d.ts +++ b/types/unsavedChildren.d.ts @@ -8,4 +8,4 @@ import type ParseObject from './ParseObject'; * @param {boolean} allowDeepUnsaved * @returns {Array} */ -export default function unsavedChildren(obj: ParseObject, allowDeepUnsaved?: boolean): Array; +export default function unsavedChildren(obj: ParseObject, allowDeepUnsaved?: boolean): (ParseFile | ParseObject)[];