From c4ff07de7293be53e7b1f306891d8b6e67620e81 Mon Sep 17 00:00:00 2001 From: Camden Phalen Date: Tue, 5 Dec 2023 14:41:37 -0500 Subject: [PATCH] use local-dev-lib for schemas / customObjects --- packages/cli/commands/customObject/schema/fetch-all.js | 9 +++++++-- packages/cli/commands/customObject/schema/fetch.js | 5 ++++- packages/cli/lib/schema.js | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/cli/commands/customObject/schema/fetch-all.js b/packages/cli/commands/customObject/schema/fetch-all.js index b2ba14735..09ed28c03 100644 --- a/packages/cli/commands/customObject/schema/fetch-all.js +++ b/packages/cli/commands/customObject/schema/fetch-all.js @@ -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'; @@ -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), diff --git a/packages/cli/commands/customObject/schema/fetch.js b/packages/cli/commands/customObject/schema/fetch.js index bb18e30a2..ecd4a29ad 100644 --- a/packages/cli/commands/customObject/schema/fetch.js +++ b/packages/cli/commands/customObject/schema/fetch.js @@ -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'); diff --git a/packages/cli/lib/schema.js b/packages/cli/lib/schema.js index 090604bb5..8b0c20f40 100644 --- a/packages/cli/lib/schema.js +++ b/packages/cli/lib/schema.js @@ -27,5 +27,6 @@ const listSchemas = async accountId => { }; module.exports = { + logSchemas, listSchemas, };