ドキュメント
認証
アカウントのサインイン、サインアップ、リカバリ、検証、マジック リンク、セッション ルックアップ、およびパスキーの登録。
英語から自動翻訳されています。 英語の原文を見る
これらのリクエストを独自の実行中のサイドカーに送信します。値はこのブラウザ内に残ります。
仕組み
サイドカーは起動時に選択されたループバック ポートをリッスンし、それをそのポートに出力します。 ready ライン;その URL を使用し、 CADCAMFUN_TOKEN で始まりました。リクエストはこのページからそのアドレスに直接送信されます。
サイドカーは CORS ヘッダーを Tauri オリジンと http://localhost または http://127.0.0.1 どのポートでも。ホストされているドキュメントからはブラウザーが応答をブロックするため、ドキュメントをローカルで実行します (bun run dev で packages/web) プレイグラウンドを使用するか、リクエストをcurlとしてコピーします。実際のデータに触れることなく実験するには、次のようにしてサイドカーを開始します。 CADCAMFUN_DATA_DIR 使い捨てディレクトリを指す - を参照 aPI のチュートリアル.
運営
15 エンドポイント( auth サイドカー自体から生成されたグループ OpenAPIドキュメント。保護された操作には時間がかかります Authorization: Bearer $CADCAMFUN_TOKEN;見る 認証。行動と制限は次のとおりです サブシステムガイド.
| 役職 | /api/auth/identity/start | auth.identityStart |
| 役職 | /api/auth/identity/poll | auth.identityPoll |
| 役職 | /api/auth/identity/cancel | auth.identityCancel |
| 役職 | /api/auth/forgot-password | auth.forgotPassword |
| 役職 | /api/auth/reset-password | auth.resetPassword |
| 役職 | /api/auth/send-magic-link | auth.sendMagicLink |
| 役職 | /api/auth/send-verification-email | auth.sendVerificationEmail |
| 役職 | /api/auth/verify-email | auth.verifyEmail |
| 役職 | /api/auth/signout | auth.signout |
| 得る | /api/auth/get-session | auth.getSession |
| 役職 | /api/auth/signin-direct | auth.signinDirect |
| 役職 | /api/auth/signup | auth.signup |
| 役職 | /api/auth/test-direct-create | auth.testDirectCreate |
| 役職 | /api/auth/verify-magic-link | auth.verifyMagicLink |
| 役職 | /api/auth/passkey-register | auth.registerPasskey |
/api/auth/identity
auth.identityStart 必要 Authorization: Bearer <token>.
200 物体 application/json
{ id: string url: string issuer: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
例を取得する
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/auth/identity/start`, {
method: "POST",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/identity/start" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
auth.identityPoll 必要 Authorization: Bearer <token>.
{ id: string }
200 オブジェクト |オブジェクト |物体 application/json
{ status: "pending" } | { status: "complete" tokens: { access: string refresh: string expiresAt: number | "Infinity" | "-Infinity" | "NaN" } } | { status: "failed" message: string }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
例を取得する
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/auth/identity/poll`, {
method: "POST",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/identity/poll" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
auth.identityCancel 必要 Authorization: Bearer <token>.
{ id: string }
200 物体 application/json
{ success: true message: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
例を取得する
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/auth/identity/cancel`, {
method: "POST",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/identity/cancel" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/auth/forgot-password
auth.forgotPassword 必要 Authorization: Bearer <token>.
{ email?: string | null callbackURL?: string | null }
200 物体 application/json
{ success: true message: string debugResetLink?: string | null }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthForgotPasswordInput
const result = await client.auth.forgotPassword({
email: "",
callbackURL: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/forgot-password" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/auth/reset-password
auth.resetPassword 必要 Authorization: Bearer <token>.
{ token?: string | null newPassword?: string | null confirmPassword?: string | null }
200 物体 application/json
{ success: true message: string user: { id: string email: string name: string | null } }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthResetPasswordInput
const result = await client.auth.resetPassword({
token: "",
newPassword: "",
confirmPassword: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/reset-password" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/auth/send-magic-link
auth.sendMagicLink 必要 Authorization: Bearer <token>.
{ email?: string | null callbackURL?: string | null }
200 物体 application/json
{ success: true message: string debugMagicLink?: string | null }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthSendMagicLinkInput
const result = await client.auth.sendMagicLink({
email: "",
callbackURL: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/send-magic-link" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/auth/send-verification-email
auth.sendVerificationEmail 必要 Authorization: Bearer <token>.
{ email?: string | null callbackURL?: string | null }
200 物体 application/json
{ success: true message: string debug: { link: string } }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthSendVerificationEmailInput
const result = await client.auth.sendVerificationEmail({
email: "",
callbackURL: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/send-verification-email" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/auth/verify-email
auth.verifyEmail 必要 Authorization: Bearer <token>.
{ token?: string | null }
200 物体 application/json
{ success: true message: string user: { id: string email: string name: string | null emailVerified: string } }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthVerifyEmailInput
const result = await client.auth.verifyEmail({
token: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/verify-email" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/auth/signout
auth.signout 必要 Authorization: Bearer <token>.
200 物体 application/json
{ success: true message: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// no input
const result = await client.auth.signout() curl
curl --request POST "${CADCAMFUN_URL}/api/auth/signout" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
/api/auth/get-session
auth.getSession 必要 Authorization: Bearer <token>.
200 物体 application/json
{ session: { user: { id: string email: string | null name: string | null emailVerified: string | null createdAt: string updatedAt: string } expires: string sessionToken?: string | null } }
401 認証されていないエンコード済み |不正にエンコードされた application/json
AuthUnauthorizedEncoded | UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
応答例 捕獲 · 200
{
"session": {
"user": {
"id": "c942817d-0162-4291-84ff-77321d387acc",
"email": "local@cadcamfun.local",
"name": "Local user",
"emailVerified": null,
"createdAt": "2026-10-15T04:52:06.538Z",
"updatedAt": "2026-10-15T04:52:06.538Z"
},
"expires": "2026-10-22T04:52:23.311Z"
}
} SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// no input
const result = await client.auth.getSession() curl
curl --request GET "${CADCAMFUN_URL}/api/auth/get-session" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
/api/auth/signin-direct
auth.signinDirect 必要 Authorization: Bearer <token>.
{ email?: string | null password?: string | null }
200 物体 application/json
{ success: true message: string user: { id: string email: string | null name: string | null emailVerified: string | null createdAt: string } token: string }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 認証されていないエンコード済み |不正にエンコードされた application/json
AuthUnauthorizedEncoded | UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthSigninDirectInput
const result = await client.auth.signinDirect({
email: "",
password: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/signin-direct" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/auth/signup
auth.signup 必要 Authorization: Bearer <token>.
{ email?: string | null password?: string | null confirmPassword?: string | null name?: string | null }
201 物体 application/json
{ success: true message: string user: { id: string email: string | null name: string | null emailVerified: string | null createdAt: string } }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthSignupInput
const result = await client.auth.signup({
email: "",
password: "",
confirmPassword: "",
name: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/signup" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/auth/test-direct-create
auth.testDirectCreate 必要 Authorization: Bearer <token>.
{ email?: string | null password?: string | null name?: string | null }
201 物体 application/json
{ success: true message: string user: { id: string email: string | null name: string | null emailVerified: string | null createdAt: string } }
400 TestCreateBadRequestEncoded application/json
TestCreateBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 TestCreateFailureEncoded application/json
TestCreateFailureEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthTestDirectCreateInput
const result = await client.auth.testDirectCreate({
email: "",
password: "",
name: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/test-direct-create" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/auth/verify-magic-link
auth.verifyMagicLink 必要 Authorization: Bearer <token>.
{ token?: string | null }
200 物体 application/json
{ success: true message: string user: { id: string email: string | null name: string | null } token?: string | null }
400 AuthBadRequestEncoded application/json
AuthBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 AuthNotFoundEncoded application/json
AuthNotFoundEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// AuthVerifyMagicLinkInput
const result = await client.auth.verifyMagicLink({
token: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/auth/verify-magic-link" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json 試してみてください
/api/auth/passkey-register
auth.registerPasskey 必要 Authorization: Bearer <token>.
200 任意の JSON 値 application/json
unknown 401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
501 PasskeyNotImplementedEncoded application/json
PasskeyNotImplementedEncoded
SDKの例
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// no input
const result = await client.auth.registerPasskey() curl
curl --request POST "${CADCAMFUN_URL}/api/auth/passkey-register" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" 試してみてください
スキーマ
このグループのパラメータ、本体、および応答から到達可能な名前付きスキーマ。あ ? オプションのフィールドをマークします。 | null null 値が存在する可能性があるフィールドにマークを付けます。
AuthBadRequestEncoded{ _tag: "AuthBadRequest" error: string details: string }
AuthInternalEncoded{ _tag: "AuthInternal" error: string details: string }
AuthNotFoundEncoded{ _tag: "AuthNotFound" error: string details: string }
PasskeyNotImplementedEncoded{ _tag: "PasskeyNotImplemented" error: string details: string todoImplementation: { webauthn: string challengeGeneration: string credentialStorage: string userVerification: string } }
TestCreateBadRequestEncoded{ _tag: "TestCreateBadRequest" error: string }
TestCreateFailureEncoded{ _tag: "TestCreateFailure" error: string message: string }
このグループに電話をかける
オペレーション ID の形式は次のとおりです。 auth.<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 行。 |