Skip to content

Commit c76f703

Browse files
authored
Merge branch 'alpha' into dependabot/npm_and_yarn/mongodb-6.5.0
2 parents 2166a42 + 2420024 commit c76f703

8 files changed

+112
-34
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,11 @@ jobs:
210210
- run: npm run coverage
211211
env:
212212
CI: true
213-
- run: bash <(curl -s https://codecov.io/bash)
213+
- name: Upload code coverage
214+
uses: codecov/codecov-action@v4
215+
with:
216+
fail_ci_if_error: true
217+
token: ${{ secrets.CODECOV_TOKEN }}
214218
check-postgres:
215219
strategy:
216220
matrix:
@@ -281,7 +285,11 @@ jobs:
281285
- run: npm run coverage
282286
env:
283287
CI: true
284-
- run: bash <(curl -s https://codecov.io/bash)
288+
- name: Upload code coverage
289+
uses: codecov/codecov-action@v4
290+
with:
291+
fail_ci_if_error: true
292+
token: ${{ secrets.CODECOV_TOKEN }}
285293
concurrency:
286294
group: ${{ github.workflow }}-${{ github.ref }}
287295
cancel-in-progress: true

changelogs/CHANGELOG_alpha.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# [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)
2+
3+
4+
### Bug Fixes
5+
6+
* `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+
18
# [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)
29

310

jsdoc-conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"template": "./node_modules/clean-jsdoc-theme",
3030
"theme_opts": {
3131
"default_theme": "dark",
32-
"title": "<img src='../.github/parse-server-logo.png' class='logo'/>",
32+
"title": "<img src='https://raw.githubusercontent.com/parse-community/parse-server/alpha/.github/parse-server-logo.png' class='logo'/>",
3333
"create_style": "header, .sidebar-section-title, .sidebar-title { color: #139cee !important } .logo { margin-left : 40px; margin-right: 40px }"
3434
}
3535
},

package-lock.json

Lines changed: 17 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "7.1.0-alpha.5",
3+
"version": "7.1.0-alpha.6",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {
@@ -66,7 +66,7 @@
6666
},
6767
"devDependencies": {
6868
"@actions/core": "1.10.1",
69-
"@apollo/client": "3.9.5",
69+
"@apollo/client": "3.9.11",
7070
"@babel/cli": "7.23.9",
7171
"@babel/core": "7.24.3",
7272
"@babel/plugin-proposal-object-rest-spread": "7.10.0",

release_docs.sh

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#!/bin/sh -e
22
set -x
3+
# GITHUB_ACTIONS=true SOURCE_TAG=test ./release_docs.sh
4+
35
if [ "${GITHUB_ACTIONS}" = "" ];
46
then
57
echo "Cannot release docs without GITHUB_ACTIONS set"
68
exit 0;
79
fi
10+
if [ "${SOURCE_TAG}" = "" ];
11+
then
12+
echo "Cannot release docs without SOURCE_TAG set"
13+
exit 0;
14+
fi
815
REPO="https://github.com/parse-community/parse-server"
916

1017
rm -rf docs
@@ -13,20 +20,20 @@ cd docs
1320
git pull origin gh-pages
1421
cd ..
1522

16-
DEST="master"
23+
RELEASE="release"
24+
VERSION="${SOURCE_TAG}"
1725

18-
if [ "${SOURCE_TAG}" != "" ];
19-
then
20-
DEST="${SOURCE_TAG}"
21-
# change the default page to the latest
22-
echo "<meta http-equiv='refresh' content='0; url=/parse-server/api/${DEST}'>" > "docs/api/index.html"
23-
fi
26+
# change the default page to the latest
27+
echo "<meta http-equiv='refresh' content='0; url=/parse-server/api/${VERSION}'>" > "docs/api/index.html"
2428

2529
npm run definitions
2630
npm run docs
2731

28-
mkdir -p "docs/api/${DEST}"
29-
cp -R out/* "docs/api/${DEST}"
32+
mkdir -p "docs/api/${RELEASE}"
33+
cp -R out/* "docs/api/${RELEASE}"
34+
35+
mkdir -p "docs/api/${VERSION}"
36+
cp -R out/* "docs/api/${VERSION}"
3037

3138
# Copy other resources
3239
RESOURCE_DIR=".github"

spec/ParseServerRESTController.spec.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,4 +631,58 @@ describe('ParseServerRESTController', () => {
631631
expect(sessions[0].get('installationId')).toBe(installationId);
632632
expect(sessions[0].get('sessionToken')).toBe(loggedUser.sessionToken);
633633
});
634+
635+
it('returns a statusId when running jobs', async () => {
636+
Parse.Cloud.job('CloudJob', () => {
637+
return 'Cloud job completed';
638+
});
639+
const res = await RESTController.request(
640+
'POST',
641+
'/jobs/CloudJob',
642+
{},
643+
{ useMasterKey: true, returnStatus: true }
644+
);
645+
const jobStatusId = res._headers['X-Parse-Job-Status-Id'];
646+
expect(jobStatusId).toBeDefined();
647+
const result = await Parse.Cloud.getJobStatus(jobStatusId);
648+
expect(result.id).toBe(jobStatusId);
649+
});
650+
651+
it('returns a statusId when running push notifications', async () => {
652+
const payload = {
653+
data: { alert: 'We return status!' },
654+
where: { deviceType: 'ios' },
655+
};
656+
const res = await RESTController.request('POST', '/push', payload, {
657+
useMasterKey: true,
658+
returnStatus: true,
659+
});
660+
const pushStatusId = res._headers['X-Parse-Push-Status-Id'];
661+
expect(pushStatusId).toBeDefined();
662+
663+
const result = await Parse.Push.getPushStatus(pushStatusId);
664+
expect(result.id).toBe(pushStatusId);
665+
});
666+
667+
it('returns a statusId when running batch push notifications', async () => {
668+
const payload = {
669+
data: { alert: 'We return status!' },
670+
where: { deviceType: 'ios' },
671+
};
672+
const res = await RESTController.request('POST', 'batch', {
673+
requests: [{
674+
method: 'POST',
675+
path: '/push',
676+
body: payload,
677+
}],
678+
}, {
679+
useMasterKey: true,
680+
returnStatus: true,
681+
});
682+
const pushStatusId = res[0]._headers['X-Parse-Push-Status-Id'];
683+
expect(pushStatusId).toBeDefined();
684+
685+
const result = await Parse.Push.getPushStatus(pushStatusId);
686+
expect(result.id).toBe(pushStatusId);
687+
});
634688
});

src/ParseServerRESTController.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,10 @@ function ParseServerRESTController(applicationId, router) {
5858
response => {
5959
if (options.returnStatus) {
6060
const status = response._status;
61+
const headers = response._headers;
6162
delete response._status;
62-
return { success: response, _status: status };
63+
delete response._headers;
64+
return { success: response, _status: status, _headers: headers };
6365
}
6466
return { success: response };
6567
},
@@ -128,9 +130,9 @@ function ParseServerRESTController(applicationId, router) {
128130
})
129131
.then(
130132
resp => {
131-
const { response, status } = resp;
133+
const { response, status, headers = {} } = resp;
132134
if (options.returnStatus) {
133-
resolve({ ...response, _status: status });
135+
resolve({ ...response, _status: status, _headers: headers });
134136
} else {
135137
resolve(response);
136138
}

0 commit comments

Comments
 (0)