Skip to content

Commit 0ca0243

Browse files
authored
Merge branch 'main' into release-please--branches--main--components--netlify-cli
2 parents 021ebd9 + 038f8a5 commit 0ca0243

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

src/commands/integration/deploy.ts

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function formatScopesForRemote(scopes) {
8585
}
8686

8787
// @ts-expect-error TS(7006) FIXME: Parameter 'name' implicitly has an 'any' type.
88-
function verifyRequiredFieldsAreInConfig(name, description, scopes, integrationLevel) {
88+
function verifyRequiredFieldsAreInConfig(name, description, scopes) {
8989
const missingFields = []
9090

9191
if (!name) {
@@ -97,9 +97,6 @@ function verifyRequiredFieldsAreInConfig(name, description, scopes, integrationL
9797
if (!scopes) {
9898
missingFields.push('scopes')
9999
}
100-
if (!integrationLevel) {
101-
missingFields.push('integrationLevel')
102-
}
103100
if (missingFields.length !== 0) {
104101
log(
105102
chalk.yellow(
@@ -120,7 +117,7 @@ function verifyRequiredFieldsAreInConfig(name, description, scopes, integrationL
120117

121118
// @ts-expect-error TS(7006) FIXME: Parameter 'workingDir' implicitly has an 'any' typ... Remove this comment to see the full error message
122119
export async function registerIntegration(workingDir, siteId, accountId, localIntegrationConfig, token) {
123-
const { description, integrationLevel, name, scopes, slug } = localIntegrationConfig
120+
const { description, name, scopes, slug } = localIntegrationConfig
124121
log(chalk.yellow(`An integration associated with the site ID ${siteId} is not registered.`))
125122
const registerPrompt = await inquirer.prompt([
126123
{
@@ -145,7 +142,7 @@ export async function registerIntegration(workingDir, siteId, accountId, localIn
145142
exit(1)
146143
}
147144

148-
if (!verifyRequiredFieldsAreInConfig(name, description, scopes, integrationLevel)) {
145+
if (!verifyRequiredFieldsAreInConfig(name, description, scopes)) {
149146
exit(1)
150147
}
151148

@@ -162,7 +159,6 @@ export async function registerIntegration(workingDir, siteId, accountId, localIn
162159
description,
163160
hostSiteId: siteId,
164161
scopes: formatScopesForRemote(scopes),
165-
integrationLevel,
166162
}),
167163
}).then(async (res) => {
168164
const response = await res.json()
@@ -186,7 +182,7 @@ export async function registerIntegration(workingDir, siteId, accountId, localIn
186182

187183
const updatedIntegrationConfig = yaml.dump({
188184
// @ts-expect-error TS(18046) - 'body' is of type 'unknown'
189-
config: { name, description, slug: body.slug, scopes, integrationLevel },
185+
config: { name, description, slug: body.slug, scopes },
190186
})
191187

192188
const filePath = resolve(workingDir, 'integration.yaml')
@@ -211,7 +207,7 @@ export async function updateIntegration(
211207
// @ts-expect-error TS(7006) FIXME: Parameter 'registeredIntegration' implicitly has a... Remove this comment to see the full error message
212208
registeredIntegration,
213209
) {
214-
let { description, integrationLevel, name, scopes, slug } = localIntegrationConfig
210+
let { description, name, scopes, slug } = localIntegrationConfig
215211

216212
let integrationSlug = slug
217213
if (slug !== registeredIntegration.slug) {
@@ -232,11 +228,6 @@ export async function updateIntegration(
232228
description = registeredIntegration.description
233229
}
234230

235-
if (!integrationLevel) {
236-
// eslint-disable-next-line prefer-destructuring
237-
integrationLevel = registeredIntegration.integrationLevel
238-
}
239-
240231
// This is returned as a comma separated string and will be easier to manage here as an array
241232
const registeredIntegrationScopes = registeredIntegration.scopes.split(',')
242233

@@ -287,7 +278,6 @@ export async function updateIntegration(
287278
hostSiteId: siteId,
288279
// @ts-expect-error TS(7005) FIXME: Variable 'localScopes' implicitly has an 'any[]' t... Remove this comment to see the full error message
289280
scopes: localScopes.join(','),
290-
integrationLevel,
291281
}),
292282
},
293283
).then(async (res) => {
@@ -325,7 +315,7 @@ export async function updateIntegration(
325315
}
326316

327317
const updatedIntegrationConfig = yaml.dump({
328-
config: { name, description, slug: integrationSlug, scopes: scopesToWrite, integrationLevel },
318+
config: { name, description, slug: integrationSlug, scopes: scopesToWrite },
329319
})
330320

331321
const filePath = resolve(workingDir, 'integration.yaml')
@@ -348,7 +338,6 @@ const IntegrationConfigurationSchema = z.object({
348338
user: z.array(z.enum(['read', 'write'])).optional(),
349339
})
350340
.optional(),
351-
integrationLevel: z.enum(['site', 'team', 'team-and-site']).optional(),
352341
})
353342

354343
// @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) => {
409398
// Confirm that a site is linked and that the user is logged in
410399
checkOptions(buildOptions)
411400

412-
const { description, integrationLevel, name, scopes, slug } = await getConfiguration(command.workingDir)
413-
const localIntegrationConfig = { name, description, scopes, slug, integrationLevel }
401+
const { description, name, scopes, slug } = await getConfiguration(command.workingDir)
402+
const localIntegrationConfig = { name, description, scopes, slug }
414403

415404
const headers = token ? { 'netlify-token': token } : undefined
416405
// @ts-expect-error TS(2345) FIXME: Argument of type '{ api: any; site: any; siteInfo:... Remove this comment to see the full error message

tests/integration/commands/integration/deploy.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ describe(`integration:deploy`, () => {
9090
scopes:
9191
site:
9292
- read
93-
integrationLevel: team-and-site
9493
`,
9594
},
9695
])

0 commit comments

Comments
 (0)