コンテンツへスキップ
CADCAMFUN
ドキュメント

ドキュメント

認証

アカウントのサインイン、サインアップ、リカバリ、検証、マジック リンク、セッション ルックアップ、およびパスキーの登録。

英語から自動翻訳されています。 英語の原文を見る

プレイグラウンド

これらのリクエストを独自の実行中のサイドカーに送信します。値はこのブラウザ内に残ります。

接続されていません
仕組み

サイドカーは起動時に選択されたループバック ポートをリッスンし、それをそのポートに出力します。 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
3D での認証操作 ドラッグして周回します · スクロールしてズーム · 右ドラッグしてパンします
オペレーションごとに 1 つのブロック (15)、このページのリソース セクションごとにスタックされ、メソッドごとに色分けされます: 緑色の GET、オレンジ色の POST、青色の PUT、紫色の PATCH、赤色の DELETE。ビルド時に OpenAPI ドキュメントから生成されます。

/api/auth/identity

役職 /api/auth/identity/start # auth.identityStart

必要 Authorization: Bearer <token>.

応答
200 物体 application/json
{
  id: string
  url: string
  issuer: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 AuthInternalEncoded application/json
AuthInternalEncoded
例を取得する
auth.identityStart
// 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
POST /api/auth/identity/start
curl --request POST "${CADCAMFUN_URL}/api/auth/identity/start" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
試してみてください
役職 /api/auth/identity/poll # auth.identityPoll

必要 Authorization: Bearer <token>.

リクエスト本文 · 必須 · application/json
{
  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
例を取得する
auth.identityPoll
// 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
POST /api/auth/identity/poll
curl --request POST "${CADCAMFUN_URL}/api/auth/identity/poll" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
試してみてください
役職 /api/auth/identity/cancel # auth.identityCancel

必要 Authorization: Bearer <token>.

リクエスト本文 · 必須 · application/json
{
  id: string
}
応答
200 物体 application/json
{
  success: true
  message: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
例を取得する
auth.identityCancel
// 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
POST /api/auth/identity/cancel
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

役職 /api/auth/forgot-password # auth.forgotPassword

必要 Authorization: Bearer <token>.

リクエスト本文 · 必須 · application/json
{
  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の例
auth.forgotPassword
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
POST /api/auth/パスワードを忘れた場合
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

役職 /api/auth/reset-password # auth.resetPassword

必要 Authorization: Bearer <token>.

リクエスト本文 · 必須 · application/json
{
  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の例
auth.resetPassword
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
POST /api/auth/リセットパスワード
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-verification-email

役職 /api/auth/send-verification-email # auth.sendVerificationEmail

必要 Authorization: Bearer <token>.

リクエスト本文 · 必須 · application/json
{
  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の例
auth.sendVerificationEmail
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
POST /api/auth/send-verification-email
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

役職 /api/auth/verify-email # auth.verifyEmail

必要 Authorization: Bearer <token>.

リクエスト本文 · 必須 · application/json
{
  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の例
auth.verifyEmail
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
POST /api/auth/verify-email
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

役職 /api/auth/signout # auth.signout

必要 Authorization: Bearer <token>.

応答
200 物体 application/json
{
  success: true
  message: string
}
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
SDKの例
auth.signout
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
POST /api/auth/signout
curl --request POST "${CADCAMFUN_URL}/api/auth/signout" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
試してみてください

/api/auth/get-session

得る /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
GET /api/auth/get-session
{
  "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の例
auth.getSession
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
GET /api/auth/get-session
curl --request GET "${CADCAMFUN_URL}/api/auth/get-session" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
試してみてください

/api/auth/signin-direct

役職 /api/auth/signin-direct # auth.signinDirect

必要 Authorization: Bearer <token>.

リクエスト本文 · 必須 · application/json
{
  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の例
auth.signinDirect
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
POST /api/auth/signin-direct
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

役職 /api/auth/signup # auth.signup

必要 Authorization: Bearer <token>.

リクエスト本文 · 必須 · application/json
{
  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の例
auth.signup
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
POST /api/auth/signup
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

役職 /api/auth/test-direct-create # auth.testDirectCreate

必要 Authorization: Bearer <token>.

リクエスト本文 · 必須 · application/json
{
  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の例
auth.testDirectCreate
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
POST /api/auth/test-direct-create
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/passkey-register

役職 /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の例
auth.registerPasskey
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
POST /api/auth/passkey-register
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
}
AuthUnauthorizedEncoded
{
  _tag: "AuthUnauthorized"
  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
}
UnauthorizedEncoded
{
  _tag: "Unauthorized"
  message: string
}

このグループに電話をかける

オペレーション ID の形式は次のとおりです。 auth.<name>。生成された Promise SDK (@cadcamfun/api/sdk) それらのほとんどを次のように公開します client.<namespace>.<method>(input)、 どこ input パスパラメータとボディフィールドの 1 つのフラットオブジェクトです。各カードの SDK の例は、正確なアクセサーと入力タイプを示しています。マルチパート アップロード、バイナリまたは JavaScript 応答、生の Webhook は生成されません。それらのカードが示しているのは fetch 代わりに。

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
  }
}

トラブルシューティング

症状考えられる原因修理
呼び出しごとの 401以前の起動からのトークン、または欠落しています Bearer 接頭辞送信 Authorization: Bearer <token> サイドカーが開始されたトークンを使用します。
何も起きる前の 400本体またはパラメータがスキーマと一致しませんペイロードとカード上のリクエスト スキーマを比較します。
別の場所で見えるレコードの 403 または 404代理アカウントは異なります権利を送信します x-session-token、またはレコードを所有するローカル プロファイルを使用します。
409重複した名前や古いブランチヘッドなどの矛盾した状態リソースを再読み込みし、現在のデータで再試行します。
「CORS によってブロックされました」と表示されてみてくださいドキュメントは非ループバックオリジンから提供されますドキュメントをローカルで実行するか、リクエストをcurlとしてコピーします。
接続拒否サイドカーが新しいポートで再起動されました新しいポートからポートを読み取ります ready 行。