Zum Inhalt springen
CADCAMFUN
Doku

Dokumentation

Historie und Arbeitsabläufe

Projekt Git-kompatible Commits, Branches, Wiederherstellungen, Überprüfungen, GitHub-Spiegelung und Workflow-Versand.

Automatisch aus dem Englischen übersetzt. Englisches Original ansehen

Playground

Senden Sie diese Anfragen an Ihren eigenen laufenden Sidecar. Werte bleiben in diesem Browser.

Nicht verbunden
Wie das funktioniert

Der Sidecar lauscht an einem beim Start ausgewählten Loopback-Port und gibt ihn dort aus ready linie; Verwenden Sie diese URL und die CADCAMFUN_TOKEN es wurde damit begonnen. Anfragen gehen direkt von dieser Seite an diese Adresse.

Der Sidecar sendet CORS-Header nur an die Tauri-Ursprünge und an http://localhost oder http://127.0.0.1 auf jedem Port. Von den gehosteten Dokumenten aus blockiert der Browser die Antwort, also führen Sie die Dokumente lokal aus (bun run dev in packages/web), um den Spielplatz zu nutzen, oder kopieren Sie die Anfrage als Curl. Um zu experimentieren, ohne echte Daten zu berühren, starten Sie den Sidecar mit CADCAMFUN_DATA_DIR zeigte auf ein Wegwerfverzeichnis – siehe die API-Komplettlösung.

Operationen

22 Endpunkte in der vcs gruppe, generiert aus der eigenen Gruppe des Sidecars OpenAPI-Dokument. Geschützte Operationen dauern Authorization: Bearer $CADCAMFUN_TOKEN; sehen authentifizierung. Verhalten und Grenzen sind in das Subsystemhandbuch.

erhalten /api/projects/{id}/vcs/status vcs.status
erhalten /api/projects/{id}/vcs/log vcs.log
post /api/projects/{id}/vcs/commit vcs.commit
erhalten /api/projects/{id}/vcs/branches vcs.branches
post /api/projects/{id}/vcs/branches vcs.createBranch
post /api/projects/{id}/vcs/checkout vcs.checkout
post /api/projects/{id}/vcs/restore vcs.restore
erhalten /api/projects/{id}/vcs/diff vcs.diff
erhalten /api/projects/{id}/pulls vcs.listPullRequests
post /api/projects/{id}/pulls vcs.openPullRequest
erhalten /api/projects/{id}/pulls/{number} vcs.pullRequest
post /api/projects/{id}/pulls/{number}/reviews vcs.review
post /api/projects/{id}/pulls/{number}/merge vcs.mergePullRequest
post /api/projects/{id}/pulls/{number}/close vcs.closePullRequest
erhalten /api/projects/{id}/vcs/remote vcs.remote
setzen /api/projects/{id}/vcs/remote vcs.setRemote
post /api/projects/{id}/vcs/push vcs.push
post /api/projects/{id}/vcs/pull vcs.pull
erhalten /api/projects/{id}/actions/runs vcs.runs
post /api/projects/{id}/actions/dispatch vcs.dispatch
erhalten /api/projects/{id}/actions/workflows vcs.listWorkflows
erhalten /api/projects/{id}/actions/workflows/{name} vcs.workflow
Verlaufs- und Workflowvorgänge in 3D Zum Orbit ziehen · zum Zoomen scrollen · zum Schwenken mit der rechten Maustaste ziehen
Ein Block pro Vorgang (22), gestapelt pro Ressourcenabschnitt dieser Seite und nach Methode gefärbt: grün GET, orange POST, blau PUT, violett PATCH, rot DELETE. Wird zur Erstellungszeit aus dem OpenAPI-Dokument generiert.

/api/projects

