Skip to content

Commit

Permalink
Merge pull request #52 from HubSpot/add/deprecation-warnings
Browse files Browse the repository at this point in the history
Add deprecation warnings to exports
  • Loading branch information
kemmerle authored May 22, 2024
2 parents f7d547a + 2ef36ad commit d80d36c
Show file tree
Hide file tree
Showing 74 changed files with 1,565 additions and 47 deletions.
6 changes: 6 additions & 0 deletions api/blogs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
const http = require('../http');
const BLOGS_API_PATH = 'blogs/v3';

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

async function fetchBlogs(accountId, query = {}) {
return http.get(accountId, {
uri: `${BLOGS_API_PATH}/blogs`,
Expand Down
6 changes: 6 additions & 0 deletions api/content.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
const http = require('../http');
const CONTENT_API_PATH = 'content/api/v4';

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

async function fetchContent(accountId, query = {}) {
return http.get(accountId, {
uri: `${CONTENT_API_PATH}/contents`,
Expand Down
42 changes: 42 additions & 0 deletions api/customObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,81 @@ const http = require('../http');

const CUSTOM_OBJECTS_API_PATH = 'crm/v3/objects';

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

const createObject = (accountId, objectTypeId, filePath) =>
http.post(accountId, {
uri: `${CUSTOM_OBJECTS_API_PATH}/${objectTypeId}`,
body: JSON.parse(fs.readFileSync(filePath, 'utf-8')),
});

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

const updateObject = async (accountId, objectTypeId, filePath) =>
http.post(accountId, {
uri: `${CUSTOM_OBJECTS_API_PATH}/${objectTypeId}`,
body: JSON.parse(fs.readFileSync(filePath, 'utf-8')),
});

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

const fetchObject = async (accountId, objectTypeId, instanceId) =>
http.get(accountId, {
uri: `${CUSTOM_OBJECTS_API_PATH}/${objectTypeId}/${instanceId}`,
});

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

const fetchObjects = async (accountId, objectTypeId) =>
http.get(accountId, {
uri: `${CUSTOM_OBJECTS_API_PATH}/${objectTypeId}`,
});

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

const archiveObject = async (accountId, objectTypeId, instanceId) =>
http.delete(accountId, {
uri: `${CUSTOM_OBJECTS_API_PATH}/${objectTypeId}/${instanceId}`,
});

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

const searchObjects = async (accountId, objectTypeId, filePath) =>
http.post(accountId, {
uri: `${CUSTOM_OBJECTS_API_PATH}/${objectTypeId}/search`,
body: JSON.parse(fs.readFileSync(filePath, 'utf-8')),
});

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

const batchCreateObjects = (accountId, objectTypeId, filePath) =>
http.post(accountId, {
uri: `${CUSTOM_OBJECTS_API_PATH}/${objectTypeId}/batch/create`,
Expand Down
24 changes: 24 additions & 0 deletions api/designManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ const http = require('../http');

const DESIGN_MANAGER_API_PATH = 'designmanager/v1';

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

/**
* @async
* @param {number} accountId
Expand All @@ -14,6 +20,12 @@ async function fetchMenus(accountId, query = {}) {
});
}

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

/**
* @async
* @param {number} accountId
Expand All @@ -26,6 +38,12 @@ async function fetchThemes(accountId, query = {}) {
});
}

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

/**
* @async
* @param {number} accountId
Expand All @@ -37,6 +55,12 @@ async function fetchBuiltinMapping(accountId) {
});
}

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

async function fetchRawAssetByPath(accountId, path) {
return http.get(accountId, {
uri: `${DESIGN_MANAGER_API_PATH}/raw-assets/by-path/${path}?portalId=${accountId}`,
Expand Down
6 changes: 6 additions & 0 deletions api/developerProjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ const http = require('../http');

const DEVELOPER_PROJECTS_API_PATH = 'developer/projects/v1';

/**
* @deprecated
* Use the corresponding export from @hubspot/local-dev-lib
* https://github.com/HubSpot/hubspot-local-dev-lib
*/

/**
* Fetch default project platform version along with list of active platform versions
*
Expand Down
Loading

0 comments on commit d80d36c

Please sign in to comment.