diff --git a/.eslintrc.json b/.eslintrc.json
index 757b9a816..997cae317 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -3,7 +3,6 @@
"extends": [
"eslint:recommended",
"plugin:jsdoc/recommended",
- "plugin:flowtype/recommended",
"plugin:@typescript-eslint/recommended"
],
"env": {
@@ -15,7 +14,6 @@
"wx": true
},
"plugins": [
- "flowtype",
"jsdoc",
"@typescript-eslint"
],
@@ -46,7 +44,6 @@
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-non-null-assertion": "off",
- "flowtype/no-types-missing-file-annotation": 0,
"jsdoc/require-jsdoc": 0,
"jsdoc/require-returns-description": 0,
"jsdoc/require-param-description": 0,
@@ -59,15 +56,6 @@
"allowExtraTrailingParamDocs": true
}
],
- "jsdoc/check-tag-names": [
- "error",
- {
- "definedTags": [
- "flow",
- "flow-weak"
- ]
- }
- ],
"jsdoc/no-undefined-types": [
"error",
{
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d36f5f600..df4119263 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -98,7 +98,7 @@ 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 [Flow](http://flowtype.org/) and ES6 for this codebase. Use modern syntax whenever possible.
+* We use ES6 for this codebase. Use modern syntax whenever possible.
* Keep lines within 80 characters.
* Always end lines with semicolons.
diff --git a/babel-jest.js b/babel-jest.js
index e17601e2a..9249b1a05 100644
--- a/babel-jest.js
+++ b/babel-jest.js
@@ -8,5 +8,4 @@ module.exports = babelJest.createTransformer({
useBuiltIns: 'entry',
corejs: 3,
}]],
- plugins: ['@babel/plugin-transform-flow-comments'],
});
diff --git a/gulpfile.js b/gulpfile.js
index 90a4f9d93..667562399 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -32,12 +32,12 @@ const PRESETS = {
'react-native': ["@babel/preset-typescript", 'module:metro-react-native-babel-preset'],
};
const PLUGINS = {
- 'browser': [transformRuntime, '@babel/plugin-transform-flow-comments', '@babel/plugin-proposal-class-properties', 'inline-package-json',
+ 'browser': [transformRuntime, '@babel/plugin-proposal-class-properties', 'inline-package-json',
['transform-inline-environment-variables', {'exclude': ['SERVER_RENDERING']}]],
- 'weapp': [transformRuntime, '@babel/plugin-transform-flow-comments', '@babel/plugin-proposal-class-properties', 'inline-package-json',
+ 'weapp': [transformRuntime, '@babel/plugin-proposal-class-properties', 'inline-package-json',
['transform-inline-environment-variables', {'exclude': ['SERVER_RENDERING']}]],
- 'node': ['@babel/plugin-transform-flow-comments', 'inline-package-json', 'transform-inline-environment-variables'],
- 'react-native': ['@babel/plugin-transform-flow-comments', 'inline-package-json', 'transform-inline-environment-variables']
+ 'node': ['inline-package-json', 'transform-inline-environment-variables'],
+ 'react-native': ['inline-package-json', 'transform-inline-environment-variables']
};
const DEV_HEADER = (
diff --git a/jsdoc-conf.json b/jsdoc-conf.json
index 107f9e9a8..f351f6f5e 100644
--- a/jsdoc-conf.json
+++ b/jsdoc-conf.json
@@ -3,7 +3,6 @@
"babel": {
"babelrc": false,
"extensions": ["js", "ts", "jsx", "tsx"],
- "plugins": ["@babel/plugin-transform-flow-comments"],
"presets": ["@babel/preset-typescript"]
},
"source": {
diff --git a/package-lock.json b/package-lock.json
index 349c6838d..9e12c786e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -13,14 +13,12 @@
"idb-keyval": "6.2.1",
"react-native-crypto-js": "1.0.0",
"uuid": "9.0.1",
- "ws": "^8.17.0",
+ "ws": "8.17.0",
"xmlhttprequest": "1.8.0"
},
"devDependencies": {
"@babel/core": "7.22.0",
"@babel/plugin-proposal-class-properties": "7.18.6",
- "@babel/plugin-transform-flow-comments": "7.22.5",
- "@babel/plugin-transform-flow-strip-types": "7.21.0",
"@babel/plugin-transform-runtime": "7.21.4",
"@babel/preset-env": "7.21.5",
"@babel/preset-react": "7.22.5",
@@ -44,7 +42,6 @@
"core-js": "3.30.2",
"cross-env": "7.0.2",
"eslint": "8.56.0",
- "eslint-plugin-flowtype": "8.0.3",
"eslint-plugin-jsdoc": "48.2.5",
"express": "4.18.2",
"gulp": "4.0.2",
@@ -1725,23 +1722,6 @@
"@babel/core": "^7.0.0-0"
}
},
- "node_modules/@babel/plugin-transform-flow-comments": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-comments/-/plugin-transform-flow-comments-7.22.5.tgz",
- "integrity": "sha512-e2lp78CXh9N2Xu0BKVibzLooLNkr1pGrSuigKBDFefibKnEuBW1uTWZVbJm7ptteOekftR27Afupm7nB74rs6w==",
- "dev": true,
- "dependencies": {
- "@babel/generator": "^7.22.5",
- "@babel/helper-plugin-utils": "^7.22.5",
- "@babel/plugin-syntax-flow": "^7.22.5"
- },
- "engines": {
- "node": ">=6.9.0"
- },
- "peerDependencies": {
- "@babel/core": "^7.0.0-0"
- }
- },
"node_modules/@babel/plugin-transform-flow-strip-types": {
"version": "7.21.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.21.0.tgz",
@@ -11293,24 +11273,6 @@
"url": "https://opencollective.com/eslint"
}
},
- "node_modules/eslint-plugin-flowtype": {
- "version": "8.0.3",
- "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-8.0.3.tgz",
- "integrity": "sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ==",
- "dev": true,
- "dependencies": {
- "lodash": "^4.17.21",
- "string-natural-compare": "^3.0.1"
- },
- "engines": {
- "node": ">=12.0.0"
- },
- "peerDependencies": {
- "@babel/plugin-syntax-flow": "^7.14.5",
- "@babel/plugin-transform-react-jsx": "^7.14.9",
- "eslint": "^8.1.0"
- }
- },
"node_modules/eslint-plugin-jsdoc": {
"version": "48.2.5",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.5.tgz",
@@ -27766,12 +27728,6 @@
"node": ">=10"
}
},
- "node_modules/string-natural-compare": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/string-natural-compare/-/string-natural-compare-3.0.1.tgz",
- "integrity": "sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==",
- "dev": true
- },
"node_modules/string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
@@ -31246,17 +31202,6 @@
"@babel/helper-plugin-utils": "^7.18.6"
}
},
- "@babel/plugin-transform-flow-comments": {
- "version": "7.22.5",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-comments/-/plugin-transform-flow-comments-7.22.5.tgz",
- "integrity": "sha512-e2lp78CXh9N2Xu0BKVibzLooLNkr1pGrSuigKBDFefibKnEuBW1uTWZVbJm7ptteOekftR27Afupm7nB74rs6w==",
- "dev": true,
- "requires": {
- "@babel/generator": "^7.22.5",
- "@babel/helper-plugin-utils": "^7.22.5",
- "@babel/plugin-syntax-flow": "^7.22.5"
- }
- },
"@babel/plugin-transform-flow-strip-types": {
"version": "7.21.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.21.0.tgz",
@@ -39027,16 +38972,6 @@
}
}
},
- "eslint-plugin-flowtype": {
- "version": "8.0.3",
- "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-8.0.3.tgz",
- "integrity": "sha512-dX8l6qUL6O+fYPtpNRideCFSpmWOUVx5QcaGLVqe/vlDiBSe4vYljDWDETwnyFzpl7By/WVIu6rcrniCgH9BqQ==",
- "dev": true,
- "requires": {
- "lodash": "^4.17.21",
- "string-natural-compare": "^3.0.1"
- }
- },
"eslint-plugin-jsdoc": {
"version": "48.2.5",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.5.tgz",
@@ -51426,12 +51361,6 @@
"strip-ansi": "^6.0.0"
}
},
- "string-natural-compare": {
- "version": "3.0.1",
- "resolved": "https://registry.npmjs.org/string-natural-compare/-/string-natural-compare-3.0.1.tgz",
- "integrity": "sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==",
- "dev": true
- },
"string-width": {
"version": "4.2.3",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
diff --git a/package.json b/package.json
index 87cad67d9..40ac1e465 100644
--- a/package.json
+++ b/package.json
@@ -39,8 +39,6 @@
"devDependencies": {
"@babel/core": "7.22.0",
"@babel/plugin-proposal-class-properties": "7.18.6",
- "@babel/plugin-transform-flow-comments": "7.22.5",
- "@babel/plugin-transform-flow-strip-types": "7.21.0",
"@babel/plugin-transform-runtime": "7.21.4",
"@babel/preset-env": "7.21.5",
"@babel/preset-react": "7.22.5",
@@ -64,7 +62,6 @@
"core-js": "3.30.2",
"cross-env": "7.0.2",
"eslint": "8.56.0",
- "eslint-plugin-flowtype": "8.0.3",
"eslint-plugin-jsdoc": "48.2.5",
"express": "4.18.2",
"gulp": "4.0.2",
diff --git a/src/.flowconfig b/src/.flowconfig
deleted file mode 100644
index e36f40442..000000000
--- a/src/.flowconfig
+++ /dev/null
@@ -1,10 +0,0 @@
-[ignore]
-.*/node_modules/
-.*/lib/
-
-[include]
-
-[libs]
-
-[options]
-suppress_comment= \\(.\\|\n\\)*\\@flow-disable-next
diff --git a/src/EventuallyQueue.js b/src/EventuallyQueue.ts
similarity index 96%
rename from src/EventuallyQueue.js
rename to src/EventuallyQueue.ts
index f4b59ffb5..a4cdb0ed8 100644
--- a/src/EventuallyQueue.js
+++ b/src/EventuallyQueue.ts
@@ -1,9 +1,3 @@
-/**
- * https://github.com/francimedia/parse-js-local-storage
- *
- * @flow
- */
-
import CoreManager from './CoreManager';
import ParseError from './ParseError';
import ParseObject from './ParseObject';
@@ -27,9 +21,9 @@ type QueueObject = {
type Queue = Array
Parse.Error
.
- * @param {string} message A detailed description of the error.
- */
- constructor(code, message) {
- super(message);
- this.code = code;
- let customMessage = message;
- CoreManager.get('PARSE_ERRORS').forEach(error => {
- if (error.code === code && error.code) {
- customMessage = error.message;
- }
- });
- Object.defineProperty(this, 'message', {
- enumerable: true,
- value: customMessage,
- });
- }
-
- toString() {
- return 'ParseError: ' + this.code + ' ' + this.message;
- }
-}
-
-/**
- * Error code indicating some error other than those enumerated here.
- *
- * @property {number} OTHER_CAUSE
- * @static
- */
-ParseError.OTHER_CAUSE = -1;
-
-/**
- * Error code indicating that something has gone wrong with the server.
- *
- * @property {number} INTERNAL_SERVER_ERROR
- * @static
- */
-ParseError.INTERNAL_SERVER_ERROR = 1;
-
-/**
- * Error code indicating the connection to the Parse servers failed.
- *
- * @property {number} CONNECTION_FAILED
- * @static
- */
-ParseError.CONNECTION_FAILED = 100;
-
-/**
- * Error code indicating the specified object doesn't exist.
- *
- * @property {number} OBJECT_NOT_FOUND
- * @static
- */
-ParseError.OBJECT_NOT_FOUND = 101;
-
-/**
- * Error code indicating you tried to query with a datatype that doesn't
- * support it, like exact matching an array or object.
- *
- * @property {number} INVALID_QUERY
- * @static
- */
-ParseError.INVALID_QUERY = 102;
-
-/**
- * Error code indicating a missing or invalid classname. Classnames are
- * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the
- * only valid characters.
- *
- * @property {number} INVALID_CLASS_NAME
- * @static
- */
-ParseError.INVALID_CLASS_NAME = 103;
-
-/**
- * Error code indicating an unspecified object id.
- *
- * @property {number} MISSING_OBJECT_ID
- * @static
- */
-ParseError.MISSING_OBJECT_ID = 104;
-
-/**
- * Error code indicating an invalid key name. Keys are case-sensitive. They
- * must start with a letter, and a-zA-Z0-9_ are the only valid characters.
- *
- * @property {number} INVALID_KEY_NAME
- * @static
- */
-ParseError.INVALID_KEY_NAME = 105;
-
-/**
- * Error code indicating a malformed pointer. You should not see this unless
- * you have been mucking about changing internal Parse code.
- *
- * @property {number} INVALID_POINTER
- * @static
- */
-ParseError.INVALID_POINTER = 106;
-
-/**
- * Error code indicating that badly formed JSON was received upstream. This
- * either indicates you have done something unusual with modifying how
- * things encode to JSON, or the network is failing badly.
- *
- * @property {number} INVALID_JSON
- * @static
- */
-ParseError.INVALID_JSON = 107;
-
-/**
- * Error code indicating that the feature you tried to access is only
- * available internally for testing purposes.
- *
- * @property {number} COMMAND_UNAVAILABLE
- * @static
- */
-ParseError.COMMAND_UNAVAILABLE = 108;
-
-/**
- * You must call Parse.initialize before using the Parse library.
- *
- * @property {number} NOT_INITIALIZED
- * @static
- */
-ParseError.NOT_INITIALIZED = 109;
-
-/**
- * Error code indicating that a field was set to an inconsistent type.
- *
- * @property {number} INCORRECT_TYPE
- * @static
- */
-ParseError.INCORRECT_TYPE = 111;
-
-/**
- * Error code indicating an invalid channel name. A channel name is either
- * an empty string (the broadcast channel) or contains only a-zA-Z0-9_
- * characters and starts with a letter.
- *
- * @property {number} INVALID_CHANNEL_NAME
- * @static
- */
-ParseError.INVALID_CHANNEL_NAME = 112;
-
-/**
- * Error code indicating that push is misconfigured.
- *
- * @property {number} PUSH_MISCONFIGURED
- * @static
- */
-ParseError.PUSH_MISCONFIGURED = 115;
-
-/**
- * Error code indicating that the object is too large.
- *
- * @property {number} OBJECT_TOO_LARGE
- * @static
- */
-ParseError.OBJECT_TOO_LARGE = 116;
-
-/**
- * Error code indicating that the operation isn't allowed for clients.
- *
- * @property {number} OPERATION_FORBIDDEN
- * @static
- */
-ParseError.OPERATION_FORBIDDEN = 119;
-
-/**
- * Error code indicating the result was not found in the cache.
- *
- * @property {number} CACHE_MISS
- * @static
- */
-ParseError.CACHE_MISS = 120;
-
-/**
- * Error code indicating that an invalid key was used in a nested
- * JSONObject.
- *
- * @property {number} INVALID_NESTED_KEY
- * @static
- */
-ParseError.INVALID_NESTED_KEY = 121;
-
-/**
- * Error code indicating that an invalid filename was used for ParseFile.
- * A valid file name contains only a-zA-Z0-9_. characters and is between 1
- * and 128 characters.
- *
- * @property {number} INVALID_FILE_NAME
- * @static
- */
-ParseError.INVALID_FILE_NAME = 122;
-
-/**
- * Error code indicating an invalid ACL was provided.
- *
- * @property {number} INVALID_ACL
- * @static
- */
-ParseError.INVALID_ACL = 123;
-
-/**
- * Error code indicating that the request timed out on the server. Typically
- * this indicates that the request is too expensive to run.
- *
- * @property {number} TIMEOUT
- * @static
- */
-ParseError.TIMEOUT = 124;
-
-/**
- * Error code indicating that the email address was invalid.
- *
- * @property {number} INVALID_EMAIL_ADDRESS
- * @static
- */
-ParseError.INVALID_EMAIL_ADDRESS = 125;
-
-/**
- * Error code indicating a missing content type.
- *
- * @property {number} MISSING_CONTENT_TYPE
- * @static
- */
-ParseError.MISSING_CONTENT_TYPE = 126;
-
-/**
- * Error code indicating a missing content length.
- *
- * @property {number} MISSING_CONTENT_LENGTH
- * @static
- */
-ParseError.MISSING_CONTENT_LENGTH = 127;
-
-/**
- * Error code indicating an invalid content length.
- *
- * @property {number} INVALID_CONTENT_LENGTH
- * @static
- */
-ParseError.INVALID_CONTENT_LENGTH = 128;
-
-/**
- * Error code indicating a file that was too large.
- *
- * @property {number} FILE_TOO_LARGE
- * @static
- */
-ParseError.FILE_TOO_LARGE = 129;
-
-/**
- * Error code indicating an error saving a file.
- *
- * @property {number} FILE_SAVE_ERROR
- * @static
- */
-ParseError.FILE_SAVE_ERROR = 130;
-
-/**
- * Error code indicating that a unique field was given a value that is
- * already taken.
- *
- * @property {number} DUPLICATE_VALUE
- * @static
- */
-ParseError.DUPLICATE_VALUE = 137;
-
-/**
- * Error code indicating that a role's name is invalid.
- *
- * @property {number} INVALID_ROLE_NAME
- * @static
- */
-ParseError.INVALID_ROLE_NAME = 139;
-
-/**
- * Error code indicating that an application quota was exceeded. Upgrade to
- * resolve.
- *
- * @property {number} EXCEEDED_QUOTA
- * @static
- */
-ParseError.EXCEEDED_QUOTA = 140;
-
-/**
- * Error code indicating that a Cloud Code script failed.
- *
- * @property {number} SCRIPT_FAILED
- * @static
- */
-ParseError.SCRIPT_FAILED = 141;
-
-/**
- * Error code indicating that a Cloud Code validation failed.
- *
- * @property {number} VALIDATION_ERROR
- * @static
- */
-ParseError.VALIDATION_ERROR = 142;
-
-/**
- * Error code indicating that invalid image data was provided.
- *
- * @property {number} INVALID_IMAGE_DATA
- * @static
- */
-ParseError.INVALID_IMAGE_DATA = 143;
-
-/**
- * Error code indicating an unsaved file.
- *
- * @property {number} UNSAVED_FILE_ERROR
- * @static
- */
-ParseError.UNSAVED_FILE_ERROR = 151;
-
-/**
- * Error code indicating an invalid push time.
- *
- * @property {number} INVALID_PUSH_TIME_ERROR
- * @static
- */
-ParseError.INVALID_PUSH_TIME_ERROR = 152;
-
-/**
- * Error code indicating an error deleting a file.
- *
- * @property {number} FILE_DELETE_ERROR
- * @static
- */
-ParseError.FILE_DELETE_ERROR = 153;
-
-/**
- * Error code indicating an error deleting an unnamed file.
- *
- * @property {number} FILE_DELETE_UNNAMED_ERROR
- * @static
- */
-ParseError.FILE_DELETE_UNNAMED_ERROR = 161;
-
-/**
- * Error code indicating that the application has exceeded its request
- * limit.
- *
- * @property {number} REQUEST_LIMIT_EXCEEDED
- * @static
- */
-ParseError.REQUEST_LIMIT_EXCEEDED = 155;
-
-/**
- * Error code indicating that the request was a duplicate and has been discarded due to
- * idempotency rules.
- *
- * @property {number} DUPLICATE_REQUEST
- * @static
- */
-ParseError.DUPLICATE_REQUEST = 159;
-
-/**
- * Error code indicating an invalid event name.
- *
- * @property {number} INVALID_EVENT_NAME
- * @static
- */
-ParseError.INVALID_EVENT_NAME = 160;
-
-/**
- * Error code indicating that a field had an invalid value.
- *
- * @property {number} INVALID_VALUE
- * @static
- */
-ParseError.INVALID_VALUE = 162;
-
-/**
- * Error code indicating that the username is missing or empty.
- *
- * @property {number} USERNAME_MISSING
- * @static
- */
-ParseError.USERNAME_MISSING = 200;
-
-/**
- * Error code indicating that the password is missing or empty.
- *
- * @property {number} PASSWORD_MISSING
- * @static
- */
-ParseError.PASSWORD_MISSING = 201;
-
-/**
- * Error code indicating that the username has already been taken.
- *
- * @property {number} USERNAME_TAKEN
- * @static
- */
-ParseError.USERNAME_TAKEN = 202;
-
-/**
- * Error code indicating that the email has already been taken.
- *
- * @property {number} EMAIL_TAKEN
- * @static
- */
-ParseError.EMAIL_TAKEN = 203;
-
-/**
- * Error code indicating that the email is missing, but must be specified.
- *
- * @property {number} EMAIL_MISSING
- * @static
- */
-ParseError.EMAIL_MISSING = 204;
-
-/**
- * Error code indicating that a user with the specified email was not found.
- *
- * @property {number} EMAIL_NOT_FOUND
- * @static
- */
-ParseError.EMAIL_NOT_FOUND = 205;
-
-/**
- * Error code indicating that a user object without a valid session could
- * not be altered.
- *
- * @property {number} SESSION_MISSING
- * @static
- */
-ParseError.SESSION_MISSING = 206;
-
-/**
- * Error code indicating that a user can only be created through signup.
- *
- * @property {number} MUST_CREATE_USER_THROUGH_SIGNUP
- * @static
- */
-ParseError.MUST_CREATE_USER_THROUGH_SIGNUP = 207;
-
-/**
- * Error code indicating that an an account being linked is already linked
- * to another user.
- *
- * @property {number} ACCOUNT_ALREADY_LINKED
- * @static
- */
-ParseError.ACCOUNT_ALREADY_LINKED = 208;
-
-/**
- * Error code indicating that the current session token is invalid.
- *
- * @property {number} INVALID_SESSION_TOKEN
- * @static
- */
-ParseError.INVALID_SESSION_TOKEN = 209;
-
-/**
- * Error code indicating an error enabling or verifying MFA
- *
- * @property {number} MFA_ERROR
- * @static
- */
-ParseError.MFA_ERROR = 210;
-
-/**
- * Error code indicating that a valid MFA token must be provided
- *
- * @property {number} MFA_TOKEN_REQUIRED
- * @static
- */
-ParseError.MFA_TOKEN_REQUIRED = 211;
-
-/**
- * Error code indicating that a user cannot be linked to an account because
- * that account's id could not be found.
- *
- * @property {number} LINKED_ID_MISSING
- * @static
- */
-ParseError.LINKED_ID_MISSING = 250;
-
-/**
- * Error code indicating that a user with a linked (e.g. Facebook) account
- * has an invalid session.
- *
- * @property {number} INVALID_LINKED_SESSION
- * @static
- */
-ParseError.INVALID_LINKED_SESSION = 251;
-
-/**
- * Error code indicating that a service being linked (e.g. Facebook or
- * Twitter) is unsupported.
- *
- * @property {number} UNSUPPORTED_SERVICE
- * @static
- */
-ParseError.UNSUPPORTED_SERVICE = 252;
-
-/**
- * Error code indicating an invalid operation occured on schema
- *
- * @property {number} INVALID_SCHEMA_OPERATION
- * @static
- */
-ParseError.INVALID_SCHEMA_OPERATION = 255;
-
-/**
- * Error code indicating that there were multiple errors. Aggregate errors
- * have an "errors" property, which is an array of error objects with more
- * detail about each error that occurred.
- *
- * @property {number} AGGREGATE_ERROR
- * @static
- */
-ParseError.AGGREGATE_ERROR = 600;
-
-/**
- * Error code indicating the client was unable to read an input file.
- *
- * @property {number} FILE_READ_ERROR
- * @static
- */
-ParseError.FILE_READ_ERROR = 601;
-
-/**
- * Error code indicating a real error code is unavailable because
- * we had to use an XDomainRequest object to allow CORS requests in
- * Internet Explorer, which strips the body from HTTP responses that have
- * a non-2XX status code.
- *
- * @property {number} X_DOMAIN_REQUEST
- * @static
- */
-ParseError.X_DOMAIN_REQUEST = 602;
-
-export default ParseError;
diff --git a/src/ParseError.ts b/src/ParseError.ts
new file mode 100644
index 000000000..498e5a2fa
--- /dev/null
+++ b/src/ParseError.ts
@@ -0,0 +1,556 @@
+import CoreManager from './CoreManager';
+import type ParseObject from './ParseObject';
+
+/**
+ * Constructs a new Parse.Error object with the given code and message.
+ *
+ * Parse.CoreManager.set('PARSE_ERRORS', [{ code, message }]) can be use to override error messages.
+ *
+ * @alias Parse.Error
+ */
+class ParseError extends Error {
+ code: number;
+ message: string;
+ object?: ParseObject;
+ errors?: Error[];
+ /**
+ * @param {number} code An error code constant from Parse.Error
.
+ * @param {string} message A detailed description of the error.
+ */
+ constructor(code: number, message?: string) {
+ super(message);
+ this.code = code;
+ let customMessage = message;
+ CoreManager.get('PARSE_ERRORS').forEach(error => {
+ if (error.code === code && error.code) {
+ customMessage = error.message;
+ }
+ });
+ Object.defineProperty(this, 'message', {
+ enumerable: true,
+ value: customMessage,
+ });
+ }
+
+ toString() {
+ return 'ParseError: ' + this.code + ' ' + this.message;
+ }
+
+ /**
+ * Error code indicating some error other than those enumerated here.
+ *
+ * @property {number} OTHER_CAUSE
+ * @static
+ */
+ static OTHER_CAUSE = -1;
+
+ /**
+ * Error code indicating that something has gone wrong with the server.
+ *
+ * @property {number} INTERNAL_SERVER_ERROR
+ * @static
+ */
+ static INTERNAL_SERVER_ERROR = 1;
+
+ /**
+ * Error code indicating the connection to the Parse servers failed.
+ *
+ * @property {number} CONNECTION_FAILED
+ * @static
+ */
+ static CONNECTION_FAILED = 100;
+
+ /**
+ * Error code indicating the specified object doesn't exist.
+ *
+ * @property {number} OBJECT_NOT_FOUND
+ * @static
+ */
+ static OBJECT_NOT_FOUND = 101;
+
+ /**
+ * Error code indicating you tried to query with a datatype that doesn't
+ * support it, like exact matching an array or object.
+ *
+ * @property {number} INVALID_QUERY
+ * @static
+ */
+ static INVALID_QUERY = 102;
+
+ /**
+ * Error code indicating a missing or invalid classname. Classnames are
+ * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the
+ * only valid characters.
+ *
+ * @property {number} INVALID_CLASS_NAME
+ * @static
+ */
+ static INVALID_CLASS_NAME = 103;
+
+ /**
+ * Error code indicating an unspecified object id.
+ *
+ * @property {number} MISSING_OBJECT_ID
+ * @static
+ */
+ static MISSING_OBJECT_ID = 104;
+
+ /**
+ * Error code indicating an invalid key name. Keys are case-sensitive. They
+ * must start with a letter, and a-zA-Z0-9_ are the only valid characters.
+ *
+ * @property {number} INVALID_KEY_NAME
+ * @static
+ */
+ static INVALID_KEY_NAME = 105;
+
+ /**
+ * Error code indicating a malformed pointer. You should not see this unless
+ * you have been mucking about changing internal Parse code.
+ *
+ * @property {number} INVALID_POINTER
+ * @static
+ */
+ static INVALID_POINTER = 106;
+
+ /**
+ * Error code indicating that badly formed JSON was received upstream. This
+ * either indicates you have done something unusual with modifying how
+ * things encode to JSON, or the network is failing badly.
+ *
+ * @property {number} INVALID_JSON
+ * @static
+ */
+ static INVALID_JSON = 107;
+
+ /**
+ * Error code indicating that the feature you tried to access is only
+ * available internally for testing purposes.
+ *
+ * @property {number} COMMAND_UNAVAILABLE
+ * @static
+ */
+ static COMMAND_UNAVAILABLE = 108;
+
+ /**
+ * You must call Parse.initialize before using the Parse library.
+ *
+ * @property {number} NOT_INITIALIZED
+ * @static
+ */
+ static NOT_INITIALIZED = 109;
+
+ /**
+ * Error code indicating that a field was set to an inconsistent type.
+ *
+ * @property {number} INCORRECT_TYPE
+ * @static
+ */
+ static INCORRECT_TYPE = 111;
+
+ /**
+ * Error code indicating an invalid channel name. A channel name is either
+ * an empty string (the broadcast channel) or contains only a-zA-Z0-9_
+ * characters and starts with a letter.
+ *
+ * @property {number} INVALID_CHANNEL_NAME
+ * @static
+ */
+ static INVALID_CHANNEL_NAME = 112;
+
+ /**
+ * Error code indicating that push is misconfigured.
+ *
+ * @property {number} PUSH_MISCONFIGURED
+ * @static
+ */
+ static PUSH_MISCONFIGURED = 115;
+
+ /**
+ * Error code indicating that the object is too large.
+ *
+ * @property {number} OBJECT_TOO_LARGE
+ * @static
+ */
+ static OBJECT_TOO_LARGE = 116;
+
+ /**
+ * Error code indicating that the operation isn't allowed for clients.
+ *
+ * @property {number} OPERATION_FORBIDDEN
+ * @static
+ */
+ static OPERATION_FORBIDDEN = 119;
+
+ /**
+ * Error code indicating the result was not found in the cache.
+ *
+ * @property {number} CACHE_MISS
+ * @static
+ */
+ static CACHE_MISS = 120;
+
+ /**
+ * Error code indicating that an invalid key was used in a nested
+ * JSONObject.
+ *
+ * @property {number} INVALID_NESTED_KEY
+ * @static
+ */
+ static INVALID_NESTED_KEY = 121;
+
+ /**
+ * Error code indicating that an invalid filename was used for ParseFile.
+ * A valid file name contains only a-zA-Z0-9_. characters and is between 1
+ * and 128 characters.
+ *
+ * @property {number} INVALID_FILE_NAME
+ * @static
+ */
+ static INVALID_FILE_NAME = 122;
+
+ /**
+ * Error code indicating an invalid ACL was provided.
+ *
+ * @property {number} INVALID_ACL
+ * @static
+ */
+ static INVALID_ACL = 123;
+
+ /**
+ * Error code indicating that the request timed out on the server. Typically
+ * this indicates that the request is too expensive to run.
+ *
+ * @property {number} TIMEOUT
+ * @static
+ */
+ static TIMEOUT = 124;
+
+ /**
+ * Error code indicating that the email address was invalid.
+ *
+ * @property {number} INVALID_EMAIL_ADDRESS
+ * @static
+ */
+ static INVALID_EMAIL_ADDRESS = 125;
+
+ /**
+ * Error code indicating a missing content type.
+ *
+ * @property {number} MISSING_CONTENT_TYPE
+ * @static
+ */
+ static MISSING_CONTENT_TYPE = 126;
+
+ /**
+ * Error code indicating a missing content length.
+ *
+ * @property {number} MISSING_CONTENT_LENGTH
+ * @static
+ */
+ static MISSING_CONTENT_LENGTH = 127;
+
+ /**
+ * Error code indicating an invalid content length.
+ *
+ * @property {number} INVALID_CONTENT_LENGTH
+ * @static
+ */
+ static INVALID_CONTENT_LENGTH = 128;
+
+ /**
+ * Error code indicating a file that was too large.
+ *
+ * @property {number} FILE_TOO_LARGE
+ * @static
+ */
+ static FILE_TOO_LARGE = 129;
+
+ /**
+ * Error code indicating an error saving a file.
+ *
+ * @property {number} FILE_SAVE_ERROR
+ * @static
+ */
+ static FILE_SAVE_ERROR = 130;
+
+ /**
+ * Error code indicating that a unique field was given a value that is
+ * already taken.
+ *
+ * @property {number} DUPLICATE_VALUE
+ * @static
+ */
+ static DUPLICATE_VALUE = 137;
+
+ /**
+ * Error code indicating that a role's name is invalid.
+ *
+ * @property {number} INVALID_ROLE_NAME
+ * @static
+ */
+ static INVALID_ROLE_NAME = 139;
+
+ /**
+ * Error code indicating that an application quota was exceeded. Upgrade to
+ * resolve.
+ *
+ * @property {number} EXCEEDED_QUOTA
+ * @static
+ */
+ static EXCEEDED_QUOTA = 140;
+
+ /**
+ * Error code indicating that a Cloud Code script failed.
+ *
+ * @property {number} SCRIPT_FAILED
+ * @static
+ */
+ static SCRIPT_FAILED = 141;
+
+ /**
+ * Error code indicating that a Cloud Code validation failed.
+ *
+ * @property {number} VALIDATION_ERROR
+ * @static
+ */
+ static VALIDATION_ERROR = 142;
+
+ /**
+ * Error code indicating that invalid image data was provided.
+ *
+ * @property {number} INVALID_IMAGE_DATA
+ * @static
+ */
+ static INVALID_IMAGE_DATA = 143;
+
+ /**
+ * Error code indicating an unsaved file.
+ *
+ * @property {number} UNSAVED_FILE_ERROR
+ * @static
+ */
+ static UNSAVED_FILE_ERROR = 151;
+
+ /**
+ * Error code indicating an invalid push time.
+ *
+ * @property {number} INVALID_PUSH_TIME_ERROR
+ * @static
+ */
+ static INVALID_PUSH_TIME_ERROR = 152;
+
+ /**
+ * Error code indicating an error deleting a file.
+ *
+ * @property {number} FILE_DELETE_ERROR
+ * @static
+ */
+ static FILE_DELETE_ERROR = 153;
+
+ /**
+ * Error code indicating an error deleting an unnamed file.
+ *
+ * @property {number} FILE_DELETE_UNNAMED_ERROR
+ * @static
+ */
+ static FILE_DELETE_UNNAMED_ERROR = 161;
+
+ /**
+ * Error code indicating that the application has exceeded its request
+ * limit.
+ *
+ * @property {number} REQUEST_LIMIT_EXCEEDED
+ * @static
+ */
+ static REQUEST_LIMIT_EXCEEDED = 155;
+
+ /**
+ * Error code indicating that the request was a duplicate and has been discarded due to
+ * idempotency rules.
+ *
+ * @property {number} DUPLICATE_REQUEST
+ * @static
+ */
+ static DUPLICATE_REQUEST = 159;
+
+ /**
+ * Error code indicating an invalid event name.
+ *
+ * @property {number} INVALID_EVENT_NAME
+ * @static
+ */
+ static INVALID_EVENT_NAME = 160;
+
+ /**
+ * Error code indicating that a field had an invalid value.
+ *
+ * @property {number} INVALID_VALUE
+ * @static
+ */
+ static INVALID_VALUE = 162;
+
+ /**
+ * Error code indicating that the username is missing or empty.
+ *
+ * @property {number} USERNAME_MISSING
+ * @static
+ */
+ static USERNAME_MISSING = 200;
+
+ /**
+ * Error code indicating that the password is missing or empty.
+ *
+ * @property {number} PASSWORD_MISSING
+ * @static
+ */
+ static PASSWORD_MISSING = 201;
+
+ /**
+ * Error code indicating that the username has already been taken.
+ *
+ * @property {number} USERNAME_TAKEN
+ * @static
+ */
+ static USERNAME_TAKEN = 202;
+
+ /**
+ * Error code indicating that the email has already been taken.
+ *
+ * @property {number} EMAIL_TAKEN
+ * @static
+ */
+ static EMAIL_TAKEN = 203;
+
+ /**
+ * Error code indicating that the email is missing, but must be specified.
+ *
+ * @property {number} EMAIL_MISSING
+ * @static
+ */
+ static EMAIL_MISSING = 204;
+
+ /**
+ * Error code indicating that a user with the specified email was not found.
+ *
+ * @property {number} EMAIL_NOT_FOUND
+ * @static
+ */
+ static EMAIL_NOT_FOUND = 205;
+
+ /**
+ * Error code indicating that a user object without a valid session could
+ * not be altered.
+ *
+ * @property {number} SESSION_MISSING
+ * @static
+ */
+ static SESSION_MISSING = 206;
+
+ /**
+ * Error code indicating that a user can only be created through signup.
+ *
+ * @property {number} MUST_CREATE_USER_THROUGH_SIGNUP
+ * @static
+ */
+ static MUST_CREATE_USER_THROUGH_SIGNUP = 207;
+
+ /**
+ * Error code indicating that an an account being linked is already linked
+ * to another user.
+ *
+ * @property {number} ACCOUNT_ALREADY_LINKED
+ * @static
+ */
+ static ACCOUNT_ALREADY_LINKED = 208;
+
+ /**
+ * Error code indicating that the current session token is invalid.
+ *
+ * @property {number} INVALID_SESSION_TOKEN
+ * @static
+ */
+ static INVALID_SESSION_TOKEN = 209;
+
+ /**
+ * Error code indicating an error enabling or verifying MFA
+ *
+ * @property {number} MFA_ERROR
+ * @static
+ */
+ static MFA_ERROR = 210;
+
+ /**
+ * Error code indicating that a valid MFA token must be provided
+ *
+ * @property {number} MFA_TOKEN_REQUIRED
+ * @static
+ */
+ static MFA_TOKEN_REQUIRED = 211;
+
+ /**
+ * Error code indicating that a user cannot be linked to an account because
+ * that account's id could not be found.
+ *
+ * @property {number} LINKED_ID_MISSING
+ * @static
+ */
+ static LINKED_ID_MISSING = 250;
+
+ /**
+ * Error code indicating that a user with a linked (e.g. Facebook) account
+ * has an invalid session.
+ *
+ * @property {number} INVALID_LINKED_SESSION
+ * @static
+ */
+ static INVALID_LINKED_SESSION = 251;
+
+ /**
+ * Error code indicating that a service being linked (e.g. Facebook or
+ * Twitter) is unsupported.
+ *
+ * @property {number} UNSUPPORTED_SERVICE
+ * @static
+ */
+ static UNSUPPORTED_SERVICE = 252;
+
+ /**
+ * Error code indicating an invalid operation occured on schema
+ *
+ * @property {number} INVALID_SCHEMA_OPERATION
+ * @static
+ */
+ static INVALID_SCHEMA_OPERATION = 255;
+
+ /**
+ * Error code indicating that there were multiple errors. Aggregate errors
+ * have an "errors" property, which is an array of error objects with more
+ * detail about each error that occurred.
+ *
+ * @property {number} AGGREGATE_ERROR
+ * @static
+ */
+ static AGGREGATE_ERROR = 600;
+
+ /**
+ * Error code indicating the client was unable to read an input file.
+ *
+ * @property {number} FILE_READ_ERROR
+ * @static
+ */
+ static FILE_READ_ERROR = 601;
+
+ /**
+ * Error code indicating a real error code is unavailable because
+ * we had to use an XDomainRequest object to allow CORS requests in
+ * Internet Explorer, which strips the body from HTTP responses that have
+ * a non-2XX status code.
+ *
+ * @property {number} X_DOMAIN_REQUEST
+ * @static
+ */
+ static X_DOMAIN_REQUEST = 602;
+}
+
+export default ParseError;
diff --git a/src/ParseLiveQuery.js b/src/ParseLiveQuery.ts
similarity index 93%
rename from src/ParseLiveQuery.js
rename to src/ParseLiveQuery.ts
index c293133c7..8c7e8188f 100644
--- a/src/ParseLiveQuery.js
+++ b/src/ParseLiveQuery.ts
@@ -1,6 +1,3 @@
-/**
- * @flow
- */
import LiveQueryClient from './LiveQueryClient';
import CoreManager from './CoreManager';
@@ -36,11 +33,15 @@ function getLiveQueryClient(): PromiseResponse Object - Contains data from the client that made the request @@ -81,21 +80,23 @@ export default Subscription; * subscription.on('close', () => { * * });
- * - * @alias Parse.LiveQuerySubscription */ declare class Subscription { - constructor(id: any, query: any, sessionToken: any); - id: any; - query: any; - sessionToken: any; - subscribePromise: PromiseParse.Error
.
* @param {string} message A detailed description of the error.
*/
- constructor(code: number, message: string);
- code: number;
-}
-declare namespace ParseError {
- let OTHER_CAUSE: number;
- let INTERNAL_SERVER_ERROR: number;
- let CONNECTION_FAILED: number;
- let OBJECT_NOT_FOUND: number;
- let INVALID_QUERY: number;
- let INVALID_CLASS_NAME: number;
- let MISSING_OBJECT_ID: number;
- let INVALID_KEY_NAME: number;
- let INVALID_POINTER: number;
- let INVALID_JSON: number;
- let COMMAND_UNAVAILABLE: number;
- let NOT_INITIALIZED: number;
- let INCORRECT_TYPE: number;
- let INVALID_CHANNEL_NAME: number;
- let PUSH_MISCONFIGURED: number;
- let OBJECT_TOO_LARGE: number;
- let OPERATION_FORBIDDEN: number;
- let CACHE_MISS: number;
- let INVALID_NESTED_KEY: number;
- let INVALID_FILE_NAME: number;
- let INVALID_ACL: number;
- let TIMEOUT: number;
- let INVALID_EMAIL_ADDRESS: number;
- let MISSING_CONTENT_TYPE: number;
- let MISSING_CONTENT_LENGTH: number;
- let INVALID_CONTENT_LENGTH: number;
- let FILE_TOO_LARGE: number;
- let FILE_SAVE_ERROR: number;
- let DUPLICATE_VALUE: number;
- let INVALID_ROLE_NAME: number;
- let EXCEEDED_QUOTA: number;
- let SCRIPT_FAILED: number;
- let VALIDATION_ERROR: number;
- let INVALID_IMAGE_DATA: number;
- let UNSAVED_FILE_ERROR: number;
- let INVALID_PUSH_TIME_ERROR: number;
- let FILE_DELETE_ERROR: number;
- let FILE_DELETE_UNNAMED_ERROR: number;
- let REQUEST_LIMIT_EXCEEDED: number;
- let DUPLICATE_REQUEST: number;
- let INVALID_EVENT_NAME: number;
- let INVALID_VALUE: number;
- let USERNAME_MISSING: number;
- let PASSWORD_MISSING: number;
- let USERNAME_TAKEN: number;
- let EMAIL_TAKEN: number;
- let EMAIL_MISSING: number;
- let EMAIL_NOT_FOUND: number;
- let SESSION_MISSING: number;
- let MUST_CREATE_USER_THROUGH_SIGNUP: number;
- let ACCOUNT_ALREADY_LINKED: number;
- let INVALID_SESSION_TOKEN: number;
- let MFA_ERROR: number;
- let MFA_TOKEN_REQUIRED: number;
- let LINKED_ID_MISSING: number;
- let INVALID_LINKED_SESSION: number;
- let UNSUPPORTED_SERVICE: number;
- let INVALID_SCHEMA_OPERATION: number;
- let AGGREGATE_ERROR: number;
- let FILE_READ_ERROR: number;
- let X_DOMAIN_REQUEST: number;
+ constructor(code: number, message?: string);
+ toString(): string;
+ /**
+ * Error code indicating some error other than those enumerated here.
+ *
+ * @property {number} OTHER_CAUSE
+ * @static
+ */
+ static OTHER_CAUSE: number;
+ /**
+ * Error code indicating that something has gone wrong with the server.
+ *
+ * @property {number} INTERNAL_SERVER_ERROR
+ * @static
+ */
+ static INTERNAL_SERVER_ERROR: number;
+ /**
+ * Error code indicating the connection to the Parse servers failed.
+ *
+ * @property {number} CONNECTION_FAILED
+ * @static
+ */
+ static CONNECTION_FAILED: number;
+ /**
+ * Error code indicating the specified object doesn't exist.
+ *
+ * @property {number} OBJECT_NOT_FOUND
+ * @static
+ */
+ static OBJECT_NOT_FOUND: number;
+ /**
+ * Error code indicating you tried to query with a datatype that doesn't
+ * support it, like exact matching an array or object.
+ *
+ * @property {number} INVALID_QUERY
+ * @static
+ */
+ static INVALID_QUERY: number;
+ /**
+ * Error code indicating a missing or invalid classname. Classnames are
+ * case-sensitive. They must start with a letter, and a-zA-Z0-9_ are the
+ * only valid characters.
+ *
+ * @property {number} INVALID_CLASS_NAME
+ * @static
+ */
+ static INVALID_CLASS_NAME: number;
+ /**
+ * Error code indicating an unspecified object id.
+ *
+ * @property {number} MISSING_OBJECT_ID
+ * @static
+ */
+ static MISSING_OBJECT_ID: number;
+ /**
+ * Error code indicating an invalid key name. Keys are case-sensitive. They
+ * must start with a letter, and a-zA-Z0-9_ are the only valid characters.
+ *
+ * @property {number} INVALID_KEY_NAME
+ * @static
+ */
+ static INVALID_KEY_NAME: number;
+ /**
+ * Error code indicating a malformed pointer. You should not see this unless
+ * you have been mucking about changing internal Parse code.
+ *
+ * @property {number} INVALID_POINTER
+ * @static
+ */
+ static INVALID_POINTER: number;
+ /**
+ * Error code indicating that badly formed JSON was received upstream. This
+ * either indicates you have done something unusual with modifying how
+ * things encode to JSON, or the network is failing badly.
+ *
+ * @property {number} INVALID_JSON
+ * @static
+ */
+ static INVALID_JSON: number;
+ /**
+ * Error code indicating that the feature you tried to access is only
+ * available internally for testing purposes.
+ *
+ * @property {number} COMMAND_UNAVAILABLE
+ * @static
+ */
+ static COMMAND_UNAVAILABLE: number;
+ /**
+ * You must call Parse.initialize before using the Parse library.
+ *
+ * @property {number} NOT_INITIALIZED
+ * @static
+ */
+ static NOT_INITIALIZED: number;
+ /**
+ * Error code indicating that a field was set to an inconsistent type.
+ *
+ * @property {number} INCORRECT_TYPE
+ * @static
+ */
+ static INCORRECT_TYPE: number;
+ /**
+ * Error code indicating an invalid channel name. A channel name is either
+ * an empty string (the broadcast channel) or contains only a-zA-Z0-9_
+ * characters and starts with a letter.
+ *
+ * @property {number} INVALID_CHANNEL_NAME
+ * @static
+ */
+ static INVALID_CHANNEL_NAME: number;
+ /**
+ * Error code indicating that push is misconfigured.
+ *
+ * @property {number} PUSH_MISCONFIGURED
+ * @static
+ */
+ static PUSH_MISCONFIGURED: number;
+ /**
+ * Error code indicating that the object is too large.
+ *
+ * @property {number} OBJECT_TOO_LARGE
+ * @static
+ */
+ static OBJECT_TOO_LARGE: number;
+ /**
+ * Error code indicating that the operation isn't allowed for clients.
+ *
+ * @property {number} OPERATION_FORBIDDEN
+ * @static
+ */
+ static OPERATION_FORBIDDEN: number;
+ /**
+ * Error code indicating the result was not found in the cache.
+ *
+ * @property {number} CACHE_MISS
+ * @static
+ */
+ static CACHE_MISS: number;
+ /**
+ * Error code indicating that an invalid key was used in a nested
+ * JSONObject.
+ *
+ * @property {number} INVALID_NESTED_KEY
+ * @static
+ */
+ static INVALID_NESTED_KEY: number;
+ /**
+ * Error code indicating that an invalid filename was used for ParseFile.
+ * A valid file name contains only a-zA-Z0-9_. characters and is between 1
+ * and 128 characters.
+ *
+ * @property {number} INVALID_FILE_NAME
+ * @static
+ */
+ static INVALID_FILE_NAME: number;
+ /**
+ * Error code indicating an invalid ACL was provided.
+ *
+ * @property {number} INVALID_ACL
+ * @static
+ */
+ static INVALID_ACL: number;
+ /**
+ * Error code indicating that the request timed out on the server. Typically
+ * this indicates that the request is too expensive to run.
+ *
+ * @property {number} TIMEOUT
+ * @static
+ */
+ static TIMEOUT: number;
+ /**
+ * Error code indicating that the email address was invalid.
+ *
+ * @property {number} INVALID_EMAIL_ADDRESS
+ * @static
+ */
+ static INVALID_EMAIL_ADDRESS: number;
+ /**
+ * Error code indicating a missing content type.
+ *
+ * @property {number} MISSING_CONTENT_TYPE
+ * @static
+ */
+ static MISSING_CONTENT_TYPE: number;
+ /**
+ * Error code indicating a missing content length.
+ *
+ * @property {number} MISSING_CONTENT_LENGTH
+ * @static
+ */
+ static MISSING_CONTENT_LENGTH: number;
+ /**
+ * Error code indicating an invalid content length.
+ *
+ * @property {number} INVALID_CONTENT_LENGTH
+ * @static
+ */
+ static INVALID_CONTENT_LENGTH: number;
+ /**
+ * Error code indicating a file that was too large.
+ *
+ * @property {number} FILE_TOO_LARGE
+ * @static
+ */
+ static FILE_TOO_LARGE: number;
+ /**
+ * Error code indicating an error saving a file.
+ *
+ * @property {number} FILE_SAVE_ERROR
+ * @static
+ */
+ static FILE_SAVE_ERROR: number;
+ /**
+ * Error code indicating that a unique field was given a value that is
+ * already taken.
+ *
+ * @property {number} DUPLICATE_VALUE
+ * @static
+ */
+ static DUPLICATE_VALUE: number;
+ /**
+ * Error code indicating that a role's name is invalid.
+ *
+ * @property {number} INVALID_ROLE_NAME
+ * @static
+ */
+ static INVALID_ROLE_NAME: number;
+ /**
+ * Error code indicating that an application quota was exceeded. Upgrade to
+ * resolve.
+ *
+ * @property {number} EXCEEDED_QUOTA
+ * @static
+ */
+ static EXCEEDED_QUOTA: number;
+ /**
+ * Error code indicating that a Cloud Code script failed.
+ *
+ * @property {number} SCRIPT_FAILED
+ * @static
+ */
+ static SCRIPT_FAILED: number;
+ /**
+ * Error code indicating that a Cloud Code validation failed.
+ *
+ * @property {number} VALIDATION_ERROR
+ * @static
+ */
+ static VALIDATION_ERROR: number;
+ /**
+ * Error code indicating that invalid image data was provided.
+ *
+ * @property {number} INVALID_IMAGE_DATA
+ * @static
+ */
+ static INVALID_IMAGE_DATA: number;
+ /**
+ * Error code indicating an unsaved file.
+ *
+ * @property {number} UNSAVED_FILE_ERROR
+ * @static
+ */
+ static UNSAVED_FILE_ERROR: number;
+ /**
+ * Error code indicating an invalid push time.
+ *
+ * @property {number} INVALID_PUSH_TIME_ERROR
+ * @static
+ */
+ static INVALID_PUSH_TIME_ERROR: number;
+ /**
+ * Error code indicating an error deleting a file.
+ *
+ * @property {number} FILE_DELETE_ERROR
+ * @static
+ */
+ static FILE_DELETE_ERROR: number;
+ /**
+ * Error code indicating an error deleting an unnamed file.
+ *
+ * @property {number} FILE_DELETE_UNNAMED_ERROR
+ * @static
+ */
+ static FILE_DELETE_UNNAMED_ERROR: number;
+ /**
+ * Error code indicating that the application has exceeded its request
+ * limit.
+ *
+ * @property {number} REQUEST_LIMIT_EXCEEDED
+ * @static
+ */
+ static REQUEST_LIMIT_EXCEEDED: number;
+ /**
+ * Error code indicating that the request was a duplicate and has been discarded due to
+ * idempotency rules.
+ *
+ * @property {number} DUPLICATE_REQUEST
+ * @static
+ */
+ static DUPLICATE_REQUEST: number;
+ /**
+ * Error code indicating an invalid event name.
+ *
+ * @property {number} INVALID_EVENT_NAME
+ * @static
+ */
+ static INVALID_EVENT_NAME: number;
+ /**
+ * Error code indicating that a field had an invalid value.
+ *
+ * @property {number} INVALID_VALUE
+ * @static
+ */
+ static INVALID_VALUE: number;
+ /**
+ * Error code indicating that the username is missing or empty.
+ *
+ * @property {number} USERNAME_MISSING
+ * @static
+ */
+ static USERNAME_MISSING: number;
+ /**
+ * Error code indicating that the password is missing or empty.
+ *
+ * @property {number} PASSWORD_MISSING
+ * @static
+ */
+ static PASSWORD_MISSING: number;
+ /**
+ * Error code indicating that the username has already been taken.
+ *
+ * @property {number} USERNAME_TAKEN
+ * @static
+ */
+ static USERNAME_TAKEN: number;
+ /**
+ * Error code indicating that the email has already been taken.
+ *
+ * @property {number} EMAIL_TAKEN
+ * @static
+ */
+ static EMAIL_TAKEN: number;
+ /**
+ * Error code indicating that the email is missing, but must be specified.
+ *
+ * @property {number} EMAIL_MISSING
+ * @static
+ */
+ static EMAIL_MISSING: number;
+ /**
+ * Error code indicating that a user with the specified email was not found.
+ *
+ * @property {number} EMAIL_NOT_FOUND
+ * @static
+ */
+ static EMAIL_NOT_FOUND: number;
+ /**
+ * Error code indicating that a user object without a valid session could
+ * not be altered.
+ *
+ * @property {number} SESSION_MISSING
+ * @static
+ */
+ static SESSION_MISSING: number;
+ /**
+ * Error code indicating that a user can only be created through signup.
+ *
+ * @property {number} MUST_CREATE_USER_THROUGH_SIGNUP
+ * @static
+ */
+ static MUST_CREATE_USER_THROUGH_SIGNUP: number;
+ /**
+ * Error code indicating that an an account being linked is already linked
+ * to another user.
+ *
+ * @property {number} ACCOUNT_ALREADY_LINKED
+ * @static
+ */
+ static ACCOUNT_ALREADY_LINKED: number;
+ /**
+ * Error code indicating that the current session token is invalid.
+ *
+ * @property {number} INVALID_SESSION_TOKEN
+ * @static
+ */
+ static INVALID_SESSION_TOKEN: number;
+ /**
+ * Error code indicating an error enabling or verifying MFA
+ *
+ * @property {number} MFA_ERROR
+ * @static
+ */
+ static MFA_ERROR: number;
+ /**
+ * Error code indicating that a valid MFA token must be provided
+ *
+ * @property {number} MFA_TOKEN_REQUIRED
+ * @static
+ */
+ static MFA_TOKEN_REQUIRED: number;
+ /**
+ * Error code indicating that a user cannot be linked to an account because
+ * that account's id could not be found.
+ *
+ * @property {number} LINKED_ID_MISSING
+ * @static
+ */
+ static LINKED_ID_MISSING: number;
+ /**
+ * Error code indicating that a user with a linked (e.g. Facebook) account
+ * has an invalid session.
+ *
+ * @property {number} INVALID_LINKED_SESSION
+ * @static
+ */
+ static INVALID_LINKED_SESSION: number;
+ /**
+ * Error code indicating that a service being linked (e.g. Facebook or
+ * Twitter) is unsupported.
+ *
+ * @property {number} UNSUPPORTED_SERVICE
+ * @static
+ */
+ static UNSUPPORTED_SERVICE: number;
+ /**
+ * Error code indicating an invalid operation occured on schema
+ *
+ * @property {number} INVALID_SCHEMA_OPERATION
+ * @static
+ */
+ static INVALID_SCHEMA_OPERATION: number;
+ /**
+ * Error code indicating that there were multiple errors. Aggregate errors
+ * have an "errors" property, which is an array of error objects with more
+ * detail about each error that occurred.
+ *
+ * @property {number} AGGREGATE_ERROR
+ * @static
+ */
+ static AGGREGATE_ERROR: number;
+ /**
+ * Error code indicating the client was unable to read an input file.
+ *
+ * @property {number} FILE_READ_ERROR
+ * @static
+ */
+ static FILE_READ_ERROR: number;
+ /**
+ * Error code indicating a real error code is unavailable because
+ * we had to use an XDomainRequest object to allow CORS requests in
+ * Internet Explorer, which strips the body from HTTP responses that have
+ * a non-2XX status code.
+ *
+ * @property {number} X_DOMAIN_REQUEST
+ * @static
+ */
+ static X_DOMAIN_REQUEST: number;
}
+export default ParseError;
diff --git a/types/ParseLiveQuery.d.ts b/types/ParseLiveQuery.d.ts
index 6e98e68c1..ac9aa3495 100644
--- a/types/ParseLiveQuery.d.ts
+++ b/types/ParseLiveQuery.d.ts
@@ -1,4 +1,3 @@
-export default LiveQuery;
/**
* We expose three events to help you monitor the status of the WebSocket connection:
*
@@ -26,4 +25,23 @@ export default LiveQuery;
* @class Parse.LiveQuery
* @static
*/
-declare const LiveQuery: any;
+declare class LiveQuery {
+ emitter: any;
+ on: any;
+ emit: any;
+ constructor();
+ /**
+ * After open is called, the LiveQuery will try to send a connect request
+ * to the LiveQuery server.
+ */
+ open(): Promise