erhalten /api/projects/{id}/vcs/status # vcs.status

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
Antworten
200 objekt application/json
{
  branch: string
  head: string | null
  dirty: string[]
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.status
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsStatusInput
const result = await client.vcs.status({
  id: "<id>"
})
curl
GET /api/projects/{id}/vcs/status
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/vcs/status" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus
erhalten /api/projects/{id}/vcs/log # vcs.log

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
rev abfrage zeichenfolge | null optional
limit abfrage zeichenfolge | null optional
weg abfrage zeichenfolge | null optional
Antworten
200 Array<Objekt> application/json
Array<{
  oid: string
  parents: string[]
  message: string
  author: {
    name: string
    email: string
    time: number | "Infinity" | "-Infinity" | "NaN"
  }
}>
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.log
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsLogInput
const result = await client.vcs.log({
  id: "<id>"
})
curl
GET /api/projects/{id}/vcs/log
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/vcs/log" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus
post /api/projects/{id}/vcs/commit # vcs.commit

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
Anforderungstext · erforderlich · application/json
{
  message: string
  authorKind?: "user" | "ai" | null
  files?: {
    [key: string]: string
  } | null
}
Antworten
201 objekt application/json
{
  oid: string
  parents: string[]
  message: string
  author: {
    name: string
    email: string
    time: number | "Infinity" | "-Infinity" | "NaN"
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.commit
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsCommitInput
const result = await client.vcs.commit({
  id: "<id>",
  message: "",
  authorKind: "user",
  files: {}
})
curl
POST /api/projects/{id}/vcs/commit
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/vcs/commit" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Probieren Sie es aus
erhalten /api/projects/{id}/vcs/branches # vcs.branches

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
Antworten
200 objekt application/json
{
  current: string
  branches: {
    [key: string]: string
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.branches
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsBranchesInput
const result = await client.vcs.branches({
  id: "<id>"
})
curl
GET /api/projects/{id}/vcs/branches
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/vcs/branches" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus
post /api/projects/{id}/vcs/branches # vcs.createBranch

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
Anforderungstext · erforderlich · application/json
{
  name: string
  from?: string | null
}
Antworten
201 objekt application/json
{
  current: string
  branches: {
    [key: string]: string
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.createBranch
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsCreateBranchInput
const result = await client.vcs.createBranch({
  id: "<id>",
  name: "",
  from: ""
})
curl
POST /api/projects/{id}/vcs/branches
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/vcs/branches" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Probieren Sie es aus
post /api/projects/{id}/vcs/checkout # vcs.checkout

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
Anforderungstext · erforderlich · application/json
{
  branch: string
}
Antworten
200 objekt application/json
{
  branch: string
  head: string | null
  dirty: string[]
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.checkout
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsCheckoutInput
const result = await client.vcs.checkout({
  id: "<id>",
  branch: ""
})
curl
POST /api/projects/{id}/vcs/checkout
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/vcs/checkout" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Probieren Sie es aus
post /api/projects/{id}/vcs/restore # vcs.restore

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
Anforderungstext · erforderlich · application/json
{
  rev: string
  paths?: string[] | null
}
Antworten
200 objekt application/json
{
  oid: string
  parents: string[]
  message: string
  author: {
    name: string
    email: string
    time: number | "Infinity" | "-Infinity" | "NaN"
  }
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.restore
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsRestoreInput
const result = await client.vcs.restore({
  id: "<id>",
  rev: "",
  paths: [
    ""
  ]
})
curl
POST /api/projects/{id}/vcs/restore
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/vcs/restore" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Probieren Sie es aus
erhalten /api/projects/{id}/vcs/diff # vcs.diff

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
aus abfrage zeichenfolge | null optional
bis abfrage zeichenfolge erforderlich
Antworten
200 Array<Objekt> application/json
Array<{
  path: string
  kind: "drawings" | "components" | "toolpaths" | "materials" | "tools" | "machine-configs" | "costs" | "project" | "other"
  id?: string | null
  name?: string | null
  status: "added" | "modified" | "deleted"
  changes: Array<{
    pointer: string
    before?: unknown | null
    after?: unknown | null
  }>
}>
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.diff
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsDiffInput
const result = await client.vcs.diff({
  id: "<id>"
})
curl
GET /api/projects/{id}/vcs/diff
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/vcs/diff?to=<to>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus
erhalten /api/projects/{id}/pulls # vcs.listPullRequests

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
zustand abfrage "offen" | „fusioniert“ | "geschlossen" | null optional
Antworten
200 Array<Objekt> application/json
Array<{
  id: string
  projectId: string
  number: number | "Infinity" | "-Infinity" | "NaN"
  title: string
  body: string
  head: string
  base: string
  state: "open" | "merged" | "closed"
  authorId: string
  authorKind: "user" | "ai"
  mergeCommit: string | null
  remoteNumber: number | "Infinity" | "-Infinity" | "NaN" | null
  createdAt: string
  updatedAt: string
}>
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.listPullRequests
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsListPullRequestsInput
const result = await client.vcs.listPullRequests({
  id: "<id>"
})
curl
GET /api/projects/{id}/pulls
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/pulls" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus
post /api/projects/{id}/pulls # vcs.openPullRequest

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
Anforderungstext · erforderlich · application/json
{
  title: string
  body?: string | null
  head: string
  base?: string | null
  authorKind?: "user" | "ai" | null
}
Antworten
201 objekt application/json
{
  id: string
  projectId: string
  number: number | "Infinity" | "-Infinity" | "NaN"
  title: string
  body: string
  head: string
  base: string
  state: "open" | "merged" | "closed"
  authorId: string
  authorKind: "user" | "ai"
  mergeCommit: string | null
  remoteNumber: number | "Infinity" | "-Infinity" | "NaN" | null
  createdAt: string
  updatedAt: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.openPullRequest
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsOpenPullRequestInput
const result = await client.vcs.openPullRequest({
  id: "<id>",
  title: "",
  body: "",
  head: "",
  base: "",
  authorKind: "user"
})
curl
POST /api/projects/{id}/pulls
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/pulls" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Probieren Sie es aus
erhalten /api/projects/{id}/pulls/{number} # vcs.pullRequest

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
nummer weg zeichenfolge erforderlich
Antworten
200 objekt application/json
{
  pullRequest: {
    id: string
    projectId: string
    number: number | "Infinity" | "-Infinity" | "NaN"
    title: string
    body: string
    head: string
    base: string
    state: "open" | "merged" | "closed"
    authorId: string
    authorKind: "user" | "ai"
    mergeCommit: string | null
    remoteNumber: number | "Infinity" | "-Infinity" | "NaN" | null
    createdAt: string
    updatedAt: string
  }
  reviews: Array<{
    id: string
    pullRequestId: string
    reviewerId: string
    verdict: "comment" | "approve" | "request-changes"
    body: string
    path: string | null
    pointer: string | null
    createdAt: string
  }>
  changes: Array<{
    path: string
    kind: "drawings" | "components" | "toolpaths" | "materials" | "tools" | "machine-configs" | "costs" | "project" | "other"
    id?: string | null
    name?: string | null
    status: "added" | "modified" | "deleted"
    changes: Array<{
      pointer: string
      before?: unknown | null
      after?: unknown | null
    }>
  }>
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.pullRequest
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsPullRequestInput
const result = await client.vcs.pullRequest({
  id: "<id>",
  number: "<number>"
})
curl
GET /api/projects/{id}/pulls/{number}
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/pulls/<number>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus
post /api/projects/{id}/pulls/{number}/reviews # vcs.review

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
nummer weg zeichenfolge erforderlich
Anforderungstext · erforderlich · application/json
{
  verdict: "comment" | "approve" | "request-changes"
  body?: string | null
  path?: string | null
  pointer?: string | null
}
Antworten
201 objekt application/json
{
  id: string
  pullRequestId: string
  reviewerId: string
  verdict: "comment" | "approve" | "request-changes"
  body: string
  path: string | null
  pointer: string | null
  createdAt: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.review
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsReviewInput
const result = await client.vcs.review({
  id: "<id>",
  number: "<number>",
  verdict: "comment",
  body: "",
  path: "",
  pointer: ""
})
curl
POST /api/projects/{id}/pulls/{number}/reviews
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/pulls/<number>/reviews" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Probieren Sie es aus
post /api/projects/{id}/pulls/{number}/merge # vcs.mergePullRequest

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
nummer weg zeichenfolge erforderlich
Antworten
200 objekt application/json
{
  id: string
  projectId: string
  number: number | "Infinity" | "-Infinity" | "NaN"
  title: string
  body: string
  head: string
  base: string
  state: "open" | "merged" | "closed"
  authorId: string
  authorKind: "user" | "ai"
  mergeCommit: string | null
  remoteNumber: number | "Infinity" | "-Infinity" | "NaN" | null
  createdAt: string
  updatedAt: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.mergePullRequest
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsMergePullRequestInput
const result = await client.vcs.mergePullRequest({
  id: "<id>",
  number: "<number>"
})
curl
POST /api/projects/{id}/pulls/{number}/merge
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/pulls/<number>/merge" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus
post /api/projects/{id}/pulls/{number}/close # vcs.closePullRequest

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
nummer weg zeichenfolge erforderlich
Antworten
200 objekt application/json
{
  id: string
  projectId: string
  number: number | "Infinity" | "-Infinity" | "NaN"
  title: string
  body: string
  head: string
  base: string
  state: "open" | "merged" | "closed"
  authorId: string
  authorKind: "user" | "ai"
  mergeCommit: string | null
  remoteNumber: number | "Infinity" | "-Infinity" | "NaN" | null
  createdAt: string
  updatedAt: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.closePullRequest
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsClosePullRequestInput
const result = await client.vcs.closePullRequest({
  id: "<id>",
  number: "<number>"
})
curl
POST /api/projects/{id}/pulls/{number}/close
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/pulls/<number>/close" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus
erhalten /api/projects/{id}/vcs/remote # vcs.remote

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
Antworten
200 objekt application/json
{
  remote: string | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.remote
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsRemoteInput
const result = await client.vcs.remote({
  id: "<id>"
})
curl
GET /api/projects/{id}/vcs/remote
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/vcs/remote" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus
setzen /api/projects/{id}/vcs/remote # vcs.setRemote

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
Anforderungstext · erforderlich · application/json
{
  remote: string | null
}
Antworten
200 objekt application/json
{
  remote: string | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.setRemote
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsSetRemoteInput
const result = await client.vcs.setRemote({
  id: "<id>",
  remote: ""
})
curl
PUT /api/projects/{id}/vcs/remote
curl --request PUT "${CADCAMFUN_URL}/api/projects/<id>/vcs/remote" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Probieren Sie es aus
post /api/projects/{id}/vcs/push # vcs.push

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
x-github-token kopfzeile zeichenfolge erforderlich
Anforderungstext · erforderlich · application/json
{
  branch?: string | null
}
Antworten
200 objekt application/json
{
  oid: string
  objects: number | "Infinity" | "-Infinity" | "NaN"
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.push
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsPushInput
const result = await client.vcs.push({
  id: "<id>",
  branch: ""
})
curl
POST /api/projects/{id}/vcs/push
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/vcs/push" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Probieren Sie es aus
post /api/projects/{id}/vcs/pull # vcs.pull

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
x-github-token kopfzeile zeichenfolge erforderlich
Anforderungstext · erforderlich · application/json
{
  branch?: string | null
}
Antworten
200 objekt application/json
{
  kind: string
  oid: string
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.pull
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsPullInput
const result = await client.vcs.pull({
  id: "<id>",
  branch: ""
})
curl
POST /api/projects/{id}/vcs/pull
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/vcs/pull" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Probieren Sie es aus
erhalten /api/projects/{id}/actions/runs # vcs.runs

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
Antworten
200 Array<Objekt> application/json
Array<{
  id: string
  projectId: string
  workflow: string
  event: "push" | "pull-request" | "manual"
  ref: string
  sha: string
  status: "queued" | "running" | "success" | "failure"
  events: unknown[]
  startedAt: string
  finishedAt: string | null
}>
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.runs
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsRunsInput
const result = await client.vcs.runs({
  id: "<id>"
})
curl
GET /api/projects/{id}/actions/runs
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/actions/runs" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus
post /api/projects/{id}/actions/dispatch # vcs.dispatch

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
Anforderungstext · erforderlich · application/json
{
  ref?: string | null
}
Antworten
200 Array<Objekt> application/json
Array<{
  id: string
  projectId: string
  workflow: string
  event: "push" | "pull-request" | "manual"
  ref: string
  sha: string
  status: "queued" | "running" | "success" | "failure"
  events: unknown[]
  startedAt: string
  finishedAt: string | null
}>
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.dispatch
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsDispatchInput
const result = await client.vcs.dispatch({
  id: "<id>",
  ref: ""
})
curl
POST /api/projects/{id}/actions/dispatch
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/actions/dispatch" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Probieren Sie es aus
erhalten /api/projects/{id}/actions/workflows # vcs.listWorkflows

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
ref abfrage zeichenfolge | null optional
Antworten
200 Array<Objekt> application/json
Array<{
  name: string
  path: string
  content: string
  problem?: string | null
}>
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.listWorkflows
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsListWorkflowsInput
const result = await client.vcs.listWorkflows({
  id: "<id>"
})
curl
GET /api/projects/{id}/actions/workflows
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/actions/workflows" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus
erhalten /api/projects/{id}/actions/workflows/{name} # vcs.workflow

Erfordert Authorization: Bearer <token>.

Parameter
NameInTypErforderlich
ausweis weg zeichenfolge erforderlich
name weg zeichenfolge erforderlich
ref abfrage zeichenfolge | null optional
Antworten
200 objekt application/json
{
  name: string
  path: string
  content: string
  problem?: string | null
}
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
409 ConflictEncoded application/json
ConflictEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDK-Beispiel
vcs.workflow
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// VcsWorkflowInput
const result = await client.vcs.workflow({
  id: "<id>",
  name: "<name>"
})
curl
GET /api/projects/{id}/actions/workflows/{name}
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/actions/workflows/<name>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Probieren Sie es aus

Schemata

Benannte Schemata, die über die Parameter, Körper und Antworten dieser Gruppe erreichbar sind. A ? markiert ein optionales Feld; | null markiert ein Feld, das möglicherweise mit einem Nullwert vorhanden ist.

BadRequestEncoded
{
  _tag: "BadRequest"
  message: string
}
ConflictEncoded
{
  _tag: "Conflict"
  message: string
}
ForbiddenEncoded
{
  _tag: "Forbidden"
  message: string
}
InternalErrorEncoded
{
  _tag: "InternalError"
  message: string
}
NotFoundEncoded
{
  _tag: "NotFound"
  message: string
}
UnauthorizedEncoded
{
  _tag: "Unauthorized"
  message: string
}

Ich rufe diese Gruppe an

Vorgangs-IDs haben die Form vcs.<name>. Das generierte Promise SDK (@cadcamfun/api/sdk) entlarvt die meisten von ihnen als client.<namespace>.<method>(input), wo input ist ein flaches Objekt aus Pfadparametern und Körperfeldern; Das SDK-Beispiel jeder Karte zeigt den genauen Zugriffs- und Eingabetyp. Mehrteilige Uploads, Binär- oder JavaScript-Antworten und unformatierte Webhooks werden nicht generiert; Diese Karten zeigen fetch stattdessen.

Fehler vom Promise SDK
import { CadCam, ClientError } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

try {
  await client.projects.list()
} catch (error) {
  if (error instanceof ClientError) {
    // Transport | UnexpectedStatus | UnsupportedContentType | MalformedResponse | SseEventTooLarge
  } else {
    // a declared error body: switch on error._tag
  }
}

Fehlerbehebung

SymptomWahrscheinliche UrsacheFix
401 bei jedem AufrufToken von einem früheren Start oder fehlt Bearer präfixSchicken Authorization: Bearer <token> mit dem Token wurde der Sidecar gestartet.
400 bevor etwas passiertText oder Parameter stimmen nicht mit dem Schema übereinVergleichen Sie die Nutzlast mit dem Anforderungsschema auf der Karte.
403 oder 404 bei einem Datensatz, den du woanders siehstDas amtierende Konto ist unterschiedlichSchicken Sie das Richtige x-session-token, oder verwenden Sie das lokale Profil, das Eigentümer des Datensatzes ist.
409Widersprüchlicher Status, z. B. ein doppelter Name oder ein veralteter ZweigkopfLesen Sie die Ressource erneut und versuchen Sie es erneut mit den aktuellen Daten.
Versuchen Sie es mit der Meldung „Von CORS blockiert“.Die Dokumente werden von einem Nicht-Loopback-Ursprung bereitgestelltFühren Sie die Dokumente lokal aus oder kopieren Sie die Anfrage als Curl.
Verbindung abgelehntDer Sidecar wurde an einem neuen Port neu gestartetLesen Sie den Port neu ready Zeile.