Skip to content

Instantly share code, notes, and snippets.

@TheNightmanCodeth
Created September 7, 2022 17:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheNightmanCodeth/31f9f953d6713b594dda735fce953784 to your computer and use it in GitHub Desktop.
Save TheNightmanCodeth/31f9f953d6713b594dda735fce953784 to your computer and use it in GitHub Desktop.
Xcode Cloud Webhook Request TypeScript Model
/*
* This file containes interfaces that represent the content of the
* webhook request's body. I won't be using all of these but figured
* someone might find this useful one day <3
*
* Copyright (C) 2022 Joseph Diragi
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
export interface Webhook {
id: string
name: string
url: string
}
export interface App {
id: string
type: string
}
export interface Workflow {
id: string
type: string
attributes: {
name: string
description: string
lastModifiedDate: string
isEnabled: boolean
isLockedForEditing: boolean
}
}
export interface Product {
id: string
type: string
attributes: {
name: string
createdDate: string
productType: string
}
}
export interface BuildRun {
id: string
type: string
attributes: {
number: number
createdDate: string
startedDate: string
finishedDate: string
sourceCommit: {
commitSha: string
author: {
displayName: string
}
commiter: {
displayName: string
}
htmlUrl: string
}
isPullRequestBuild: boolean
executionProgress: string
completionStatus: string
}
}
export interface BuildAction {
id: string
type: string
attributes: {
name: string
actionType: string
startedDate: string
finishedDate: string
issueCounts: {
analyzerWarnings: number
errors: number
testFailures: number
warnings: number
}
executionProgress: string
executionStatus: string
isRequiredToPass: boolean
}
relationships: {} // Need more data
}
export interface ScmProvider {
type: string
attributes: {
scmProviderType: {
scmProviderType: string
displayName: string
isOnPremise: boolean
}
endpoint: string
}
}
export interface ScmRepository {
id: string
type: string
attributes: {
httpCloneUrl: string
sshCloneUrl: string
ownerName: string
repositoryName: string
}
}
export interface ScmGitReference {
id: string
type: string
attributes: {
name: string
canonicalName: string
isDeleted: boolean
kind: string
}
}
export interface XcodeCloudRequest {
webhook: Webhook
app: App
ciWorkflow: Workflow
ciProduct: Product
ciBuildRun: BuildRun
ciBuildActions: [BuildAction]
scmProvider: ScmProvider
scmRepository: ScmRepository
scmGitReference: ScmGitReference
}
@TheNightmanCodeth
Copy link
Author

NOTE: This may be incomplete. I am not, as of yet, using all of the features Xcode Cloud has to offer. I will be updating it as I go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment