feat: Upgrade to @parse/push-adapter 8.1.0 (#9938)
This commit is contained in:
167
README.md
167
README.md
@@ -29,7 +29,7 @@ The full documentation for Parse Server is available in the [wiki](https://githu
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
A big *thank you* 🙏 to our [sponsors](#sponsors) and [backers](#backers) who support the development of Parse Platform!
|
A big _thank you_ 🙏 to our [sponsors](#sponsors) and [backers](#backers) who support the development of Parse Platform!
|
||||||
|
|
||||||
#### Bronze Sponsors
|
#### Bronze Sponsors
|
||||||
|
|
||||||
@@ -126,7 +126,7 @@ Before you start make sure you have installed:
|
|||||||
Parse Server is continuously tested with the most recent releases of Node.js to ensure compatibility. We follow the [Node.js Long Term Support plan](https://github.com/nodejs/Release) and only test against versions that are officially supported and have not reached their end-of-life date.
|
Parse Server is continuously tested with the most recent releases of Node.js to ensure compatibility. We follow the [Node.js Long Term Support plan](https://github.com/nodejs/Release) and only test against versions that are officially supported and have not reached their end-of-life date.
|
||||||
|
|
||||||
| Version | Minimum Version | End-of-Life | Parse Server Support |
|
| Version | Minimum Version | End-of-Life | Parse Server Support |
|
||||||
|------------|-----------------|-------------|----------------------|
|
| ---------- | --------------- | ----------- | -------------------- |
|
||||||
| Node.js 18 | 18.20.4 | April 2025 | <= 8.x (2025) |
|
| Node.js 18 | 18.20.4 | April 2025 | <= 8.x (2025) |
|
||||||
| Node.js 20 | 20.19.0 | April 2026 | <= 9.x (2026) |
|
| Node.js 20 | 20.19.0 | April 2026 | <= 9.x (2026) |
|
||||||
| Node.js 22 | 22.12.0 | April 2027 | <= 10.x (2027) |
|
| Node.js 22 | 22.12.0 | April 2027 | <= 10.x (2027) |
|
||||||
@@ -137,7 +137,7 @@ Parse Server is continuously tested with the most recent releases of Node.js to
|
|||||||
Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and [MongoDB lifecycle schedule](https://www.mongodb.com/support-policy/lifecycles) and only test against versions that are officially supported and have not reached their end-of-life date. MongoDB "rapid releases" are ignored as these are considered pre-releases of the next major version.
|
Parse Server is continuously tested with the most recent releases of MongoDB to ensure compatibility. We follow the [MongoDB support schedule](https://www.mongodb.com/support-policy) and [MongoDB lifecycle schedule](https://www.mongodb.com/support-policy/lifecycles) and only test against versions that are officially supported and have not reached their end-of-life date. MongoDB "rapid releases" are ignored as these are considered pre-releases of the next major version.
|
||||||
|
|
||||||
| Version | Minimum Version | End-of-Life | Parse Server Support |
|
| Version | Minimum Version | End-of-Life | Parse Server Support |
|
||||||
|-----------|-----------------|-------------|----------------------|
|
| --------- | --------------- | ----------- | -------------------- |
|
||||||
| MongoDB 6 | 6.0.19 | July 2025 | <= 8.x (2025) |
|
| MongoDB 6 | 6.0.19 | July 2025 | <= 8.x (2025) |
|
||||||
| MongoDB 7 | 7.0.16 | August 2026 | <= 9.x (2026) |
|
| MongoDB 7 | 7.0.16 | August 2026 | <= 9.x (2026) |
|
||||||
| MongoDB 8 | 8.0.4 | TDB | <= 10.x (2027) |
|
| MongoDB 8 | 8.0.4 | TDB | <= 10.x (2027) |
|
||||||
@@ -147,7 +147,7 @@ Parse Server is continuously tested with the most recent releases of MongoDB to
|
|||||||
Parse Server is continuously tested with the most recent releases of PostgreSQL and PostGIS to ensure compatibility, using [PostGIS docker images](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&ordering=last_updated). We follow the [PostgreSQL support schedule](https://www.postgresql.org/support/versioning) and [PostGIS support schedule](https://www.postgis.net/eol_policy/) and only test against versions that are officially supported and have not reached their end-of-life date. Due to the extensive PostgreSQL support duration of 5 years, Parse Server drops support about 2 years before the official end-of-life date.
|
Parse Server is continuously tested with the most recent releases of PostgreSQL and PostGIS to ensure compatibility, using [PostGIS docker images](https://registry.hub.docker.com/r/postgis/postgis/tags?page=1&ordering=last_updated). We follow the [PostgreSQL support schedule](https://www.postgresql.org/support/versioning) and [PostGIS support schedule](https://www.postgis.net/eol_policy/) and only test against versions that are officially supported and have not reached their end-of-life date. Due to the extensive PostgreSQL support duration of 5 years, Parse Server drops support about 2 years before the official end-of-life date.
|
||||||
|
|
||||||
| Version | PostGIS Version | End-of-Life | Parse Server Support |
|
| Version | PostGIS Version | End-of-Life | Parse Server Support |
|
||||||
|-------------|-------------------------|---------------|----------------------|
|
| ----------- | ----------------------- | ------------- | -------------------- |
|
||||||
| Postgres 13 | 3.1, 3.2, 3.3, 3.4, 3.5 | November 2025 | <= 6.x (2023) |
|
| Postgres 13 | 3.1, 3.2, 3.3, 3.4, 3.5 | November 2025 | <= 6.x (2023) |
|
||||||
| Postgres 14 | 3.5 | November 2026 | <= 7.x (2024) |
|
| Postgres 14 | 3.5 | November 2026 | <= 7.x (2024) |
|
||||||
| Postgres 15 | 3.3, 3.4, 3.5 | November 2027 | <= 8.x (2025) |
|
| Postgres 15 | 3.3, 3.4, 3.5 | November 2027 | <= 8.x (2025) |
|
||||||
@@ -162,8 +162,8 @@ $ npm install -g parse-server mongodb-runner
|
|||||||
$ mongodb-runner start
|
$ mongodb-runner start
|
||||||
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test
|
$ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://localhost/test
|
||||||
```
|
```
|
||||||
***Note:*** *If installation with* `-g` *fails due to permission problems* (`npm ERR! code 'EACCES'`), *please refer to [this link](https://docs.npmjs.com/getting-started/fixing-npm-permissions).*
|
|
||||||
|
|
||||||
|
**_Note:_** _If installation with_ `-g` _fails due to permission problems_ (`npm ERR! code 'EACCES'`), _please refer to [this link](https://docs.npmjs.com/getting-started/fixing-npm-permissions)._
|
||||||
|
|
||||||
### Docker Container
|
### Docker Container
|
||||||
|
|
||||||
@@ -180,13 +180,13 @@ $ docker run --name my-mongo -d mongo
|
|||||||
$ docker run --name my-parse-server -v config-vol:/parse-server/config -p 1337:1337 --link my-mongo:mongo -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test
|
$ docker run --name my-parse-server -v config-vol:/parse-server/config -p 1337:1337 --link my-mongo:mongo -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test
|
||||||
```
|
```
|
||||||
|
|
||||||
***Note:*** *If you want to use [Cloud Code](https://docs.parseplatform.org/cloudcode/guide/), add `-v cloud-code-vol:/parse-server/cloud --cloud /parse-server/cloud/main.js` to the command above. Make sure `main.js` is in the `cloud-code-vol` directory before starting Parse Server.*
|
**_Note:_** _If you want to use [Cloud Code](https://docs.parseplatform.org/cloudcode/guide/), add `-v cloud-code-vol:/parse-server/cloud --cloud /parse-server/cloud/main.js` to the command above. Make sure `main.js` is in the `cloud-code-vol` directory before starting Parse Server._
|
||||||
|
|
||||||
You can use any arbitrary string as your application id and master key. These will be used by your clients to authenticate with the Parse Server.
|
You can use any arbitrary string as your application id and master key. These will be used by your clients to authenticate with the Parse Server.
|
||||||
|
|
||||||
That's it! You are now running a standalone version of Parse Server on your machine.
|
That's it! You are now running a standalone version of Parse Server on your machine.
|
||||||
|
|
||||||
**Using a remote MongoDB?** Pass the `--databaseURI DATABASE_URI` parameter when starting `parse-server`. Learn more about configuring Parse Server [here](#configuration). For a full list of available options, run `parse-server --help`.
|
**Using a remote MongoDB?** Pass the `--databaseURI DATABASE_URI` parameter when starting `parse-server`. Learn more about configuring Parse Server [here](#configuration). For a full list of available options, run `parse-server --help`.
|
||||||
|
|
||||||
### Saving and Querying Objects
|
### Saving and Querying Objects
|
||||||
|
|
||||||
@@ -204,17 +204,17 @@ Once you have a better understanding of how the project works, please refer to t
|
|||||||
|
|
||||||
We have provided a basic [Node.js application](https://github.com/parse-community/parse-server-example) that uses the Parse Server module on Express and can be easily deployed to various infrastructure providers:
|
We have provided a basic [Node.js application](https://github.com/parse-community/parse-server-example) that uses the Parse Server module on Express and can be easily deployed to various infrastructure providers:
|
||||||
|
|
||||||
* [Heroku and mLab](https://devcenter.heroku.com/articles/deploying-a-parse-server-to-heroku)
|
- [Heroku and mLab](https://devcenter.heroku.com/articles/deploying-a-parse-server-to-heroku)
|
||||||
* [AWS and Elastic Beanstalk](http://mobile.awsblog.com/post/TxCD57GZLM2JR/How-to-set-up-Parse-Server-on-AWS-using-AWS-Elastic-Beanstalk)
|
- [AWS and Elastic Beanstalk](http://mobile.awsblog.com/post/TxCD57GZLM2JR/How-to-set-up-Parse-Server-on-AWS-using-AWS-Elastic-Beanstalk)
|
||||||
* [Google App Engine](https://medium.com/@justinbeckwith/deploying-parse-server-to-google-app-engine-6bc0b7451d50)
|
- [Google App Engine](https://medium.com/@justinbeckwith/deploying-parse-server-to-google-app-engine-6bc0b7451d50)
|
||||||
* [Microsoft Azure](https://azure.microsoft.com/en-us/blog/azure-welcomes-parse-developers/)
|
- [Microsoft Azure](https://azure.microsoft.com/en-us/blog/azure-welcomes-parse-developers/)
|
||||||
* [SashiDo](https://blog.sashido.io/tag/migration/)
|
- [SashiDo](https://blog.sashido.io/tag/migration/)
|
||||||
* [Digital Ocean](https://www.digitalocean.com/community/tutorials/how-to-run-parse-server-on-ubuntu-14-04)
|
- [Digital Ocean](https://www.digitalocean.com/community/tutorials/how-to-run-parse-server-on-ubuntu-14-04)
|
||||||
* [Pivotal Web Services](https://github.com/cf-platform-eng/pws-parse-server)
|
- [Pivotal Web Services](https://github.com/cf-platform-eng/pws-parse-server)
|
||||||
* [Back4app](https://www.back4app.com/docs/get-started/welcome)
|
- [Back4app](https://www.back4app.com/docs/get-started/welcome)
|
||||||
* [Glitch](https://glitch.com/edit/#!/parse-server)
|
- [Glitch](https://glitch.com/edit/#!/parse-server)
|
||||||
* [Flynn](https://flynn.io/blog/parse-apps-on-flynn)
|
- [Flynn](https://flynn.io/blog/parse-apps-on-flynn)
|
||||||
* [Elestio](https://elest.io/open-source/parse)
|
- [Elestio](https://elest.io/open-source/parse)
|
||||||
|
|
||||||
### Parse Server + Express
|
### Parse Server + Express
|
||||||
|
|
||||||
@@ -231,7 +231,7 @@ const server = new ParseServer({
|
|||||||
appId: 'myAppId',
|
appId: 'myAppId',
|
||||||
masterKey: 'myMasterKey', // Keep this key secret!
|
masterKey: 'myMasterKey', // Keep this key secret!
|
||||||
fileKey: 'optionalFileKey',
|
fileKey: 'optionalFileKey',
|
||||||
serverURL: 'http://localhost:1337/parse' // Don't forget to change to https if needed
|
serverURL: 'http://localhost:1337/parse', // Don't forget to change to https if needed
|
||||||
});
|
});
|
||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
@@ -240,7 +240,7 @@ await server.start();
|
|||||||
// Serve the Parse API on the /parse URL prefix
|
// Serve the Parse API on the /parse URL prefix
|
||||||
app.use('/parse', server.app);
|
app.use('/parse', server.app);
|
||||||
|
|
||||||
app.listen(1337, function() {
|
app.listen(1337, function () {
|
||||||
console.log('parse-server-example running on port 1337.');
|
console.log('parse-server-example running on port 1337.');
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
@@ -262,7 +262,7 @@ The response looks like this:
|
|||||||
### Status Values
|
### Status Values
|
||||||
|
|
||||||
| Value | Description |
|
| Value | Description |
|
||||||
|---------------|-----------------------------------------------------------------------------|
|
| ------------- | --------------------------------------------------------------------------- |
|
||||||
| `initialized` | The server has been created but the `start` method has not been called yet. |
|
| `initialized` | The server has been created but the `start` method has not been called yet. |
|
||||||
| `starting` | The server is starting up. |
|
| `starting` | The server is starting up. |
|
||||||
| `ok` | The server started and is running. |
|
| `ok` | The server started and is running. |
|
||||||
@@ -276,27 +276,27 @@ For the full list of available options, run `parse-server --help` or take a look
|
|||||||
|
|
||||||
## Basic Options
|
## Basic Options
|
||||||
|
|
||||||
* `appId` **(required)** - The application id to host with this server instance. You can use any arbitrary string. For migrated apps, this should match your hosted Parse app.
|
- `appId` **(required)** - The application id to host with this server instance. You can use any arbitrary string. For migrated apps, this should match your hosted Parse app.
|
||||||
* `masterKey` **(required)** - The master key to use for overriding ACL security. You can use any arbitrary string. Keep it secret! For migrated apps, this should match your hosted Parse app.
|
- `masterKey` **(required)** - The master key to use for overriding ACL security. You can use any arbitrary string. Keep it secret! For migrated apps, this should match your hosted Parse app.
|
||||||
* `databaseURI` **(required)** - The connection string for your database, i.e. `mongodb://user:pass@host.com/dbname`. Be sure to [URL encode your password](https://app.zencoder.com/docs/guides/getting-started/special-characters-in-usernames-and-passwords) if your password has special characters.
|
- `databaseURI` **(required)** - The connection string for your database, i.e. `mongodb://user:pass@host.com/dbname`. Be sure to [URL encode your password](https://app.zencoder.com/docs/guides/getting-started/special-characters-in-usernames-and-passwords) if your password has special characters.
|
||||||
* `port` - The default port is 1337, specify this parameter to use a different port.
|
- `port` - The default port is 1337, specify this parameter to use a different port.
|
||||||
* `serverURL` - URL to your Parse Server (don't forget to specify http:// or https://). This URL will be used when making requests to Parse Server from Cloud Code.
|
- `serverURL` - URL to your Parse Server (don't forget to specify http:// or https://). This URL will be used when making requests to Parse Server from Cloud Code.
|
||||||
* `cloud` - The absolute path to your cloud code `main.js` file.
|
- `cloud` - The absolute path to your cloud code `main.js` file.
|
||||||
* `push` - Configuration options for APNS and GCM push. See the [Push Notifications quick start](https://docs.parseplatform.org/parse-server/guide/#push-notifications-quick-start).
|
- `push` - Configuration options for APNS and FCM push. See the [Push Notifications quick start](https://docs.parseplatform.org/parse-server/guide/#push-notifications-quick-start).
|
||||||
|
|
||||||
## Client Key Options
|
## Client Key Options
|
||||||
|
|
||||||
The client keys used with Parse are no longer necessary with Parse Server. If you wish to still require them, perhaps to be able to refuse access to older clients, you can set the keys at initialization time. Setting any of these keys will require all requests to provide one of the configured keys.
|
The client keys used with Parse are no longer necessary with Parse Server. If you wish to still require them, perhaps to be able to refuse access to older clients, you can set the keys at initialization time. Setting any of these keys will require all requests to provide one of the configured keys.
|
||||||
|
|
||||||
* `clientKey`
|
- `clientKey`
|
||||||
* `javascriptKey`
|
- `javascriptKey`
|
||||||
* `restAPIKey`
|
- `restAPIKey`
|
||||||
* `dotNetKey`
|
- `dotNetKey`
|
||||||
|
|
||||||
## Access Scopes
|
## Access Scopes
|
||||||
|
|
||||||
| Scope | Internal data | Read-only data <sub>(1)</sub> | Custom data | Restricted by CLP, ACL | Key |
|
| Scope | Internal data | Read-only data <sub>(1)</sub> | Custom data | Restricted by CLP, ACL | Key |
|
||||||
|----------------|---------------|-------------------------------|-------------|------------------------|---------------------|
|
| -------------- | ------------- | ----------------------------- | ----------- | ---------------------- | ------------------- |
|
||||||
| Internal | r/w | r/w | r/w | no | `maintenanceKey` |
|
| Internal | r/w | r/w | r/w | no | `maintenanceKey` |
|
||||||
| Master | -/- | r/- | r/w | no | `masterKey` |
|
| Master | -/- | r/- | r/w | no | `masterKey` |
|
||||||
| ReadOnlyMaster | -/- | r/- | r/- | no | `readOnlyMasterKey` |
|
| ReadOnlyMaster | -/- | r/- | r/- | no | `readOnlyMasterKey` |
|
||||||
@@ -323,16 +323,18 @@ const server = ParseServer({
|
|||||||
module: 'example-mail-adapter',
|
module: 'example-mail-adapter',
|
||||||
options: {
|
options: {
|
||||||
// Additional adapter options
|
// Additional adapter options
|
||||||
...mailAdapterOptions
|
...mailAdapterOptions,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
Offical email adapters maintained by Parse Platform:
|
Offical email adapters maintained by Parse Platform:
|
||||||
|
|
||||||
- [parse-server-api-mail-adapter](https://github.com/parse-community/parse-server-api-mail-adapter) (localization, templates, universally supports any email provider)
|
- [parse-server-api-mail-adapter](https://github.com/parse-community/parse-server-api-mail-adapter) (localization, templates, universally supports any email provider)
|
||||||
|
|
||||||
Email adapters contributed by the community:
|
Email adapters contributed by the community:
|
||||||
|
|
||||||
- [parse-smtp-template](https://www.npmjs.com/package/parse-smtp-template) (localization, templates)
|
- [parse-smtp-template](https://www.npmjs.com/package/parse-smtp-template) (localization, templates)
|
||||||
- [parse-server-postmark-adapter](https://www.npmjs.com/package/parse-server-postmark-adapter)
|
- [parse-server-postmark-adapter](https://www.npmjs.com/package/parse-server-postmark-adapter)
|
||||||
- [parse-server-sendgrid-adapter](https://www.npmjs.com/package/parse-server-sendgrid-adapter)
|
- [parse-server-sendgrid-adapter](https://www.npmjs.com/package/parse-server-sendgrid-adapter)
|
||||||
@@ -410,7 +412,7 @@ The `handler` receives the `request` and returns a `custom_page.html` webpage fr
|
|||||||
The following paths are already used by Parse Server's built-in features and are therefore not available for custom routes. Custom routes with an identical combination of `path` and `method` are ignored.
|
The following paths are already used by Parse Server's built-in features and are therefore not available for custom routes. Custom routes with an identical combination of `path` and `method` are ignored.
|
||||||
|
|
||||||
| Path | HTTP Method | Feature |
|
| Path | HTTP Method | Feature |
|
||||||
|-----------------------------|-------------|--------------------|
|
| --------------------------- | ----------- | ------------------ |
|
||||||
| `verify_email` | `GET` | email verification |
|
| `verify_email` | `GET` | email verification |
|
||||||
| `resend_verification_email` | `POST` | email verification |
|
| `resend_verification_email` | `POST` | email verification |
|
||||||
| `choose_password` | `GET` | password reset |
|
| `choose_password` | `GET` | password reset |
|
||||||
@@ -420,7 +422,7 @@ The following paths are already used by Parse Server's built-in features and are
|
|||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Parameter | Optional | Type | Default value | Example values | Environment variable | Description |
|
| Parameter | Optional | Type | Default value | Example values | Environment variable | Description |
|
||||||
|------------------------------|----------|-----------------|---------------|-----------------------|------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| ---------------------------- | -------- | --------------- | ------------- | --------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| `pages` | yes | `Object` | `undefined` | - | `PARSE_SERVER_PAGES` | The options for pages such as password reset and email verification. |
|
| `pages` | yes | `Object` | `undefined` | - | `PARSE_SERVER_PAGES` | The options for pages such as password reset and email verification. |
|
||||||
| `pages.enableRouter` | yes | `Boolean` | `false` | - | `PARSE_SERVER_PAGES_ENABLE_ROUTER` | Is `true` if the pages router should be enabled; this is required for any of the pages options to take effect. |
|
| `pages.enableRouter` | yes | `Boolean` | `false` | - | `PARSE_SERVER_PAGES_ENABLE_ROUTER` | Is `true` if the pages router should be enabled; this is required for any of the pages options to take effect. |
|
||||||
| `pages.customRoutes` | yes | `Array` | `[]` | - | `PARSE_SERVER_PAGES_CUSTOM_ROUTES` | The custom routes. The routes are added in the order they are defined here, which has to be considered since requests traverse routes in an ordered manner. Custom routes are traversed after build-in routes such as password reset and email verification. |
|
| `pages.customRoutes` | yes | `Array` | `[]` | - | `PARSE_SERVER_PAGES_CUSTOM_ROUTES` | The custom routes. The routes are added in the order they are defined here, which has to be considered since requests traverse routes in an ordered manner. Custom routes are traversed after build-in routes such as password reset and email verification. |
|
||||||
@@ -437,16 +439,16 @@ const server = ParseServer({
|
|||||||
...otherOptions,
|
...otherOptions,
|
||||||
|
|
||||||
customPages: {
|
customPages: {
|
||||||
passwordResetSuccess: "http://yourapp.com/passwordResetSuccess",
|
passwordResetSuccess: 'http://yourapp.com/passwordResetSuccess',
|
||||||
verifyEmailSuccess: "http://yourapp.com/verifyEmailSuccess",
|
verifyEmailSuccess: 'http://yourapp.com/verifyEmailSuccess',
|
||||||
parseFrameURL: "http://yourapp.com/parseFrameURL",
|
parseFrameURL: 'http://yourapp.com/parseFrameURL',
|
||||||
linkSendSuccess: "http://yourapp.com/linkSendSuccess",
|
linkSendSuccess: 'http://yourapp.com/linkSendSuccess',
|
||||||
linkSendFail: "http://yourapp.com/linkSendFail",
|
linkSendFail: 'http://yourapp.com/linkSendFail',
|
||||||
invalidLink: "http://yourapp.com/invalidLink",
|
invalidLink: 'http://yourapp.com/invalidLink',
|
||||||
invalidVerificationLink: "http://yourapp.com/invalidVerificationLink",
|
invalidVerificationLink: 'http://yourapp.com/invalidVerificationLink',
|
||||||
choosePassword: "http://yourapp.com/choosePassword"
|
choosePassword: 'http://yourapp.com/choosePassword',
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using Environment Variables
|
## Using Environment Variables
|
||||||
@@ -482,10 +484,10 @@ You can also find more adapters maintained by the community by searching on [npm
|
|||||||
|
|
||||||
Parse Server allows developers to choose from several options when hosting files:
|
Parse Server allows developers to choose from several options when hosting files:
|
||||||
|
|
||||||
* `GridFSBucketAdapter` - which is backed by MongoDB
|
- `GridFSBucketAdapter` - which is backed by MongoDB
|
||||||
* `S3Adapter` - which is backed by [Amazon S3](https://aws.amazon.com/s3/)
|
- `S3Adapter` - which is backed by [Amazon S3](https://aws.amazon.com/s3/)
|
||||||
* `GCSAdapter` - which is backed by [Google Cloud Storage](https://cloud.google.com/storage/)
|
- `GCSAdapter` - which is backed by [Google Cloud Storage](https://cloud.google.com/storage/)
|
||||||
* `FSAdapter` - local file storage
|
- `FSAdapter` - local file storage
|
||||||
|
|
||||||
`GridFSBucketAdapter` is used by default and requires no setup, but if you're interested in using Amazon S3, Google Cloud Storage, or local file storage, additional configuration information is available in the [Parse Server guide](http://docs.parseplatform.org/parse-server/guide/#configuring-file-adapters).
|
`GridFSBucketAdapter` is used by default and requires no setup, but if you're interested in using Amazon S3, Google Cloud Storage, or local file storage, additional configuration information is available in the [Parse Server guide](http://docs.parseplatform.org/parse-server/guide/#configuring-file-adapters).
|
||||||
|
|
||||||
@@ -515,7 +517,7 @@ let api = new ParseServer({
|
|||||||
### Parameters <!-- omit in toc -->
|
### Parameters <!-- omit in toc -->
|
||||||
|
|
||||||
| Parameter | Optional | Type | Default value | Example values | Environment variable | Description |
|
| Parameter | Optional | Type | Default value | Example values | Environment variable | Description |
|
||||||
|----------------------------|----------|-----------------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| -------------------------- | -------- | --------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `idempotencyOptions` | yes | `Object` | `undefined` | | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_OPTIONS | Setting this enables idempotency enforcement for the specified paths. |
|
| `idempotencyOptions` | yes | `Object` | `undefined` | | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_OPTIONS | Setting this enables idempotency enforcement for the specified paths. |
|
||||||
| `idempotencyOptions.paths` | yes | `Array<String>` | `[]` | `.*` (all paths, includes the examples below), <br>`functions/.*` (all functions), <br>`jobs/.*` (all jobs), <br>`classes/.*` (all classes), <br>`functions/.*` (all functions), <br>`users` (user creation / update), <br>`installations` (installation creation / update) | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_PATHS | An array of path patterns that have to match the request path for request deduplication to be enabled. The mount path must not be included, for example to match the request path `/parse/functions/myFunction` specify the path pattern `functions/myFunction`. A trailing slash of the request path is ignored, for example the path pattern `functions/myFunction` matches both `/parse/functions/myFunction` and `/parse/functions/myFunction/`. |
|
| `idempotencyOptions.paths` | yes | `Array<String>` | `[]` | `.*` (all paths, includes the examples below), <br>`functions/.*` (all functions), <br>`jobs/.*` (all jobs), <br>`classes/.*` (all classes), <br>`functions/.*` (all functions), <br>`users` (user creation / update), <br>`installations` (installation creation / update) | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_PATHS | An array of path patterns that have to match the request path for request deduplication to be enabled. The mount path must not be included, for example to match the request path `/parse/functions/myFunction` specify the path pattern `functions/myFunction`. A trailing slash of the request path is ignored, for example the path pattern `functions/myFunction` matches both `/parse/functions/myFunction` and `/parse/functions/myFunction/`. |
|
||||||
| `idempotencyOptions.ttl` | yes | `Integer` | `300` | `60` (60 seconds) | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_TTL | The duration in seconds after which a request record is discarded from the database. Duplicate requests due to network issues can be expected to arrive within milliseconds up to several seconds. This value must be greater than `0`. |
|
| `idempotencyOptions.ttl` | yes | `Integer` | `300` | `60` (60 seconds) | PARSE_SERVER_EXPERIMENTAL_IDEMPOTENCY_TTL | The duration in seconds after which a request record is discarded from the database. Duplicate requests due to network issues can be expected to arrive within milliseconds up to several seconds. This value must be greater than `0`. |
|
||||||
@@ -559,11 +561,13 @@ const api = new ParseServer({
|
|||||||
```
|
```
|
||||||
|
|
||||||
Localization is achieved by matching a request-supplied `locale` parameter with localized page content. The locale can be supplied in either the request query, body or header with the following keys:
|
Localization is achieved by matching a request-supplied `locale` parameter with localized page content. The locale can be supplied in either the request query, body or header with the following keys:
|
||||||
|
|
||||||
- query: `locale`
|
- query: `locale`
|
||||||
- body: `locale`
|
- body: `locale`
|
||||||
- header: `x-parse-page-param-locale`
|
- header: `x-parse-page-param-locale`
|
||||||
|
|
||||||
For example, a password reset link with the locale parameter in the query could look like this:
|
For example, a password reset link with the locale parameter in the query could look like this:
|
||||||
|
|
||||||
```
|
```
|
||||||
http://example.com/parse/apps/[appId]/request_password_reset?token=[token]&username=[username]&locale=de-AT
|
http://example.com/parse/apps/[appId]/request_password_reset?token=[token]&username=[username]&locale=de-AT
|
||||||
```
|
```
|
||||||
@@ -579,6 +583,7 @@ Pages can be localized in two ways:
|
|||||||
Pages are localized by using the corresponding file in the directory structure where the files are placed in subdirectories named after the locale or language. The file in the base directory is the default file.
|
Pages are localized by using the corresponding file in the directory structure where the files are placed in subdirectories named after the locale or language. The file in the base directory is the default file.
|
||||||
|
|
||||||
**Example Directory Structure:**
|
**Example Directory Structure:**
|
||||||
|
|
||||||
```js
|
```js
|
||||||
root/
|
root/
|
||||||
├── public/ // pages base path
|
├── public/ // pages base path
|
||||||
@@ -590,11 +595,13 @@ root/
|
|||||||
```
|
```
|
||||||
|
|
||||||
Files are matched with the locale in the following order:
|
Files are matched with the locale in the following order:
|
||||||
|
|
||||||
1. Locale match, e.g. locale `de-AT` matches file in folder `de-AT`.
|
1. Locale match, e.g. locale `de-AT` matches file in folder `de-AT`.
|
||||||
1. Language match, e.g. locale `de-CH` matches file in folder `de`.
|
1. Language match, e.g. locale `de-CH` matches file in folder `de`.
|
||||||
1. Default; file in base folder is returned.
|
1. Default; file in base folder is returned.
|
||||||
|
|
||||||
**Configuration Example:**
|
**Configuration Example:**
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const api = new ParseServer({
|
const api = new ParseServer({
|
||||||
...otherOptions,
|
...otherOptions,
|
||||||
@@ -610,9 +617,11 @@ const api = new ParseServer({
|
|||||||
```
|
```
|
||||||
|
|
||||||
Pros:
|
Pros:
|
||||||
|
|
||||||
- All files are complete in their content and can be easily opened and previewed by viewing the file in a browser.
|
- All files are complete in their content and can be easily opened and previewed by viewing the file in a browser.
|
||||||
|
|
||||||
Cons:
|
Cons:
|
||||||
|
|
||||||
- In most cases, a localized page differs only slightly from the default page, which could cause a lot of duplicate code that is difficult to maintain.
|
- In most cases, a localized page differs only slightly from the default page, which could cause a lot of duplicate code that is difficult to maintain.
|
||||||
|
|
||||||
#### Localization with JSON Resource
|
#### Localization with JSON Resource
|
||||||
@@ -620,6 +629,7 @@ Cons:
|
|||||||
Pages are localized by adding placeholders in the HTML files and providing a JSON resource that contains the translations to fill into the placeholders.
|
Pages are localized by adding placeholders in the HTML files and providing a JSON resource that contains the translations to fill into the placeholders.
|
||||||
|
|
||||||
**Example Directory Structure:**
|
**Example Directory Structure:**
|
||||||
|
|
||||||
```js
|
```js
|
||||||
root/
|
root/
|
||||||
├── public/ // pages base path
|
├── public/ // pages base path
|
||||||
@@ -631,6 +641,7 @@ root/
|
|||||||
The JSON resource file loosely follows the [i18next](https://github.com/i18next/i18next) syntax, which is a syntax that is often supported by translation platforms, making it easy to manage translations, exporting them for use in Parse Server, and even to automate this workflow.
|
The JSON resource file loosely follows the [i18next](https://github.com/i18next/i18next) syntax, which is a syntax that is often supported by translation platforms, making it easy to manage translations, exporting them for use in Parse Server, and even to automate this workflow.
|
||||||
|
|
||||||
**Example JSON Content:**
|
**Example JSON Content:**
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"en": { // resource for language `en` (English)
|
"en": { // resource for language `en` (English)
|
||||||
@@ -652,6 +663,7 @@ The JSON resource file loosely follows the [i18next](https://github.com/i18next/
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Configuration Example:**
|
**Configuration Example:**
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const api = new ParseServer({
|
const api = new ParseServer({
|
||||||
...otherOptions,
|
...otherOptions,
|
||||||
@@ -666,9 +678,11 @@ const api = new ParseServer({
|
|||||||
```
|
```
|
||||||
|
|
||||||
Pros:
|
Pros:
|
||||||
|
|
||||||
- There is only one HTML file to maintain that contains the placeholders that are filled with the translations according to the locale.
|
- There is only one HTML file to maintain that contains the placeholders that are filled with the translations according to the locale.
|
||||||
|
|
||||||
Cons:
|
Cons:
|
||||||
|
|
||||||
- Files cannot be easily previewed by viewing the file in a browser because the content contains only placeholders and even HTML or CSS changes may be dynamically applied, e.g. when a localization requires a Right-To-Left layout direction.
|
- Files cannot be easily previewed by viewing the file in a browser because the content contains only placeholders and even HTML or CSS changes may be dynamically applied, e.g. when a localization requires a Right-To-Left layout direction.
|
||||||
- Style and other fundamental layout changes may be more difficult to apply.
|
- Style and other fundamental layout changes may be more difficult to apply.
|
||||||
|
|
||||||
@@ -677,6 +691,7 @@ Cons:
|
|||||||
In addition to feature related default parameters such as `appId` and the translations provided via JSON resource, it is possible to define custom dynamic placeholders as part of the router configuration. This works independently of localization and, also if `enableLocalization` is disabled.
|
In addition to feature related default parameters such as `appId` and the translations provided via JSON resource, it is possible to define custom dynamic placeholders as part of the router configuration. This works independently of localization and, also if `enableLocalization` is disabled.
|
||||||
|
|
||||||
**Configuration Example:**
|
**Configuration Example:**
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const api = new ParseServer({
|
const api = new ParseServer({
|
||||||
...otherOptions,
|
...otherOptions,
|
||||||
@@ -689,6 +704,7 @@ const api = new ParseServer({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The placeholders can also be provided as function or as async function, with the `locale` and other feature related parameters passed through, to allow for dynamic placeholder values:
|
The placeholders can also be provided as function or as async function, with the `locale` and other feature related parameters passed through, to allow for dynamic placeholder values:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@@ -714,7 +730,7 @@ The following parameter and placeholder keys are reserved because they are used
|
|||||||
#### Parameters
|
#### Parameters
|
||||||
|
|
||||||
| Parameter | Optional | Type | Default value | Example values | Environment variable | Description |
|
| Parameter | Optional | Type | Default value | Example values | Environment variable | Description |
|
||||||
|-------------------------------------------------|----------|---------------------------------------|----------------------------------------|------------------------------------------------------|-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| ----------------------------------------------- | -------- | ------------------------------------- | -------------------------------------- | ---------------------------------------------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| `pages` | yes | `Object` | `undefined` | - | `PARSE_SERVER_PAGES` | The options for pages such as password reset and email verification. |
|
| `pages` | yes | `Object` | `undefined` | - | `PARSE_SERVER_PAGES` | The options for pages such as password reset and email verification. |
|
||||||
| `pages.enableRouter` | yes | `Boolean` | `false` | - | `PARSE_SERVER_PAGES_ENABLE_ROUTER` | Is `true` if the pages router should be enabled; this is required for any of the pages options to take effect. |
|
| `pages.enableRouter` | yes | `Boolean` | `false` | - | `PARSE_SERVER_PAGES_ENABLE_ROUTER` | Is `true` if the pages router should be enabled; this is required for any of the pages options to take effect. |
|
||||||
| `pages.enableLocalization` | yes | `Boolean` | `false` | - | `PARSE_SERVER_PAGES_ENABLE_LOCALIZATION` | Is true if pages should be localized; this has no effect on custom page redirects. |
|
| `pages.enableLocalization` | yes | `Boolean` | `false` | - | `PARSE_SERVER_PAGES_ENABLE_LOCALIZATION` | Is true if pages should be localized; this has no effect on custom page redirects. |
|
||||||
@@ -741,18 +757,19 @@ The following parameter and placeholder keys are reserved because they are used
|
|||||||
## Logging
|
## Logging
|
||||||
|
|
||||||
Parse Server will, by default, log:
|
Parse Server will, by default, log:
|
||||||
* to the console
|
|
||||||
* daily rotating files as new line delimited JSON
|
- to the console
|
||||||
|
- daily rotating files as new line delimited JSON
|
||||||
|
|
||||||
Logs are also viewable in Parse Dashboard.
|
Logs are also viewable in Parse Dashboard.
|
||||||
|
|
||||||
**Want to log each request and response?** Set the `VERBOSE` environment variable when starting `parse-server`. Usage :- `VERBOSE='1' parse-server --appId APPLICATION_ID --masterKey MASTER_KEY`
|
**Want to log each request and response?** Set the `VERBOSE` environment variable when starting `parse-server`. Usage :- `VERBOSE='1' parse-server --appId APPLICATION_ID --masterKey MASTER_KEY`
|
||||||
|
|
||||||
**Want logs to be placed in a different folder?** Pass the `PARSE_SERVER_LOGS_FOLDER` environment variable when starting `parse-server`. Usage :- `PARSE_SERVER_LOGS_FOLDER='<path-to-logs-folder>' parse-server --appId APPLICATION_ID --masterKey MASTER_KEY`
|
**Want logs to be placed in a different folder?** Pass the `PARSE_SERVER_LOGS_FOLDER` environment variable when starting `parse-server`. Usage :- `PARSE_SERVER_LOGS_FOLDER='<path-to-logs-folder>' parse-server --appId APPLICATION_ID --masterKey MASTER_KEY`
|
||||||
|
|
||||||
**Want to log specific levels?** Pass the `logLevel` parameter when starting `parse-server`. Usage :- `parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --logLevel LOG_LEVEL`
|
**Want to log specific levels?** Pass the `logLevel` parameter when starting `parse-server`. Usage :- `parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --logLevel LOG_LEVEL`
|
||||||
|
|
||||||
**Want new line delimited JSON error logs (for consumption by CloudWatch, Google Cloud Logging, etc)?** Pass the `JSON_LOGS` environment variable when starting `parse-server`. Usage :- `JSON_LOGS='1' parse-server --appId APPLICATION_ID --masterKey MASTER_KEY`
|
**Want new line delimited JSON error logs (for consumption by CloudWatch, Google Cloud Logging, etc)?** Pass the `JSON_LOGS` environment variable when starting `parse-server`. Usage :- `JSON_LOGS='1' parse-server --appId APPLICATION_ID --masterKey MASTER_KEY`
|
||||||
|
|
||||||
# Deprecations
|
# Deprecations
|
||||||
|
|
||||||
@@ -782,7 +799,7 @@ $ parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongo
|
|||||||
|
|
||||||
After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
|
After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
|
||||||
|
|
||||||
***Note:*** Do ***NOT*** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.
|
**_Note:_** Do **_NOT_** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.
|
||||||
|
|
||||||
### Using Docker
|
### Using Docker
|
||||||
|
|
||||||
@@ -801,11 +818,11 @@ $ docker run --name my-mongo -d mongo
|
|||||||
$ docker run --name my-parse-server --link my-mongo:mongo -v config-vol:/parse-server/config -p 1337:1337 -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground
|
$ docker run --name my-parse-server --link my-mongo:mongo -v config-vol:/parse-server/config -p 1337:1337 -d parse-server --appId APPLICATION_ID --masterKey MASTER_KEY --databaseURI mongodb://mongo/test --publicServerURL http://localhost:1337/parse --mountGraphQL --mountPlayground
|
||||||
```
|
```
|
||||||
|
|
||||||
***Note:*** *If you want to use [Cloud Code](https://docs.parseplatform.org/cloudcode/guide/), add `-v cloud-code-vol:/parse-server/cloud --cloud /parse-server/cloud/main.js` to the command above. Make sure `main.js` is in the `cloud-code-vol` directory before starting Parse Server.*
|
**_Note:_** _If you want to use [Cloud Code](https://docs.parseplatform.org/cloudcode/guide/), add `-v cloud-code-vol:/parse-server/cloud --cloud /parse-server/cloud/main.js` to the command above. Make sure `main.js` is in the `cloud-code-vol` directory before starting Parse Server._
|
||||||
|
|
||||||
After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
|
After starting the server, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
|
||||||
|
|
||||||
***Note:*** Do ***NOT*** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.
|
**_Note:_** Do **_NOT_** use --mountPlayground option in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.
|
||||||
|
|
||||||
### Using Express.js
|
### Using Express.js
|
||||||
|
|
||||||
@@ -830,23 +847,20 @@ const parseServer = new ParseServer({
|
|||||||
appId: 'APPLICATION_ID',
|
appId: 'APPLICATION_ID',
|
||||||
masterKey: 'MASTER_KEY',
|
masterKey: 'MASTER_KEY',
|
||||||
serverURL: 'http://localhost:1337/parse',
|
serverURL: 'http://localhost:1337/parse',
|
||||||
publicServerURL: 'http://localhost:1337/parse'
|
publicServerURL: 'http://localhost:1337/parse',
|
||||||
});
|
});
|
||||||
|
|
||||||
const parseGraphQLServer = new ParseGraphQLServer(
|
const parseGraphQLServer = new ParseGraphQLServer(parseServer, {
|
||||||
parseServer,
|
graphQLPath: '/graphql',
|
||||||
{
|
playgroundPath: '/playground',
|
||||||
graphQLPath: '/graphql',
|
});
|
||||||
playgroundPath: '/playground'
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
app.use('/parse', parseServer.app); // (Optional) Mounts the REST API
|
app.use('/parse', parseServer.app); // (Optional) Mounts the REST API
|
||||||
parseGraphQLServer.applyGraphQL(app); // Mounts the GraphQL API
|
parseGraphQLServer.applyGraphQL(app); // Mounts the GraphQL API
|
||||||
parseGraphQLServer.applyPlayground(app); // (Optional) Mounts the GraphQL Playground - do NOT use in Production
|
parseGraphQLServer.applyPlayground(app); // (Optional) Mounts the GraphQL Playground - do NOT use in Production
|
||||||
|
|
||||||
await parseServer.start();
|
await parseServer.start();
|
||||||
app.listen(1337, function() {
|
app.listen(1337, function () {
|
||||||
console.log('REST API running on http://localhost:1337/parse');
|
console.log('REST API running on http://localhost:1337/parse');
|
||||||
console.log('GraphQL API running on http://localhost:1337/graphql');
|
console.log('GraphQL API running on http://localhost:1337/graphql');
|
||||||
console.log('GraphQL Playground running on http://localhost:1337/playground');
|
console.log('GraphQL Playground running on http://localhost:1337/playground');
|
||||||
@@ -862,7 +876,7 @@ $ node index.js
|
|||||||
|
|
||||||
After starting the app, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
|
After starting the app, you can visit http://localhost:1337/playground in your browser to start playing with your GraphQL API.
|
||||||
|
|
||||||
***Note:*** Do ***NOT*** mount the GraphQL Playground in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.
|
**_Note:_** Do **_NOT_** mount the GraphQL Playground in production. [Parse Dashboard](https://github.com/parse-community/parse-dashboard) has a built-in GraphQL Playground and it is the recommended option for production apps.
|
||||||
|
|
||||||
## Checking the API health
|
## Checking the API health
|
||||||
|
|
||||||
@@ -957,13 +971,7 @@ Run the following to create your first object:
|
|||||||
|
|
||||||
```graphql
|
```graphql
|
||||||
mutation CreateGameScore {
|
mutation CreateGameScore {
|
||||||
createGameScore(
|
createGameScore(fields: { playerName: "Sean Plott", score: 1337, cheatMode: false }) {
|
||||||
fields: {
|
|
||||||
playerName: "Sean Plott"
|
|
||||||
score: 1337
|
|
||||||
cheatMode: false
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
id
|
||||||
updatedAt
|
updatedAt
|
||||||
createdAt
|
createdAt
|
||||||
@@ -1142,4 +1150,5 @@ Support us with a monthly donation and help us continue our activities. [Become
|
|||||||
[log_release]: https://github.com/parse-community/parse-server/blob/release/changelogs/CHANGELOG_release.md
|
[log_release]: https://github.com/parse-community/parse-server/blob/release/changelogs/CHANGELOG_release.md
|
||||||
[log_beta]: https://github.com/parse-community/parse-server/blob/beta/changelogs/CHANGELOG_beta.md
|
[log_beta]: https://github.com/parse-community/parse-server/blob/beta/changelogs/CHANGELOG_beta.md
|
||||||
[log_alpha]: https://github.com/parse-community/parse-server/blob/alpha/changelogs/CHANGELOG_alpha.md
|
[log_alpha]: https://github.com/parse-community/parse-server/blob/alpha/changelogs/CHANGELOG_alpha.md
|
||||||
|
|
||||||
[server-options] http://parseplatform.org/parse-server/api/release/ParseServerOptions.html
|
[server-options] http://parseplatform.org/parse-server/api/release/ParseServerOptions.html
|
||||||
|
|||||||
1451
package-lock.json
generated
1451
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -26,7 +26,7 @@
|
|||||||
"@graphql-tools/schema": "10.0.23",
|
"@graphql-tools/schema": "10.0.23",
|
||||||
"@graphql-tools/utils": "10.8.6",
|
"@graphql-tools/utils": "10.8.6",
|
||||||
"@parse/fs-files-adapter": "3.0.0",
|
"@parse/fs-files-adapter": "3.0.0",
|
||||||
"@parse/push-adapter": "6.11.0",
|
"@parse/push-adapter": "8.1.0",
|
||||||
"bcryptjs": "3.0.2",
|
"bcryptjs": "3.0.2",
|
||||||
"commander": "13.1.0",
|
"commander": "13.1.0",
|
||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
@@ -48,8 +48,8 @@
|
|||||||
"mongodb": "6.20.0",
|
"mongodb": "6.20.0",
|
||||||
"mustache": "4.2.0",
|
"mustache": "4.2.0",
|
||||||
"otpauth": "9.4.0",
|
"otpauth": "9.4.0",
|
||||||
"path-to-regexp": "8.3.0",
|
|
||||||
"parse": "8.0.0",
|
"parse": "8.0.0",
|
||||||
|
"path-to-regexp": "8.3.0",
|
||||||
"pg-monitor": "3.0.0",
|
"pg-monitor": "3.0.0",
|
||||||
"pg-promise": "12.2.0",
|
"pg-promise": "12.2.0",
|
||||||
"pluralize": "8.0.0",
|
"pluralize": "8.0.0",
|
||||||
|
|||||||
@@ -105,8 +105,19 @@ describe('AdapterLoader', () => {
|
|||||||
it('should load push adapter from options', async () => {
|
it('should load push adapter from options', async () => {
|
||||||
const options = {
|
const options = {
|
||||||
android: {
|
android: {
|
||||||
senderId: 'yolo',
|
firebaseServiceAccount: {
|
||||||
apiKey: 'yolo',
|
"type": "service_account",
|
||||||
|
"project_id": "example-xxxx",
|
||||||
|
"private_key_id": "xxxx",
|
||||||
|
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCxFcVMD9L2xJWW\nEMi4w/XIBPvX5bTStIEdt4GY+yfrmCHspaVdgpTcHlTLA60sAGTFdorPprOwAm6f\njaTG4j86zfW25GF6AlFO/8vE2B0tjreuQQtcP9gkWJmsTp8yzXDirDQ43Kv93Kbc\nUPmsyAN5WB8XiFjjWLnFCeDiOVdd8sHfG0HYldNzyYwXrOTLE5kOjASYSJDzdrfI\nwN9PzZC7+cCy/DDzTRKQCqfz9pEZmxqJk4Id5HLVNkGKgji3C3b6o3MXWPS+1+zD\nGheKC9WLDZnCVycAnNHFiPpsp7R82lLKC3Dth37b6qzJO+HwfTmzCb0/xCVJ0/mZ\nC4Mxih/bAgMBAAECggEACbL1DvDw75Yd0U3TCJenDxEC0DTjHgVH6x5BaWUcLyGy\nffkmoQQFbjb1Evd9FSNiYZRYDv6E6feAIpoJ8+CxcOGV+zHwCtQ0qtyExx/FHVkr\nQ06JtkBC8N6vcAoQWyJ4c9nVtGWVv/5FX1zKCAYedpd2gH31zGHwLtQXLpzQZbNO\nO/0rcggg4unGSUIyw5437XiyckJ3QdneSEPe9HvY2wxLn/f1PjMpRYiNLBSuaFBJ\n+MYXr//Vh7cMInQk5/pMFbGxugNb7dtjgvm3LKRssKnubEOyrKldo8DVJmAvjhP4\nWboOOBVEo2ZhXgnBjeMvI8btXlJ85h9lZ7xwqfWsjQKBgQDkrrLpA3Mm21rsP1Ar\nMLEnYTdMZ7k+FTm5pJffPOsC7wiLWdRLwwrtb0V3kC3jr2K4SZY/OEV8IAWHfut/\n8mP8cPQPJiFp92iOgde4Xq/Ycwx4ZAXUj7mHHgywFi2K0xATzgc9sgX3NCVl9utR\nIU/FbEDCLxyD4T3Jb5gL3xFdhwKBgQDGPS46AiHuYmV7OG4gEOsNdczTppBJCgTt\nKGSJOxZg8sQodNJeWTPP2iQr4yJ4EY57NQmH7WSogLrGj8tmorEaL7I2kYlHJzGm\nniwApWEZlFc00xgXwV5d8ATfmAf8W1ZSZ6THbHesDUGjXSoL95k3KKXhnztjUT6I\n8d5qkCygDQKBgFN7p1rDZKVZzO6UCntJ8lJS/jIJZ6nPa9xmxv67KXxPsQnWSFdE\nI9gcF/sXCnmlTF/ElXIM4+j1c69MWULDRVciESb6n5YkuOnVYuAuyPk2vuWwdiRs\nN6mpAa7C2etlM+hW/XO7aswdIE4B/1QF2i5TX6zEMB/A+aJw98vVqmw/AoGADOm9\nUiADb9DPBXjGi6YueYD756mI6okRixU/f0TvDz+hEXWSonyzCE4QXx97hlC2dEYf\nKdCH5wYDpJ2HRVdBrBABTtaqF41xCYZyHVSof48PIyzA/AMnj3zsBFiV5JVaiSGh\nNTBWl0mBxg9yhrcJLvOh4pGJv81yAl+m+lAL6B0CgYEArtqtQ1YVLIUn4Pb/HDn8\nN8o7WbhloWQnG34iSsAG8yNtzbbxdugFrEm5ejPSgZ+dbzSzi/hizOFS/+/fwEdl\nay9jqY1fngoqSrS8eddUsY1/WAcmd6wPWEamsSjazA4uxQERruuFOi94E4b895KA\nqYe0A3xb0JL2ieAOZsn8XNA=\n-----END PRIVATE KEY-----\n",
|
||||||
|
"client_email": "test@example.com",
|
||||||
|
"client_id": "1",
|
||||||
|
"auth_uri": "https://example.com",
|
||||||
|
"token_uri": "https://example.com",
|
||||||
|
"auth_provider_x509_cert_url": "https://example.com",
|
||||||
|
"client_x509_cert_url": "https://example.com",
|
||||||
|
"universe_domain": "example.com"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const ParsePushAdapter = await loadModule('@parse/push-adapter');
|
const ParsePushAdapter = await loadModule('@parse/push-adapter');
|
||||||
|
|||||||
@@ -154,36 +154,24 @@ describe('ParseLiveQueryServer', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('properly passes the CLP to afterSave/afterDelete hook', function (done) {
|
it('properly passes the CLP to afterSave/afterDelete hook', function (done) {
|
||||||
function setPermissionsOnClass(className, permissions, doPut) {
|
async function setPermissionsOnClass(className, permissions, doPut) {
|
||||||
const request = require('request');
|
const method = doPut ? 'PUT' : 'POST';
|
||||||
let op = request.post;
|
const response = await fetch(Parse.serverURL + '/schemas/' + className, {
|
||||||
if (doPut) {
|
method,
|
||||||
op = request.put;
|
headers: {
|
||||||
}
|
'X-Parse-Application-Id': Parse.applicationId,
|
||||||
return new Promise((resolve, reject) => {
|
'X-Parse-Master-Key': Parse.masterKey,
|
||||||
op(
|
'Content-Type': 'application/json',
|
||||||
{
|
},
|
||||||
url: Parse.serverURL + '/schemas/' + className,
|
body: JSON.stringify({
|
||||||
headers: {
|
classLevelPermissions: permissions,
|
||||||
'X-Parse-Application-Id': Parse.applicationId,
|
}),
|
||||||
'X-Parse-Master-Key': Parse.masterKey,
|
|
||||||
},
|
|
||||||
json: true,
|
|
||||||
body: {
|
|
||||||
classLevelPermissions: permissions,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
(error, response, body) => {
|
|
||||||
if (error) {
|
|
||||||
return reject(error);
|
|
||||||
}
|
|
||||||
if (body.error) {
|
|
||||||
return reject(body);
|
|
||||||
}
|
|
||||||
return resolve(body);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
const body = await response.json();
|
||||||
|
if (body.error) {
|
||||||
|
throw body;
|
||||||
|
}
|
||||||
|
return body;
|
||||||
}
|
}
|
||||||
|
|
||||||
let saveSpy;
|
let saveSpy;
|
||||||
@@ -641,7 +629,7 @@ describe('ParseLiveQueryServer', function () {
|
|||||||
|
|
||||||
it('can forward event to cloud code', function () {
|
it('can forward event to cloud code', function () {
|
||||||
const cloudCodeHandler = {
|
const cloudCodeHandler = {
|
||||||
handler: () => {},
|
handler: () => { },
|
||||||
};
|
};
|
||||||
const spy = spyOn(cloudCodeHandler, 'handler').and.callThrough();
|
const spy = spyOn(cloudCodeHandler, 'handler').and.callThrough();
|
||||||
Parse.Cloud.onLiveQueryEvent(cloudCodeHandler.handler);
|
Parse.Cloud.onLiveQueryEvent(cloudCodeHandler.handler);
|
||||||
@@ -1932,36 +1920,24 @@ describe('ParseLiveQueryServer', function () {
|
|||||||
|
|
||||||
describe('LiveQueryController', () => {
|
describe('LiveQueryController', () => {
|
||||||
it('properly passes the CLP to afterSave/afterDelete hook', function (done) {
|
it('properly passes the CLP to afterSave/afterDelete hook', function (done) {
|
||||||
function setPermissionsOnClass(className, permissions, doPut) {
|
async function setPermissionsOnClass(className, permissions, doPut) {
|
||||||
const request = require('request');
|
const method = doPut ? 'PUT' : 'POST';
|
||||||
let op = request.post;
|
const response = await fetch(Parse.serverURL + '/schemas/' + className, {
|
||||||
if (doPut) {
|
method,
|
||||||
op = request.put;
|
headers: {
|
||||||
}
|
'X-Parse-Application-Id': Parse.applicationId,
|
||||||
return new Promise((resolve, reject) => {
|
'X-Parse-Master-Key': Parse.masterKey,
|
||||||
op(
|
'Content-Type': 'application/json',
|
||||||
{
|
},
|
||||||
url: Parse.serverURL + '/schemas/' + className,
|
body: JSON.stringify({
|
||||||
headers: {
|
classLevelPermissions: permissions,
|
||||||
'X-Parse-Application-Id': Parse.applicationId,
|
}),
|
||||||
'X-Parse-Master-Key': Parse.masterKey,
|
|
||||||
},
|
|
||||||
json: true,
|
|
||||||
body: {
|
|
||||||
classLevelPermissions: permissions,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
(error, response, body) => {
|
|
||||||
if (error) {
|
|
||||||
return reject(error);
|
|
||||||
}
|
|
||||||
if (body.error) {
|
|
||||||
return reject(body);
|
|
||||||
}
|
|
||||||
return resolve(body);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
const body = await response.json();
|
||||||
|
if (body.error) {
|
||||||
|
throw body;
|
||||||
|
}
|
||||||
|
return body;
|
||||||
}
|
}
|
||||||
|
|
||||||
let saveSpy;
|
let saveSpy;
|
||||||
|
|||||||
@@ -136,8 +136,20 @@ const defaultConfiguration = {
|
|||||||
},
|
},
|
||||||
push: {
|
push: {
|
||||||
android: {
|
android: {
|
||||||
senderId: 'yolo',
|
firebaseServiceAccount: {
|
||||||
apiKey: 'yolo',
|
"type": "service_account",
|
||||||
|
"project_id": "example-xxxx",
|
||||||
|
"private_key_id": "xxxx",
|
||||||
|
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCxFcVMD9L2xJWW\nEMi4w/XIBPvX5bTStIEdt4GY+yfrmCHspaVdgpTcHlTLA60sAGTFdorPprOwAm6f\njaTG4j86zfW25GF6AlFO/8vE2B0tjreuQQtcP9gkWJmsTp8yzXDirDQ43Kv93Kbc\nUPmsyAN5WB8XiFjjWLnFCeDiOVdd8sHfG0HYldNzyYwXrOTLE5kOjASYSJDzdrfI\nwN9PzZC7+cCy/DDzTRKQCqfz9pEZmxqJk4Id5HLVNkGKgji3C3b6o3MXWPS+1+zD\nGheKC9WLDZnCVycAnNHFiPpsp7R82lLKC3Dth37b6qzJO+HwfTmzCb0/xCVJ0/mZ\nC4Mxih/bAgMBAAECggEACbL1DvDw75Yd0U3TCJenDxEC0DTjHgVH6x5BaWUcLyGy\nffkmoQQFbjb1Evd9FSNiYZRYDv6E6feAIpoJ8+CxcOGV+zHwCtQ0qtyExx/FHVkr\nQ06JtkBC8N6vcAoQWyJ4c9nVtGWVv/5FX1zKCAYedpd2gH31zGHwLtQXLpzQZbNO\nO/0rcggg4unGSUIyw5437XiyckJ3QdneSEPe9HvY2wxLn/f1PjMpRYiNLBSuaFBJ\n+MYXr//Vh7cMInQk5/pMFbGxugNb7dtjgvm3LKRssKnubEOyrKldo8DVJmAvjhP4\nWboOOBVEo2ZhXgnBjeMvI8btXlJ85h9lZ7xwqfWsjQKBgQDkrrLpA3Mm21rsP1Ar\nMLEnYTdMZ7k+FTm5pJffPOsC7wiLWdRLwwrtb0V3kC3jr2K4SZY/OEV8IAWHfut/\n8mP8cPQPJiFp92iOgde4Xq/Ycwx4ZAXUj7mHHgywFi2K0xATzgc9sgX3NCVl9utR\nIU/FbEDCLxyD4T3Jb5gL3xFdhwKBgQDGPS46AiHuYmV7OG4gEOsNdczTppBJCgTt\nKGSJOxZg8sQodNJeWTPP2iQr4yJ4EY57NQmH7WSogLrGj8tmorEaL7I2kYlHJzGm\nniwApWEZlFc00xgXwV5d8ATfmAf8W1ZSZ6THbHesDUGjXSoL95k3KKXhnztjUT6I\n8d5qkCygDQKBgFN7p1rDZKVZzO6UCntJ8lJS/jIJZ6nPa9xmxv67KXxPsQnWSFdE\nI9gcF/sXCnmlTF/ElXIM4+j1c69MWULDRVciESb6n5YkuOnVYuAuyPk2vuWwdiRs\nN6mpAa7C2etlM+hW/XO7aswdIE4B/1QF2i5TX6zEMB/A+aJw98vVqmw/AoGADOm9\nUiADb9DPBXjGi6YueYD756mI6okRixU/f0TvDz+hEXWSonyzCE4QXx97hlC2dEYf\nKdCH5wYDpJ2HRVdBrBABTtaqF41xCYZyHVSof48PIyzA/AMnj3zsBFiV5JVaiSGh\nNTBWl0mBxg9yhrcJLvOh4pGJv81yAl+m+lAL6B0CgYEArtqtQ1YVLIUn4Pb/HDn8\nN8o7WbhloWQnG34iSsAG8yNtzbbxdugFrEm5ejPSgZ+dbzSzi/hizOFS/+/fwEdl\nay9jqY1fngoqSrS8eddUsY1/WAcmd6wPWEamsSjazA4uxQERruuFOi94E4b895KA\nqYe0A3xb0JL2ieAOZsn8XNA=\n-----END PRIVATE KEY-----\n",
|
||||||
|
"client_email": "test@example.com",
|
||||||
|
"client_id": "1",
|
||||||
|
"auth_uri": "https://example.com",
|
||||||
|
"token_uri": "https://example.com",
|
||||||
|
"auth_provider_x509_cert_url": "https://example.com",
|
||||||
|
"client_x509_cert_url": "https://example.com",
|
||||||
|
"universe_domain": "example.com"
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
auth: {
|
auth: {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
// * getValidPushTypes()
|
// * getValidPushTypes()
|
||||||
// * send(devices, installations, pushStatus)
|
// * send(devices, installations, pushStatus)
|
||||||
//
|
//
|
||||||
// Default is ParsePushAdapter, which uses GCM for
|
// Default is ParsePushAdapter, which uses FCM for
|
||||||
// android push and APNS for ios push.
|
// android push and APNS for ios push.
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user