diff --git a/content/get-started/start-your-journey/index.md b/content/get-started/start-your-journey/index.md index 7c6d81be2987..ec7ad779f112 100644 --- a/content/get-started/start-your-journey/index.md +++ b/content/get-started/start-your-journey/index.md @@ -1,6 +1,6 @@ --- title: Start your journey -intro: 'Learn the basics of {% data variables.product.github %}.' +intro: "Brand new to {% data variables.product.github %}? Learn the basics here." versions: fpt: '*' ghes: '*' @@ -22,4 +22,18 @@ children: redirect_from: - /github/getting-started-with-github/quickstart - /get-started/quickstart +layout: journey-landing +journeyTracks: + - id: 'learn_the_basics' + title: 'Get started' + description: 'Master the fundamentals of {% data variables.product.github %} and Git.' + guides: + - '/get-started/start-your-journey/about-github-and-git' + - '/get-started/start-your-journey/creating-an-account-on-github' + - '/get-started/start-your-journey/hello-world' + - '/get-started/start-your-journey/setting-up-your-profile' + - '/get-started/start-your-journey/finding-inspiration-on-github' + - '/get-started/start-your-journey/downloading-files-from-github' + - '/get-started/start-your-journey/uploading-a-project-to-github' + - '/get-started/start-your-journey/git-and-github-learning-resources' --- diff --git a/data/features/dependabot-option-cooldown.yml b/data/features/dependabot-option-cooldown.yml index 8d8f85b970eb..45ff416811aa 100644 --- a/data/features/dependabot-option-cooldown.yml +++ b/data/features/dependabot-option-cooldown.yml @@ -3,4 +3,4 @@ versions: fpt: '*' ghec: '*' - ghes: '>3.19' + ghes: '>3.18' diff --git a/src/article-api/middleware/article.ts b/src/article-api/middleware/article.ts index 3bbb79cc628f..713c5eb6790a 100644 --- a/src/article-api/middleware/article.ts +++ b/src/article-api/middleware/article.ts @@ -172,11 +172,19 @@ function incrementArticleLookup( // logs the source of the request, if it's for hovercards it'll have the header X-Request-Source. // see src/links/components/LinkPreviewPopover.tsx - const source = - req.get('X-Request-Source') || - (req.get('Referer') - ? `external-${new URL(req.get('Referer') || '').hostname || 'unknown'}` - : 'external') + let source = req.get('X-Request-Source') + if (!source) { + const referer = req.get('Referer') + if (referer) { + try { + source = `external-${new URL(referer).hostname || 'unknown'}` + } catch { + source = 'external' + } + } else { + source = 'external' + } + } const tags = [ // According to https://docs.datadoghq.com/getting_started/tagging/#define-tags diff --git a/src/article-api/tests/article-body.ts b/src/article-api/tests/article-body.ts index dadb514f616f..45e686c129d5 100644 --- a/src/article-api/tests/article-body.ts +++ b/src/article-api/tests/article-body.ts @@ -66,4 +66,13 @@ describe('article body api', () => { const { error } = JSON.parse(res.body) expect(error).toContain("isn't yet available in markdown") }) + + test('invalid Referer header does not crash', async () => { + const res = await get(makeURL('/en/get-started/start-your-journey/hello-world'), { + headers: { + Referer: 'invalid-url', + }, + }) + expect(res.statusCode).toBe(200) + }) }) diff --git a/src/codeql-cli/scripts/sync.ts b/src/codeql-cli/scripts/sync.ts index 7ca45f732e7b..d7a273980178 100755 --- a/src/codeql-cli/scripts/sync.ts +++ b/src/codeql-cli/scripts/sync.ts @@ -29,7 +29,7 @@ async function main() { includeBasePath: true, globs: ['**/*.md'], }) - const cliMarkdownContents: Record = {} + const cliMarkdownContents: Record; content: string }> = {} for (const file of markdownFiles) { const sourceContent = await readFile(file, 'utf8') diff --git a/src/content-linter/lib/linting-rules/ctas-schema.ts b/src/content-linter/lib/linting-rules/ctas-schema.ts index 00981e0fb5a8..72c58a70ec75 100644 --- a/src/content-linter/lib/linting-rules/ctas-schema.ts +++ b/src/content-linter/lib/linting-rules/ctas-schema.ts @@ -105,15 +105,16 @@ export const ctasSchema: Rule = { for (const error of errors) { let message = '' if (error.keyword === 'required') { - message = `Missing required parameter: ${(error.params as any)?.missingProperty}` + message = `Missing required parameter: ${(error.params as { missingProperty?: string })?.missingProperty}` } else if (error.keyword === 'enum') { const paramName = error.instancePath.substring(1) // Get the actual invalid value from refParams and allowed values from params const invalidValue = refParams[paramName] - const allowedValues = (error.params as any)?.allowedValues || [] + const allowedValues = + (error.params as { allowedValues?: unknown[] })?.allowedValues || [] message = `Invalid value for ${paramName}: "${invalidValue}". Valid values are: ${allowedValues.join(', ')}` } else if (error.keyword === 'additionalProperties') { - message = `Unexpected parameter: ${(error.params as any)?.additionalProperty}` + message = `Unexpected parameter: ${(error.params as { additionalProperty?: string })?.additionalProperty}` } else { message = `CTA URL validation error: ${error.message}` } diff --git a/src/content-linter/lib/linting-rules/link-punctuation.ts b/src/content-linter/lib/linting-rules/link-punctuation.ts index 75045e2b2eb4..afeecb5656c8 100644 --- a/src/content-linter/lib/linting-rules/link-punctuation.ts +++ b/src/content-linter/lib/linting-rules/link-punctuation.ts @@ -3,31 +3,39 @@ import type { RuleParams, RuleErrorCallback, Rule } from '../../types' import { doesStringEndWithPeriod, getRange, isStringQuoted } from '../helpers/utils' +// Minimal type for markdownit tokens used in this rule +interface MarkdownToken { + children?: MarkdownToken[] + line?: string + type?: string + content?: string + lineNumber?: number +} + export const linkPunctuation: Rule = { names: ['GHD001', 'link-punctuation'], description: 'Internal link titles must not contain punctuation', tags: ['links', 'url'], parser: 'markdownit', function: (params: RuleParams, onError: RuleErrorCallback) => { - // Using 'any' type for token as markdownlint-rule-helpers doesn't provide TypeScript types - filterTokens(params, 'inline', (token: any) => { + filterTokens(params, 'inline', (token: MarkdownToken) => { const { children, line } = token let inLink = false - for (const child of children) { + for (const child of children || []) { if (child.type === 'link_open') { inLink = true } else if (child.type === 'link_close') { inLink = false - } else if (inLink && child.type === 'text') { + } else if (inLink && child.type === 'text' && child.content) { const content = child.content.trim() const hasPeriod = doesStringEndWithPeriod(content) const hasQuotes = isStringQuoted(content) if (hasPeriod || hasQuotes) { - const range = getRange(line, content) + const range = line ? getRange(line, content) : [] addError( onError, - child.lineNumber, + child.lineNumber || 1, 'Remove quotes and/or period punctuation from the link title.', child.content, range, diff --git a/src/content-render/liquid/data.ts b/src/content-render/liquid/data.ts index fce51925c73f..28c8f581738f 100644 --- a/src/content-render/liquid/data.ts +++ b/src/content-render/liquid/data.ts @@ -7,10 +7,13 @@ import { getDataByLanguage } from '@/data-directory/lib/get-data' const Syntax = /([a-z0-9/\\_.\-[\]]+)/i const SyntaxHelp = "Syntax Error in 'data' - Valid syntax: data [path]" -// Using any for scope because it has custom environments property not in Liquid's Scope type +// Using unknown for scope because it has custom environments property not in Liquid's Scope type interface CustomScope { - environments: any - [key: string]: any + environments: { + currentLanguage?: string + [key: string]: unknown + } + [key: string]: unknown } interface DataTag { @@ -32,7 +35,7 @@ export default { }, async render(scope: CustomScope) { - let text = getDataByLanguage(this.path, scope.environments.currentLanguage) + let text = getDataByLanguage(this.path, scope.environments.currentLanguage || '') if (text === undefined) { if (scope.environments.currentLanguage === 'en') { const message = `Can't find the key 'data ${this.path}' in the scope.` diff --git a/src/fixtures/tests/internal-links.ts b/src/fixtures/tests/internal-links.ts index d95dcc71d0f1..e0847dc2395e 100644 --- a/src/fixtures/tests/internal-links.ts +++ b/src/fixtures/tests/internal-links.ts @@ -9,7 +9,7 @@ describe('autotitle', () => { test('internal links with AUTOTITLE resolves', async () => { const $: cheerio.Root = await getDOM('/get-started/foo/autotitling') const links = $('#article-contents a[href]') - links.each((i: number, element: any) => { + links.each((i: number, element: cheerio.Element) => { if ($(element).attr('href')?.includes('/get-started/start-your-journey/hello-world')) { expect($(element).text()).toBe('Hello World') } @@ -49,13 +49,14 @@ describe('cross-version-links', () => { // Tests that the hardcoded prefix is always removed const firstLink = links.filter( - (i: number, element: any) => $(element).text() === 'Hello world always in free-pro-team', + (i: number, element: cheerio.Element) => + $(element).text() === 'Hello world always in free-pro-team', ) expect(firstLink.attr('href')).toBe('/en/get-started/start-your-journey/hello-world') // Tests that the second link always goes to enterprise-server@X.Y const secondLink = links.filter( - (i: number, element: any) => + (i: number, element: cheerio.Element) => $(element).text() === 'Autotitling page always in enterprise-server latest', ) expect(secondLink.attr('href')).toBe( @@ -72,7 +73,7 @@ describe('link-rewriting', () => { { const link = links.filter( - (i: number, element: any) => $(element).text() === 'Cross Version Linking', + (i: number, element: cheerio.Element) => $(element).text() === 'Cross Version Linking', ) expect(link.attr('href')).toMatch('/en/get-started/') } @@ -80,21 +81,25 @@ describe('link-rewriting', () => { // Some links are left untouched { - const link = links.filter((i: number, element: any) => + const link = links.filter((i: number, element: cheerio.Element) => $(element).text().includes('Enterprise 11.10'), ) expect(link.attr('href')).toMatch('/en/enterprise/') } { - const link = links.filter((i: number, element: any) => $(element).text().includes('peterbe')) + const link = links.filter((i: number, element: cheerio.Element) => + $(element).text().includes('peterbe'), + ) expect(link.attr('href')).toMatch(/^https:/) } { - const link = links.filter((i: number, element: any) => $(element).text().includes('Picture')) + const link = links.filter((i: number, element: cheerio.Element) => + $(element).text().includes('Picture'), + ) expect(link.attr('href')).toMatch(/^\/assets\//) } { - const link = links.filter((i: number, element: any) => + const link = links.filter((i: number, element: cheerio.Element) => $(element).text().includes('GraphQL Schema'), ) expect(link.attr('href')).toMatch(/^\/public\//) @@ -108,7 +113,7 @@ describe('link-rewriting', () => { const links = $('#article-contents a[href]') const link = links.filter( - (i: number, element: any) => $(element).text() === 'Cross Version Linking', + (i: number, element: cheerio.Element) => $(element).text() === 'Cross Version Linking', ) expect(link.attr('href')).toMatch('/en/enterprise-cloud@latest/get-started/') }) @@ -121,7 +126,7 @@ describe('link-rewriting', () => { const links = $('#article-contents a[href]') const link = links.filter( - (i: number, element: any) => $(element).text() === 'Cross Version Linking', + (i: number, element: cheerio.Element) => $(element).text() === 'Cross Version Linking', ) expect(link.attr('href')).toMatch( `/en/enterprise-server@${enterpriseServerReleases.latestStable}/get-started/`, @@ -133,14 +138,14 @@ describe('subcategory links', () => { test('no free-pro-team prefix', async () => { const $: cheerio.Root = await getDOM('/rest/actions') const links = $('[data-testid="table-of-contents"] a[href]') - links.each((i: number, element: any) => { + links.each((i: number, element: cheerio.Element) => { expect($(element).attr('href')).not.toContain('/free-pro-team@latest') }) }) test('enterprise-server prefix', async () => { const $: cheerio.Root = await getDOM('/enterprise-server@latest/rest/actions') const links = $('[data-testid="table-of-contents"] a[href]') - links.each((i: number, element: any) => { + links.each((i: number, element: cheerio.Element) => { expect($(element).attr('href')).toMatch(/\/enterprise-server@\d/) }) }) diff --git a/src/graphql/data/fpt/changelog.json b/src/graphql/data/fpt/changelog.json index 15fea5fc8cbb..05c494018644 100644 --- a/src/graphql/data/fpt/changelog.json +++ b/src/graphql/data/fpt/changelog.json @@ -1,4 +1,139 @@ [ + { + "schemaChanges": [ + { + "title": "The GraphQL schema includes these changes:", + "changes": [ + "

Type CreateRepositoryCustomPropertyInput was added

", + "

Input field allowedValues of type '[String!]was added to input object typeCreateRepositoryCustomPropertyInput'

", + "

Input field clientMutationId of type String was added to input object type CreateRepositoryCustomPropertyInput

", + "

Input field defaultValue of type String was added to input object type CreateRepositoryCustomPropertyInput

", + "

Input field description of type String was added to input object type CreateRepositoryCustomPropertyInput

", + "

Input field propertyName of type String! was added to input object type CreateRepositoryCustomPropertyInput

", + "

Input field regex of type String was added to input object type CreateRepositoryCustomPropertyInput

", + "

Input field required of type Boolean was added to input object type CreateRepositoryCustomPropertyInput

", + "

Input field sourceId of type ID! was added to input object type CreateRepositoryCustomPropertyInput

", + "

Input field valueType of type CustomPropertyValueType! was added to input object type CreateRepositoryCustomPropertyInput

", + "

Input field valuesEditableBy of type RepositoryCustomPropertyValuesEditableBy was added to input object type CreateRepositoryCustomPropertyInput

", + "

Type CreateRepositoryCustomPropertyPayload was added

", + "

Field clientMutationId was added to object type CreateRepositoryCustomPropertyPayload

", + "

Field repositoryCustomProperty was added to object type CreateRepositoryCustomPropertyPayload

", + "

Type CustomPropertySource was added

", + "

Member Enterprise was added to Union type CustomPropertySource

", + "

Member Organization was added to Union type CustomPropertySource

", + "

Type CustomPropertyValue was added

", + "

Type CustomPropertyValueInput was added

", + "

Input field propertyName of type String! was added to input object type CustomPropertyValueInput

", + "

Input field value of type CustomPropertyValue was added to input object type CustomPropertyValueInput

", + "

Type CustomPropertyValueType was added

", + "

Enum value 'MULTI_SELECTwas added to enumCustomPropertyValueType'

", + "

Enum value 'SINGLE_SELECTwas added to enumCustomPropertyValueType'

", + "

Enum value STRING was added to enum CustomPropertyValueType

", + "

Enum value 'TRUE_FALSEwas added to enumCustomPropertyValueType'

", + "

Enum value URL was added to enum CustomPropertyValueType

", + "

Type DeleteRepositoryCustomPropertyInput was added

", + "

Input field clientMutationId of type String was added to input object type DeleteRepositoryCustomPropertyInput

", + "

Input field id of type ID! was added to input object type DeleteRepositoryCustomPropertyInput

", + "

Type DeleteRepositoryCustomPropertyPayload was added

", + "

Field clientMutationId was added to object type DeleteRepositoryCustomPropertyPayload

", + "

Field repositoryCustomProperty was added to object type DeleteRepositoryCustomPropertyPayload

", + "

Type PromoteRepositoryCustomPropertyInput was added

", + "

Input field clientMutationId of type String was added to input object type PromoteRepositoryCustomPropertyInput

", + "

Input field repositoryCustomPropertyId of type ID! was added to input object type PromoteRepositoryCustomPropertyInput

", + "

Type PromoteRepositoryCustomPropertyPayload was added

", + "

Field clientMutationId was added to object type PromoteRepositoryCustomPropertyPayload

", + "

Field repositoryCustomProperty was added to object type PromoteRepositoryCustomPropertyPayload

", + "

Type RepositoryCustomProperty was added

", + "

RepositoryCustomProperty object implements Node interface

", + "

Field allowedValues was added to object type RepositoryCustomProperty

", + "

Field defaultValue was added to object type RepositoryCustomProperty

", + "

Field description was added to object type RepositoryCustomProperty

", + "

Field id was added to object type RepositoryCustomProperty

", + "

Field propertyName was added to object type RepositoryCustomProperty

", + "

Field regex was added to object type RepositoryCustomProperty

", + "

Field required was added to object type RepositoryCustomProperty

", + "

Field source was added to object type RepositoryCustomProperty

", + "

Field valueType was added to object type RepositoryCustomProperty

", + "

Field valuesEditableBy was added to object type RepositoryCustomProperty

", + "

Type RepositoryCustomPropertyConnection was added

", + "

Field edges was added to object type RepositoryCustomPropertyConnection

", + "

Field nodes was added to object type RepositoryCustomPropertyConnection

", + "

Field pageInfo was added to object type RepositoryCustomPropertyConnection

", + "

Field totalCount was added to object type RepositoryCustomPropertyConnection

", + "

Type RepositoryCustomPropertyEdge was added

", + "

Field cursor was added to object type RepositoryCustomPropertyEdge

", + "

Field node was added to object type RepositoryCustomPropertyEdge

", + "

Type RepositoryCustomPropertyValue was added

", + "

Field propertyName was added to object type RepositoryCustomPropertyValue

", + "

Field value was added to object type RepositoryCustomPropertyValue

", + "

Type RepositoryCustomPropertyValueConnection was added

", + "

Field edges was added to object type RepositoryCustomPropertyValueConnection

", + "

Field nodes was added to object type RepositoryCustomPropertyValueConnection

", + "

Field pageInfo was added to object type RepositoryCustomPropertyValueConnection

", + "

Field totalCount was added to object type RepositoryCustomPropertyValueConnection

", + "

Type RepositoryCustomPropertyValueEdge was added

", + "

Field cursor was added to object type RepositoryCustomPropertyValueEdge

", + "

Field node was added to object type RepositoryCustomPropertyValueEdge

", + "

Type RepositoryCustomPropertyValuesEditableBy was added

", + "

Enum value 'ORG_ACTORSwas added to enumRepositoryCustomPropertyValuesEditableBy'

", + "

Enum value 'ORG_AND_REPO_ACTORSwas added to enumRepositoryCustomPropertyValuesEditableBy'

", + "

Type SetRepositoryCustomPropertyValuesInput was added

", + "

Input field clientMutationId of type String was added to input object type SetRepositoryCustomPropertyValuesInput

", + "

Input field properties of type '[CustomPropertyValueInput!]!was added to input object typeSetRepositoryCustomPropertyValuesInput'

", + "

Input field repositoryId of type ID! was added to input object type SetRepositoryCustomPropertyValuesInput

", + "

Type SetRepositoryCustomPropertyValuesPayload was added

", + "

Field clientMutationId was added to object type SetRepositoryCustomPropertyValuesPayload

", + "

Field repository was added to object type SetRepositoryCustomPropertyValuesPayload

", + "

Type UpdateRepositoryCustomPropertyInput was added

", + "

Input field allowedValues of type '[String!]was added to input object typeUpdateRepositoryCustomPropertyInput'

", + "

Input field clientMutationId of type String was added to input object type UpdateRepositoryCustomPropertyInput

", + "

Input field defaultValue of type String was added to input object type UpdateRepositoryCustomPropertyInput

", + "

Input field description of type String was added to input object type UpdateRepositoryCustomPropertyInput

", + "

Input field regex of type String was added to input object type UpdateRepositoryCustomPropertyInput

", + "

Input field repositoryCustomPropertyId of type ID! was added to input object type UpdateRepositoryCustomPropertyInput

", + "

Input field required of type Boolean was added to input object type UpdateRepositoryCustomPropertyInput

", + "

Input field valuesEditableBy of type RepositoryCustomPropertyValuesEditableBy was added to input object type UpdateRepositoryCustomPropertyInput

", + "

Type UpdateRepositoryCustomPropertyPayload was added

", + "

Field clientMutationId was added to object type UpdateRepositoryCustomPropertyPayload

", + "

Field repositoryCustomProperty was added to object type UpdateRepositoryCustomPropertyPayload

", + "

Field repositoryCustomProperties was added to object type Enterprise

", + "

Argument after: String added to field Enterprise.repositoryCustomProperties

", + "

Argument before: String added to field Enterprise.repositoryCustomProperties

", + "

Argument first: Int added to field Enterprise.repositoryCustomProperties

", + "

Argument last: Int added to field Enterprise.repositoryCustomProperties

", + "

Field repositoryCustomProperty was added to object type Enterprise

", + "

Argument propertyName: String! added to field Enterprise.repositoryCustomProperty

", + "

Field createRepositoryCustomProperty was added to object type Mutation

", + "

Argument input: CreateRepositoryCustomPropertyInput! added to field Mutation.createRepositoryCustomProperty

", + "

Field deleteRepositoryCustomProperty was added to object type Mutation

", + "

Argument input: DeleteRepositoryCustomPropertyInput! added to field Mutation.deleteRepositoryCustomProperty

", + "

Field promoteRepositoryCustomProperty was added to object type Mutation

", + "

Argument input: PromoteRepositoryCustomPropertyInput! added to field Mutation.promoteRepositoryCustomProperty

", + "

Field setRepositoryCustomPropertyValues was added to object type Mutation

", + "

Argument input: SetRepositoryCustomPropertyValuesInput! added to field Mutation.setRepositoryCustomPropertyValues

", + "

Field updateRepositoryCustomProperty was added to object type Mutation

", + "

Argument input: UpdateRepositoryCustomPropertyInput! added to field Mutation.updateRepositoryCustomProperty

", + "

Field repositoryCustomProperties was added to object type Organization

", + "

Argument after: String added to field Organization.repositoryCustomProperties

", + "

Argument before: String added to field Organization.repositoryCustomProperties

", + "

Argument first: Int added to field Organization.repositoryCustomProperties

", + "

Argument last: Int added to field Organization.repositoryCustomProperties

", + "

Field repositoryCustomProperty was added to object type Organization

", + "

Argument propertyName: String! added to field Organization.repositoryCustomProperty

", + "

Field repositoryCustomPropertyValue was added to object type Repository

", + "

Argument propertyName: String! added to field Repository.repositoryCustomPropertyValue

", + "

Field repositoryCustomPropertyValues was added to object type Repository

", + "

Argument after: String added to field Repository.repositoryCustomPropertyValues

", + "

Argument before: String added to field Repository.repositoryCustomPropertyValues

", + "

Argument first: Int added to field Repository.repositoryCustomPropertyValues

", + "

Argument last: Int added to field Repository.repositoryCustomPropertyValues

" + ] + } + ], + "previewChanges": [], + "upcomingChanges": [], + "date": "2025-12-10" + }, { "schemaChanges": [ { diff --git a/src/graphql/data/fpt/schema.docs.graphql b/src/graphql/data/fpt/schema.docs.graphql index 9a517584cab1..65dd7e8a9ddd 100644 --- a/src/graphql/data/fpt/schema.docs.graphql +++ b/src/graphql/data/fpt/schema.docs.graphql @@ -8724,6 +8724,76 @@ type CreateRefPayload { ref: Ref } +""" +Autogenerated input type of CreateRepositoryCustomProperty +""" +input CreateRepositoryCustomPropertyInput { + """ + The allowed values for the custom property. + """ + allowedValues: [String!] + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The default value for the custom property if the property is required. + """ + defaultValue: String + + """ + The description of the custom property. + """ + description: String + + """ + The name of the custom property. + """ + propertyName: String! + + """ + The regex pattern that the value of the custom property must match, if the `value_type` is `string`. + """ + regex: String + + """ + Whether the custom property is required. + """ + required: Boolean + + """ + The global relay id of the source in which a new custom property should be created in. + """ + sourceId: ID! @possibleTypes(concreteTypes: ["Enterprise", "Organization"], abstractType: "CustomPropertySource") + + """ + The value type for the custom property. + """ + valueType: CustomPropertyValueType! + + """ + The allowed actors who can edit the values of a custom property. + """ + valuesEditableBy: RepositoryCustomPropertyValuesEditableBy +} + +""" +Autogenerated return type of CreateRepositoryCustomProperty. +""" +type CreateRepositoryCustomPropertyPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The newly created repository custom property. + """ + repositoryCustomProperty: RepositoryCustomProperty +} + """ Autogenerated input type of CreateRepository """ @@ -9782,6 +9852,64 @@ type CrossReferencedEvent implements Node & UniformResourceLocatable { willCloseTarget: Boolean! } +""" +Sources which can have custom properties defined. +""" +union CustomPropertySource = Enterprise | Organization + +""" +A custom property value can be either a string or an array of strings. All +property types support only a single string value, except for the multi-select +type, which supports only a string array. +""" +scalar CustomPropertyValue + +""" +The custom property name and value to be set. +""" +input CustomPropertyValueInput { + """ + The name of the custom property. + """ + propertyName: String! + + """ + The value to set for the custom property. Using a value of null will unset the + property value, reverting to the default value if the property is required. + """ + value: CustomPropertyValue +} + +""" +The allowed value types for a custom property definition. +""" +enum CustomPropertyValueType { + """ + A multi-select value. + """ + MULTI_SELECT + + """ + A single-select value. + """ + SINGLE_SELECT + + """ + A string value. + """ + STRING + + """ + A true/false value. + """ + TRUE_FALSE + + """ + A URL value. + """ + URL +} + """ The Common Vulnerability Scoring System """ @@ -10588,6 +10716,36 @@ type DeleteRefPayload { clientMutationId: String } +""" +Autogenerated input type of DeleteRepositoryCustomProperty +""" +input DeleteRepositoryCustomPropertyInput { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The global relay id of the custom property to be deleted. + """ + id: ID! @possibleTypes(concreteTypes: ["RepositoryCustomProperty"]) +} + +""" +Autogenerated return type of DeleteRepositoryCustomProperty. +""" +type DeleteRepositoryCustomPropertyPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The deleted custom property. + """ + repositoryCustomProperty: RepositoryCustomProperty +} + """ Autogenerated input type of DeleteRepositoryRuleset """ @@ -13660,6 +13818,41 @@ type Enterprise implements Node { """ readmeHTML: HTML! + """ + A list of repository custom properties for this enterprise. + """ + repositoryCustomProperties( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryCustomPropertyConnection + + """ + Returns a single repository custom property for the current enterprise by name. + """ + repositoryCustomProperty( + """ + The name of the repository custom property to be returned. + """ + propertyName: String! + ): RepositoryCustomProperty + """ The HTTP path for this enterprise. """ @@ -25263,6 +25456,16 @@ type Mutation { input: CreateRepositoryInput! ): CreateRepositoryPayload + """ + Create a repository custom property. + """ + createRepositoryCustomProperty( + """ + Parameters for CreateRepositoryCustomProperty + """ + input: CreateRepositoryCustomPropertyInput! + ): CreateRepositoryCustomPropertyPayload + """ Create a repository ruleset """ @@ -25593,6 +25796,16 @@ type Mutation { input: DeleteRefInput! ): DeleteRefPayload + """ + Delete a repository custom property. + """ + deleteRepositoryCustomProperty( + """ + Parameters for DeleteRepositoryCustomProperty + """ + input: DeleteRepositoryCustomPropertyInput! + ): DeleteRepositoryCustomPropertyPayload + """ Delete a repository ruleset """ @@ -25935,6 +26148,16 @@ type Mutation { input: PinIssueInput! ): PinIssuePayload + """ + Promote a repository custom property to the enterprise level. + """ + promoteRepositoryCustomProperty( + """ + Parameters for PromoteRepositoryCustomProperty + """ + input: PromoteRepositoryCustomPropertyInput! + ): PromoteRepositoryCustomPropertyPayload + """ Publish an existing sponsorship tier that is currently still a draft to a GitHub Sponsors profile. """ @@ -26256,6 +26479,16 @@ type Mutation { input: SetOrganizationInteractionLimitInput! ): SetOrganizationInteractionLimitPayload + """ + Set repository custom property values for a repository. + """ + setRepositoryCustomPropertyValues( + """ + Parameters for SetRepositoryCustomPropertyValues + """ + input: SetRepositoryCustomPropertyValuesInput! + ): SetRepositoryCustomPropertyValuesPayload + """ Sets an interaction limit setting for a repository. """ @@ -27049,6 +27282,16 @@ type Mutation { input: UpdateRepositoryInput! ): UpdateRepositoryPayload + """ + Update a repository custom property. + """ + updateRepositoryCustomProperty( + """ + Parameters for UpdateRepositoryCustomProperty + """ + input: UpdateRepositoryCustomPropertyInput! + ): UpdateRepositoryCustomPropertyPayload + """ Update a repository ruleset """ @@ -33264,6 +33507,41 @@ type Organization implements Actor & MemberStatusable & Node & PackageOwner & Pr name: String! ): Repository + """ + A list of custom properties for this organization. + """ + repositoryCustomProperties( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryCustomPropertyConnection + + """ + Returns a single custom property from the current organization by name. + """ + repositoryCustomProperty( + """ + The name of the custom property to be returned. + """ + propertyName: String! + ): RepositoryCustomProperty + """ Discussion comments this user has authored. """ @@ -40299,6 +40577,36 @@ enum ProjectV2WorkflowsOrderField { UPDATED_AT } +""" +Autogenerated input type of PromoteRepositoryCustomProperty +""" +input PromoteRepositoryCustomPropertyInput { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The ID of the repository custom property to be promoted. + """ + repositoryCustomPropertyId: ID! @possibleTypes(concreteTypes: ["RepositoryCustomProperty"]) +} + +""" +Autogenerated return type of PromoteRepositoryCustomProperty. +""" +type PromoteRepositoryCustomPropertyPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The repository custom property that has been promoted. + """ + repositoryCustomProperty: RepositoryCustomProperty +} + """ A property that must match """ @@ -51484,6 +51792,41 @@ type Repository implements Node & PackageOwner & ProjectOwner & ProjectV2Recent orderBy: ReleaseOrder ): ReleaseConnection! + """ + A custom property value for the repository. + """ + repositoryCustomPropertyValue( + """ + The name of the custom property to retrieve the value for. + """ + propertyName: String! + ): RepositoryCustomPropertyValue + + """ + A list of custom properties and their associated values for a repository. + """ + repositoryCustomPropertyValues( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryCustomPropertyValueConnection + """ A list of applied repository-topic associations for this repository. """ @@ -52095,6 +52438,171 @@ enum RepositoryContributionType { REPOSITORY } +""" +A repository custom property. +""" +type RepositoryCustomProperty implements Node { + """ + The allowed values for the custom property. Required if `value_type` is `single_select` or `multi_select`. + """ + allowedValues: [String!] + + """ + The default value of the custom property, if the property is `required`. + """ + defaultValue: CustomPropertyValue + + """ + The description of the custom property. + """ + description: String + + """ + The Node ID of the RepositoryCustomProperty object + """ + id: ID! + + """ + The name of the custom property. + """ + propertyName: String! + + """ + The regex pattern that the value of the custom property must match, if the `value_type` is `string`. + """ + regex: String + + """ + Whether the custom property is required. + """ + required: Boolean + + """ + The source type of the custom property. + """ + source: CustomPropertySource! + + """ + The value type of the custom property. + """ + valueType: CustomPropertyValueType! + + """ + Who can edit the values of this repository custom property. + """ + valuesEditableBy: RepositoryCustomPropertyValuesEditableBy! +} + +""" +The connection type for RepositoryCustomProperty. +""" +type RepositoryCustomPropertyConnection { + """ + A list of edges. + """ + edges: [RepositoryCustomPropertyEdge] + + """ + A list of nodes. + """ + nodes: [RepositoryCustomProperty] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type RepositoryCustomPropertyEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: RepositoryCustomProperty +} + +""" +A value associated with a repository custom property. +""" +type RepositoryCustomPropertyValue { + """ + The name of the custom property. + """ + propertyName: String! + + """ + The value of the custom property. + """ + value: CustomPropertyValue! +} + +""" +The connection type for RepositoryCustomPropertyValue. +""" +type RepositoryCustomPropertyValueConnection { + """ + A list of edges. + """ + edges: [RepositoryCustomPropertyValueEdge] + + """ + A list of nodes. + """ + nodes: [RepositoryCustomPropertyValue] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type RepositoryCustomPropertyValueEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: RepositoryCustomPropertyValue +} + +""" +The allowed actors who can edit the values of a custom property. +""" +enum RepositoryCustomPropertyValuesEditableBy { + """ + The organization actors. + """ + ORG_ACTORS + + """ + The organization and repository actors. + """ + ORG_AND_REPO_ACTORS +} + """ Represents an author of discussions in repositories. """ @@ -56348,6 +56856,41 @@ type SetOrganizationInteractionLimitPayload { organization: Organization } +""" +Autogenerated input type of SetRepositoryCustomPropertyValues +""" +input SetRepositoryCustomPropertyValuesInput { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + A list of custom property names and associated values to apply. + """ + properties: [CustomPropertyValueInput!]! + + """ + The ID of the repository to set properties for. + """ + repositoryId: ID! @possibleTypes(concreteTypes: ["Repository"]) +} + +""" +Autogenerated return type of SetRepositoryCustomPropertyValues. +""" +type SetRepositoryCustomPropertyValuesPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The repository that the custom properties were set for. + """ + repository: Repository +} + """ Autogenerated input type of SetRepositoryInteractionLimit """ @@ -66870,6 +67413,66 @@ type UpdateRefsPayload { clientMutationId: String } +""" +Autogenerated input type of UpdateRepositoryCustomProperty +""" +input UpdateRepositoryCustomPropertyInput { + """ + The updated allowed values for the custom property. + """ + allowedValues: [String!] + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated default value for the custom property if the property is required. + """ + defaultValue: String + + """ + The updated description of the custom property. + """ + description: String + + """ + The regex pattern that the value of the custom property must match, if the `value_type` is `string`. + """ + regex: String + + """ + The global relay id of the source of the custom property. + """ + repositoryCustomPropertyId: ID! @possibleTypes(concreteTypes: ["RepositoryCustomProperty"]) + + """ + Whether the updated custom property is required. + """ + required: Boolean + + """ + The updated actors who can edit the values of the custom property. + """ + valuesEditableBy: RepositoryCustomPropertyValuesEditableBy +} + +""" +Autogenerated return type of UpdateRepositoryCustomProperty. +""" +type UpdateRepositoryCustomPropertyPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated repository custom property. + """ + repositoryCustomProperty: RepositoryCustomProperty +} + """ Autogenerated input type of UpdateRepository """ diff --git a/src/graphql/data/fpt/schema.json b/src/graphql/data/fpt/schema.json index edd334750b8d..2473f2dce94f 100644 --- a/src/graphql/data/fpt/schema.json +++ b/src/graphql/data/fpt/schema.json @@ -3461,6 +3461,40 @@ } ] }, + { + "name": "createRepositoryCustomProperty", + "kind": "mutations", + "id": "createrepositorycustomproperty", + "href": "/graphql/reference/mutations#createrepositorycustomproperty", + "description": "

Create a repository custom property.

", + "inputFields": [ + { + "name": "input", + "type": "CreateRepositoryCustomPropertyInput!", + "id": "createrepositorycustompropertyinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#createrepositorycustompropertyinput" + } + ], + "returnFields": [ + { + "name": "clientMutationId", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string", + "description": "

A unique identifier for the client performing the mutation.

" + }, + { + "name": "repositoryCustomProperty", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "description": "

The newly created repository custom property.

" + } + ] + }, { "name": "createRepositoryRuleset", "kind": "mutations", @@ -4561,6 +4595,40 @@ } ] }, + { + "name": "deleteRepositoryCustomProperty", + "kind": "mutations", + "id": "deleterepositorycustomproperty", + "href": "/graphql/reference/mutations#deleterepositorycustomproperty", + "description": "

Delete a repository custom property.

", + "inputFields": [ + { + "name": "input", + "type": "DeleteRepositoryCustomPropertyInput!", + "id": "deleterepositorycustompropertyinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#deleterepositorycustompropertyinput" + } + ], + "returnFields": [ + { + "name": "clientMutationId", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string", + "description": "

A unique identifier for the client performing the mutation.

" + }, + { + "name": "repositoryCustomProperty", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "description": "

The deleted custom property.

" + } + ] + }, { "name": "deleteRepositoryRuleset", "kind": "mutations", @@ -5715,6 +5783,40 @@ } ] }, + { + "name": "promoteRepositoryCustomProperty", + "kind": "mutations", + "id": "promoterepositorycustomproperty", + "href": "/graphql/reference/mutations#promoterepositorycustomproperty", + "description": "

Promote a repository custom property to the enterprise level.

", + "inputFields": [ + { + "name": "input", + "type": "PromoteRepositoryCustomPropertyInput!", + "id": "promoterepositorycustompropertyinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#promoterepositorycustompropertyinput" + } + ], + "returnFields": [ + { + "name": "clientMutationId", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string", + "description": "

A unique identifier for the client performing the mutation.

" + }, + { + "name": "repositoryCustomProperty", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "description": "

The repository custom property that has been promoted.

" + } + ] + }, { "name": "publishSponsorsTier", "kind": "mutations", @@ -6915,6 +7017,40 @@ } ] }, + { + "name": "setRepositoryCustomPropertyValues", + "kind": "mutations", + "id": "setrepositorycustompropertyvalues", + "href": "/graphql/reference/mutations#setrepositorycustompropertyvalues", + "description": "

Set repository custom property values for a repository.

", + "inputFields": [ + { + "name": "input", + "type": "SetRepositoryCustomPropertyValuesInput!", + "id": "setrepositorycustompropertyvaluesinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#setrepositorycustompropertyvaluesinput" + } + ], + "returnFields": [ + { + "name": "clientMutationId", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string", + "description": "

A unique identifier for the client performing the mutation.

" + }, + { + "name": "repository", + "type": "Repository", + "id": "repository", + "kind": "objects", + "href": "/graphql/reference/objects#repository", + "description": "

The repository that the custom properties were set for.

" + } + ] + }, { "name": "setRepositoryInteractionLimit", "kind": "mutations", @@ -9683,6 +9819,40 @@ } ] }, + { + "name": "updateRepositoryCustomProperty", + "kind": "mutations", + "id": "updaterepositorycustomproperty", + "href": "/graphql/reference/mutations#updaterepositorycustomproperty", + "description": "

Update a repository custom property.

", + "inputFields": [ + { + "name": "input", + "type": "UpdateRepositoryCustomPropertyInput!", + "id": "updaterepositorycustompropertyinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#updaterepositorycustompropertyinput" + } + ], + "returnFields": [ + { + "name": "clientMutationId", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string", + "description": "

A unique identifier for the client performing the mutation.

" + }, + { + "name": "repositoryCustomProperty", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "description": "

The updated repository custom property.

" + } + ] + }, { "name": "updateRepositoryRuleset", "kind": "mutations", @@ -22469,6 +22639,76 @@ "kind": "scalars", "href": "/graphql/reference/scalars#html" }, + { + "name": "repositoryCustomProperties", + "description": "

A list of repository custom properties for this enterprise.

", + "type": "RepositoryCustomPropertyConnection", + "id": "repositorycustompropertyconnection", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyconnection", + "arguments": [ + { + "name": "after", + "description": "

Returns the elements in the list that come after the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "before", + "description": "

Returns the elements in the list that come before the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "first", + "description": "

Returns the first n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + }, + { + "name": "last", + "description": "

Returns the last n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + } + ] + }, + { + "name": "repositoryCustomProperty", + "description": "

Returns a single repository custom property for the current enterprise by name.

", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "arguments": [ + { + "name": "propertyName", + "description": "

The name of the repository custom property to be returned.

", + "type": { + "name": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + } + ] + }, { "name": "resourcePath", "description": "

The HTTP path for this enterprise.

", @@ -44592,12 +44832,12 @@ ] }, { - "name": "repositoryDiscussionComments", - "description": "

Discussion comments this user has authored.

", - "type": "DiscussionCommentConnection!", - "id": "discussioncommentconnection", + "name": "repositoryCustomProperties", + "description": "

A list of custom properties for this organization.

", + "type": "RepositoryCustomPropertyConnection", + "id": "repositorycustompropertyconnection", "kind": "objects", - "href": "/graphql/reference/objects#discussioncommentconnection", + "href": "/graphql/reference/objects#repositorycustompropertyconnection", "arguments": [ { "name": "after", @@ -44638,37 +44878,36 @@ "kind": "scalars", "href": "/graphql/reference/scalars#int" } - }, - { - "name": "onlyAnswers", - "defaultValue": false, - "description": "

Filter discussion comments to only those that were marked as the answer.

", - "type": { - "name": "Boolean", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean" - } - }, + } + ] + }, + { + "name": "repositoryCustomProperty", + "description": "

Returns a single custom property from the current organization by name.

", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "arguments": [ { - "name": "repositoryId", - "description": "

Filter discussion comments to only those in a specific repository.

", + "name": "propertyName", + "description": "

The name of the custom property to be returned.

", "type": { - "name": "ID", - "id": "id", + "name": "String!", + "id": "string", "kind": "scalars", - "href": "/graphql/reference/scalars#id" + "href": "/graphql/reference/scalars#string" } } ] }, { - "name": "repositoryDiscussions", - "description": "

Discussions this user has started.

", - "type": "DiscussionConnection!", - "id": "discussionconnection", + "name": "repositoryDiscussionComments", + "description": "

Discussion comments this user has authored.

", + "type": "DiscussionCommentConnection!", + "id": "discussioncommentconnection", "kind": "objects", - "href": "/graphql/reference/objects#discussionconnection", + "href": "/graphql/reference/objects#discussioncommentconnection", "arguments": [ { "name": "after", @@ -44680,16 +44919,6 @@ "href": "/graphql/reference/scalars#string" } }, - { - "name": "answered", - "description": "

Filter discussions to only those that have been answered or not. Defaults to\nincluding both answered and unanswered discussions.

", - "type": { - "name": "Boolean", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean" - } - }, { "name": "before", "description": "

Returns the elements in the list that come before the specified cursor.

", @@ -44721,44 +44950,125 @@ } }, { - "name": "orderBy", - "description": "

Ordering options for discussions returned from the connection.

", + "name": "onlyAnswers", + "defaultValue": false, + "description": "

Filter discussion comments to only those that were marked as the answer.

", "type": { - "name": "DiscussionOrder", - "id": "discussionorder", - "kind": "input-objects", - "href": "/graphql/reference/input-objects#discussionorder" + "name": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" } }, { "name": "repositoryId", - "description": "

Filter discussions to only those in a specific repository.

", + "description": "

Filter discussion comments to only those in a specific repository.

", "type": { "name": "ID", "id": "id", "kind": "scalars", "href": "/graphql/reference/scalars#id" } - }, - { - "name": "states", - "description": "

A list of states to filter the discussions by.

", - "type": { - "name": "[DiscussionState!]", - "id": "discussionstate", - "kind": "enums", - "href": "/graphql/reference/enums#discussionstate" - } } ] }, { - "name": "repositoryMigrations", - "description": "

A list of all repository migrations for this organization.

", - "type": "RepositoryMigrationConnection!", - "id": "repositorymigrationconnection", + "name": "repositoryDiscussions", + "description": "

Discussions this user has started.

", + "type": "DiscussionConnection!", + "id": "discussionconnection", "kind": "objects", - "href": "/graphql/reference/objects#repositorymigrationconnection", + "href": "/graphql/reference/objects#discussionconnection", + "arguments": [ + { + "name": "after", + "description": "

Returns the elements in the list that come after the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "answered", + "description": "

Filter discussions to only those that have been answered or not. Defaults to\nincluding both answered and unanswered discussions.

", + "type": { + "name": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + } + }, + { + "name": "before", + "description": "

Returns the elements in the list that come before the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "first", + "description": "

Returns the first n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + }, + { + "name": "last", + "description": "

Returns the last n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + }, + { + "name": "orderBy", + "description": "

Ordering options for discussions returned from the connection.

", + "type": { + "name": "DiscussionOrder", + "id": "discussionorder", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#discussionorder" + } + }, + { + "name": "repositoryId", + "description": "

Filter discussions to only those in a specific repository.

", + "type": { + "name": "ID", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id" + } + }, + { + "name": "states", + "description": "

A list of states to filter the discussions by.

", + "type": { + "name": "[DiscussionState!]", + "id": "discussionstate", + "kind": "enums", + "href": "/graphql/reference/enums#discussionstate" + } + } + ] + }, + { + "name": "repositoryMigrations", + "description": "

A list of all repository migrations for this organization.

", + "type": "RepositoryMigrationConnection!", + "id": "repositorymigrationconnection", + "kind": "objects", + "href": "/graphql/reference/objects#repositorymigrationconnection", "arguments": [ { "name": "after", @@ -67934,12 +68244,32 @@ ] }, { - "name": "repositoryTopics", - "description": "

A list of applied repository-topic associations for this repository.

", - "type": "RepositoryTopicConnection!", - "id": "repositorytopicconnection", + "name": "repositoryCustomPropertyValue", + "description": "

A custom property value for the repository.

", + "type": "RepositoryCustomPropertyValue", + "id": "repositorycustompropertyvalue", "kind": "objects", - "href": "/graphql/reference/objects#repositorytopicconnection", + "href": "/graphql/reference/objects#repositorycustompropertyvalue", + "arguments": [ + { + "name": "propertyName", + "description": "

The name of the custom property to retrieve the value for.

", + "type": { + "name": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + } + ] + }, + { + "name": "repositoryCustomPropertyValues", + "description": "

A list of custom properties and their associated values for a repository.

", + "type": "RepositoryCustomPropertyValueConnection", + "id": "repositorycustompropertyvalueconnection", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyvalueconnection", "arguments": [ { "name": "after", @@ -67984,51 +68314,12 @@ ] }, { - "name": "resourcePath", - "description": "

The HTTP path for this repository.

", - "type": "URI!", - "id": "uri", - "kind": "scalars", - "href": "/graphql/reference/scalars#uri" - }, - { - "name": "ruleset", - "description": "

Returns a single ruleset from the current repository by ID.

", - "type": "RepositoryRuleset", - "id": "repositoryruleset", - "kind": "objects", - "href": "/graphql/reference/objects#repositoryruleset", - "arguments": [ - { - "name": "databaseId", - "description": "

The ID of the ruleset to be returned.

", - "type": { - "name": "Int!", - "id": "int", - "kind": "scalars", - "href": "/graphql/reference/scalars#int" - } - }, - { - "name": "includeParents", - "defaultValue": true, - "description": "

Include rulesets configured at higher levels that apply to this repository.

", - "type": { - "name": "Boolean", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean" - } - } - ] - }, - { - "name": "rulesets", - "description": "

A list of rulesets for this repository.

", - "type": "RepositoryRulesetConnection", - "id": "repositoryrulesetconnection", + "name": "repositoryTopics", + "description": "

A list of applied repository-topic associations for this repository.

", + "type": "RepositoryTopicConnection!", + "id": "repositorytopicconnection", "kind": "objects", - "href": "/graphql/reference/objects#repositoryrulesetconnection", + "href": "/graphql/reference/objects#repositorytopicconnection", "arguments": [ { "name": "after", @@ -68060,17 +68351,6 @@ "href": "/graphql/reference/scalars#int" } }, - { - "name": "includeParents", - "defaultValue": true, - "description": "

Return rulesets configured at higher levels that apply to this repository.

", - "type": { - "name": "Boolean", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean" - } - }, { "name": "last", "description": "

Returns the last n elements from the list.

", @@ -68080,105 +68360,205 @@ "kind": "scalars", "href": "/graphql/reference/scalars#int" } - }, - { - "name": "targets", - "description": "

Return rulesets that apply to the specified target.

", - "type": { - "name": "[RepositoryRulesetTarget!]", - "id": "repositoryrulesettarget", - "kind": "enums", - "href": "/graphql/reference/enums#repositoryrulesettarget" - } } ] }, { - "name": "securityPolicyUrl", - "description": "

The security policy URL.

", - "type": "URI", + "name": "resourcePath", + "description": "

The HTTP path for this repository.

", + "type": "URI!", "id": "uri", "kind": "scalars", "href": "/graphql/reference/scalars#uri" }, { - "name": "shortDescriptionHTML", - "description": "

A description of the repository, rendered to HTML without any links in it.

", - "type": "HTML!", - "id": "html", - "kind": "scalars", - "href": "/graphql/reference/scalars#html", + "name": "ruleset", + "description": "

Returns a single ruleset from the current repository by ID.

", + "type": "RepositoryRuleset", + "id": "repositoryruleset", + "kind": "objects", + "href": "/graphql/reference/objects#repositoryruleset", "arguments": [ { - "name": "limit", - "defaultValue": "200", - "description": "

How many characters to return.

", + "name": "databaseId", + "description": "

The ID of the ruleset to be returned.

", "type": { - "name": "Int", + "name": "Int!", "id": "int", "kind": "scalars", "href": "/graphql/reference/scalars#int" } + }, + { + "name": "includeParents", + "defaultValue": true, + "description": "

Include rulesets configured at higher levels that apply to this repository.

", + "type": { + "name": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + } } ] }, { - "name": "squashMergeAllowed", - "description": "

Whether or not squash-merging is enabled on this repository.

", - "type": "Boolean!", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean" - }, - { - "name": "squashMergeCommitMessage", - "description": "

How the default commit message will be generated when squash merging a pull request.

", - "type": "SquashMergeCommitMessage!", - "id": "squashmergecommitmessage", - "kind": "enums", - "href": "/graphql/reference/enums#squashmergecommitmessage" - }, - { - "name": "squashMergeCommitTitle", - "description": "

How the default commit title will be generated when squash merging a pull request.

", - "type": "SquashMergeCommitTitle!", - "id": "squashmergecommittitle", - "kind": "enums", - "href": "/graphql/reference/enums#squashmergecommittitle" - }, - { - "name": "squashPrTitleUsedAsDefault", - "description": "

Whether a squash merge commit can use the pull request title as default.

", - "type": "Boolean!", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean", - "isDeprecated": true, - "deprecationReason": "

squashPrTitleUsedAsDefault will be removed. Use Repository.squashMergeCommitTitle instead. Removal on 2023-04-01 UTC.

" - }, - { - "name": "sshUrl", - "description": "

The SSH URL to clone this repository.

", - "type": "GitSSHRemote!", - "id": "gitsshremote", - "kind": "scalars", - "href": "/graphql/reference/scalars#gitsshremote" - }, - { - "name": "stargazerCount", - "description": "

Returns a count of how many stargazers there are on this object.

", - "type": "Int!", - "id": "int", - "kind": "scalars", - "href": "/graphql/reference/scalars#int" - }, - { - "name": "stargazers", - "description": "

A list of users who have starred this starrable.

", - "type": "StargazerConnection!", - "id": "stargazerconnection", + "name": "rulesets", + "description": "

A list of rulesets for this repository.

", + "type": "RepositoryRulesetConnection", + "id": "repositoryrulesetconnection", "kind": "objects", - "href": "/graphql/reference/objects#stargazerconnection", + "href": "/graphql/reference/objects#repositoryrulesetconnection", + "arguments": [ + { + "name": "after", + "description": "

Returns the elements in the list that come after the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "before", + "description": "

Returns the elements in the list that come before the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "first", + "description": "

Returns the first n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + }, + { + "name": "includeParents", + "defaultValue": true, + "description": "

Return rulesets configured at higher levels that apply to this repository.

", + "type": { + "name": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + } + }, + { + "name": "last", + "description": "

Returns the last n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + }, + { + "name": "targets", + "description": "

Return rulesets that apply to the specified target.

", + "type": { + "name": "[RepositoryRulesetTarget!]", + "id": "repositoryrulesettarget", + "kind": "enums", + "href": "/graphql/reference/enums#repositoryrulesettarget" + } + } + ] + }, + { + "name": "securityPolicyUrl", + "description": "

The security policy URL.

", + "type": "URI", + "id": "uri", + "kind": "scalars", + "href": "/graphql/reference/scalars#uri" + }, + { + "name": "shortDescriptionHTML", + "description": "

A description of the repository, rendered to HTML without any links in it.

", + "type": "HTML!", + "id": "html", + "kind": "scalars", + "href": "/graphql/reference/scalars#html", + "arguments": [ + { + "name": "limit", + "defaultValue": "200", + "description": "

How many characters to return.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + } + ] + }, + { + "name": "squashMergeAllowed", + "description": "

Whether or not squash-merging is enabled on this repository.

", + "type": "Boolean!", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + }, + { + "name": "squashMergeCommitMessage", + "description": "

How the default commit message will be generated when squash merging a pull request.

", + "type": "SquashMergeCommitMessage!", + "id": "squashmergecommitmessage", + "kind": "enums", + "href": "/graphql/reference/enums#squashmergecommitmessage" + }, + { + "name": "squashMergeCommitTitle", + "description": "

How the default commit title will be generated when squash merging a pull request.

", + "type": "SquashMergeCommitTitle!", + "id": "squashmergecommittitle", + "kind": "enums", + "href": "/graphql/reference/enums#squashmergecommittitle" + }, + { + "name": "squashPrTitleUsedAsDefault", + "description": "

Whether a squash merge commit can use the pull request title as default.

", + "type": "Boolean!", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean", + "isDeprecated": true, + "deprecationReason": "

squashPrTitleUsedAsDefault will be removed. Use Repository.squashMergeCommitTitle instead. Removal on 2023-04-01 UTC.

" + }, + { + "name": "sshUrl", + "description": "

The SSH URL to clone this repository.

", + "type": "GitSSHRemote!", + "id": "gitsshremote", + "kind": "scalars", + "href": "/graphql/reference/scalars#gitsshremote" + }, + { + "name": "stargazerCount", + "description": "

Returns a count of how many stargazers there are on this object.

", + "type": "Int!", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + }, + { + "name": "stargazers", + "description": "

A list of users who have starred this starrable.

", + "type": "StargazerConnection!", + "id": "stargazerconnection", + "kind": "objects", + "href": "/graphql/reference/objects#stargazerconnection", "arguments": [ { "name": "after", @@ -68896,6 +69276,259 @@ } ] }, + { + "name": "RepositoryCustomProperty", + "kind": "objects", + "id": "repositorycustomproperty", + "href": "/graphql/reference/objects#repositorycustomproperty", + "description": "

A repository custom property.

", + "implements": [ + { + "name": "Node", + "id": "node", + "href": "/graphql/reference/interfaces#node" + } + ], + "fields": [ + { + "name": "allowedValues", + "description": "

The allowed values for the custom property. Required if value_type is single_select or multi_select.

", + "type": "[String!]", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "defaultValue", + "description": "

The default value of the custom property, if the property is required.

", + "type": "CustomPropertyValue", + "id": "custompropertyvalue", + "kind": "scalars", + "href": "/graphql/reference/scalars#custompropertyvalue" + }, + { + "name": "description", + "description": "

The description of the custom property.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "id", + "description": "

The Node ID of the RepositoryCustomProperty object.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id" + }, + { + "name": "propertyName", + "description": "

The name of the custom property.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "regex", + "description": "

The regex pattern that the value of the custom property must match, if the value_type is string.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "required", + "description": "

Whether the custom property is required.

", + "type": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + }, + { + "name": "source", + "description": "

The source type of the custom property.

", + "type": "CustomPropertySource!", + "id": "custompropertysource", + "kind": "unions", + "href": "/graphql/reference/unions#custompropertysource" + }, + { + "name": "valueType", + "description": "

The value type of the custom property.

", + "type": "CustomPropertyValueType!", + "id": "custompropertyvaluetype", + "kind": "enums", + "href": "/graphql/reference/enums#custompropertyvaluetype" + }, + { + "name": "valuesEditableBy", + "description": "

Who can edit the values of this repository custom property.

", + "type": "RepositoryCustomPropertyValuesEditableBy!", + "id": "repositorycustompropertyvalueseditableby", + "kind": "enums", + "href": "/graphql/reference/enums#repositorycustompropertyvalueseditableby" + } + ] + }, + { + "name": "RepositoryCustomPropertyConnection", + "kind": "objects", + "id": "repositorycustompropertyconnection", + "href": "/graphql/reference/objects#repositorycustompropertyconnection", + "description": "

The connection type for RepositoryCustomProperty.

", + "fields": [ + { + "name": "edges", + "description": "

A list of edges.

", + "type": "[RepositoryCustomPropertyEdge]", + "id": "repositorycustompropertyedge", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyedge" + }, + { + "name": "nodes", + "description": "

A list of nodes.

", + "type": "[RepositoryCustomProperty]", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty" + }, + { + "name": "pageInfo", + "description": "

Information to aid in pagination.

", + "type": "PageInfo!", + "id": "pageinfo", + "kind": "objects", + "href": "/graphql/reference/objects#pageinfo" + }, + { + "name": "totalCount", + "description": "

Identifies the total count of items in the connection.

", + "type": "Int!", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + ] + }, + { + "name": "RepositoryCustomPropertyEdge", + "kind": "objects", + "id": "repositorycustompropertyedge", + "href": "/graphql/reference/objects#repositorycustompropertyedge", + "description": "

An edge in a connection.

", + "fields": [ + { + "name": "cursor", + "description": "

A cursor for use in pagination.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "node", + "description": "

The item at the end of the edge.

", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty" + } + ] + }, + { + "name": "RepositoryCustomPropertyValue", + "kind": "objects", + "id": "repositorycustompropertyvalue", + "href": "/graphql/reference/objects#repositorycustompropertyvalue", + "description": "

A value associated with a repository custom property.

", + "fields": [ + { + "name": "propertyName", + "description": "

The name of the custom property.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "value", + "description": "

The value of the custom property.

", + "type": "CustomPropertyValue!", + "id": "custompropertyvalue", + "kind": "scalars", + "href": "/graphql/reference/scalars#custompropertyvalue" + } + ] + }, + { + "name": "RepositoryCustomPropertyValueConnection", + "kind": "objects", + "id": "repositorycustompropertyvalueconnection", + "href": "/graphql/reference/objects#repositorycustompropertyvalueconnection", + "description": "

The connection type for RepositoryCustomPropertyValue.

", + "fields": [ + { + "name": "edges", + "description": "

A list of edges.

", + "type": "[RepositoryCustomPropertyValueEdge]", + "id": "repositorycustompropertyvalueedge", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyvalueedge" + }, + { + "name": "nodes", + "description": "

A list of nodes.

", + "type": "[RepositoryCustomPropertyValue]", + "id": "repositorycustompropertyvalue", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyvalue" + }, + { + "name": "pageInfo", + "description": "

Information to aid in pagination.

", + "type": "PageInfo!", + "id": "pageinfo", + "kind": "objects", + "href": "/graphql/reference/objects#pageinfo" + }, + { + "name": "totalCount", + "description": "

Identifies the total count of items in the connection.

", + "type": "Int!", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + ] + }, + { + "name": "RepositoryCustomPropertyValueEdge", + "kind": "objects", + "id": "repositorycustompropertyvalueedge", + "href": "/graphql/reference/objects#repositorycustompropertyvalueedge", + "description": "

An edge in a connection.

", + "fields": [ + { + "name": "cursor", + "description": "

A cursor for use in pagination.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "node", + "description": "

The item at the end of the edge.

", + "type": "RepositoryCustomPropertyValue", + "id": "repositorycustompropertyvalue", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyvalue" + } + ] + }, { "name": "RepositoryEdge", "kind": "objects", @@ -89344,6 +89977,35 @@ } ] }, + { + "name": "CustomPropertyValueType", + "kind": "enums", + "id": "custompropertyvaluetype", + "href": "/graphql/reference/enums#custompropertyvaluetype", + "description": "

The allowed value types for a custom property definition.

", + "values": [ + { + "name": "MULTI_SELECT", + "description": "

A multi-select value.

" + }, + { + "name": "SINGLE_SELECT", + "description": "

A single-select value.

" + }, + { + "name": "STRING", + "description": "

A string value.

" + }, + { + "name": "TRUE_FALSE", + "description": "

A true/false value.

" + }, + { + "name": "URL", + "description": "

A URL value.

" + } + ] + }, { "name": "DefaultRepositoryPermissionField", "kind": "enums", @@ -93298,6 +93960,23 @@ } ] }, + { + "name": "RepositoryCustomPropertyValuesEditableBy", + "kind": "enums", + "id": "repositorycustompropertyvalueseditableby", + "href": "/graphql/reference/enums#repositorycustompropertyvalueseditableby", + "description": "

The allowed actors who can edit the values of a custom property.

", + "values": [ + { + "name": "ORG_ACTORS", + "description": "

The organization actors.

" + }, + { + "name": "ORG_AND_REPO_ACTORS", + "description": "

The organization and repository actors.

" + } + ] + }, { "name": "RepositoryInteractionLimit", "kind": "enums", @@ -96174,6 +96853,25 @@ } ] }, + { + "name": "CustomPropertySource", + "kind": "unions", + "id": "custompropertysource", + "href": "/graphql/reference/unions#custompropertysource", + "description": "

Sources which can have custom properties defined.

", + "possibleTypes": [ + { + "name": "Enterprise", + "id": "enterprise", + "href": "/graphql/reference/objects#enterprise" + }, + { + "name": "Organization", + "id": "organization", + "href": "/graphql/reference/objects#organization" + } + ] + }, { "name": "DeploymentReviewer", "kind": "unions", @@ -102224,6 +102922,96 @@ } ] }, + { + "name": "CreateRepositoryCustomPropertyInput", + "kind": "inputObjects", + "id": "createrepositorycustompropertyinput", + "href": "/graphql/reference/input-objects#createrepositorycustompropertyinput", + "description": "

Autogenerated input type of CreateRepositoryCustomProperty.

", + "inputFields": [ + { + "name": "allowedValues", + "description": "

The allowed values for the custom property.

", + "type": "[String!]", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "clientMutationId", + "description": "

A unique identifier for the client performing the mutation.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "defaultValue", + "description": "

The default value for the custom property if the property is required.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "description", + "description": "

The description of the custom property.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "propertyName", + "description": "

The name of the custom property.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "regex", + "description": "

The regex pattern that the value of the custom property must match, if the value_type is string.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "required", + "description": "

Whether the custom property is required.

", + "type": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + }, + { + "name": "sourceId", + "description": "

The global relay id of the source in which a new custom property should be created in.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id", + "isDeprecated": false + }, + { + "name": "valueType", + "description": "

The value type for the custom property.

", + "type": "CustomPropertyValueType!", + "id": "custompropertyvaluetype", + "kind": "enums", + "href": "/graphql/reference/enums#custompropertyvaluetype" + }, + { + "name": "valuesEditableBy", + "description": "

The allowed actors who can edit the values of a custom property.

", + "type": "RepositoryCustomPropertyValuesEditableBy", + "id": "repositorycustompropertyvalueseditableby", + "kind": "enums", + "href": "/graphql/reference/enums#repositorycustompropertyvalueseditableby" + } + ] + }, { "name": "CreateRepositoryInput", "kind": "inputObjects", @@ -102835,6 +103623,31 @@ } ] }, + { + "name": "CustomPropertyValueInput", + "kind": "inputObjects", + "id": "custompropertyvalueinput", + "href": "/graphql/reference/input-objects#custompropertyvalueinput", + "description": "

The custom property name and value to be set.

", + "inputFields": [ + { + "name": "propertyName", + "description": "

The name of the custom property.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "value", + "description": "

The value to set for the custom property. Using a value of null will unset the\nproperty value, reverting to the default value if the property is required.

", + "type": "CustomPropertyValue", + "id": "custompropertyvalue", + "kind": "scalars", + "href": "/graphql/reference/scalars#custompropertyvalue" + } + ] + }, { "name": "DeclineTopicSuggestionInput", "kind": "inputObjects", @@ -103484,6 +104297,32 @@ } ] }, + { + "name": "DeleteRepositoryCustomPropertyInput", + "kind": "inputObjects", + "id": "deleterepositorycustompropertyinput", + "href": "/graphql/reference/input-objects#deleterepositorycustompropertyinput", + "description": "

Autogenerated input type of DeleteRepositoryCustomProperty.

", + "inputFields": [ + { + "name": "clientMutationId", + "description": "

A unique identifier for the client performing the mutation.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "id", + "description": "

The global relay id of the custom property to be deleted.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id", + "isDeprecated": false + } + ] + }, { "name": "DeleteRepositoryRulesetInput", "kind": "inputObjects", @@ -106254,6 +107093,32 @@ } ] }, + { + "name": "PromoteRepositoryCustomPropertyInput", + "kind": "inputObjects", + "id": "promoterepositorycustompropertyinput", + "href": "/graphql/reference/input-objects#promoterepositorycustompropertyinput", + "description": "

Autogenerated input type of PromoteRepositoryCustomProperty.

", + "inputFields": [ + { + "name": "clientMutationId", + "description": "

A unique identifier for the client performing the mutation.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "repositoryCustomPropertyId", + "description": "

The ID of the repository custom property to be promoted.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id", + "isDeprecated": false + } + ] + }, { "name": "PropertyTargetDefinitionInput", "kind": "inputObjects", @@ -108313,6 +109178,40 @@ } ] }, + { + "name": "SetRepositoryCustomPropertyValuesInput", + "kind": "inputObjects", + "id": "setrepositorycustompropertyvaluesinput", + "href": "/graphql/reference/input-objects#setrepositorycustompropertyvaluesinput", + "description": "

Autogenerated input type of SetRepositoryCustomPropertyValues.

", + "inputFields": [ + { + "name": "clientMutationId", + "description": "

A unique identifier for the client performing the mutation.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "properties", + "description": "

A list of custom property names and associated values to apply.

", + "type": "[CustomPropertyValueInput!]!", + "id": "custompropertyvalueinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#custompropertyvalueinput" + }, + { + "name": "repositoryId", + "description": "

The ID of the repository to set properties for.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id", + "isDeprecated": false + } + ] + }, { "name": "SetRepositoryInteractionLimitInput", "kind": "inputObjects", @@ -112093,6 +112992,80 @@ } ] }, + { + "name": "UpdateRepositoryCustomPropertyInput", + "kind": "inputObjects", + "id": "updaterepositorycustompropertyinput", + "href": "/graphql/reference/input-objects#updaterepositorycustompropertyinput", + "description": "

Autogenerated input type of UpdateRepositoryCustomProperty.

", + "inputFields": [ + { + "name": "allowedValues", + "description": "

The updated allowed values for the custom property.

", + "type": "[String!]", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "clientMutationId", + "description": "

A unique identifier for the client performing the mutation.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "defaultValue", + "description": "

The updated default value for the custom property if the property is required.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "description", + "description": "

The updated description of the custom property.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "regex", + "description": "

The regex pattern that the value of the custom property must match, if the value_type is string.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "repositoryCustomPropertyId", + "description": "

The global relay id of the source of the custom property.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id", + "isDeprecated": false + }, + { + "name": "required", + "description": "

Whether the updated custom property is required.

", + "type": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + }, + { + "name": "valuesEditableBy", + "description": "

The updated actors who can edit the values of the custom property.

", + "type": "RepositoryCustomPropertyValuesEditableBy", + "id": "repositorycustompropertyvalueseditableby", + "kind": "enums", + "href": "/graphql/reference/enums#repositorycustompropertyvalueseditableby" + } + ] + }, { "name": "UpdateRepositoryInput", "kind": "inputObjects", @@ -112951,6 +113924,13 @@ "id": "boolean", "href": "/graphql/reference/scalars#boolean" }, + { + "name": "CustomPropertyValue", + "kind": "scalars", + "id": "custompropertyvalue", + "href": "/graphql/reference/scalars#custompropertyvalue", + "description": "

A custom property value can be either a string or an array of strings. All\nproperty types support only a single string value, except for the multi-select\ntype, which supports only a string array.

" + }, { "name": "Date", "kind": "scalars", diff --git a/src/graphql/data/ghec/schema.docs.graphql b/src/graphql/data/ghec/schema.docs.graphql index 9a517584cab1..65dd7e8a9ddd 100644 --- a/src/graphql/data/ghec/schema.docs.graphql +++ b/src/graphql/data/ghec/schema.docs.graphql @@ -8724,6 +8724,76 @@ type CreateRefPayload { ref: Ref } +""" +Autogenerated input type of CreateRepositoryCustomProperty +""" +input CreateRepositoryCustomPropertyInput { + """ + The allowed values for the custom property. + """ + allowedValues: [String!] + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The default value for the custom property if the property is required. + """ + defaultValue: String + + """ + The description of the custom property. + """ + description: String + + """ + The name of the custom property. + """ + propertyName: String! + + """ + The regex pattern that the value of the custom property must match, if the `value_type` is `string`. + """ + regex: String + + """ + Whether the custom property is required. + """ + required: Boolean + + """ + The global relay id of the source in which a new custom property should be created in. + """ + sourceId: ID! @possibleTypes(concreteTypes: ["Enterprise", "Organization"], abstractType: "CustomPropertySource") + + """ + The value type for the custom property. + """ + valueType: CustomPropertyValueType! + + """ + The allowed actors who can edit the values of a custom property. + """ + valuesEditableBy: RepositoryCustomPropertyValuesEditableBy +} + +""" +Autogenerated return type of CreateRepositoryCustomProperty. +""" +type CreateRepositoryCustomPropertyPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The newly created repository custom property. + """ + repositoryCustomProperty: RepositoryCustomProperty +} + """ Autogenerated input type of CreateRepository """ @@ -9782,6 +9852,64 @@ type CrossReferencedEvent implements Node & UniformResourceLocatable { willCloseTarget: Boolean! } +""" +Sources which can have custom properties defined. +""" +union CustomPropertySource = Enterprise | Organization + +""" +A custom property value can be either a string or an array of strings. All +property types support only a single string value, except for the multi-select +type, which supports only a string array. +""" +scalar CustomPropertyValue + +""" +The custom property name and value to be set. +""" +input CustomPropertyValueInput { + """ + The name of the custom property. + """ + propertyName: String! + + """ + The value to set for the custom property. Using a value of null will unset the + property value, reverting to the default value if the property is required. + """ + value: CustomPropertyValue +} + +""" +The allowed value types for a custom property definition. +""" +enum CustomPropertyValueType { + """ + A multi-select value. + """ + MULTI_SELECT + + """ + A single-select value. + """ + SINGLE_SELECT + + """ + A string value. + """ + STRING + + """ + A true/false value. + """ + TRUE_FALSE + + """ + A URL value. + """ + URL +} + """ The Common Vulnerability Scoring System """ @@ -10588,6 +10716,36 @@ type DeleteRefPayload { clientMutationId: String } +""" +Autogenerated input type of DeleteRepositoryCustomProperty +""" +input DeleteRepositoryCustomPropertyInput { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The global relay id of the custom property to be deleted. + """ + id: ID! @possibleTypes(concreteTypes: ["RepositoryCustomProperty"]) +} + +""" +Autogenerated return type of DeleteRepositoryCustomProperty. +""" +type DeleteRepositoryCustomPropertyPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The deleted custom property. + """ + repositoryCustomProperty: RepositoryCustomProperty +} + """ Autogenerated input type of DeleteRepositoryRuleset """ @@ -13660,6 +13818,41 @@ type Enterprise implements Node { """ readmeHTML: HTML! + """ + A list of repository custom properties for this enterprise. + """ + repositoryCustomProperties( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryCustomPropertyConnection + + """ + Returns a single repository custom property for the current enterprise by name. + """ + repositoryCustomProperty( + """ + The name of the repository custom property to be returned. + """ + propertyName: String! + ): RepositoryCustomProperty + """ The HTTP path for this enterprise. """ @@ -25263,6 +25456,16 @@ type Mutation { input: CreateRepositoryInput! ): CreateRepositoryPayload + """ + Create a repository custom property. + """ + createRepositoryCustomProperty( + """ + Parameters for CreateRepositoryCustomProperty + """ + input: CreateRepositoryCustomPropertyInput! + ): CreateRepositoryCustomPropertyPayload + """ Create a repository ruleset """ @@ -25593,6 +25796,16 @@ type Mutation { input: DeleteRefInput! ): DeleteRefPayload + """ + Delete a repository custom property. + """ + deleteRepositoryCustomProperty( + """ + Parameters for DeleteRepositoryCustomProperty + """ + input: DeleteRepositoryCustomPropertyInput! + ): DeleteRepositoryCustomPropertyPayload + """ Delete a repository ruleset """ @@ -25935,6 +26148,16 @@ type Mutation { input: PinIssueInput! ): PinIssuePayload + """ + Promote a repository custom property to the enterprise level. + """ + promoteRepositoryCustomProperty( + """ + Parameters for PromoteRepositoryCustomProperty + """ + input: PromoteRepositoryCustomPropertyInput! + ): PromoteRepositoryCustomPropertyPayload + """ Publish an existing sponsorship tier that is currently still a draft to a GitHub Sponsors profile. """ @@ -26256,6 +26479,16 @@ type Mutation { input: SetOrganizationInteractionLimitInput! ): SetOrganizationInteractionLimitPayload + """ + Set repository custom property values for a repository. + """ + setRepositoryCustomPropertyValues( + """ + Parameters for SetRepositoryCustomPropertyValues + """ + input: SetRepositoryCustomPropertyValuesInput! + ): SetRepositoryCustomPropertyValuesPayload + """ Sets an interaction limit setting for a repository. """ @@ -27049,6 +27282,16 @@ type Mutation { input: UpdateRepositoryInput! ): UpdateRepositoryPayload + """ + Update a repository custom property. + """ + updateRepositoryCustomProperty( + """ + Parameters for UpdateRepositoryCustomProperty + """ + input: UpdateRepositoryCustomPropertyInput! + ): UpdateRepositoryCustomPropertyPayload + """ Update a repository ruleset """ @@ -33264,6 +33507,41 @@ type Organization implements Actor & MemberStatusable & Node & PackageOwner & Pr name: String! ): Repository + """ + A list of custom properties for this organization. + """ + repositoryCustomProperties( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryCustomPropertyConnection + + """ + Returns a single custom property from the current organization by name. + """ + repositoryCustomProperty( + """ + The name of the custom property to be returned. + """ + propertyName: String! + ): RepositoryCustomProperty + """ Discussion comments this user has authored. """ @@ -40299,6 +40577,36 @@ enum ProjectV2WorkflowsOrderField { UPDATED_AT } +""" +Autogenerated input type of PromoteRepositoryCustomProperty +""" +input PromoteRepositoryCustomPropertyInput { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The ID of the repository custom property to be promoted. + """ + repositoryCustomPropertyId: ID! @possibleTypes(concreteTypes: ["RepositoryCustomProperty"]) +} + +""" +Autogenerated return type of PromoteRepositoryCustomProperty. +""" +type PromoteRepositoryCustomPropertyPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The repository custom property that has been promoted. + """ + repositoryCustomProperty: RepositoryCustomProperty +} + """ A property that must match """ @@ -51484,6 +51792,41 @@ type Repository implements Node & PackageOwner & ProjectOwner & ProjectV2Recent orderBy: ReleaseOrder ): ReleaseConnection! + """ + A custom property value for the repository. + """ + repositoryCustomPropertyValue( + """ + The name of the custom property to retrieve the value for. + """ + propertyName: String! + ): RepositoryCustomPropertyValue + + """ + A list of custom properties and their associated values for a repository. + """ + repositoryCustomPropertyValues( + """ + Returns the elements in the list that come after the specified cursor. + """ + after: String + + """ + Returns the elements in the list that come before the specified cursor. + """ + before: String + + """ + Returns the first _n_ elements from the list. + """ + first: Int + + """ + Returns the last _n_ elements from the list. + """ + last: Int + ): RepositoryCustomPropertyValueConnection + """ A list of applied repository-topic associations for this repository. """ @@ -52095,6 +52438,171 @@ enum RepositoryContributionType { REPOSITORY } +""" +A repository custom property. +""" +type RepositoryCustomProperty implements Node { + """ + The allowed values for the custom property. Required if `value_type` is `single_select` or `multi_select`. + """ + allowedValues: [String!] + + """ + The default value of the custom property, if the property is `required`. + """ + defaultValue: CustomPropertyValue + + """ + The description of the custom property. + """ + description: String + + """ + The Node ID of the RepositoryCustomProperty object + """ + id: ID! + + """ + The name of the custom property. + """ + propertyName: String! + + """ + The regex pattern that the value of the custom property must match, if the `value_type` is `string`. + """ + regex: String + + """ + Whether the custom property is required. + """ + required: Boolean + + """ + The source type of the custom property. + """ + source: CustomPropertySource! + + """ + The value type of the custom property. + """ + valueType: CustomPropertyValueType! + + """ + Who can edit the values of this repository custom property. + """ + valuesEditableBy: RepositoryCustomPropertyValuesEditableBy! +} + +""" +The connection type for RepositoryCustomProperty. +""" +type RepositoryCustomPropertyConnection { + """ + A list of edges. + """ + edges: [RepositoryCustomPropertyEdge] + + """ + A list of nodes. + """ + nodes: [RepositoryCustomProperty] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type RepositoryCustomPropertyEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: RepositoryCustomProperty +} + +""" +A value associated with a repository custom property. +""" +type RepositoryCustomPropertyValue { + """ + The name of the custom property. + """ + propertyName: String! + + """ + The value of the custom property. + """ + value: CustomPropertyValue! +} + +""" +The connection type for RepositoryCustomPropertyValue. +""" +type RepositoryCustomPropertyValueConnection { + """ + A list of edges. + """ + edges: [RepositoryCustomPropertyValueEdge] + + """ + A list of nodes. + """ + nodes: [RepositoryCustomPropertyValue] + + """ + Information to aid in pagination. + """ + pageInfo: PageInfo! + + """ + Identifies the total count of items in the connection. + """ + totalCount: Int! +} + +""" +An edge in a connection. +""" +type RepositoryCustomPropertyValueEdge { + """ + A cursor for use in pagination. + """ + cursor: String! + + """ + The item at the end of the edge. + """ + node: RepositoryCustomPropertyValue +} + +""" +The allowed actors who can edit the values of a custom property. +""" +enum RepositoryCustomPropertyValuesEditableBy { + """ + The organization actors. + """ + ORG_ACTORS + + """ + The organization and repository actors. + """ + ORG_AND_REPO_ACTORS +} + """ Represents an author of discussions in repositories. """ @@ -56348,6 +56856,41 @@ type SetOrganizationInteractionLimitPayload { organization: Organization } +""" +Autogenerated input type of SetRepositoryCustomPropertyValues +""" +input SetRepositoryCustomPropertyValuesInput { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + A list of custom property names and associated values to apply. + """ + properties: [CustomPropertyValueInput!]! + + """ + The ID of the repository to set properties for. + """ + repositoryId: ID! @possibleTypes(concreteTypes: ["Repository"]) +} + +""" +Autogenerated return type of SetRepositoryCustomPropertyValues. +""" +type SetRepositoryCustomPropertyValuesPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The repository that the custom properties were set for. + """ + repository: Repository +} + """ Autogenerated input type of SetRepositoryInteractionLimit """ @@ -66870,6 +67413,66 @@ type UpdateRefsPayload { clientMutationId: String } +""" +Autogenerated input type of UpdateRepositoryCustomProperty +""" +input UpdateRepositoryCustomPropertyInput { + """ + The updated allowed values for the custom property. + """ + allowedValues: [String!] + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated default value for the custom property if the property is required. + """ + defaultValue: String + + """ + The updated description of the custom property. + """ + description: String + + """ + The regex pattern that the value of the custom property must match, if the `value_type` is `string`. + """ + regex: String + + """ + The global relay id of the source of the custom property. + """ + repositoryCustomPropertyId: ID! @possibleTypes(concreteTypes: ["RepositoryCustomProperty"]) + + """ + Whether the updated custom property is required. + """ + required: Boolean + + """ + The updated actors who can edit the values of the custom property. + """ + valuesEditableBy: RepositoryCustomPropertyValuesEditableBy +} + +""" +Autogenerated return type of UpdateRepositoryCustomProperty. +""" +type UpdateRepositoryCustomPropertyPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + + """ + The updated repository custom property. + """ + repositoryCustomProperty: RepositoryCustomProperty +} + """ Autogenerated input type of UpdateRepository """ diff --git a/src/graphql/data/ghec/schema.json b/src/graphql/data/ghec/schema.json index edd334750b8d..2473f2dce94f 100644 --- a/src/graphql/data/ghec/schema.json +++ b/src/graphql/data/ghec/schema.json @@ -3461,6 +3461,40 @@ } ] }, + { + "name": "createRepositoryCustomProperty", + "kind": "mutations", + "id": "createrepositorycustomproperty", + "href": "/graphql/reference/mutations#createrepositorycustomproperty", + "description": "

Create a repository custom property.

", + "inputFields": [ + { + "name": "input", + "type": "CreateRepositoryCustomPropertyInput!", + "id": "createrepositorycustompropertyinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#createrepositorycustompropertyinput" + } + ], + "returnFields": [ + { + "name": "clientMutationId", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string", + "description": "

A unique identifier for the client performing the mutation.

" + }, + { + "name": "repositoryCustomProperty", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "description": "

The newly created repository custom property.

" + } + ] + }, { "name": "createRepositoryRuleset", "kind": "mutations", @@ -4561,6 +4595,40 @@ } ] }, + { + "name": "deleteRepositoryCustomProperty", + "kind": "mutations", + "id": "deleterepositorycustomproperty", + "href": "/graphql/reference/mutations#deleterepositorycustomproperty", + "description": "

Delete a repository custom property.

", + "inputFields": [ + { + "name": "input", + "type": "DeleteRepositoryCustomPropertyInput!", + "id": "deleterepositorycustompropertyinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#deleterepositorycustompropertyinput" + } + ], + "returnFields": [ + { + "name": "clientMutationId", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string", + "description": "

A unique identifier for the client performing the mutation.

" + }, + { + "name": "repositoryCustomProperty", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "description": "

The deleted custom property.

" + } + ] + }, { "name": "deleteRepositoryRuleset", "kind": "mutations", @@ -5715,6 +5783,40 @@ } ] }, + { + "name": "promoteRepositoryCustomProperty", + "kind": "mutations", + "id": "promoterepositorycustomproperty", + "href": "/graphql/reference/mutations#promoterepositorycustomproperty", + "description": "

Promote a repository custom property to the enterprise level.

", + "inputFields": [ + { + "name": "input", + "type": "PromoteRepositoryCustomPropertyInput!", + "id": "promoterepositorycustompropertyinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#promoterepositorycustompropertyinput" + } + ], + "returnFields": [ + { + "name": "clientMutationId", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string", + "description": "

A unique identifier for the client performing the mutation.

" + }, + { + "name": "repositoryCustomProperty", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "description": "

The repository custom property that has been promoted.

" + } + ] + }, { "name": "publishSponsorsTier", "kind": "mutations", @@ -6915,6 +7017,40 @@ } ] }, + { + "name": "setRepositoryCustomPropertyValues", + "kind": "mutations", + "id": "setrepositorycustompropertyvalues", + "href": "/graphql/reference/mutations#setrepositorycustompropertyvalues", + "description": "

Set repository custom property values for a repository.

", + "inputFields": [ + { + "name": "input", + "type": "SetRepositoryCustomPropertyValuesInput!", + "id": "setrepositorycustompropertyvaluesinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#setrepositorycustompropertyvaluesinput" + } + ], + "returnFields": [ + { + "name": "clientMutationId", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string", + "description": "

A unique identifier for the client performing the mutation.

" + }, + { + "name": "repository", + "type": "Repository", + "id": "repository", + "kind": "objects", + "href": "/graphql/reference/objects#repository", + "description": "

The repository that the custom properties were set for.

" + } + ] + }, { "name": "setRepositoryInteractionLimit", "kind": "mutations", @@ -9683,6 +9819,40 @@ } ] }, + { + "name": "updateRepositoryCustomProperty", + "kind": "mutations", + "id": "updaterepositorycustomproperty", + "href": "/graphql/reference/mutations#updaterepositorycustomproperty", + "description": "

Update a repository custom property.

", + "inputFields": [ + { + "name": "input", + "type": "UpdateRepositoryCustomPropertyInput!", + "id": "updaterepositorycustompropertyinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#updaterepositorycustompropertyinput" + } + ], + "returnFields": [ + { + "name": "clientMutationId", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string", + "description": "

A unique identifier for the client performing the mutation.

" + }, + { + "name": "repositoryCustomProperty", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "description": "

The updated repository custom property.

" + } + ] + }, { "name": "updateRepositoryRuleset", "kind": "mutations", @@ -22469,6 +22639,76 @@ "kind": "scalars", "href": "/graphql/reference/scalars#html" }, + { + "name": "repositoryCustomProperties", + "description": "

A list of repository custom properties for this enterprise.

", + "type": "RepositoryCustomPropertyConnection", + "id": "repositorycustompropertyconnection", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyconnection", + "arguments": [ + { + "name": "after", + "description": "

Returns the elements in the list that come after the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "before", + "description": "

Returns the elements in the list that come before the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "first", + "description": "

Returns the first n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + }, + { + "name": "last", + "description": "

Returns the last n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + } + ] + }, + { + "name": "repositoryCustomProperty", + "description": "

Returns a single repository custom property for the current enterprise by name.

", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "arguments": [ + { + "name": "propertyName", + "description": "

The name of the repository custom property to be returned.

", + "type": { + "name": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + } + ] + }, { "name": "resourcePath", "description": "

The HTTP path for this enterprise.

", @@ -44592,12 +44832,12 @@ ] }, { - "name": "repositoryDiscussionComments", - "description": "

Discussion comments this user has authored.

", - "type": "DiscussionCommentConnection!", - "id": "discussioncommentconnection", + "name": "repositoryCustomProperties", + "description": "

A list of custom properties for this organization.

", + "type": "RepositoryCustomPropertyConnection", + "id": "repositorycustompropertyconnection", "kind": "objects", - "href": "/graphql/reference/objects#discussioncommentconnection", + "href": "/graphql/reference/objects#repositorycustompropertyconnection", "arguments": [ { "name": "after", @@ -44638,37 +44878,36 @@ "kind": "scalars", "href": "/graphql/reference/scalars#int" } - }, - { - "name": "onlyAnswers", - "defaultValue": false, - "description": "

Filter discussion comments to only those that were marked as the answer.

", - "type": { - "name": "Boolean", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean" - } - }, + } + ] + }, + { + "name": "repositoryCustomProperty", + "description": "

Returns a single custom property from the current organization by name.

", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty", + "arguments": [ { - "name": "repositoryId", - "description": "

Filter discussion comments to only those in a specific repository.

", + "name": "propertyName", + "description": "

The name of the custom property to be returned.

", "type": { - "name": "ID", - "id": "id", + "name": "String!", + "id": "string", "kind": "scalars", - "href": "/graphql/reference/scalars#id" + "href": "/graphql/reference/scalars#string" } } ] }, { - "name": "repositoryDiscussions", - "description": "

Discussions this user has started.

", - "type": "DiscussionConnection!", - "id": "discussionconnection", + "name": "repositoryDiscussionComments", + "description": "

Discussion comments this user has authored.

", + "type": "DiscussionCommentConnection!", + "id": "discussioncommentconnection", "kind": "objects", - "href": "/graphql/reference/objects#discussionconnection", + "href": "/graphql/reference/objects#discussioncommentconnection", "arguments": [ { "name": "after", @@ -44680,16 +44919,6 @@ "href": "/graphql/reference/scalars#string" } }, - { - "name": "answered", - "description": "

Filter discussions to only those that have been answered or not. Defaults to\nincluding both answered and unanswered discussions.

", - "type": { - "name": "Boolean", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean" - } - }, { "name": "before", "description": "

Returns the elements in the list that come before the specified cursor.

", @@ -44721,44 +44950,125 @@ } }, { - "name": "orderBy", - "description": "

Ordering options for discussions returned from the connection.

", + "name": "onlyAnswers", + "defaultValue": false, + "description": "

Filter discussion comments to only those that were marked as the answer.

", "type": { - "name": "DiscussionOrder", - "id": "discussionorder", - "kind": "input-objects", - "href": "/graphql/reference/input-objects#discussionorder" + "name": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" } }, { "name": "repositoryId", - "description": "

Filter discussions to only those in a specific repository.

", + "description": "

Filter discussion comments to only those in a specific repository.

", "type": { "name": "ID", "id": "id", "kind": "scalars", "href": "/graphql/reference/scalars#id" } - }, - { - "name": "states", - "description": "

A list of states to filter the discussions by.

", - "type": { - "name": "[DiscussionState!]", - "id": "discussionstate", - "kind": "enums", - "href": "/graphql/reference/enums#discussionstate" - } } ] }, { - "name": "repositoryMigrations", - "description": "

A list of all repository migrations for this organization.

", - "type": "RepositoryMigrationConnection!", - "id": "repositorymigrationconnection", + "name": "repositoryDiscussions", + "description": "

Discussions this user has started.

", + "type": "DiscussionConnection!", + "id": "discussionconnection", "kind": "objects", - "href": "/graphql/reference/objects#repositorymigrationconnection", + "href": "/graphql/reference/objects#discussionconnection", + "arguments": [ + { + "name": "after", + "description": "

Returns the elements in the list that come after the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "answered", + "description": "

Filter discussions to only those that have been answered or not. Defaults to\nincluding both answered and unanswered discussions.

", + "type": { + "name": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + } + }, + { + "name": "before", + "description": "

Returns the elements in the list that come before the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "first", + "description": "

Returns the first n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + }, + { + "name": "last", + "description": "

Returns the last n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + }, + { + "name": "orderBy", + "description": "

Ordering options for discussions returned from the connection.

", + "type": { + "name": "DiscussionOrder", + "id": "discussionorder", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#discussionorder" + } + }, + { + "name": "repositoryId", + "description": "

Filter discussions to only those in a specific repository.

", + "type": { + "name": "ID", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id" + } + }, + { + "name": "states", + "description": "

A list of states to filter the discussions by.

", + "type": { + "name": "[DiscussionState!]", + "id": "discussionstate", + "kind": "enums", + "href": "/graphql/reference/enums#discussionstate" + } + } + ] + }, + { + "name": "repositoryMigrations", + "description": "

A list of all repository migrations for this organization.

", + "type": "RepositoryMigrationConnection!", + "id": "repositorymigrationconnection", + "kind": "objects", + "href": "/graphql/reference/objects#repositorymigrationconnection", "arguments": [ { "name": "after", @@ -67934,12 +68244,32 @@ ] }, { - "name": "repositoryTopics", - "description": "

A list of applied repository-topic associations for this repository.

", - "type": "RepositoryTopicConnection!", - "id": "repositorytopicconnection", + "name": "repositoryCustomPropertyValue", + "description": "

A custom property value for the repository.

", + "type": "RepositoryCustomPropertyValue", + "id": "repositorycustompropertyvalue", "kind": "objects", - "href": "/graphql/reference/objects#repositorytopicconnection", + "href": "/graphql/reference/objects#repositorycustompropertyvalue", + "arguments": [ + { + "name": "propertyName", + "description": "

The name of the custom property to retrieve the value for.

", + "type": { + "name": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + } + ] + }, + { + "name": "repositoryCustomPropertyValues", + "description": "

A list of custom properties and their associated values for a repository.

", + "type": "RepositoryCustomPropertyValueConnection", + "id": "repositorycustompropertyvalueconnection", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyvalueconnection", "arguments": [ { "name": "after", @@ -67984,51 +68314,12 @@ ] }, { - "name": "resourcePath", - "description": "

The HTTP path for this repository.

", - "type": "URI!", - "id": "uri", - "kind": "scalars", - "href": "/graphql/reference/scalars#uri" - }, - { - "name": "ruleset", - "description": "

Returns a single ruleset from the current repository by ID.

", - "type": "RepositoryRuleset", - "id": "repositoryruleset", - "kind": "objects", - "href": "/graphql/reference/objects#repositoryruleset", - "arguments": [ - { - "name": "databaseId", - "description": "

The ID of the ruleset to be returned.

", - "type": { - "name": "Int!", - "id": "int", - "kind": "scalars", - "href": "/graphql/reference/scalars#int" - } - }, - { - "name": "includeParents", - "defaultValue": true, - "description": "

Include rulesets configured at higher levels that apply to this repository.

", - "type": { - "name": "Boolean", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean" - } - } - ] - }, - { - "name": "rulesets", - "description": "

A list of rulesets for this repository.

", - "type": "RepositoryRulesetConnection", - "id": "repositoryrulesetconnection", + "name": "repositoryTopics", + "description": "

A list of applied repository-topic associations for this repository.

", + "type": "RepositoryTopicConnection!", + "id": "repositorytopicconnection", "kind": "objects", - "href": "/graphql/reference/objects#repositoryrulesetconnection", + "href": "/graphql/reference/objects#repositorytopicconnection", "arguments": [ { "name": "after", @@ -68060,17 +68351,6 @@ "href": "/graphql/reference/scalars#int" } }, - { - "name": "includeParents", - "defaultValue": true, - "description": "

Return rulesets configured at higher levels that apply to this repository.

", - "type": { - "name": "Boolean", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean" - } - }, { "name": "last", "description": "

Returns the last n elements from the list.

", @@ -68080,105 +68360,205 @@ "kind": "scalars", "href": "/graphql/reference/scalars#int" } - }, - { - "name": "targets", - "description": "

Return rulesets that apply to the specified target.

", - "type": { - "name": "[RepositoryRulesetTarget!]", - "id": "repositoryrulesettarget", - "kind": "enums", - "href": "/graphql/reference/enums#repositoryrulesettarget" - } } ] }, { - "name": "securityPolicyUrl", - "description": "

The security policy URL.

", - "type": "URI", + "name": "resourcePath", + "description": "

The HTTP path for this repository.

", + "type": "URI!", "id": "uri", "kind": "scalars", "href": "/graphql/reference/scalars#uri" }, { - "name": "shortDescriptionHTML", - "description": "

A description of the repository, rendered to HTML without any links in it.

", - "type": "HTML!", - "id": "html", - "kind": "scalars", - "href": "/graphql/reference/scalars#html", + "name": "ruleset", + "description": "

Returns a single ruleset from the current repository by ID.

", + "type": "RepositoryRuleset", + "id": "repositoryruleset", + "kind": "objects", + "href": "/graphql/reference/objects#repositoryruleset", "arguments": [ { - "name": "limit", - "defaultValue": "200", - "description": "

How many characters to return.

", + "name": "databaseId", + "description": "

The ID of the ruleset to be returned.

", "type": { - "name": "Int", + "name": "Int!", "id": "int", "kind": "scalars", "href": "/graphql/reference/scalars#int" } + }, + { + "name": "includeParents", + "defaultValue": true, + "description": "

Include rulesets configured at higher levels that apply to this repository.

", + "type": { + "name": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + } } ] }, { - "name": "squashMergeAllowed", - "description": "

Whether or not squash-merging is enabled on this repository.

", - "type": "Boolean!", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean" - }, - { - "name": "squashMergeCommitMessage", - "description": "

How the default commit message will be generated when squash merging a pull request.

", - "type": "SquashMergeCommitMessage!", - "id": "squashmergecommitmessage", - "kind": "enums", - "href": "/graphql/reference/enums#squashmergecommitmessage" - }, - { - "name": "squashMergeCommitTitle", - "description": "

How the default commit title will be generated when squash merging a pull request.

", - "type": "SquashMergeCommitTitle!", - "id": "squashmergecommittitle", - "kind": "enums", - "href": "/graphql/reference/enums#squashmergecommittitle" - }, - { - "name": "squashPrTitleUsedAsDefault", - "description": "

Whether a squash merge commit can use the pull request title as default.

", - "type": "Boolean!", - "id": "boolean", - "kind": "scalars", - "href": "/graphql/reference/scalars#boolean", - "isDeprecated": true, - "deprecationReason": "

squashPrTitleUsedAsDefault will be removed. Use Repository.squashMergeCommitTitle instead. Removal on 2023-04-01 UTC.

" - }, - { - "name": "sshUrl", - "description": "

The SSH URL to clone this repository.

", - "type": "GitSSHRemote!", - "id": "gitsshremote", - "kind": "scalars", - "href": "/graphql/reference/scalars#gitsshremote" - }, - { - "name": "stargazerCount", - "description": "

Returns a count of how many stargazers there are on this object.

", - "type": "Int!", - "id": "int", - "kind": "scalars", - "href": "/graphql/reference/scalars#int" - }, - { - "name": "stargazers", - "description": "

A list of users who have starred this starrable.

", - "type": "StargazerConnection!", - "id": "stargazerconnection", + "name": "rulesets", + "description": "

A list of rulesets for this repository.

", + "type": "RepositoryRulesetConnection", + "id": "repositoryrulesetconnection", "kind": "objects", - "href": "/graphql/reference/objects#stargazerconnection", + "href": "/graphql/reference/objects#repositoryrulesetconnection", + "arguments": [ + { + "name": "after", + "description": "

Returns the elements in the list that come after the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "before", + "description": "

Returns the elements in the list that come before the specified cursor.

", + "type": { + "name": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + } + }, + { + "name": "first", + "description": "

Returns the first n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + }, + { + "name": "includeParents", + "defaultValue": true, + "description": "

Return rulesets configured at higher levels that apply to this repository.

", + "type": { + "name": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + } + }, + { + "name": "last", + "description": "

Returns the last n elements from the list.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + }, + { + "name": "targets", + "description": "

Return rulesets that apply to the specified target.

", + "type": { + "name": "[RepositoryRulesetTarget!]", + "id": "repositoryrulesettarget", + "kind": "enums", + "href": "/graphql/reference/enums#repositoryrulesettarget" + } + } + ] + }, + { + "name": "securityPolicyUrl", + "description": "

The security policy URL.

", + "type": "URI", + "id": "uri", + "kind": "scalars", + "href": "/graphql/reference/scalars#uri" + }, + { + "name": "shortDescriptionHTML", + "description": "

A description of the repository, rendered to HTML without any links in it.

", + "type": "HTML!", + "id": "html", + "kind": "scalars", + "href": "/graphql/reference/scalars#html", + "arguments": [ + { + "name": "limit", + "defaultValue": "200", + "description": "

How many characters to return.

", + "type": { + "name": "Int", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + } + ] + }, + { + "name": "squashMergeAllowed", + "description": "

Whether or not squash-merging is enabled on this repository.

", + "type": "Boolean!", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + }, + { + "name": "squashMergeCommitMessage", + "description": "

How the default commit message will be generated when squash merging a pull request.

", + "type": "SquashMergeCommitMessage!", + "id": "squashmergecommitmessage", + "kind": "enums", + "href": "/graphql/reference/enums#squashmergecommitmessage" + }, + { + "name": "squashMergeCommitTitle", + "description": "

How the default commit title will be generated when squash merging a pull request.

", + "type": "SquashMergeCommitTitle!", + "id": "squashmergecommittitle", + "kind": "enums", + "href": "/graphql/reference/enums#squashmergecommittitle" + }, + { + "name": "squashPrTitleUsedAsDefault", + "description": "

Whether a squash merge commit can use the pull request title as default.

", + "type": "Boolean!", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean", + "isDeprecated": true, + "deprecationReason": "

squashPrTitleUsedAsDefault will be removed. Use Repository.squashMergeCommitTitle instead. Removal on 2023-04-01 UTC.

" + }, + { + "name": "sshUrl", + "description": "

The SSH URL to clone this repository.

", + "type": "GitSSHRemote!", + "id": "gitsshremote", + "kind": "scalars", + "href": "/graphql/reference/scalars#gitsshremote" + }, + { + "name": "stargazerCount", + "description": "

Returns a count of how many stargazers there are on this object.

", + "type": "Int!", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + }, + { + "name": "stargazers", + "description": "

A list of users who have starred this starrable.

", + "type": "StargazerConnection!", + "id": "stargazerconnection", + "kind": "objects", + "href": "/graphql/reference/objects#stargazerconnection", "arguments": [ { "name": "after", @@ -68896,6 +69276,259 @@ } ] }, + { + "name": "RepositoryCustomProperty", + "kind": "objects", + "id": "repositorycustomproperty", + "href": "/graphql/reference/objects#repositorycustomproperty", + "description": "

A repository custom property.

", + "implements": [ + { + "name": "Node", + "id": "node", + "href": "/graphql/reference/interfaces#node" + } + ], + "fields": [ + { + "name": "allowedValues", + "description": "

The allowed values for the custom property. Required if value_type is single_select or multi_select.

", + "type": "[String!]", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "defaultValue", + "description": "

The default value of the custom property, if the property is required.

", + "type": "CustomPropertyValue", + "id": "custompropertyvalue", + "kind": "scalars", + "href": "/graphql/reference/scalars#custompropertyvalue" + }, + { + "name": "description", + "description": "

The description of the custom property.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "id", + "description": "

The Node ID of the RepositoryCustomProperty object.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id" + }, + { + "name": "propertyName", + "description": "

The name of the custom property.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "regex", + "description": "

The regex pattern that the value of the custom property must match, if the value_type is string.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "required", + "description": "

Whether the custom property is required.

", + "type": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + }, + { + "name": "source", + "description": "

The source type of the custom property.

", + "type": "CustomPropertySource!", + "id": "custompropertysource", + "kind": "unions", + "href": "/graphql/reference/unions#custompropertysource" + }, + { + "name": "valueType", + "description": "

The value type of the custom property.

", + "type": "CustomPropertyValueType!", + "id": "custompropertyvaluetype", + "kind": "enums", + "href": "/graphql/reference/enums#custompropertyvaluetype" + }, + { + "name": "valuesEditableBy", + "description": "

Who can edit the values of this repository custom property.

", + "type": "RepositoryCustomPropertyValuesEditableBy!", + "id": "repositorycustompropertyvalueseditableby", + "kind": "enums", + "href": "/graphql/reference/enums#repositorycustompropertyvalueseditableby" + } + ] + }, + { + "name": "RepositoryCustomPropertyConnection", + "kind": "objects", + "id": "repositorycustompropertyconnection", + "href": "/graphql/reference/objects#repositorycustompropertyconnection", + "description": "

The connection type for RepositoryCustomProperty.

", + "fields": [ + { + "name": "edges", + "description": "

A list of edges.

", + "type": "[RepositoryCustomPropertyEdge]", + "id": "repositorycustompropertyedge", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyedge" + }, + { + "name": "nodes", + "description": "

A list of nodes.

", + "type": "[RepositoryCustomProperty]", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty" + }, + { + "name": "pageInfo", + "description": "

Information to aid in pagination.

", + "type": "PageInfo!", + "id": "pageinfo", + "kind": "objects", + "href": "/graphql/reference/objects#pageinfo" + }, + { + "name": "totalCount", + "description": "

Identifies the total count of items in the connection.

", + "type": "Int!", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + ] + }, + { + "name": "RepositoryCustomPropertyEdge", + "kind": "objects", + "id": "repositorycustompropertyedge", + "href": "/graphql/reference/objects#repositorycustompropertyedge", + "description": "

An edge in a connection.

", + "fields": [ + { + "name": "cursor", + "description": "

A cursor for use in pagination.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "node", + "description": "

The item at the end of the edge.

", + "type": "RepositoryCustomProperty", + "id": "repositorycustomproperty", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustomproperty" + } + ] + }, + { + "name": "RepositoryCustomPropertyValue", + "kind": "objects", + "id": "repositorycustompropertyvalue", + "href": "/graphql/reference/objects#repositorycustompropertyvalue", + "description": "

A value associated with a repository custom property.

", + "fields": [ + { + "name": "propertyName", + "description": "

The name of the custom property.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "value", + "description": "

The value of the custom property.

", + "type": "CustomPropertyValue!", + "id": "custompropertyvalue", + "kind": "scalars", + "href": "/graphql/reference/scalars#custompropertyvalue" + } + ] + }, + { + "name": "RepositoryCustomPropertyValueConnection", + "kind": "objects", + "id": "repositorycustompropertyvalueconnection", + "href": "/graphql/reference/objects#repositorycustompropertyvalueconnection", + "description": "

The connection type for RepositoryCustomPropertyValue.

", + "fields": [ + { + "name": "edges", + "description": "

A list of edges.

", + "type": "[RepositoryCustomPropertyValueEdge]", + "id": "repositorycustompropertyvalueedge", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyvalueedge" + }, + { + "name": "nodes", + "description": "

A list of nodes.

", + "type": "[RepositoryCustomPropertyValue]", + "id": "repositorycustompropertyvalue", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyvalue" + }, + { + "name": "pageInfo", + "description": "

Information to aid in pagination.

", + "type": "PageInfo!", + "id": "pageinfo", + "kind": "objects", + "href": "/graphql/reference/objects#pageinfo" + }, + { + "name": "totalCount", + "description": "

Identifies the total count of items in the connection.

", + "type": "Int!", + "id": "int", + "kind": "scalars", + "href": "/graphql/reference/scalars#int" + } + ] + }, + { + "name": "RepositoryCustomPropertyValueEdge", + "kind": "objects", + "id": "repositorycustompropertyvalueedge", + "href": "/graphql/reference/objects#repositorycustompropertyvalueedge", + "description": "

An edge in a connection.

", + "fields": [ + { + "name": "cursor", + "description": "

A cursor for use in pagination.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "node", + "description": "

The item at the end of the edge.

", + "type": "RepositoryCustomPropertyValue", + "id": "repositorycustompropertyvalue", + "kind": "objects", + "href": "/graphql/reference/objects#repositorycustompropertyvalue" + } + ] + }, { "name": "RepositoryEdge", "kind": "objects", @@ -89344,6 +89977,35 @@ } ] }, + { + "name": "CustomPropertyValueType", + "kind": "enums", + "id": "custompropertyvaluetype", + "href": "/graphql/reference/enums#custompropertyvaluetype", + "description": "

The allowed value types for a custom property definition.

", + "values": [ + { + "name": "MULTI_SELECT", + "description": "

A multi-select value.

" + }, + { + "name": "SINGLE_SELECT", + "description": "

A single-select value.

" + }, + { + "name": "STRING", + "description": "

A string value.

" + }, + { + "name": "TRUE_FALSE", + "description": "

A true/false value.

" + }, + { + "name": "URL", + "description": "

A URL value.

" + } + ] + }, { "name": "DefaultRepositoryPermissionField", "kind": "enums", @@ -93298,6 +93960,23 @@ } ] }, + { + "name": "RepositoryCustomPropertyValuesEditableBy", + "kind": "enums", + "id": "repositorycustompropertyvalueseditableby", + "href": "/graphql/reference/enums#repositorycustompropertyvalueseditableby", + "description": "

The allowed actors who can edit the values of a custom property.

", + "values": [ + { + "name": "ORG_ACTORS", + "description": "

The organization actors.

" + }, + { + "name": "ORG_AND_REPO_ACTORS", + "description": "

The organization and repository actors.

" + } + ] + }, { "name": "RepositoryInteractionLimit", "kind": "enums", @@ -96174,6 +96853,25 @@ } ] }, + { + "name": "CustomPropertySource", + "kind": "unions", + "id": "custompropertysource", + "href": "/graphql/reference/unions#custompropertysource", + "description": "

Sources which can have custom properties defined.

", + "possibleTypes": [ + { + "name": "Enterprise", + "id": "enterprise", + "href": "/graphql/reference/objects#enterprise" + }, + { + "name": "Organization", + "id": "organization", + "href": "/graphql/reference/objects#organization" + } + ] + }, { "name": "DeploymentReviewer", "kind": "unions", @@ -102224,6 +102922,96 @@ } ] }, + { + "name": "CreateRepositoryCustomPropertyInput", + "kind": "inputObjects", + "id": "createrepositorycustompropertyinput", + "href": "/graphql/reference/input-objects#createrepositorycustompropertyinput", + "description": "

Autogenerated input type of CreateRepositoryCustomProperty.

", + "inputFields": [ + { + "name": "allowedValues", + "description": "

The allowed values for the custom property.

", + "type": "[String!]", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "clientMutationId", + "description": "

A unique identifier for the client performing the mutation.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "defaultValue", + "description": "

The default value for the custom property if the property is required.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "description", + "description": "

The description of the custom property.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "propertyName", + "description": "

The name of the custom property.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "regex", + "description": "

The regex pattern that the value of the custom property must match, if the value_type is string.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "required", + "description": "

Whether the custom property is required.

", + "type": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + }, + { + "name": "sourceId", + "description": "

The global relay id of the source in which a new custom property should be created in.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id", + "isDeprecated": false + }, + { + "name": "valueType", + "description": "

The value type for the custom property.

", + "type": "CustomPropertyValueType!", + "id": "custompropertyvaluetype", + "kind": "enums", + "href": "/graphql/reference/enums#custompropertyvaluetype" + }, + { + "name": "valuesEditableBy", + "description": "

The allowed actors who can edit the values of a custom property.

", + "type": "RepositoryCustomPropertyValuesEditableBy", + "id": "repositorycustompropertyvalueseditableby", + "kind": "enums", + "href": "/graphql/reference/enums#repositorycustompropertyvalueseditableby" + } + ] + }, { "name": "CreateRepositoryInput", "kind": "inputObjects", @@ -102835,6 +103623,31 @@ } ] }, + { + "name": "CustomPropertyValueInput", + "kind": "inputObjects", + "id": "custompropertyvalueinput", + "href": "/graphql/reference/input-objects#custompropertyvalueinput", + "description": "

The custom property name and value to be set.

", + "inputFields": [ + { + "name": "propertyName", + "description": "

The name of the custom property.

", + "type": "String!", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "value", + "description": "

The value to set for the custom property. Using a value of null will unset the\nproperty value, reverting to the default value if the property is required.

", + "type": "CustomPropertyValue", + "id": "custompropertyvalue", + "kind": "scalars", + "href": "/graphql/reference/scalars#custompropertyvalue" + } + ] + }, { "name": "DeclineTopicSuggestionInput", "kind": "inputObjects", @@ -103484,6 +104297,32 @@ } ] }, + { + "name": "DeleteRepositoryCustomPropertyInput", + "kind": "inputObjects", + "id": "deleterepositorycustompropertyinput", + "href": "/graphql/reference/input-objects#deleterepositorycustompropertyinput", + "description": "

Autogenerated input type of DeleteRepositoryCustomProperty.

", + "inputFields": [ + { + "name": "clientMutationId", + "description": "

A unique identifier for the client performing the mutation.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "id", + "description": "

The global relay id of the custom property to be deleted.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id", + "isDeprecated": false + } + ] + }, { "name": "DeleteRepositoryRulesetInput", "kind": "inputObjects", @@ -106254,6 +107093,32 @@ } ] }, + { + "name": "PromoteRepositoryCustomPropertyInput", + "kind": "inputObjects", + "id": "promoterepositorycustompropertyinput", + "href": "/graphql/reference/input-objects#promoterepositorycustompropertyinput", + "description": "

Autogenerated input type of PromoteRepositoryCustomProperty.

", + "inputFields": [ + { + "name": "clientMutationId", + "description": "

A unique identifier for the client performing the mutation.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "repositoryCustomPropertyId", + "description": "

The ID of the repository custom property to be promoted.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id", + "isDeprecated": false + } + ] + }, { "name": "PropertyTargetDefinitionInput", "kind": "inputObjects", @@ -108313,6 +109178,40 @@ } ] }, + { + "name": "SetRepositoryCustomPropertyValuesInput", + "kind": "inputObjects", + "id": "setrepositorycustompropertyvaluesinput", + "href": "/graphql/reference/input-objects#setrepositorycustompropertyvaluesinput", + "description": "

Autogenerated input type of SetRepositoryCustomPropertyValues.

", + "inputFields": [ + { + "name": "clientMutationId", + "description": "

A unique identifier for the client performing the mutation.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "properties", + "description": "

A list of custom property names and associated values to apply.

", + "type": "[CustomPropertyValueInput!]!", + "id": "custompropertyvalueinput", + "kind": "input-objects", + "href": "/graphql/reference/input-objects#custompropertyvalueinput" + }, + { + "name": "repositoryId", + "description": "

The ID of the repository to set properties for.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id", + "isDeprecated": false + } + ] + }, { "name": "SetRepositoryInteractionLimitInput", "kind": "inputObjects", @@ -112093,6 +112992,80 @@ } ] }, + { + "name": "UpdateRepositoryCustomPropertyInput", + "kind": "inputObjects", + "id": "updaterepositorycustompropertyinput", + "href": "/graphql/reference/input-objects#updaterepositorycustompropertyinput", + "description": "

Autogenerated input type of UpdateRepositoryCustomProperty.

", + "inputFields": [ + { + "name": "allowedValues", + "description": "

The updated allowed values for the custom property.

", + "type": "[String!]", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "clientMutationId", + "description": "

A unique identifier for the client performing the mutation.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "defaultValue", + "description": "

The updated default value for the custom property if the property is required.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "description", + "description": "

The updated description of the custom property.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "regex", + "description": "

The regex pattern that the value of the custom property must match, if the value_type is string.

", + "type": "String", + "id": "string", + "kind": "scalars", + "href": "/graphql/reference/scalars#string" + }, + { + "name": "repositoryCustomPropertyId", + "description": "

The global relay id of the source of the custom property.

", + "type": "ID!", + "id": "id", + "kind": "scalars", + "href": "/graphql/reference/scalars#id", + "isDeprecated": false + }, + { + "name": "required", + "description": "

Whether the updated custom property is required.

", + "type": "Boolean", + "id": "boolean", + "kind": "scalars", + "href": "/graphql/reference/scalars#boolean" + }, + { + "name": "valuesEditableBy", + "description": "

The updated actors who can edit the values of the custom property.

", + "type": "RepositoryCustomPropertyValuesEditableBy", + "id": "repositorycustompropertyvalueseditableby", + "kind": "enums", + "href": "/graphql/reference/enums#repositorycustompropertyvalueseditableby" + } + ] + }, { "name": "UpdateRepositoryInput", "kind": "inputObjects", @@ -112951,6 +113924,13 @@ "id": "boolean", "href": "/graphql/reference/scalars#boolean" }, + { + "name": "CustomPropertyValue", + "kind": "scalars", + "id": "custompropertyvalue", + "href": "/graphql/reference/scalars#custompropertyvalue", + "description": "

A custom property value can be either a string or an array of strings. All\nproperty types support only a single string value, except for the multi-select\ntype, which supports only a string array.

" + }, { "name": "Date", "kind": "scalars", diff --git a/src/graphql/tests/build-changelog.ts b/src/graphql/tests/build-changelog.ts index cf6e34e0dc5b..f5c131468bad 100644 --- a/src/graphql/tests/build-changelog.ts +++ b/src/graphql/tests/build-changelog.ts @@ -19,8 +19,8 @@ interface Preview { title: string description: string toggled_by: string - announcement: any - updates: any + announcement: unknown + updates: unknown toggled_on: string[] owning_teams: string[] } @@ -33,7 +33,7 @@ interface UpcomingChange { interface IgnoredChange { type: string - [key: string]: any + [key: string]: unknown } interface IgnoredChangesSummary { @@ -285,7 +285,7 @@ describe('ignored changes tracking', () => { // This should generate a TypeDescriptionAdded change type that gets ignored await createChangelogEntry(oldSchemaString, newSchemaString, [], [], []) - const ignoredChanges: IgnoredChange[] = getLastIgnoredChanges() + const ignoredChanges: IgnoredChange[] = getLastIgnoredChanges() as unknown as IgnoredChange[] expect(ignoredChanges.length).toBe(1) expect(ignoredChanges[0].type).toBe('TYPE_DESCRIPTION_ADDED') }) diff --git a/src/landings/components/ProductGuidesContext.tsx b/src/landings/components/ProductGuidesContext.tsx index 65de24591eac..35a3c26158bb 100644 --- a/src/landings/components/ProductGuidesContext.tsx +++ b/src/landings/components/ProductGuidesContext.tsx @@ -1,5 +1,6 @@ import { createContext, useContext } from 'react' import pick from 'lodash/pick' +import type { ExtendedRequest } from '@/types' export type LearningTrack = { trackName: string @@ -38,24 +39,45 @@ export const useProductGuidesContext = (): ProductGuidesContextT => { return context } -export const getProductGuidesContextFromRequest = (req: any): ProductGuidesContextT => { - const page = req.context.page +export const getProductGuidesContextFromRequest = (req: ExtendedRequest): ProductGuidesContextT => { + if (!req.context || !req.context.page) { + throw new Error('Request context or page is missing') + } + + const page = req.context.page as typeof req.context.page & { + learningTracks?: Array> + includeGuides?: Array> + } - const learningTracks: LearningTrack[] = (page.learningTracks || []).map((track: any) => ({ - ...pick(track, ['title', 'description', 'trackName', 'trackProduct']), - guides: (track.guides || []).map((guide: any) => { - return pick(guide, ['title', 'intro', 'href', 'page.type']) + const learningTracks: LearningTrack[] = (page.learningTracks || []).map( + (track: Record) => ({ + title: (track.title as string) || '', + description: (track.description as string) || '', + trackName: (track.trackName as string) || '', + trackProduct: (track.trackProduct as string) || '', + guides: ((track.guides as Array>) || []).map( + (guide: Record) => ({ + title: (guide.title as string) || '', + intro: (guide.intro as string) || '', + href: (guide.href as string) || '', + page: guide.page as { type: string } | undefined, + }), + ), }), - })) + ) return { ...pick(page, ['title', 'intro']), + title: page.title || '', + intro: page.intro || '', learningTracks, - includeGuides: (page.includeGuides || []).map((guide: any) => { + includeGuides: (page.includeGuides || []).map((guide: Record) => { return { - ...pick(guide, ['href', 'title', 'intro']), - type: guide.type || '', - topics: guide.topics || [], + href: (guide.href as string) || '', + title: (guide.title as string) || '', + intro: (guide.intro as string) || '', + type: (guide.type as string) || '', + topics: (guide.topics as Array) || [], } }), } diff --git a/src/languages/scripts/count-translation-corruptions.ts b/src/languages/scripts/count-translation-corruptions.ts index 3f0bf17e40f9..a46a1bc2ed5f 100644 --- a/src/languages/scripts/count-translation-corruptions.ts +++ b/src/languages/scripts/count-translation-corruptions.ts @@ -77,10 +77,10 @@ function run(languageCode: string, site: Site, englishReusables: Reusables) { const illegalTags = new Map() function countError(error: TokenizationError, where: string) { - const originalError = (error as any).originalError + const originalError = (error as { originalError?: Error }).originalError const errorString = originalError ? originalError.message : error.message if (errorString.includes('illegal tag syntax')) { - const illegalTag = (error as any).token.content + const illegalTag = (error as unknown as { token: { content: string } }).token.content illegalTags.set(illegalTag, (illegalTags.get(illegalTag) || 0) + 1) } errors.set(errorString, (errors.get(errorString) || 0) + 1) diff --git a/src/learning-track/lib/types.ts b/src/learning-track/lib/types.ts index 2547d6db8114..60ab19d011ee 100644 --- a/src/learning-track/lib/types.ts +++ b/src/learning-track/lib/types.ts @@ -2,18 +2,10 @@ * Common types used across learning track components */ -/** - * Basic context interface for rendering operations - */ -export interface Context { - currentProduct?: string - currentLanguage?: string - currentVersion?: string - pages?: any - redirects?: any - // Additional properties that may be needed for rendering - [key: string]: any -} +import type { Context, Page as MainPage } from '@/types' + +// Re-export Context from main types to avoid duplicate definitions +export type { Context } /** * Options for retrieving link data @@ -49,11 +41,9 @@ export interface PageFeaturedLinks { /** * Page interface for basic page properties + * Using the main Page type from @/types */ -export interface Page { - renderTitle: (context: Context, opts: any) => Promise - renderProp: (prop: string, context: Context, opts: any) => Promise -} +export type Page = MainPage /** * Guide in a learning track @@ -83,7 +73,7 @@ export interface LearningTrackMetadata { title: string description: string guides: string[] - versions?: any + versions?: unknown } /** diff --git a/src/observability/tests/failbot.ts b/src/observability/tests/failbot.ts index cbfc87348309..8a3ddaaf6168 100644 --- a/src/observability/tests/failbot.ts +++ b/src/observability/tests/failbot.ts @@ -4,7 +4,7 @@ import nock from 'nock' import FailBot from '../lib/failbot' describe('FailBot', () => { - const requestBodiesSent: any[] = [] + const requestBodiesSent: unknown[] = [] beforeEach(() => { delete process.env.HAYSTACK_URL diff --git a/src/rest/api/anchor-redirect.ts b/src/rest/api/anchor-redirect.ts index e29a72b0562e..59d1c8c28831 100644 --- a/src/rest/api/anchor-redirect.ts +++ b/src/rest/api/anchor-redirect.ts @@ -1,4 +1,4 @@ -import express from 'express' +import express, { RequestHandler } from 'express' import path from 'path' import { readCompressedJsonFileFallbackLazily } from '@/frame/lib/read-json-file' @@ -12,20 +12,22 @@ const clientSideRestAPIRedirects = readCompressedJsonFileFallbackLazily( const router = express.Router() // Returns a client side redirect if one exists for the given path. -// Note: Using 'any' for req/res because Express types are complex and the -// function signature is constrained by the router.get() overloads -router.get('/', function redirects(req: any, res: any) { +const redirects: RequestHandler = (req, res) => { if (!req.query.path) { - return res.status(400).send("Missing 'path' query string") + res.status(400).send("Missing 'path' query string") + return } if (!req.query.hash) { - return res.status(400).send("Missing 'hash' query string") + res.status(400).send("Missing 'hash' query string") + return } defaultCacheControl(res) const redirectFrom: string = `${req.query.path}#${req.query.hash}` res.status(200).send({ to: clientSideRestAPIRedirects()[redirectFrom] }) -}) +} + +router.get('/', redirects) export default router diff --git a/src/rest/scripts/openapi-check.ts b/src/rest/scripts/openapi-check.ts index d9efa87ec34c..6b08012f0d40 100755 --- a/src/rest/scripts/openapi-check.ts +++ b/src/rest/scripts/openapi-check.ts @@ -8,7 +8,7 @@ import fs from 'fs' import path from 'path' import { globSync } from 'glob' import { program } from 'commander' -import { createOperations, processOperations } from './utils/get-operations' +import { createOperations, processOperations, type SchemaInput } from './utils/get-operations' interface ProgramOptions { files: string[] @@ -35,15 +35,15 @@ if (filesToCheck.length) { async function check(files: string[]): Promise { console.log('Verifying OpenAPI files are valid with decorator') - const documents: [string, any][] = files.map((filename: string) => [ + const documents: [string, unknown][] = files.map((filename: string) => [ filename, JSON.parse(fs.readFileSync(path.join(filename), 'utf8')), ]) - for (const [filename, schema] of documents as [string, any][]) { + for (const [filename, schema] of documents as [string, unknown][]) { try { // munge OpenAPI definitions object in an array of operations objects - const operations = await createOperations(schema) + const operations = await createOperations(schema as SchemaInput) // process each operation, asynchronously rendering markdown and stuff await processOperations(operations, {}) diff --git a/src/rest/scripts/utils/get-body-params.ts b/src/rest/scripts/utils/get-body-params.ts index e5ca3030b9e7..72528ad5f7a6 100644 --- a/src/rest/scripts/utils/get-body-params.ts +++ b/src/rest/scripts/utils/get-body-params.ts @@ -1,18 +1,18 @@ import { renderContent } from './render-content' -interface Schema { - oneOf?: any[] +export interface Schema { + oneOf?: Schema[] type?: string - items?: any - properties?: Record + items?: Schema + properties?: Record required?: string[] - additionalProperties?: any + additionalProperties?: Schema description?: string enum?: string[] nullable?: boolean - allOf?: any[] - anyOf?: any[] - [key: string]: any + allOf?: Schema[] + anyOf?: Schema[] + [key: string]: unknown } export interface TransformedParam { @@ -24,7 +24,7 @@ export interface TransformedParam { childParamsGroups?: TransformedParam[] enum?: string[] oneOfObject?: boolean - default?: any + default?: unknown } interface BodyParamProps { @@ -43,7 +43,7 @@ interface BodyParamProps { // operations have a top-level oneOf. async function getTopLevelOneOfProperty( schema: Schema, -): Promise<{ properties: Record; required: string[] }> { +): Promise<{ properties: Record; required: string[] }> { if (!schema.oneOf) { throw new Error('Schema does not have a requestBody oneOf property defined') } @@ -65,10 +65,14 @@ async function getTopLevelOneOfProperty( // This merges all of the properties and required values. if (allOneOfAreObjects) { for (const each of schema.oneOf.slice(1)) { - Object.assign(firstOneOfObject.properties, each.properties) - required = firstOneOfObject.required.concat(each.required) + if (firstOneOfObject.properties && each.properties) { + Object.assign(firstOneOfObject.properties, each.properties) + } + if (firstOneOfObject.required && each.required) { + required = firstOneOfObject.required.concat(each.required) + } } - properties = firstOneOfObject.properties + properties = firstOneOfObject.properties || {} } return { properties, required } } @@ -79,7 +83,7 @@ async function handleObjectOnlyOneOf( param: Schema, paramType: string[], ): Promise { - if (param.oneOf && param.oneOf.every((object: TransformedParam) => object.type === 'object')) { + if (param.oneOf && param.oneOf.every((object: Schema) => object.type === 'object')) { paramType.push('object') param.oneOfObject = true return await getOneOfChildParams(param) @@ -97,6 +101,9 @@ export async function getBodyParams(schema: Schema, topLevel = false): Promise t !== undefined, + ) const additionalPropertiesType = param.additionalProperties - ? Array.isArray(param.additionalProperties.type) - ? param.additionalProperties.type - : [param.additionalProperties.type] + ? (Array.isArray(param.additionalProperties.type) + ? param.additionalProperties.type + : [param.additionalProperties.type] + ).filter((t): t is string => t !== undefined) : [] const childParamsGroups: TransformedParam[] = [] @@ -142,7 +152,6 @@ export async function getBodyParams(schema: Schema, topLevel = false): Promise object.type === 'object')) { + if (param.items.oneOf.every((object: Schema) => object.type === 'object')) { paramType.splice(paramType.indexOf('array'), 1, `array of objects`) param.oneOfObject = true childParamsGroups.push(...(await getOneOfChildParams(param.items))) @@ -169,7 +178,7 @@ export async function getBodyParams(schema: Schema, topLevel = false): Promise `${lang}`).join(', ')}` + }Supported values are: ${((param.items.enum || []) as string[]).map((lang: string) => `${lang}`).join(', ')}` } } } else if (paramType.includes('object')) { @@ -183,7 +192,7 @@ export async function getBodyParams(schema: Schema, topLevel = false): Promise 0) { childParamsGroups.push(...oneOfChildren) } else { @@ -193,19 +202,25 @@ export async function getBodyParams(schema: Schema, topLevel = false): Promise { for (const oneOfParam of param.oneOf) { const objParam: TransformedParam = { type: 'object', - name: oneOfParam.title, - description: await renderContent(oneOfParam.description), - isRequired: oneOfParam.required, + name: (oneOfParam.title as string) || '', + description: await renderContent((oneOfParam.description as string) || ''), childParamsGroups: [], } if (objParam.childParamsGroups) { diff --git a/src/rest/scripts/utils/get-operations.ts b/src/rest/scripts/utils/get-operations.ts index 705e07832ece..4edead37125d 100644 --- a/src/rest/scripts/utils/get-operations.ts +++ b/src/rest/scripts/utils/get-operations.ts @@ -4,7 +4,7 @@ interface ProgAccessData { [key: string]: any } -interface SchemaInput { +export interface SchemaInput { paths?: { [requestPath: string]: { [verb: string]: any diff --git a/src/secret-scanning/scripts/sync.ts b/src/secret-scanning/scripts/sync.ts index ea3ff4add414..daf1a62868a3 100755 --- a/src/secret-scanning/scripts/sync.ts +++ b/src/secret-scanning/scripts/sync.ts @@ -7,8 +7,9 @@ * https://github.com/github/token-scanning-service/blob/main/docs/public-docs * directory to src/secret-scanning/data/pattern-docs */ -import { writeFile } from 'fs/promises' +import { writeFile, mkdir } from 'fs/promises' import yaml from 'js-yaml' +import path from 'path' import { getDirectoryContents } from '@/workflows/git-utils' import schema from '@/secret-scanning/data/public-docs-schema' @@ -52,6 +53,7 @@ async function main() { const filePath = file.path.replace(`${directory}/`, '') const localFilePath = `${SECRET_SCANNING_DIR}/${filePath}` + await mkdir(path.dirname(localFilePath), { recursive: true }) await writeFile(localFilePath, yaml.dump(yamlData)) } } diff --git a/src/webhooks/tests/oneof-handling.ts b/src/webhooks/tests/oneof-handling.ts index baca4038f242..a04cf9448269 100644 --- a/src/webhooks/tests/oneof-handling.ts +++ b/src/webhooks/tests/oneof-handling.ts @@ -1,5 +1,9 @@ import { describe, expect, test } from 'vitest' -import { getBodyParams, type TransformedParam } from '../../rest/scripts/utils/get-body-params' +import { + getBodyParams, + type TransformedParam, + type Schema, +} from '../../rest/scripts/utils/get-body-params' describe('oneOf handling in webhook parameters', () => { test('should handle oneOf fields correctly for secret_scanning_alert_location details', async () => { @@ -122,7 +126,7 @@ describe('oneOf handling in webhook parameters', () => { }, } - const result: TransformedParam[] = await getBodyParams(mockSchema, true) + const result: TransformedParam[] = await getBodyParams(mockSchema as unknown as Schema, true) // Find the location parameter const locationParam: TransformedParam | undefined = result.find( @@ -205,7 +209,10 @@ describe('oneOf handling in webhook parameters', () => { }, } - const result: TransformedParam[] = await getBodyParams(mockSchemaWithoutTitles, true) + const result: TransformedParam[] = await getBodyParams( + mockSchemaWithoutTitles as unknown as Schema, + true, + ) const detailsParam: TransformedParam | undefined = result.find( (param) => param.name === 'details', @@ -260,7 +267,10 @@ describe('oneOf handling in webhook parameters', () => { }, } - const result: TransformedParam[] = await getBodyParams(mockNestedOneOfSchema, true) + const result: TransformedParam[] = await getBodyParams( + mockNestedOneOfSchema as unknown as Schema, + true, + ) const wrapperParam: TransformedParam | undefined = result.find( (param) => param.name === 'wrapper', diff --git a/src/workflows/ready-for-docs-review.ts b/src/workflows/ready-for-docs-review.ts index 3fa626f748a1..b3d39b60ace1 100644 --- a/src/workflows/ready-for-docs-review.ts +++ b/src/workflows/ready-for-docs-review.ts @@ -17,28 +17,34 @@ import { * @param data GraphQL response data containing PR information * @returns Object with isCopilotAuthor boolean and copilotAssignee string */ -function getCopilotAuthorInfo(data: Record): { +function getCopilotAuthorInfo(data: Record): { isCopilotAuthor: boolean copilotAssignee: string } { + const item = data.item as Record + const author = item.author as Record | undefined + const assigneesObj = item.assignees as Record | undefined + // Check if this is a Copilot-authored PR - const isCopilotAuthor = - data.item.__typename === 'PullRequest' && - data.item.author && - data.item.author.login === 'copilot-swe-agent' + const isCopilotAuthor = !!( + item.__typename === 'PullRequest' && + author && + author.login === 'copilot-swe-agent' + ) // For Copilot PRs, find the appropriate assignee (excluding Copilot itself) let copilotAssignee = '' - if (isCopilotAuthor && data.item.assignees && data.item.assignees.nodes) { - const assignees = data.item.assignees.nodes - .map((assignee: Record) => assignee.login) + if (isCopilotAuthor && assigneesObj && assigneesObj.nodes) { + const nodes = assigneesObj.nodes as Array> + const assigneeLogins = nodes + .map((assignee: Record) => assignee.login as string) .filter((login: string) => login !== 'copilot-swe-agent') // Use the first non-Copilot assignee - copilotAssignee = assignees.length > 0 ? assignees[0] : '' + copilotAssignee = assigneeLogins.length > 0 ? assigneeLogins[0] : '' } - return { isCopilotAuthor, copilotAssignee } + return { isCopilotAuthor, copilotAssignee: copilotAssignee || '' } } /** @@ -66,7 +72,7 @@ function getAuthorFieldValue( async function run() { // Get info about the docs-content review board project - const data: Record = await graphql( + const data: Record = await graphql( ` query ($organization: String!, $projectNumber: Int!, $id: ID!) { organization(login: $organization) { @@ -123,7 +129,9 @@ async function run() { ) // Get the project ID - const projectID = data.organization.projectV2.id + const organization = data.organization as Record + const projectV2 = organization.projectV2 as Record + const projectID = projectV2.id as string // Get the ID of the fields that we want to populate const datePostedID = findFieldID('Date posted', data) @@ -152,7 +160,7 @@ async function run() { // If yes, set the author to 'first time contributor' instead of to the author login let firstTimeContributor if (process.env.REPO === 'github/docs') { - const contributorData: Record = await graphql( + const contributorData: Record = await graphql( ` query ($author: String!) { user(login: $author) { @@ -184,17 +192,30 @@ async function run() { }, }, ) - const docsPRData = - contributorData.user.contributionsCollection.pullRequestContributionsByRepository.filter( - (item: Record) => item.repository.nameWithOwner === 'github/docs', - )[0] - const prCount = docsPRData ? docsPRData.contributions.totalCount : 0 + const user = contributorData.user as Record + const contributionsCollection = user.contributionsCollection as Record + const pullRequestContributions = + contributionsCollection.pullRequestContributionsByRepository as Array> + const docsPRData = pullRequestContributions.filter((item: Record) => { + const repository = item.repository as Record + return repository.nameWithOwner === 'github/docs' + })[0] + const prContributions = docsPRData + ? (docsPRData.contributions as Record) + : undefined + const prCount = prContributions ? (prContributions.totalCount as number) : 0 - const docsIssueData = - contributorData.user.contributionsCollection.issueContributionsByRepository.filter( - (item: Record) => item.repository.nameWithOwner === 'github/docs', - )[0] - const issueCount = docsIssueData ? docsIssueData.contributions.totalCount : 0 + const issueContributions = contributionsCollection.issueContributionsByRepository as Array< + Record + > + const docsIssueData = issueContributions.filter((item: Record) => { + const repository = item.repository as Record + return repository.nameWithOwner === 'github/docs' + })[0] + const issueContributionsObj = docsIssueData + ? (docsIssueData.contributions as Record) + : undefined + const issueCount = issueContributionsObj ? (issueContributionsObj.totalCount as number) : 0 if (prCount + issueCount <= 1) { firstTimeContributor = true