Skip to content

Commit 2d79c08

Browse files
authored
feat: Remove deprecation DEPPS4: Remove convenience method for http request Parse.Cloud.httpRequest (parse-community#8287)
BREAKING CHANGE: The convenience method for HTTP requests `Parse.Cloud.httpRequest` is removed; use your preferred 3rd party library for making HTTP requests
1 parent 739a3a9 commit 2d79c08

8 files changed

+178
-252
lines changed

Diff for: DEPRECATIONS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +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 | - |
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) | removed | - |
1111
| 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 | - |
1212
| 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 | - |
1313
| 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 | - |

Diff for: spec/CloudCode.spec.js

-19
Original file line numberDiff line numberDiff line change
@@ -1686,25 +1686,6 @@ 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-
17081689
describe('cloud jobs', () => {
17091690
it('should define a job', done => {
17101691
expect(() => {

Diff for: spec/HTTPRequest.spec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

3-
const httpRequest = require('../lib/cloud-code/httpRequest'),
4-
HTTPResponse = require('../lib/cloud-code/HTTPResponse').default,
3+
const httpRequest = require('../lib/request'),
4+
HTTPResponse = require('../lib/request').HTTPResponse,
55
bodyParser = require('body-parser'),
66
express = require('express');
77

Diff for: spec/ParseGeoPoint.spec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('Parse.GeoPoint testing', () => {
4747
obj.set('location', point);
4848
obj.set('name', 'Zhoul');
4949
await obj.save();
50-
Parse.Cloud.httpRequest({
50+
request({
5151
url: 'http://localhost:8378/1/classes/TestObject/' + obj.id,
5252
headers: {
5353
'X-Parse-Application-Id': 'test',

Diff for: src/cloud-code/HTTPResponse.js

-61
This file was deleted.

Diff for: src/cloud-code/Parse.Cloud.js

-9
Original file line numberDiff line numberDiff line change
@@ -713,15 +713,6 @@ ParseCloud.useMasterKey = () => {
713713
);
714714
};
715715

716-
const request = require('./httpRequest');
717-
ParseCloud.httpRequest = opts => {
718-
Deprecator.logRuntimeDeprecation({
719-
usage: 'Parse.Cloud.httpRequest',
720-
solution: 'Use a http request library instead.',
721-
});
722-
return request(opts);
723-
};
724-
725716
module.exports = ParseCloud;
726717

727718
/**

Diff for: src/cloud-code/httpRequest.js

-158
This file was deleted.

0 commit comments

Comments
 (0)