build: Release (#9836)
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
## [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)
|
## [8.2.2-alpha.1](https://github.com/parse-community/parse-server/compare/8.2.1...8.2.2-alpha.1) (2025-07-10)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
84
package-lock.json
generated
84
package-lock.json
generated
@@ -1,17 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "parse-server",
|
"name": "parse-server",
|
||||||
"version": "8.2.2",
|
"version": "8.2.3-alpha.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "parse-server",
|
"name": "parse-server",
|
||||||
"version": "8.2.2",
|
"version": "8.2.3-alpha.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/server": "^4.12.1",
|
"@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/merge": "9.0.24",
|
||||||
"@graphql-tools/schema": "10.0.23",
|
"@graphql-tools/schema": "10.0.23",
|
||||||
"@graphql-tools/utils": "10.8.6",
|
"@graphql-tools/utils": "10.8.6",
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
"deepcopy": "2.1.0",
|
"deepcopy": "2.1.0",
|
||||||
"express": "5.1.0",
|
"express": "5.1.0",
|
||||||
"express-rate-limit": "7.5.0",
|
"express-rate-limit": "7.5.1",
|
||||||
"follow-redirects": "1.15.9",
|
"follow-redirects": "1.15.9",
|
||||||
"graphql": "16.11.0",
|
"graphql": "16.11.0",
|
||||||
"graphql-list-fields": "2.0.4",
|
"graphql-list-fields": "2.0.4",
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
"parse": "6.1.1",
|
"parse": "6.1.1",
|
||||||
"path-to-regexp": "6.3.0",
|
"path-to-regexp": "6.3.0",
|
||||||
"pg-monitor": "3.0.0",
|
"pg-monitor": "3.0.0",
|
||||||
"pg-promise": "11.13.0",
|
"pg-promise": "11.14.0",
|
||||||
"pluralize": "8.0.0",
|
"pluralize": "8.0.0",
|
||||||
"punycode": "2.3.1",
|
"punycode": "2.3.1",
|
||||||
"rate-limit-redis": "4.2.0",
|
"rate-limit-redis": "4.2.0",
|
||||||
@@ -900,9 +900,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@babel/eslint-parser": {
|
"node_modules/@babel/eslint-parser": {
|
||||||
"version": "7.27.1",
|
"version": "7.28.0",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.27.1.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.28.0.tgz",
|
||||||
"integrity": "sha512-q8rjOuadH0V6Zo4XLMkJ3RMQ9MSBqwaDByyYB0izsYdaIWGNLmEblbCOf1vyFHICcg16CD7Fsi51vcQnYxmt6Q==",
|
"integrity": "sha512-N4ntErOlKvcbTt01rr5wj3y55xnIdx1ymrfIr8C2WnM1Y9glFgWaGDEULJIazOX3XM9NRzhfJ6zZnQ1sBNWU+w==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1",
|
"@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1",
|
||||||
@@ -7704,12 +7704,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/assert-options": {
|
"node_modules/assert-options": {
|
||||||
"version": "0.8.2",
|
"version": "0.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.8.3.tgz",
|
||||||
"integrity": "sha512-XaXoMxY0zuwAb0YuZjxIm8FeWvNq0aWNIbrzHhFjme8Smxw4JlPoyrAKQ6808k5UvQdhvnWqHZCphq5mXd4TDA==",
|
"integrity": "sha512-s6v4HnA+vYSGO4eZX+F+I3gvF74wPk+m6Z1Q3w1Dsg4Pnv/R24vhKAasoMVZGvDpOOfTg1Qz4ptZnEbuy95XsQ==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=14.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/assert-plus": {
|
"node_modules/assert-plus": {
|
||||||
@@ -10579,9 +10579,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/express-rate-limit": {
|
"node_modules/express-rate-limit": {
|
||||||
"version": "7.5.0",
|
"version": "7.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.1.tgz",
|
||||||
"integrity": "sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==",
|
"integrity": "sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 16"
|
"node": ">= 16"
|
||||||
@@ -10590,7 +10590,7 @@
|
|||||||
"url": "https://github.com/sponsors/express-rate-limit"
|
"url": "https://github.com/sponsors/express-rate-limit"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"express": "^4.11 || 5 || ^5.0.0-beta.1"
|
"express": ">= 4.11"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/express/node_modules/mime-db": {
|
"node_modules/express/node_modules/mime-db": {
|
||||||
@@ -18771,15 +18771,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/pg-promise": {
|
"node_modules/pg-promise": {
|
||||||
"version": "11.13.0",
|
"version": "11.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-11.13.0.tgz",
|
"resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-11.14.0.tgz",
|
||||||
"integrity": "sha512-NWCsh1gnELfYRF5hNhfXPcSxuCk9C3FyM9MhmGkVTmepczAC2aXuBkyXhipVlHzp0V/IVzyCZOrlH48Ma3i7YQ==",
|
"integrity": "sha512-x/HZ6hK0MxYllyfUbmN/XZc7JBYoow7KElyNW9hnlhgRHMiRZmRUtfNM/wcuElpjSoASPxkoIKi4IA5QlwOONA==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"assert-options": "0.8.2",
|
"assert-options": "0.8.3",
|
||||||
"pg": "8.14.1",
|
"pg": "8.14.1",
|
||||||
"pg-minify": "1.7.0",
|
"pg-minify": "1.7.0",
|
||||||
"spex": "3.4.0"
|
"spex": "3.4.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0"
|
"node": ">=14.0"
|
||||||
@@ -20938,9 +20938,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/spex": {
|
"node_modules/spex": {
|
||||||
"version": "3.4.0",
|
"version": "3.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/spex/-/spex-3.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/spex/-/spex-3.4.1.tgz",
|
||||||
"integrity": "sha512-8JeZJ7QlEBnSj1W1fKXgbB2KUPA8k4BxFMf6lZX/c1ZagU/1b9uZWZK0yD6yjfzqAIuTNG4YlRmtMpQiXuohsg==",
|
"integrity": "sha512-Br0Mu3S+c70kr4keXF+6K4B8ohR+aJjI9s7SbdsI3hliE1Riz4z+FQk7FQL+r7X1t90KPkpuKwQyITpCIQN9mg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
@@ -23422,9 +23422,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@babel/eslint-parser": {
|
"@babel/eslint-parser": {
|
||||||
"version": "7.27.1",
|
"version": "7.28.0",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.27.1.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.28.0.tgz",
|
||||||
"integrity": "sha512-q8rjOuadH0V6Zo4XLMkJ3RMQ9MSBqwaDByyYB0izsYdaIWGNLmEblbCOf1vyFHICcg16CD7Fsi51vcQnYxmt6Q==",
|
"integrity": "sha512-N4ntErOlKvcbTt01rr5wj3y55xnIdx1ymrfIr8C2WnM1Y9glFgWaGDEULJIazOX3XM9NRzhfJ6zZnQ1sBNWU+w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1",
|
"@nicolo-ribaudo/eslint-scope-5-internals": "5.1.1-v1",
|
||||||
"eslint-visitor-keys": "^2.1.0",
|
"eslint-visitor-keys": "^2.1.0",
|
||||||
@@ -28087,9 +28087,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"assert-options": {
|
"assert-options": {
|
||||||
"version": "0.8.2",
|
"version": "0.8.3",
|
||||||
"resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.8.2.tgz",
|
"resolved": "https://registry.npmjs.org/assert-options/-/assert-options-0.8.3.tgz",
|
||||||
"integrity": "sha512-XaXoMxY0zuwAb0YuZjxIm8FeWvNq0aWNIbrzHhFjme8Smxw4JlPoyrAKQ6808k5UvQdhvnWqHZCphq5mXd4TDA=="
|
"integrity": "sha512-s6v4HnA+vYSGO4eZX+F+I3gvF74wPk+m6Z1Q3w1Dsg4Pnv/R24vhKAasoMVZGvDpOOfTg1Qz4ptZnEbuy95XsQ=="
|
||||||
},
|
},
|
||||||
"assert-plus": {
|
"assert-plus": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
@@ -30147,9 +30147,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"express-rate-limit": {
|
"express-rate-limit": {
|
||||||
"version": "7.5.0",
|
"version": "7.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.1.tgz",
|
||||||
"integrity": "sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==",
|
"integrity": "sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"extend": {
|
"extend": {
|
||||||
@@ -35796,14 +35796,14 @@
|
|||||||
"requires": {}
|
"requires": {}
|
||||||
},
|
},
|
||||||
"pg-promise": {
|
"pg-promise": {
|
||||||
"version": "11.13.0",
|
"version": "11.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-11.13.0.tgz",
|
"resolved": "https://registry.npmjs.org/pg-promise/-/pg-promise-11.14.0.tgz",
|
||||||
"integrity": "sha512-NWCsh1gnELfYRF5hNhfXPcSxuCk9C3FyM9MhmGkVTmepczAC2aXuBkyXhipVlHzp0V/IVzyCZOrlH48Ma3i7YQ==",
|
"integrity": "sha512-x/HZ6hK0MxYllyfUbmN/XZc7JBYoow7KElyNW9hnlhgRHMiRZmRUtfNM/wcuElpjSoASPxkoIKi4IA5QlwOONA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"assert-options": "0.8.2",
|
"assert-options": "0.8.3",
|
||||||
"pg": "8.14.1",
|
"pg": "8.14.1",
|
||||||
"pg-minify": "1.7.0",
|
"pg-minify": "1.7.0",
|
||||||
"spex": "3.4.0"
|
"spex": "3.4.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pg-protocol": {
|
"pg-protocol": {
|
||||||
@@ -37327,9 +37327,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"spex": {
|
"spex": {
|
||||||
"version": "3.4.0",
|
"version": "3.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/spex/-/spex-3.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/spex/-/spex-3.4.1.tgz",
|
||||||
"integrity": "sha512-8JeZJ7QlEBnSj1W1fKXgbB2KUPA8k4BxFMf6lZX/c1ZagU/1b9uZWZK0yD6yjfzqAIuTNG4YlRmtMpQiXuohsg=="
|
"integrity": "sha512-Br0Mu3S+c70kr4keXF+6K4B8ohR+aJjI9s7SbdsI3hliE1Riz4z+FQk7FQL+r7X1t90KPkpuKwQyITpCIQN9mg=="
|
||||||
},
|
},
|
||||||
"split2": {
|
"split2": {
|
||||||
"version": "4.2.0",
|
"version": "4.2.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "parse-server",
|
"name": "parse-server",
|
||||||
"version": "8.2.2",
|
"version": "8.2.3-alpha.1",
|
||||||
"description": "An express module providing a Parse-compatible API server",
|
"description": "An express module providing a Parse-compatible API server",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/server": "4.12.1",
|
"@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/merge": "9.0.24",
|
||||||
"@graphql-tools/schema": "10.0.23",
|
"@graphql-tools/schema": "10.0.23",
|
||||||
"@graphql-tools/utils": "10.8.6",
|
"@graphql-tools/utils": "10.8.6",
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
"cors": "2.8.5",
|
"cors": "2.8.5",
|
||||||
"deepcopy": "2.1.0",
|
"deepcopy": "2.1.0",
|
||||||
"express": "5.1.0",
|
"express": "5.1.0",
|
||||||
"express-rate-limit": "7.5.0",
|
"express-rate-limit": "7.5.1",
|
||||||
"follow-redirects": "1.15.9",
|
"follow-redirects": "1.15.9",
|
||||||
"graphql": "16.11.0",
|
"graphql": "16.11.0",
|
||||||
"graphql-list-fields": "2.0.4",
|
"graphql-list-fields": "2.0.4",
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
"parse": "6.1.1",
|
"parse": "6.1.1",
|
||||||
"path-to-regexp": "6.3.0",
|
"path-to-regexp": "6.3.0",
|
||||||
"pg-monitor": "3.0.0",
|
"pg-monitor": "3.0.0",
|
||||||
"pg-promise": "11.13.0",
|
"pg-promise": "11.14.0",
|
||||||
"pluralize": "8.0.0",
|
"pluralize": "8.0.0",
|
||||||
"punycode": "2.3.1",
|
"punycode": "2.3.1",
|
||||||
"rate-limit-redis": "4.2.0",
|
"rate-limit-redis": "4.2.0",
|
||||||
|
|||||||
@@ -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')(
|
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
|
'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 => {
|
done => {
|
||||||
|
|||||||
@@ -960,23 +960,28 @@ export class MongoStorageAdapter implements StorageAdapter {
|
|||||||
return pipeline;
|
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
|
* Recursively converts values to Date objects. Since the passed object is part of an aggregation
|
||||||
// an operator in it (like $gt, $lt, etc). Because of this I felt it was easier to make this a
|
* pipeline and can contain various logic operators (like $gt, $lt, etc), this function will
|
||||||
// recursive method to traverse down to the "leaf node" which is going to be the string.
|
* 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 {
|
_convertToDate(value: any): any {
|
||||||
if (value instanceof Date) {
|
if (value instanceof Date) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
if (typeof value === 'string') {
|
if (typeof value === 'string') {
|
||||||
return new Date(value);
|
return isNaN(Date.parse(value)) ? value : new Date(value);
|
||||||
}
|
}
|
||||||
|
if (typeof value === 'object') {
|
||||||
const returnValue = {};
|
const returnValue = {};
|
||||||
for (const field in value) {
|
for (const field in value) {
|
||||||
returnValue[field] = this._convertToDate(value[field]);
|
returnValue[field] = this._convertToDate(value[field]);
|
||||||
|
}
|
||||||
|
return returnValue;
|
||||||
}
|
}
|
||||||
return returnValue;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
_parseReadPreference(readPreference: ?string): ?string {
|
_parseReadPreference(readPreference: ?string): ?string {
|
||||||
|
|||||||
Reference in New Issue
Block a user