mirror of
https://github.com/parse-community/parse-server
synced 2026-08-09 13:03:18 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7faabb569 | ||
|
|
3c7c5e1a78 | ||
|
|
fe4ba57892 | ||
|
|
389de8426c | ||
|
|
aad8ff9326 | ||
|
|
7b5395c5d4 | ||
|
|
82fdb0d95a | ||
|
|
43cb65ff90 | ||
|
|
e6283c3ca3 | ||
|
|
b71a3106ce | ||
|
|
4b3f10b2ab | ||
|
|
587abdd45f | ||
|
|
743484768b | ||
|
|
c2c593f437 | ||
|
|
1a24ede388 | ||
|
|
080610ac5f | ||
|
|
a09f751c14 | ||
|
|
3d8dc5fa0d | ||
|
|
4e301a5fff | ||
|
|
dfffc14a54 | ||
|
|
9c6d7ab4f1 | ||
|
|
847a274cdb |
@@ -210,8 +210,7 @@ jobs:
|
||||
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- run: npm run pretest
|
||||
- run: npm run coverage
|
||||
- run: npm run coverage:mongodb
|
||||
env:
|
||||
CI: true
|
||||
- name: Upload code coverage
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
## [8.2.5-alpha.1](https://github.com/parse-community/parse-server/compare/8.2.4...8.2.5-alpha.1) (2025-09-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* GraphQL playground shows blank page ([#9858](https://github.com/parse-community/parse-server/issues/9858)) ([7b5395c](https://github.com/parse-community/parse-server/commit/7b5395c5d481235c022d96603280672366a50715))
|
||||
|
||||
## [8.2.4-alpha.1](https://github.com/parse-community/parse-server/compare/8.2.3...8.2.4-alpha.1) (2025-08-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Security upgrade form-data from 4.0.3 to 4.0.4 ([#9829](https://github.com/parse-community/parse-server/issues/9829)) ([c2c593f](https://github.com/parse-community/parse-server/commit/c2c593f437c33f37101b4f3bb1287eef31dbbc3b))
|
||||
|
||||
## [8.2.3-alpha.1](https://github.com/parse-community/parse-server/compare/8.2.2...8.2.3-alpha.1) (2025-07-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* MongoDB aggregation pipeline with `$dateSubtract` from `$$NOW` returns no results ([#9822](https://github.com/parse-community/parse-server/issues/9822)) ([847a274](https://github.com/parse-community/parse-server/commit/847a274cdb8c22f8e0fc249162e5e2c9e29a594a))
|
||||
|
||||
## [8.2.2-alpha.1](https://github.com/parse-community/parse-server/compare/8.2.1...8.2.2-alpha.1) (2025-07-10)
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
## [8.2.5](https://github.com/parse-community/parse-server/compare/8.2.4...8.2.5) (2025-10-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* GraphQL playground shows blank page ([#9858](https://github.com/parse-community/parse-server/issues/9858)) ([7b5395c](https://github.com/parse-community/parse-server/commit/7b5395c5d481235c022d96603280672366a50715))
|
||||
|
||||
## [8.2.4](https://github.com/parse-community/parse-server/compare/8.2.3...8.2.4) (2025-09-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Security upgrade form-data from 4.0.3 to 4.0.4 ([#9829](https://github.com/parse-community/parse-server/issues/9829)) ([c2c593f](https://github.com/parse-community/parse-server/commit/c2c593f437c33f37101b4f3bb1287eef31dbbc3b))
|
||||
|
||||
## [8.2.3](https://github.com/parse-community/parse-server/compare/8.2.2...8.2.3) (2025-08-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* MongoDB aggregation pipeline with `$dateSubtract` from `$$NOW` returns no results ([#9822](https://github.com/parse-community/parse-server/issues/9822)) ([847a274](https://github.com/parse-community/parse-server/commit/847a274cdb8c22f8e0fc249162e5e2c9e29a594a))
|
||||
|
||||
## [8.2.2](https://github.com/parse-community/parse-server/compare/8.2.1...8.2.2) (2025-07-10)
|
||||
|
||||
|
||||
|
||||
Generated
+458
-160
File diff suppressed because it is too large
Load Diff
+11
-15
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "parse-server",
|
||||
"version": "8.2.2",
|
||||
"version": "8.2.5",
|
||||
"description": "An express module providing a Parse-compatible API server",
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
@@ -21,7 +21,7 @@
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@apollo/server": "4.12.1",
|
||||
"@babel/eslint-parser": "7.27.1",
|
||||
"@babel/eslint-parser": "7.28.0",
|
||||
"@graphql-tools/merge": "9.0.24",
|
||||
"@graphql-tools/schema": "10.0.23",
|
||||
"@graphql-tools/utils": "10.8.6",
|
||||
@@ -32,7 +32,7 @@
|
||||
"cors": "2.8.5",
|
||||
"deepcopy": "2.1.0",
|
||||
"express": "5.1.0",
|
||||
"express-rate-limit": "7.5.0",
|
||||
"express-rate-limit": "7.5.1",
|
||||
"follow-redirects": "1.15.9",
|
||||
"graphql": "16.11.0",
|
||||
"graphql-list-fields": "2.0.4",
|
||||
@@ -52,7 +52,7 @@
|
||||
"parse": "6.1.1",
|
||||
"path-to-regexp": "6.3.0",
|
||||
"pg-monitor": "3.0.0",
|
||||
"pg-promise": "11.13.0",
|
||||
"pg-promise": "11.14.0",
|
||||
"pluralize": "8.0.0",
|
||||
"punycode": "2.3.1",
|
||||
"rate-limit-redis": "4.2.0",
|
||||
@@ -90,7 +90,7 @@
|
||||
"eslint": "9.27.0",
|
||||
"eslint-plugin-expect-type": "0.6.2",
|
||||
"flow-bin": "0.271.0",
|
||||
"form-data": "4.0.3",
|
||||
"form-data": "4.0.4",
|
||||
"globals": "16.2.0",
|
||||
"graphql-tag": "2.12.6",
|
||||
"husky": "9.1.7",
|
||||
@@ -103,7 +103,7 @@
|
||||
"madge": "8.0.0",
|
||||
"mock-files-adapter": "file:spec/dependencies/mock-files-adapter",
|
||||
"mock-mail-adapter": "file:spec/dependencies/mock-mail-adapter",
|
||||
"mongodb-runner": "5.8.3",
|
||||
"mongodb-runner": "5.9.3",
|
||||
"node-abort-controller": "3.1.1",
|
||||
"node-fetch": "3.2.10",
|
||||
"nyc": "17.1.0",
|
||||
@@ -125,18 +125,14 @@
|
||||
"build:types": "tsc",
|
||||
"watch": "babel --watch src/ -d lib/ --copy-files",
|
||||
"watch:ts": "tsc --watch",
|
||||
"test:mongodb:runnerstart": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start -t ${MONGODB_TOPOLOGY} --version ${MONGODB_VERSION} -- --port 27017",
|
||||
"test:mongodb:testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=$npm_config_dbversion} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine",
|
||||
"test:mongodb": "npm run test:mongodb:runnerstart --dbversion=$npm_config_dbversion && npm run test:mongodb:testonly --dbversion=$npm_config_dbversion",
|
||||
"test:mongodb:6.0.19": "npm run test:mongodb --dbversion=6.0.19",
|
||||
"test:mongodb:7.0.16": "npm run test:mongodb --dbversion=7.0.16",
|
||||
"test:mongodb:8.0.4": "npm run test:mongodb --dbversion=8.0.4",
|
||||
"test:mongodb:6.0.19": "MONGODB_VERSION=6.0.19 npm run test",
|
||||
"test:mongodb:7.0.16": "MONGODB_VERSION=7.0.16 npm run test",
|
||||
"test:mongodb:8.0.4": "MONGODB_VERSION=8.0.4 npm run test",
|
||||
"test:postgres:testonly": "cross-env PARSE_SERVER_TEST_DB=postgres PARSE_SERVER_TEST_DATABASE_URI=postgres://postgres:password@localhost:5432/parse_server_postgres_adapter_test_database npm run testonly",
|
||||
"pretest": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=8.0.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start -t ${MONGODB_TOPOLOGY} --version ${MONGODB_VERSION} -- --port 27017",
|
||||
"testonly": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=8.0.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 jasmine",
|
||||
"test": "npm run testonly",
|
||||
"test": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=8.0.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner exec -t ${MONGODB_TOPOLOGY} --version ${MONGODB_VERSION} -- --port 27017 -- npm run testonly",
|
||||
"test:types": "eslint types/tests.ts -c ./types/eslint.config.mjs",
|
||||
"posttest": "cross-env mongodb-runner stop --all",
|
||||
"coverage:mongodb": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=8.0.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner exec -t ${MONGODB_TOPOLOGY} --version ${MONGODB_VERSION} -- --port 27017 -- npm run coverage",
|
||||
"coverage": "cross-env MONGODB_VERSION=${MONGODB_VERSION:=8.0.4} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} TESTING=1 nyc jasmine",
|
||||
"start": "node ./bin/parse-server",
|
||||
"prettier": "prettier --write {src,spec}/{**/*,*}.js",
|
||||
|
||||
@@ -439,6 +439,36 @@ describe('Parse.Query Aggregate testing', () => {
|
||||
}
|
||||
);
|
||||
|
||||
it_id('3723671d-4100-4103-ad9c-60e4c22e20ff')(it_exclude_dbs(['postgres']))('matches expression with $dateSubtract from $$NOW', async () => {
|
||||
const obj1 = new TestObject({ date: new Date(new Date().getTime() - 1 * 24 * 60 * 60 * 1_000) }); // 1 day ago
|
||||
const obj2 = new TestObject({ date: new Date(new Date().getTime() - 2 * 24 * 60 * 60 * 1_000) }); // 3 days ago
|
||||
await Parse.Object.saveAll([obj1, obj2]);
|
||||
|
||||
const pipeline = [
|
||||
{
|
||||
$match: {
|
||||
$expr: {
|
||||
$gte: [
|
||||
'$date',
|
||||
{
|
||||
$dateSubtract: {
|
||||
startDate: '$$NOW',
|
||||
unit: 'day',
|
||||
amount: 2,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const query = new Parse.Query('TestObject');
|
||||
const results = await query.aggregate(pipeline, { useMasterKey: true });
|
||||
expect(results.length).toBe(1);
|
||||
expect(new Date(results[0].date.iso)).toEqual(obj1.get('date'));
|
||||
});
|
||||
|
||||
it_only_db('postgres')(
|
||||
'can group by any date field (it does not work if you have dirty data)', // rows in your collection with non date data in the field that is supposed to be a date
|
||||
done => {
|
||||
|
||||
@@ -960,23 +960,28 @@ export class MongoStorageAdapter implements StorageAdapter {
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
// This function will attempt to convert the provided value to a Date object. Since this is part
|
||||
// of an aggregation pipeline, the value can either be a string or it can be another object with
|
||||
// an operator in it (like $gt, $lt, etc). Because of this I felt it was easier to make this a
|
||||
// recursive method to traverse down to the "leaf node" which is going to be the string.
|
||||
/**
|
||||
* Recursively converts values to Date objects. Since the passed object is part of an aggregation
|
||||
* pipeline and can contain various logic operators (like $gt, $lt, etc), this function will
|
||||
* traverse the object and convert any strings that can be parsed as dates into Date objects.
|
||||
* @param {any} value The value to convert.
|
||||
* @returns {any} The original value if not convertible to Date, or a Date object if it is.
|
||||
*/
|
||||
_convertToDate(value: any): any {
|
||||
if (value instanceof Date) {
|
||||
return value;
|
||||
}
|
||||
if (typeof value === 'string') {
|
||||
return new Date(value);
|
||||
return isNaN(Date.parse(value)) ? value : new Date(value);
|
||||
}
|
||||
|
||||
const returnValue = {};
|
||||
for (const field in value) {
|
||||
returnValue[field] = this._convertToDate(value[field]);
|
||||
if (typeof value === 'object') {
|
||||
const returnValue = {};
|
||||
for (const field in value) {
|
||||
returnValue[field] = this._convertToDate(value[field]);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
return returnValue;
|
||||
return value;
|
||||
}
|
||||
|
||||
_parseReadPreference(readPreference: ?string): ?string {
|
||||
|
||||
@@ -167,14 +167,14 @@ class ParseGraphQLServer {
|
||||
new window.EmbeddedSandbox({
|
||||
target: "#sandbox",
|
||||
endpointIsEditable: false,
|
||||
initialEndpoint: "${JSON.stringify(this.config.graphQLPath)}",
|
||||
initialEndpoint: ${JSON.stringify(this.config.graphQLPath)},
|
||||
handleRequest: (endpointUrl, options) => {
|
||||
return fetch(endpointUrl, {
|
||||
...options,
|
||||
headers: {
|
||||
...options.headers,
|
||||
'X-Parse-Application-Id': "${JSON.stringify(this.parseServer.config.appId)}",
|
||||
'X-Parse-Master-Key': "${JSON.stringify(this.parseServer.config.masterKey)}",
|
||||
'X-Parse-Application-Id': ${JSON.stringify(this.parseServer.config.appId)},
|
||||
'X-Parse-Master-Key': ${JSON.stringify(this.parseServer.config.masterKey)},
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user