दस्तावेज़
उपयोगकर्ताओं
प्रोफ़ाइल, खाता संसाधन, एपीआई कुंजी, टोकन रिकॉर्ड, पासवर्ड और खाता हटाना।
स्वचालित अनुवाद अभी उपलब्ध नहीं है; पाठ अंग्रेज़ी में है और इंटरफ़ेस आपकी भाषा में है। अंग्रेज़ी मूल देखें
इन अनुरोधों को अपने स्वयं के चल रहे साइडकार को भेजें। मान इस ब्राउज़र में रहते हैं.
यह कैसे काम करता है
साइडकार स्टार्टअप पर चुने गए लूपबैक पोर्ट पर सुनता है और इसे प्रिंट करता है ready रेखा; उस यूआरएल का उपयोग करें और CADCAMFUN_TOKEN इसकी शुरुआत की गई थी. अनुरोध सीधे इस पृष्ठ से उस पते पर जाते हैं।
साइडकार CORS हेडर को केवल टौरी मूल और तक भेजता है http://localhost या http://127.0.0.1 किसी भी बंदरगाह पर. होस्ट किए गए दस्तावेज़ों से ब्राउज़र प्रतिक्रिया को अवरुद्ध कर देता है, इसलिए दस्तावेज़ों को स्थानीय रूप से चलाएँ (bun run dev में packages/web) खेल के मैदान का उपयोग करने के लिए, या अनुरोध को कर्ल के रूप में कॉपी करें। वास्तविक डेटा को छुए बिना प्रयोग करने के लिए, साइडकार से शुरुआत करें CADCAMFUN_DATA_DIR एक बेकार निर्देशिका की ओर इशारा किया - देखें एपीआई वॉकथ्रू.
संचालन
18 एंडपॉइंट user समूह, साइडकार के स्वयं से उत्पन्न ओपनएपीआई दस्तावेज़. संरक्षित संचालन लेते हैं Authorization: Bearer $CADCAMFUN_TOKEN; देखना प्रमाणीकरण. व्यवहार और मर्यादा में हैं सबसिस्टम गाइड.
| पाना | /api/user/profile | user.profile |
| रखना | /api/user/profile | user.updateProfile |
| पाना | /api/user/stats | user.stats |
| पाना | /api/user/components | user.components |
| पाना | /api/user/projects | user.projects |
| पाना | /api/user/toolpaths | user.toolpaths |
| पाना | /api/user/organizations | user.organizations |
| पाना | /api/user/api-keys | user.apiKeys |
| डाक | /api/user/api-keys | user.createApiKey |
| मिटाना | /api/user/api-keys | user.revokeApiKey |
| मिटाना | /api/user/delete-account | user.deleteAccount |
| रखना | /api/user/password | user.password |
| पाना | /api/user/tokens | user.tokens |
| डाक | /api/user/tokens | user.createToken |
| पाना | /api/user/verify-change | user.verifyChange |
| पाना | /api/user/git-profile | user.gitProfile |
| रखना | /api/user/git-profile | user.updateGitProfile |
| पाना | /api/user/{id} | user.byId |
/api/user/profile
user.profile आवश्यक है Authorization: Bearer <token>.
200 वस्तु application/json
{ id: string name: string | null email: string | null image: string | null bio: string | null location: string | null website: string | null company: string | null title: string | null publicProfile: boolean showEmail: boolean createdAt: string _count: { projects: number | "Infinity" | "-Infinity" | "NaN" } }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
{
"id": "c942817d-0162-4291-84ff-77321d387acc",
"name": "Local user",
"email": "local@cadcamfun.local",
"image": null,
"bio": null,
"location": null,
"website": null,
"company": null,
"title": null,
"publicProfile": true,
"showEmail": false,
"createdAt": "2026-10-15T04:52:06.538Z",
"_count": {
"projects": 0
}
} एसडीके उदाहरण
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.user.profile() curl
curl --request GET "${CADCAMFUN_URL}/api/user/profile" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
user.updateProfile आवश्यक है Authorization: Bearer <token>.
{ name?: string | null bio?: string | null location?: string | null website?: string | null company?: string | null title?: string | null publicProfile?: string | null showEmail?: string | null profileImage?: string[] | null }
200 वस्तु application/json
{ message: string user: { id: string name: string | null email: string | null image: string | null bio: string | null location: string | null website: string | null company: string | null title: string | null publicProfile: boolean showEmail: boolean updatedAt: string } name: string | null email: string | null image: string | null }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण लाओ
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/user/profile`, {
method: "PUT",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request PUT "${CADCAMFUN_URL}/api/user/profile" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: multipart/form-data" \
--data-binary @request-body इसे अजमाएं
यह ऑपरेशन मल्टीपार्ट/फॉर्म-डेटा लेता है; कर्ल या फ़ेच उदाहरण का उपयोग करें।
/api/user/stats
user.stats आवश्यक है Authorization: Bearer <token>.
200 वस्तु application/json
{ projectsCount: number | "Infinity" | "-Infinity" | "NaN" drawingsCount: number | "Infinity" | "-Infinity" | "NaN" toolpathsCount: number | "Infinity" | "-Infinity" | "NaN" componentsCount: number | "Infinity" | "-Infinity" | "NaN" totalDesigns: number | "Infinity" | "-Infinity" | "NaN" memberSince: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 KeyedInternalEncoded application/json
KeyedInternalEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
{
"projectsCount": 0,
"drawingsCount": 0,
"toolpathsCount": 0,
"componentsCount": 0,
"totalDesigns": 0,
"memberSince": "2026-10-15T04:52:06.538Z"
} एसडीके उदाहरण
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.user.stats() curl
curl --request GET "${CADCAMFUN_URL}/api/user/stats" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
/api/user/components
user.components आवश्यक है Authorization: Bearer <token>.
200 सारणी<ऑब्जेक्ट> application/json
Array<{ id: string name: string description: string | null createdAt: string updatedAt: string thumbnail: string | null projectId: string | null }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
[] एसडीके उदाहरण
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.user.components() curl
curl --request GET "${CADCAMFUN_URL}/api/user/components" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
/api/user/projects
user.projects आवश्यक है Authorization: Bearer <token>.
200 सारणी<ऑब्जेक्ट> application/json
Array<{ id: string name: string description: string | null createdAt: string updatedAt: string }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
[] एसडीके उदाहरण
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.user.projects() curl
curl --request GET "${CADCAMFUN_URL}/api/user/projects" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
/api/user/toolpaths
user.toolpaths आवश्यक है Authorization: Bearer <token>.
200 सारणी<ऑब्जेक्ट> application/json
Array<{ id: string name: string description: string | null createdAt: string updatedAt: string thumbnail: string | null projectId: string | null }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
[] एसडीके उदाहरण
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.user.toolpaths() curl
curl --request GET "${CADCAMFUN_URL}/api/user/toolpaths" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
/api/user/organizations
user.organizations आवश्यक है Authorization: Bearer <token>.
200 सारणी<ऑब्जेक्ट> application/json
Array<{ id: string name: string description: string | null createdAt: string updatedAt: string role: string userCount: number | "Infinity" | "-Infinity" | "NaN" projectCount: number | "Infinity" | "-Infinity" | "NaN" }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
[] एसडीके उदाहरण
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.user.organizations() curl
curl --request GET "${CADCAMFUN_URL}/api/user/organizations" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
/api/user/api-keys
user.apiKeys आवश्यक है Authorization: Bearer <token>.
200 सारणी<ऑब्जेक्ट> application/json
Array<{ id: string name: string createdAt: string lastUsed: string | null expiresAt: string | null }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
[] एसडीके उदाहरण
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.user.apiKeys() curl
curl --request GET "${CADCAMFUN_URL}/api/user/api-keys" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
user.createApiKey आवश्यक है Authorization: Bearer <token>.
{ name?: unknown | null }
201 वस्तु application/json
{ message: string apiKey: string name: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserCreateApiKeyInput
const result = await client.user.createApiKey({
name: null
}) curl
curl --request POST "${CADCAMFUN_URL}/api/user/api-keys" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
user.revokeApiKey आवश्यक है Authorization: Bearer <token>.
| नाम | में | प्रकार | आवश्यक |
|---|---|---|---|
| keyId | सवाल | डोरी | null | वैकल्पिक |
200 वस्तु application/json
{ message: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserRevokeApiKeyInput
const result = await client.user.revokeApiKey({}) curl
curl --request DELETE "${CADCAMFUN_URL}/api/user/api-keys" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
/api/user/delete-account
user.deleteAccount आवश्यक है Authorization: Bearer <token>.
200 वस्तु application/json
{ message: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
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.user.deleteAccount() curl
curl --request DELETE "${CADCAMFUN_URL}/api/user/delete-account" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
/api/user/password
user.password आवश्यक है Authorization: Bearer <token>.
{ currentPassword?: string | null newPassword?: string | null }
200 वस्तु application/json
{ message: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserPasswordInput
const result = await client.user.password({
currentPassword: "",
newPassword: ""
}) curl
curl --request PUT "${CADCAMFUN_URL}/api/user/password" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/user/tokens
user.tokens आवश्यक है Authorization: Bearer <token>.
200 वस्तु application/json
{ tokens: Array<{ id: string name: string prefix: string permissions: string[] createdAt: string lastUsed?: string | null expiresAt?: string | null isActive: boolean }> }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 KeyedInternalEncoded application/json
KeyedInternalEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 200
{
"tokens": [
{
"id": "token-1",
"name": "Development Token",
"prefix": "cad_dev_abc123",
"permissions": [
"read:projects",
"write:drawings",
"read:toolpaths"
],
"createdAt": "2026-10-08T04:52:23.364Z",
"lastUsed": "2026-10-15T03:52:23.364Z",
"isActive": true
},
{
"id": "token-2",
"name": "Mobile App Token",
"prefix": "cad_mobile_xyz789",
"permissions": [
"read:projects",
"write:toolpaths"
],
"createdAt": "2026-10-01T04:52:23.364Z",
"lastUsed": "2026-10-15T01:52:23.364Z",
"expiresAt": "2026-11-14T04:52:23.364Z",
"isActive": true
},
{
"id": "token-3",
"name": "Analytics Integration",
"prefix": "cad_analytics_def456",
"permissions": [
"read:analytics",
"read:usage"
],
"createdAt": "2026-09-24T04:52:23.364Z",
"expiresAt": "2026-10-14T04:52:23.364Z",
"isActive": false
}
]
} एसडीके उदाहरण
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.user.tokens() curl
curl --request GET "${CADCAMFUN_URL}/api/user/tokens" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
user.createToken आवश्यक है Authorization: Bearer <token>.
{ name?: string | null permissions?: unknown | null expiresIn?: number | "Infinity" | "-Infinity" | "NaN" | null }
201 वस्तु application/json
{ token: { id: string name: string prefix: string permissions: string[] createdAt: string lastUsed?: string | null expiresAt?: string | null isActive: boolean } fullToken: string }
400 TokenBadRequestEncoded application/json
TokenBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 KeyedInternalEncoded application/json
KeyedInternalEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserCreateTokenInput
const result = await client.user.createToken({
name: "",
permissions: null,
expiresIn: 0
}) curl
curl --request POST "${CADCAMFUN_URL}/api/user/tokens" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/user/verify-change
user.verifyChange आवश्यक है Authorization: Bearer <token>.
| नाम | में | प्रकार | आवश्यक |
|---|---|---|---|
| टोकन | सवाल | डोरी | null | वैकल्पिक |
| प्रकार | सवाल | डोरी | null | वैकल्पिक |
| पासवर्ड | सवाल | डोरी | null | वैकल्पिक |
200 वस्तु application/json
{ message: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण प्रतिक्रिया कब्जा कर लिया गया · 400
{
"_tag": "BadRequest",
"message": "Token and verification type are required"
} एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserVerifyChangeInput
const result = await client.user.verifyChange({}) curl
curl --request GET "${CADCAMFUN_URL}/api/user/verify-change" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
/api/user/git-profile
user.gitProfile आवश्यक है Authorization: Bearer <token>.
200 वस्तु application/json
{ name: string email: string }
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण लाओ
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/user/git-profile`, {
method: "GET",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request GET "${CADCAMFUN_URL}/api/user/git-profile" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
user.updateGitProfile आवश्यक है Authorization: Bearer <token>.
{ name: string email: string }
200 वस्तु application/json
{ name: string email: string }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
उदाहरण लाओ
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/user/git-profile`, {
method: "PUT",
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
}) curl
curl --request PUT "${CADCAMFUN_URL}/api/user/git-profile" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json इसे अजमाएं
/api/user
user.byId आवश्यक है Authorization: Bearer <token>.
| नाम | में | प्रकार | आवश्यक |
|---|---|---|---|
| पहचान | पथ | डोरी | आवश्यक |
200 वस्तु application/json
{ id: string name: string | null email: string | null image: string | null createdAt: string organizations: Array<{ id: string name: string role: string }> }
400 BadRequestEncoded application/json
BadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 NotFoundEncoded application/json
NotFoundEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
एसडीके उदाहरण
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// UserByIdInput
const result = await client.user.byId({
id: "<id>"
}) curl
curl --request GET "${CADCAMFUN_URL}/api/user/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" इसे अजमाएं
स्कीमा
नामित स्कीमा इस समूह के मापदंडों, निकायों और प्रतिक्रियाओं से पहुंच योग्य हैं। ए ? एक वैकल्पिक फ़ील्ड चिह्नित करता है; | null उस फ़ील्ड को चिह्नित करता है जो शून्य मान के साथ मौजूद हो सकता है।
BadRequestEncoded{ _tag: "BadRequest" message: string }
InternalErrorEncoded{ _tag: "InternalError" message: string }
KeyedInternalEncoded{ _tag: "KeyedInternal" error: string }
NotFoundEncoded{ _tag: "NotFound" message: string }
TokenBadRequestEncoded{ _tag: "TokenBadRequest" error: string }
इस समूह को कॉल किया जा रहा है
ऑपरेशन आईडी का फॉर्म है user.<name>. जनरेट किया गया प्रॉमिस SDK (@cadcamfun/api/sdk) उनमें से अधिकांश को इस रूप में उजागर करता है client.<namespace>.<method>(input), कहाँ input पथ पैरामीटर और बॉडी फ़ील्ड की एक सपाट वस्तु है; प्रत्येक कार्ड का एसडीके उदाहरण सटीक एक्सेसर और इनपुट प्रकार दिखाता है। मल्टीपार्ट अपलोड, बाइनरी या जावास्क्रिप्ट प्रतिक्रियाएँ और कच्चे वेबहुक उत्पन्न नहीं होते हैं; वे कार्ड दिखाते हैं 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 | विरोधाभासी स्थिति, जैसे डुप्लिकेट नाम या पुराना शाखा प्रमुख | संसाधन को दोबारा पढ़ें और वर्तमान डेटा के साथ पुनः प्रयास करें। |
| कोशिश करें यह कहता है "सीओआरएस द्वारा अवरुद्ध" | दस्तावेज़ गैर-लूपबैक मूल से परोसे जाते हैं | दस्तावेज़ों को स्थानीय रूप से चलाएँ या अनुरोध को कर्ल के रूप में कॉपी करें। |
| कनेक्शन नहीं हो सका | साइडकार एक नए बंदरगाह पर फिर से शुरू हुई | नए से पोर्ट पढ़ें ready पंक्ति. |