Merge remote-tracking branch 'upstream/alpha' into alpha
This commit is contained in:
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@@ -210,7 +210,11 @@ jobs:
|
||||
- run: npm run coverage
|
||||
env:
|
||||
CI: true
|
||||
- run: bash <(curl -s https://codecov.io/bash)
|
||||
- name: Upload code coverage
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
fail_ci_if_error: true
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
check-postgres:
|
||||
strategy:
|
||||
matrix:
|
||||
@@ -281,7 +285,11 @@ jobs:
|
||||
- run: npm run coverage
|
||||
env:
|
||||
CI: true
|
||||
- run: bash <(curl -s https://codecov.io/bash)
|
||||
- name: Upload code coverage
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
fail_ci_if_error: true
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
# [7.1.0-alpha.6](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.5...7.1.0-alpha.6) (2024-04-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `Parse.Cloud.startJob` and `Parse.Push.send` not returning status ID when setting Parse Server option `directAccess: true` ([#8766](https://github.com/parse-community/parse-server/issues/8766)) ([5b0efb2](https://github.com/parse-community/parse-server/commit/5b0efb22efe94c47f243cf8b1e6407ed5c5a67d3))
|
||||
|
||||
# [7.1.0-alpha.5](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.4...7.1.0-alpha.5) (2024-04-07)
|
||||
|
||||
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "parse-server",
|
||||
"version": "7.1.0-alpha.5",
|
||||
"version": "7.1.0-alpha.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "parse-server",
|
||||
"version": "7.1.0-alpha.5",
|
||||
"version": "7.1.0-alpha.6",
|
||||
"hasInstallScript": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "parse-server",
|
||||
"version": "7.1.0-alpha.5",
|
||||
"version": "7.1.0-alpha.6",
|
||||
"description": "An express module providing a Parse-compatible API server",
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -631,4 +631,58 @@ describe('ParseServerRESTController', () => {
|
||||
expect(sessions[0].get('installationId')).toBe(installationId);
|
||||
expect(sessions[0].get('sessionToken')).toBe(loggedUser.sessionToken);
|
||||
});
|
||||
|
||||
it('returns a statusId when running jobs', async () => {
|
||||
Parse.Cloud.job('CloudJob', () => {
|
||||
return 'Cloud job completed';
|
||||
});
|
||||
const res = await RESTController.request(
|
||||
'POST',
|
||||
'/jobs/CloudJob',
|
||||
{},
|
||||
{ useMasterKey: true, returnStatus: true }
|
||||
);
|
||||
const jobStatusId = res._headers['X-Parse-Job-Status-Id'];
|
||||
expect(jobStatusId).toBeDefined();
|
||||
const result = await Parse.Cloud.getJobStatus(jobStatusId);
|
||||
expect(result.id).toBe(jobStatusId);
|
||||
});
|
||||
|
||||
it('returns a statusId when running push notifications', async () => {
|
||||
const payload = {
|
||||
data: { alert: 'We return status!' },
|
||||
where: { deviceType: 'ios' },
|
||||
};
|
||||
const res = await RESTController.request('POST', '/push', payload, {
|
||||
useMasterKey: true,
|
||||
returnStatus: true,
|
||||
});
|
||||
const pushStatusId = res._headers['X-Parse-Push-Status-Id'];
|
||||
expect(pushStatusId).toBeDefined();
|
||||
|
||||
const result = await Parse.Push.getPushStatus(pushStatusId);
|
||||
expect(result.id).toBe(pushStatusId);
|
||||
});
|
||||
|
||||
it('returns a statusId when running batch push notifications', async () => {
|
||||
const payload = {
|
||||
data: { alert: 'We return status!' },
|
||||
where: { deviceType: 'ios' },
|
||||
};
|
||||
const res = await RESTController.request('POST', 'batch', {
|
||||
requests: [{
|
||||
method: 'POST',
|
||||
path: '/push',
|
||||
body: payload,
|
||||
}],
|
||||
}, {
|
||||
useMasterKey: true,
|
||||
returnStatus: true,
|
||||
});
|
||||
const pushStatusId = res[0]._headers['X-Parse-Push-Status-Id'];
|
||||
expect(pushStatusId).toBeDefined();
|
||||
|
||||
const result = await Parse.Push.getPushStatus(pushStatusId);
|
||||
expect(result.id).toBe(pushStatusId);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -58,8 +58,10 @@ function ParseServerRESTController(applicationId, router) {
|
||||
response => {
|
||||
if (options.returnStatus) {
|
||||
const status = response._status;
|
||||
const headers = response._headers;
|
||||
delete response._status;
|
||||
return { success: response, _status: status };
|
||||
delete response._headers;
|
||||
return { success: response, _status: status, _headers: headers };
|
||||
}
|
||||
return { success: response };
|
||||
},
|
||||
@@ -128,9 +130,9 @@ function ParseServerRESTController(applicationId, router) {
|
||||
})
|
||||
.then(
|
||||
resp => {
|
||||
const { response, status } = resp;
|
||||
const { response, status, headers = {} } = resp;
|
||||
if (options.returnStatus) {
|
||||
resolve({ ...response, _status: status });
|
||||
resolve({ ...response, _status: status, _headers: headers });
|
||||
} else {
|
||||
resolve(response);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user