Skip to content

Commit 1e185c7

Browse files
committed
revert removal
1 parent 17387b6 commit 1e185c7

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

DEPRECATIONS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The following is a list of deprecations, according to the [Deprecation Policy](h
77
| DEPPS1 | Native MongoDB syntax in aggregation pipeline | [#7338](https://github.com/parse-community/parse-server/issues/7338) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
88
| DEPPS2 | Config option `directAccess` defaults to `true` | [#6636](https://github.com/parse-community/parse-server/pull/6636) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
99
| DEPPS3 | Config option `enforcePrivateUsers` defaults to `true` | [#7319](https://github.com/parse-community/parse-server/pull/7319) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
10+
| DEPPS4 | Remove convenience method for http request `Parse.Cloud.httpRequest` | [#7589](https://github.com/parse-community/parse-server/pull/7589) | 5.0.0 (2022) | 6.0.0 (2023) | deprecated | - |
1011
| DEPPS5 | Config option `allowClientClassCreation` defaults to `false` | [#7925](https://github.com/parse-community/parse-server/pull/7925) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - |
1112
| DEPPS6 | Auth providers disabled by default | [#7953](https://github.com/parse-community/parse-server/pull/7953) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - |
1213
| DEPPS7 | Remove file trigger syntax `Parse.Cloud.beforeSaveFile((request) => {})` | [#7966](https://github.com/parse-community/parse-server/pull/7966) | 5.3.0 (2022) | 7.0.0 (2024) | deprecated | - |

spec/CloudCode.spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,25 @@ describe('Cloud Code', () => {
16861686
obj.save().then(done, done.fail);
16871687
});
16881688

1689+
it('can deprecate Parse.Cloud.httpRequest', async () => {
1690+
const logger = require('../lib/logger').logger;
1691+
spyOn(logger, 'warn').and.callFake(() => {});
1692+
Parse.Cloud.define('hello', () => {
1693+
return 'Hello world!';
1694+
});
1695+
await Parse.Cloud.httpRequest({
1696+
method: 'POST',
1697+
url: 'http://localhost:8378/1/functions/hello',
1698+
headers: {
1699+
'X-Parse-Application-Id': Parse.applicationId,
1700+
'X-Parse-REST-API-Key': 'rest',
1701+
},
1702+
});
1703+
expect(logger.warn).toHaveBeenCalledWith(
1704+
'DeprecationWarning: Parse.Cloud.httpRequest is deprecated and will be removed in a future version. Use a http request library instead.'
1705+
);
1706+
});
1707+
16891708
describe('cloud jobs', () => {
16901709
it('should define a job', done => {
16911710
expect(() => {

0 commit comments

Comments
 (0)