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
Senden Sie diese Anfragen an Ihren eigenen laufenden Sidecar. Werte bleiben in diesem Browser.
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.
/api/projects
vcs.status Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
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
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
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/vcs/status" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" Probieren Sie es aus
vcs.log Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
| rev | abfrage | zeichenfolge | null | optional |
| limit | abfrage | zeichenfolge | null | optional |
| weg | abfrage | zeichenfolge | null | optional |
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
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
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/vcs/log" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" Probieren Sie es aus
vcs.commit Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
{ message: string authorKind?: "user" | "ai" | null files?: { [key: string]: string } | null }
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
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
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
vcs.branches Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
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
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
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/vcs/branches" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" Probieren Sie es aus
vcs.createBranch Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
{ name: string from?: string | null }
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
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
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
vcs.checkout Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
{ branch: string }
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
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
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
vcs.restore Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
{ rev: string paths?: string[] | null }
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
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
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
vcs.diff Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
| aus | abfrage | zeichenfolge | null | optional |
| bis | abfrage | zeichenfolge | erforderlich |
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
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
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/vcs/diff?to=<to>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" Probieren Sie es aus
vcs.listPullRequests Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
| zustand | abfrage | "offen" | „fusioniert“ | "geschlossen" | null | optional |
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
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
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/pulls" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" Probieren Sie es aus
vcs.openPullRequest Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
{ title: string body?: string | null head: string base?: string | null authorKind?: "user" | "ai" | null }
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
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
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
vcs.pullRequest Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
| nummer | weg | zeichenfolge | erforderlich |
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
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
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/pulls/<number>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" Probieren Sie es aus
vcs.review Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
| nummer | weg | zeichenfolge | erforderlich |
{ verdict: "comment" | "approve" | "request-changes" body?: string | null path?: string | null pointer?: string | null }
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
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
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
vcs.mergePullRequest Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
| nummer | weg | zeichenfolge | erforderlich |
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
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
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/pulls/<number>/merge" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" Probieren Sie es aus
vcs.closePullRequest Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
| nummer | weg | zeichenfolge | erforderlich |
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
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
curl --request POST "${CADCAMFUN_URL}/api/projects/<id>/pulls/<number>/close" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" Probieren Sie es aus
vcs.remote Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
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
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
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/vcs/remote" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" Probieren Sie es aus
vcs.setRemote Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
{ remote: string | null }
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
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
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
vcs.push Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
| x-github-token | kopfzeile | zeichenfolge | erforderlich |
{ branch?: string | null }
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
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
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
vcs.pull Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
| x-github-token | kopfzeile | zeichenfolge | erforderlich |
{ branch?: string | null }
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
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
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
vcs.runs Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
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
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
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/actions/runs" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" Probieren Sie es aus
vcs.dispatch Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
{ ref?: string | null }
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
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
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
vcs.listWorkflows Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
| ref | abfrage | zeichenfolge | null | optional |
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
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
curl --request GET "${CADCAMFUN_URL}/api/projects/<id>/actions/workflows" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" Probieren Sie es aus
vcs.workflow Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
| name | weg | zeichenfolge | erforderlich |
| ref | abfrage | zeichenfolge | null | optional |
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
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
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 }
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.
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
| Symptom | Wahrscheinliche Ursache | Fix |
|---|---|---|
| 401 bei jedem Aufruf | Token von einem früheren Start oder fehlt Bearer präfix | Schicken Authorization: Bearer <token> mit dem Token wurde der Sidecar gestartet. |
| 400 bevor etwas passiert | Text oder Parameter stimmen nicht mit dem Schema überein | Vergleichen Sie die Nutzlast mit dem Anforderungsschema auf der Karte. |
| 403 oder 404 bei einem Datensatz, den du woanders siehst | Das amtierende Konto ist unterschiedlich | Schicken Sie das Richtige x-session-token, oder verwenden Sie das lokale Profil, das Eigentümer des Datensatzes ist. |
| 409 | Widersprüchlicher Status, z. B. ein doppelter Name oder ein veralteter Zweigkopf | Lesen 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 bereitgestellt | Führen Sie die Dokumente lokal aus oder kopieren Sie die Anfrage als Curl. |
| Verbindung abgelehnt | Der Sidecar wurde an einem neuen Port neu gestartet | Lesen Sie den Port neu ready Zeile. |