ドキュメント
ツールパス履歴
ツールパスのバージョン、復元、ライブラリの検出、およびスレッド化されたプログラムのコメント。
英語から自動翻訳されています。 英語の原文を見る
これらのリクエストを独自の実行中のサイドカーに送信します。値はこのブラウザ内に残ります。
仕組み
サイドカーは起動時に選択されたループバック ポートをリッスンし、それをそのポートに出力します。 ready ライン;その URL を使用し、 CADCAMFUN_TOKEN で始まりました。リクエストはこのページからそのアドレスに直接送信されます。
サイドカーは CORS ヘッダーを Tauri オリジンと http://localhost または http://127.0.0.1 どのポートでも。ホストされているドキュメントからはブラウザーが応答をブロックするため、ドキュメントをローカルで実行します (bun run dev で packages/web) プレイグラウンドを使用するか、リクエストをcurlとしてコピーします。実際のデータに触れることなく実験するには、次のようにしてサイドカーを開始します。 CADCAMFUN_DATA_DIR 使い捨てディレクトリを指す - を参照 aPI のチュートリアル.
運営
8 エンドポイント( toolpathExtras サイドカー自体から生成されたグループ OpenAPIドキュメント。保護された操作には時間がかかります Authorization: Bearer $CADCAMFUN_TOKEN;見る 認証。行動と制限は次のとおりです サブシステムガイド.
| 得る | /api/toolpaths/library | toolpathExtras.library |
| 得る | /api/toolpaths/{id}/versions | toolpathExtras.listVersions |
| 役職 | /api/toolpaths/{id}/versions | toolpathExtras.createVersion |
| 役職 | /api/toolpaths/{id}/versions/restore | toolpathExtras.restoreVersion |
| 得る | /api/toolpaths/{id}/comments | toolpathExtras.listComments |
| 役職 | /api/toolpaths/{id}/comments | toolpathExtras.createComment |
| 置く | /api/toolpaths/{id}/comments/{commentId} | toolpathExtras.updateComment |
| 消去 | /api/toolpaths/{id}/comments/{commentId} | toolpathExtras.removeComment |
/api/toolpaths/library
toolpathExtras.library 必要 Authorization: Bearer <token>.
| 名前 | で | タイプ | 必須 |
|---|---|---|---|
| projectId | クエリ | 弦 | 必須 |
| タイプ | クエリ | 弦 | null | オプション |
| operationType | クエリ | 弦 | null | オプション |
| カテゴリ | クエリ | 弦 | null | オプション |
| 検索 | クエリ | 弦 | null | オプション |
200 配列<オブジェクト> application/json
Array<{ id: string name: string description: string type: string operationType: string category: string tags: string[] data: unknown gcode: string projectId: string }>
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ToolpathExtrasLibraryInput
const result = await client.toolpathExtras.library({}) curl
curl --request GET "${CADCAMFUN_URL}/api/toolpaths/library?projectId=<projectId>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
/api/toolpaths
toolpathExtras.listVersions 必要 Authorization: Bearer <token>.
| 名前 | で | タイプ | 必須 |
|---|---|---|---|
| iD | パス | 弦 | 必須 |
200 配列<オブジェクト> application/json
Array<{ id: string toolpathId: string data: unknown gcode: string | null changeMessage: string | null userId: string createdAt: string user: { name: string | null email: string | null } | null }>
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ToolpathExtrasListVersionsInput
const result = await client.toolpathExtras.listVersions({
id: "<id>"
}) curl
curl --request GET "${CADCAMFUN_URL}/api/toolpaths/<id>/versions" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
toolpathExtras.createVersion 必要 Authorization: Bearer <token>.
| 名前 | で | タイプ | 必須 |
|---|---|---|---|
| iD | パス | 弦 | 必須 |
{ data?: unknown | null gcode?: string | null changeMessage?: string | null }
201 物体 application/json
{ id: string toolpathId: string data: unknown gcode: string | null changeMessage: string | null userId: string createdAt: string message: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ToolpathExtrasCreateVersionInput
const result = await client.toolpathExtras.createVersion({
id: "<id>",
data: null,
gcode: "",
changeMessage: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/toolpaths/<id>/versions" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
toolpathExtras.restoreVersion 必要 Authorization: Bearer <token>.
| 名前 | で | タイプ | 必須 |
|---|---|---|---|
| iD | パス | 弦 | 必須 |
{ versionId: string }
200 物体 application/json
{ id: string name: string description: string | null data: unknown type: string | null operationType: string | null gcode: string | null thumbnail: string | null isPublic: boolean projectId: string createdAt: string updatedAt: string createdBy: string drawingId: string | null materialId: string | null toolId: string | null machineConfigId: string | null message: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ToolpathExtrasRestoreVersionInput
const result = await client.toolpathExtras.restoreVersion({
id: "<id>",
versionId: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/toolpaths/<id>/versions/restore" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
toolpathExtras.listComments 必要 Authorization: Bearer <token>.
| 名前 | で | タイプ | 必須 |
|---|---|---|---|
| iD | パス | 弦 | 必須 |
200 配列<オブジェクト> application/json
Array<{ id: string toolpathId: string content: string userId: string createdAt: string updatedAt: string user: { id: string name: string | null email: string | null image: string | null } | null }>
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ToolpathExtrasListCommentsInput
const result = await client.toolpathExtras.listComments({
id: "<id>"
}) curl
curl --request GET "${CADCAMFUN_URL}/api/toolpaths/<id>/comments" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
toolpathExtras.createComment 必要 Authorization: Bearer <token>.
| 名前 | で | タイプ | 必須 |
|---|---|---|---|
| iD | パス | 弦 | 必須 |
{ content: string }
201 物体 application/json
{ id: string toolpathId: string content: string userId: string createdAt: string updatedAt: string user: { id: string name: string | null email: string | null image: string | null } | null }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ToolpathExtrasCreateCommentInput
const result = await client.toolpathExtras.createComment({
id: "<id>",
content: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/toolpaths/<id>/comments" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
toolpathExtras.updateComment 必要 Authorization: Bearer <token>.
| 名前 | で | タイプ | 必須 |
|---|---|---|---|
| iD | パス | 弦 | 必須 |
| commentId | パス | 弦 | 必須 |
{ content: string }
200 物体 application/json
{ id: string toolpathId: string content: string userId: string createdAt: string updatedAt: string user: { id: string name: string | null email: string | null image: string | null } | null }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ToolpathExtrasUpdateCommentInput
const result = await client.toolpathExtras.updateComment({
id: "<id>",
commentId: "<commentId>",
content: ""
}) curl
curl --request PUT "${CADCAMFUN_URL}/api/toolpaths/<id>/comments/<commentId>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
toolpathExtras.removeComment 必要 Authorization: Bearer <token>.
| 名前 | で | タイプ | 必須 |
|---|---|---|---|
| iD | パス | 弦 | 必須 |
| commentId | パス | 弦 | 必須 |
200 物体 application/json
{ message: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ToolpathExtrasRemoveCommentInput
const result = await client.toolpathExtras.removeComment({
id: "<id>",
commentId: "<commentId>"
}) curl
curl --request DELETE "${CADCAMFUN_URL}/api/toolpaths/<id>/comments/<commentId>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
スキーマ
このグループのパラメータ、本体、および応答から到達可能な名前付きスキーマ。あ ? オプションのフィールドをマークします。 | null null 値が存在する可能性があるフィールドにマークを付けます。
BadRequestEncoded{ _tag: "BadRequest" message: string }
ForbiddenEncoded{ _tag: "Forbidden" message: string }
InternalErrorEncoded{ _tag: "InternalError" message: string }
NotFoundEncoded{ _tag: "NotFound" message: string }
このグループに電話をかける
オペレーション ID の形式は次のとおりです。 toolpathExtras.<name>。生成された Promise SDK (@cadcamfun/api/sdk) それらのほとんどを次のように公開します client.<namespace>.<method>(input)、 どこ input パスパラメータとボディフィールドの 1 つのフラットオブジェクトです。各カードの SDK の例は、正確なアクセサーと入力タイプを示しています。マルチパート アップロード、バイナリまたは JavaScript 応答、生の Webhook は生成されません。それらのカードが示しているのは fetch 代わりに。
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
}
} トラブルシューティング
| 症状 | 考えられる原因 | 修理 |
|---|---|---|
| 呼び出しごとの 401 | 以前の起動からのトークン、または欠落しています Bearer 接頭辞 | 送信 Authorization: Bearer <token> サイドカーが開始されたトークンを使用します。 |
| 何も起きる前の 400 | 本体またはパラメータがスキーマと一致しません | ペイロードとカード上のリクエスト スキーマを比較します。 |
| 別の場所で見えるレコードの 403 または 404 | 代理アカウントは異なります | 権利を送信します x-session-token、またはレコードを所有するローカル プロファイルを使用します。 |
| 409 | 重複した名前や古いブランチヘッドなどの矛盾した状態 | リソースを再読み込みし、現在のデータで再試行します。 |
| 「CORS によってブロックされました」と表示されてみてください | ドキュメントは非ループバックオリジンから提供されます | ドキュメントをローカルで実行するか、リクエストをcurlとしてコピーします。 |
| 接続拒否 | サイドカーが新しいポートで再起動されました | 新しいポートからポートを読み取ります ready 行。 |