Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dry-run-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
run: npm install
- name: Dry-run release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
run: npm install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ build
/specifications/merged.yaml
/version.txt
node_modules
/specifications/*.tgz
6 changes: 5 additions & 1 deletion api-server-stubs-ktor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ fabrikt {
}
generate("mavenConnector") {
apiFile = rootProject.layout.projectDirectory.file("redocly/bundled/maven-connector-v1.yaml")
basePackage = "org.modelix.services.maven_connector.stubs"
basePackage = "org.modelix.services.mavenconnector.stubs"
}
generate("gitConnector") {
apiFile = rootProject.layout.projectDirectory.file("redocly/bundled/git-connector-v1.yaml")
basePackage = "org.modelix.services.gitconnector.stubs"
}
generate("repository") {
apiFile = rootProject.layout.projectDirectory.file("redocly/bundled/repository-v3.yaml")
Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ fun computeVersion(): String {
} else {
val gitVersion: groovy.lang.Closure<String> by extra
gitVersion()
.replace("""\.dirty$""".toRegex(), "-dirty")
.let {
// Normalize the version so that is always a valid NPM version.
if (it.matches("""\d+\.\d+.\d+-.*""".toRegex())) it else "0.0.1-$it"
Expand Down
5 changes: 5 additions & 0 deletions redocly/redocly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ apis:
output: ./bundled/maven-connector-v1.yaml
decorators:
plugin/use-server-path: {}
git-connector@v1:
root: ../specifications/git-connector/v1/git.yaml
output: ./bundled/git-connector-v1.yaml
decorators:
plugin/use-server-path: {}
workspaces@v1:
root: ../specifications/workspaces/v1/workspaces.yaml
output: ./bundled/workspaces-v1.yaml
Expand Down
328 changes: 328 additions & 0 deletions specifications/git-connector/v1/git.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,328 @@
openapi: "3.1.0"
info:
title: "Modelix Git Connector"
version: "1.0.0"
servers:
- url: '/modelix/git-connector'
description: Import MPS project from Git repositories
tags:
- name: GitConnector
- name: GitRepositories
- name: GitBranches
- name: Drafts
paths:
/repositories/:
get:
operationId: listGitRepositories
tags: [GitRepositories]
parameters:
- name: includeStatus
in: query
required: false
schema:
type: boolean
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GitRepositoryConfigList'
post:
operationId: createGitRepository
tags: [GitRepositories]
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GitRepositoryConfig'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GitRepositoryConfig'

/repositories/{repositoryId}:
get:
operationId: getGitRepository
tags: [GitRepositories]
parameters:
- name: repositoryId
in: path
required: true
schema:
type: string
- name: includeStatus
in: query
required: false
schema:
type: boolean
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GitRepositoryConfig'
put:
operationId: updateGitRepository
tags: [GitRepositories]
parameters:
- name: repositoryId
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GitRepositoryConfig'
responses:
"200":
description: OK
delete:
operationId: deleteGitRepository
tags: [GitRepositories]
parameters:
- name: repositoryId
in: path
required: true
schema:
type: string
responses:
"200":
description: OK

/repositories/{repositoryId}/status:
get:
operationId: getGitRepositoryStatus
tags: [GitRepositories, GitBranches]
parameters:
- name: repositoryId
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GitRepositoryStatusData'

/repositories/{repositoryId}/branches/:
get:
operationId: listBranches
tags: [GitBranches]
parameters:
- name: repositoryId
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GitBranchList'

/repositories/{repositoryId}/branches/update:
post:
operationId: updateBranches
tags: [GitBranches]
parameters:
- name: repositoryId
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/GitBranchList'

/repositories/{repositoryId}/drafts/:
get:
operationId: listDraftsInRepository
tags: [Drafts]
parameters:
- name: repositoryId
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/DraftConfigList'
post:
operationId: createDraftInRepository
tags: [Drafts]
parameters:
- name: repositoryId
in: path
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DraftConfig'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/DraftConfig'

/drafts/{draftId}:
get:
operationId: getDraft
tags: [Drafts]
parameters:
- name: draftId
in: path
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/DraftConfig'
delete:
operationId: deleteDraft
tags: [Drafts]
parameters:
- name: draftId
in: path
required: true
schema:
type: string
responses:
"200":
description: OK

components:
schemas:
GitRepositoryConfigList:
type: object
required: [repositories]
properties:
repositories:
type: array
items:
$ref: '#/components/schemas/GitRepositoryConfig'

GitRepositoryConfig:
type: object
required: [id, url]
properties:
id:
type: string
format: uuid
name:
type: string
remotes:
type: array
items:
$ref: '#/components/schemas/GitRemoteConfig'
modelixRepository:
type: string
status:
$ref: '#/components/schemas/GitRepositoryStatusData'

GitRemoteConfig:
type: object
required: [name, url, hasCredentials]
properties:
name:
type: string
url:
type: string
hasCredentials:
type: boolean
credentials:
$ref: '#/components/schemas/GitCredentials'

GitCredentials:
type: object
properties:
username:
type: string
password:
type: string

GitRepositoryStatusData:
type: object
properties:
branches:
type: array
items:
$ref: '#/components/schemas/GitBranchStatusData'

GitBranchList:
type: object
required: [branches]
properties:
branches:
type: array
items:
$ref: '#/components/schemas/GitBranchStatusData'

GitBranchStatusData:
type: object
required: [remoteRepositoryName, name]
properties:
remoteRepositoryName: { type: string }
name: { type: string }
gitCommitHash: { type: string }
modelixBranchName: { type: string }
modelixCommitHash: { type: string }
lastImportedGitCommitHash: { type: string }

DraftConfigList:
type: object
required: [drafts]
properties:
drafts:
type: array
items:
$ref: '#/components/schemas/DraftConfig'

DraftConfig:
type: object
required: [id, gitRepositoryId, modelixBranchName, gitBranchName, baseGitCommit]
properties:
id: { type: string }
name: { type: string }
gitRepositoryId: { type: string }
gitBranchName: { type: string }
baseGitCommit: { type: string }
modelixBranchName: { type: string }
defaultWorkspace: { type: string }

securitySchemes:
modelixJwtAuth:
type: http
scheme: bearer
bearerFormat: JWT

security:
- modelixJwtAuth: []
Loading
Loading