diff --git a/src/commands/integration/deploy.ts b/src/commands/integration/deploy.ts index df2f74ce22d..56c0def7bae 100644 --- a/src/commands/integration/deploy.ts +++ b/src/commands/integration/deploy.ts @@ -84,7 +84,7 @@ function formatScopesForRemote(scopes) { } // @ts-expect-error TS(7006) FIXME: Parameter 'name' implicitly has an 'any' type. -function verifyRequiredFieldsAreInConfig(name, description, scopes, integrationLevel) { +function verifyRequiredFieldsAreInConfig(name, description, scopes) { const missingFields = [] if (!name) { @@ -96,9 +96,6 @@ function verifyRequiredFieldsAreInConfig(name, description, scopes, integrationL if (!scopes) { missingFields.push('scopes') } - if (!integrationLevel) { - missingFields.push('integrationLevel') - } if (missingFields.length !== 0) { log( chalk.yellow( @@ -119,7 +116,7 @@ function verifyRequiredFieldsAreInConfig(name, description, scopes, integrationL // @ts-expect-error TS(7006) FIXME: Parameter 'workingDir' implicitly has an 'any' typ... Remove this comment to see the full error message export async function registerIntegration(workingDir, siteId, accountId, localIntegrationConfig, token) { - const { description, integrationLevel, name, scopes, slug } = localIntegrationConfig + const { description, name, scopes, slug } = localIntegrationConfig log(chalk.yellow(`An integration associated with the site ID ${siteId} is not registered.`)) const registerPrompt = await inquirer.prompt([ { @@ -144,7 +141,7 @@ export async function registerIntegration(workingDir, siteId, accountId, localIn exit(1) } - if (!verifyRequiredFieldsAreInConfig(name, description, scopes, integrationLevel)) { + if (!verifyRequiredFieldsAreInConfig(name, description, scopes)) { exit(1) } @@ -161,7 +158,6 @@ export async function registerIntegration(workingDir, siteId, accountId, localIn description, hostSiteId: siteId, scopes: formatScopesForRemote(scopes), - integrationLevel, }), }).then(async (res) => { const response = await res.json() @@ -185,7 +181,7 @@ export async function registerIntegration(workingDir, siteId, accountId, localIn const updatedIntegrationConfig = yaml.dump({ // @ts-expect-error TS(18046) - 'body' is of type 'unknown' - config: { name, description, slug: body.slug, scopes, integrationLevel }, + config: { name, description, slug: body.slug, scopes }, }) const filePath = resolve(workingDir, 'integration.yaml') @@ -210,7 +206,7 @@ export async function updateIntegration( // @ts-expect-error TS(7006) FIXME: Parameter 'registeredIntegration' implicitly has a... Remove this comment to see the full error message registeredIntegration, ) { - let { description, integrationLevel, name, scopes, slug } = localIntegrationConfig + let { description, name, scopes, slug } = localIntegrationConfig let integrationSlug = slug if (slug !== registeredIntegration.slug) { @@ -231,11 +227,6 @@ export async function updateIntegration( description = registeredIntegration.description } - if (!integrationLevel) { - // eslint-disable-next-line prefer-destructuring - integrationLevel = registeredIntegration.integrationLevel - } - // This is returned as a comma separated string and will be easier to manage here as an array const registeredIntegrationScopes = registeredIntegration.scopes.split(',') @@ -286,7 +277,6 @@ export async function updateIntegration( hostSiteId: siteId, // @ts-expect-error TS(7005) FIXME: Variable 'localScopes' implicitly has an 'any[]' t... Remove this comment to see the full error message scopes: localScopes.join(','), - integrationLevel, }), }, ).then(async (res) => { @@ -324,7 +314,7 @@ export async function updateIntegration( } const updatedIntegrationConfig = yaml.dump({ - config: { name, description, slug: integrationSlug, scopes: scopesToWrite, integrationLevel }, + config: { name, description, slug: integrationSlug, scopes: scopesToWrite }, }) const filePath = resolve(workingDir, 'integration.yaml') @@ -347,7 +337,6 @@ const IntegrationConfigurationSchema = z.object({ user: z.array(z.enum(['read', 'write'])).optional(), }) .optional(), - integrationLevel: z.enum(['site', 'team', 'team-and-site']).optional(), }) // @ts-expect-error TS(7006) FIXME: Parameter 'workingDir' implicitly has an 'any' typ... Remove this comment to see the full error message @@ -409,8 +398,8 @@ export const deploy = async (options: OptionValues, command: BaseCommand) => { // Confirm that a site is linked and that the user is logged in checkOptions(buildOptions) - const { description, integrationLevel, name, scopes, slug } = await getConfiguration(command.workingDir) - const localIntegrationConfig = { name, description, scopes, slug, integrationLevel } + const { description, name, scopes, slug } = await getConfiguration(command.workingDir) + const localIntegrationConfig = { name, description, scopes, slug } // @ts-expect-error TS(2345) FIXME: Argument of type '{ api: any; site: any; siteInfo:... Remove this comment to see the full error message const { accountId } = await getSiteInformation({ diff --git a/tests/integration/commands/integration/deploy.test.ts b/tests/integration/commands/integration/deploy.test.ts index ee0972b4f08..a4c546e0d8e 100644 --- a/tests/integration/commands/integration/deploy.test.ts +++ b/tests/integration/commands/integration/deploy.test.ts @@ -74,7 +74,6 @@ describe(`integration:deploy`, () => { scopes: site: - read - integrationLevel: team-and-site `, }, ])