Skip to content

Commit

Permalink
use local-dev-lib for schemas / customObjects
Browse files Browse the repository at this point in the history
  • Loading branch information
camden11 committed Dec 5, 2023
1 parent 5c92038 commit c4ff07d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions packages/cli/commands/customObject/schema/fetch-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ const {
const { loadAndValidateOptions } = require('../../../lib/validation');
const { trackCommandUsage } = require('../../../lib/usageTracking');
const { getAccountId } = require('../../../lib/commonOpts');
const { downloadSchemas, getResolvedPath } = require('@hubspot/cli-lib/schema');
const {
downloadSchemas,
getResolvedPath,
} = require('@hubspot/local-dev-lib/customObjects');
const { i18n } = require('../../../lib/lang');
const { logSchemas } = require('../../../lib/schema');

const i18nKey =
'cli.commands.customObject.subcommands.schema.subcommands.fetchAll';
Expand All @@ -23,7 +27,8 @@ exports.handler = async options => {
trackCommandUsage('custom-object-schema-fetch-all', null, accountId);

try {
await downloadSchemas(accountId, options.dest);
const schemas = await downloadSchemas(accountId, options.dest);
logSchemas(schemas);
logger.success(
i18n(`${i18nKey}.success.fetch`, {
path: getResolvedPath(options.dest),
Expand Down
5 changes: 4 additions & 1 deletion packages/cli/commands/customObject/schema/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ const {
logErrorInstance,
} = require('../../../lib/errorHandlers/standardErrors');
const { ConfigFlags } = require('@hubspot/cli-lib/lib/constants');
const { downloadSchema, getResolvedPath } = require('@hubspot/cli-lib/schema');
const {
downloadSchema,
getResolvedPath,
} = require('@hubspot/local-dev-lib/schema');
const { fetchSchema } = require('@hubspot/cli-lib/api/fileTransport');
const { getCwd } = require('@hubspot/cli-lib/path');

Expand Down
1 change: 1 addition & 0 deletions packages/cli/lib/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ const listSchemas = async accountId => {
};

module.exports = {
logSchemas,
listSchemas,
};

0 comments on commit c4ff07d

Please sign in to comment.