Skip to content

Commit

Permalink
Merge branch 'alpha' into dependabot/npm_and_yarn/mongodb-6.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrezza committed Apr 19, 2024
2 parents 2166a42 + 2420024 commit c76f703
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 34 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
7 changes: 7 additions & 0 deletions changelogs/CHANGELOG_alpha.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
2 changes: 1 addition & 1 deletion jsdoc-conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"template": "./node_modules/clean-jsdoc-theme",
"theme_opts": {
"default_theme": "dark",
"title": "<img src='../.github/parse-server-logo.png' class='logo'/>",
"title": "<img src='https://raw.githubusercontent.com/parse-community/parse-server/alpha/.github/parse-server-logo.png' class='logo'/>",
"create_style": "header, .sidebar-section-title, .sidebar-title { color: #139cee !important } .logo { margin-left : 40px; margin-right: 40px }"
}
},
Expand Down
34 changes: 17 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down Expand Up @@ -66,7 +66,7 @@
},
"devDependencies": {
"@actions/core": "1.10.1",
"@apollo/client": "3.9.5",
"@apollo/client": "3.9.11",
"@babel/cli": "7.23.9",
"@babel/core": "7.24.3",
"@babel/plugin-proposal-object-rest-spread": "7.10.0",
Expand Down
25 changes: 16 additions & 9 deletions release_docs.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
#!/bin/sh -e
set -x
# GITHUB_ACTIONS=true SOURCE_TAG=test ./release_docs.sh

if [ "${GITHUB_ACTIONS}" = "" ];
then
echo "Cannot release docs without GITHUB_ACTIONS set"
exit 0;
fi
if [ "${SOURCE_TAG}" = "" ];
then
echo "Cannot release docs without SOURCE_TAG set"
exit 0;
fi
REPO="https://github.com/parse-community/parse-server"

rm -rf docs
Expand All @@ -13,20 +20,20 @@ cd docs
git pull origin gh-pages
cd ..

DEST="master"
RELEASE="release"
VERSION="${SOURCE_TAG}"

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

npm run definitions
npm run docs

mkdir -p "docs/api/${DEST}"
cp -R out/* "docs/api/${DEST}"
mkdir -p "docs/api/${RELEASE}"
cp -R out/* "docs/api/${RELEASE}"

mkdir -p "docs/api/${VERSION}"
cp -R out/* "docs/api/${VERSION}"

# Copy other resources
RESOURCE_DIR=".github"
Expand Down
54 changes: 54 additions & 0 deletions spec/ParseServerRESTController.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
8 changes: 5 additions & 3 deletions src/ParseServerRESTController.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
},
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit c76f703

Please sign in to comment.