الوثائق
تكاليف الإنتاج
التقديرات وطلبات الحساب وتكاليف المواد وتكاليف التشغيل وسجلات استخدام الأدوات.
مترجم تلقائيًا من الإنجليزية. عرض الأصل بالإنجليزية
أرسل هذه الطلبات إلى السايدكار الخاصة بك. تبقى القيم في هذا المتصفح.
كيف يعمل هذا
يستمع السايدكار إلى منفذ الاسترجاع الذي تم اختياره عند بدء التشغيل ويطبعه في منفذ الاسترجاع الخاص به ready خط؛ استخدم عنوان URL هذا و CADCAMFUN_TOKEN لقد بدأ مع. تذهب الطلبات مباشرة من هذه الصفحة إلى هذا العنوان.
يرسل السايدكار رؤوس CORS فقط إلى أصول Tauri وإلى http://localhost أو http://127.0.0.1 على أي منفذ. من المستندات المستضافة، يحظر المتصفح الاستجابة، لذا قم بتشغيل المستندات محليًا (bun run dev في packages/web) لاستخدام الملعب، أو نسخ الطلب كحليقة. للتجربة دون لمس البيانات الحقيقية، ابدأ تشغيل السايدكار باستخدام CADCAMFUN_DATA_DIR أشار إلى دليل مهمل - انظر إرشادات واجهة برمجة التطبيقات.
العمليات
21 نقاط نهاية في production-costs المجموعة التي تم إنشاؤها من السايدكار مستند OpenAPI. تأخذ العمليات المحمية Authorization: Bearer $CADCAMFUN_TOKEN; يرى المصادقة. السلوك والحدود موجودة دليل النظام الفرعي.
| يحصل | /api/production-costs/estimates | production-costs.listEstimates |
| بريد | /api/production-costs/estimates | production-costs.createEstimate |
| يحصل | /api/production-costs/estimates/{id} | production-costs.getEstimate |
| يضع | /api/production-costs/estimates/{id} | production-costs.updateEstimate |
| يمسح | /api/production-costs/estimates/{id} | production-costs.deleteEstimate |
| بريد | /api/production-costs/estimates/calculate | production-costs.calculateEstimate |
| يحصل | /api/production-costs/material-costs | production-costs.listMaterialCosts |
| بريد | /api/production-costs/material-costs | production-costs.createMaterialCost |
| يحصل | /api/production-costs/material-costs/{id} | production-costs.getMaterialCost |
| يضع | /api/production-costs/material-costs/{id} | production-costs.updateMaterialCost |
| يمسح | /api/production-costs/material-costs/{id} | production-costs.deleteMaterialCost |
| يحصل | /api/production-costs/operation-costs | production-costs.listOperationCosts |
| بريد | /api/production-costs/operation-costs | production-costs.createOperationCost |
| يحصل | /api/production-costs/operation-costs/{id} | production-costs.getOperationCost |
| يضع | /api/production-costs/operation-costs/{id} | production-costs.updateOperationCost |
| يمسح | /api/production-costs/operation-costs/{id} | production-costs.deleteOperationCost |
| يحصل | /api/production-costs/tool-wear | production-costs.listToolWear |
| بريد | /api/production-costs/tool-wear | production-costs.createToolWear |
| يحصل | /api/production-costs/tool-wear/{id} | production-costs.getToolWear |
| يضع | /api/production-costs/tool-wear/{id} | production-costs.updateToolWear |
| يمسح | /api/production-costs/tool-wear/{id} | production-costs.deleteToolWear |
/api/production-costs/estimates
production-costs.listEstimates يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| toolpathId | استفسار | خيط | null | خياري |
| projectId | استفسار | خيط | null | خياري |
| organizationId | استفسار | "باطل" | خيط | null | خياري |
200 صفيف <كائن> application/json
Array<{ id: string createdAt: string updatedAt: string materialCost: number | "Infinity" | "-Infinity" | "NaN" toolWearCost: number | "Infinity" | "-Infinity" | "NaN" machineTime: number | "Infinity" | "-Infinity" | "NaN" machineTimeCost: number | "Infinity" | "-Infinity" | "NaN" operatorTime: number | "Infinity" | "-Infinity" | "NaN" operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN" setupCost: number | "Infinity" | "-Infinity" | "NaN" totalCost: number | "Infinity" | "-Infinity" | "NaN" currencyCode: string ownerId: string | null organizationId: string | null toolpathId: string details: unknown operationCostId: string | null costSettingsId?: string | null owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: string | null } | null toolpath: { id: string name: string projectId?: string | null } operationCost: { id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string name: string machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN" operatorHourlyRate: number | "NaN" setupTime: number | "NaN" } | null }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
رد المثال تم الالتقاط · 200
[] مثال SDK
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ProductionCostsListEstimatesInput
const result = await client["production-costs"].listEstimates({}) curl
curl --request GET "${CADCAMFUN_URL}/api/production-costs/estimates" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
production-costs.createEstimate يتطلب Authorization: Bearer <token>.
{ toolpathId: string totalCost: number | "Infinity" | "-Infinity" | "NaN" materialCost?: number | "Infinity" | "-Infinity" | "NaN" | null toolWearCost?: number | "Infinity" | "-Infinity" | "NaN" | null machineTime?: number | "Infinity" | "-Infinity" | "NaN" | null machineTimeCost?: number | "Infinity" | "-Infinity" | "NaN" | null operatorTime?: number | "Infinity" | "-Infinity" | "NaN" | null operatorTimeCost?: number | "Infinity" | "-Infinity" | "NaN" | null setupCost?: number | "Infinity" | "-Infinity" | "NaN" | null currencyCode?: string | null details?: unknown | null operationCostId?: string | null costSettingsId?: string | null organizationId?: string | null }
201 هدف application/json
{ id: string createdAt: string updatedAt: string materialCost: number | "Infinity" | "-Infinity" | "NaN" toolWearCost: number | "Infinity" | "-Infinity" | "NaN" machineTime: number | "Infinity" | "-Infinity" | "NaN" machineTimeCost: number | "Infinity" | "-Infinity" | "NaN" operatorTime: number | "Infinity" | "-Infinity" | "NaN" operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN" setupCost: number | "Infinity" | "-Infinity" | "NaN" totalCost: number | "Infinity" | "-Infinity" | "NaN" currencyCode: string ownerId: string | null organizationId: string | null toolpathId: string details: unknown operationCostId: string | null costSettingsId?: string | null owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: string | null } | null toolpath: { id: string name: string projectId?: string | null } operationCost: { id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string name: string machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN" operatorHourlyRate: number | "NaN" setupTime: number | "NaN" } | 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}` },
})
// ProductionCostsCreateEstimateInput
const result = await client["production-costs"].createEstimate({
toolpathId: "",
totalCost: 0,
materialCost: 0,
toolWearCost: 0,
machineTime: 0,
machineTimeCost: 0,
operatorTime: 0,
operatorTimeCost: 0,
setupCost: 0,
currencyCode: "",
details: null,
operationCostId: "",
costSettingsId: "",
organizationId: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/production-costs/estimates" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json جربه
production-costs.getEstimate يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
200 هدف application/json
{ id: string createdAt: string updatedAt: string materialCost: number | "Infinity" | "-Infinity" | "NaN" toolWearCost: number | "Infinity" | "-Infinity" | "NaN" machineTime: number | "Infinity" | "-Infinity" | "NaN" machineTimeCost: number | "Infinity" | "-Infinity" | "NaN" operatorTime: number | "Infinity" | "-Infinity" | "NaN" operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN" setupCost: number | "Infinity" | "-Infinity" | "NaN" totalCost: number | "Infinity" | "-Infinity" | "NaN" currencyCode: string ownerId: string | null organizationId: string | null toolpathId: string details: unknown operationCostId: string | null costSettingsId?: string | null owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: string | null } | null toolpath: { id: string name: string projectId?: string | null } operationCost: { id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string name: string machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN" operatorHourlyRate: number | "NaN" setupTime: number | "NaN" } | 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}` },
})
// ProductionCostsGetEstimateInput
const result = await client["production-costs"].getEstimate({
id: "<id>"
}) curl
curl --request GET "${CADCAMFUN_URL}/api/production-costs/estimates/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
production-costs.updateEstimate يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
{ currencyCode?: string | null details?: unknown | null notes?: string | null }
200 هدف application/json
{ id: string createdAt: string updatedAt: string materialCost: number | "Infinity" | "-Infinity" | "NaN" toolWearCost: number | "Infinity" | "-Infinity" | "NaN" machineTime: number | "Infinity" | "-Infinity" | "NaN" machineTimeCost: number | "Infinity" | "-Infinity" | "NaN" operatorTime: number | "Infinity" | "-Infinity" | "NaN" operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN" setupCost: number | "Infinity" | "-Infinity" | "NaN" totalCost: number | "Infinity" | "-Infinity" | "NaN" currencyCode: string ownerId: string | null organizationId: string | null toolpathId: string details: unknown operationCostId: string | null costSettingsId?: string | null owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: string | null } | null toolpath: { id: string name: string projectId?: string | 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}` },
})
// ProductionCostsUpdateEstimateInput
const result = await client["production-costs"].updateEstimate({
id: "<id>",
currencyCode: "",
details: null,
notes: ""
}) curl
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/estimates/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json جربه
production-costs.deleteEstimate يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
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}` },
})
// ProductionCostsDeleteEstimateInput
const result = await client["production-costs"].deleteEstimate({
id: "<id>"
}) curl
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/estimates/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
production-costs.calculateEstimate يتطلب Authorization: Bearer <token>.
{ toolpathId: string costSettingsId?: string | null organizationId?: string | null }
200 هدف application/json
{ materialCost: number | "Infinity" | "-Infinity" | "NaN" toolWearCost: number | "Infinity" | "-Infinity" | "NaN" machineTime: number | "Infinity" | "-Infinity" | "NaN" machineTimeCost: number | "Infinity" | "-Infinity" | "NaN" operatorTime: number | "Infinity" | "-Infinity" | "NaN" operatorTimeCost: number | "Infinity" | "-Infinity" | "NaN" setupCost: number | "Infinity" | "-Infinity" | "NaN" totalCost: number | "Infinity" | "-Infinity" | "NaN" currencyCode: string ownerId: string | null organizationId: string | null toolpathId: string details: { sourceSettingsId?: string | null inputs: { toolpathId: string toolId: string | null materialId: string | null } calculatedValues: { totalPathLengthMm: number | "Infinity" | "-Infinity" | "NaN" materialVolumeM3: number | "Infinity" | "-Infinity" | "NaN" feedRateMmMin: number | "Infinity" | "-Infinity" | "NaN" machineTimeMinutes: number | "Infinity" | "-Infinity" | "NaN" operatorTimeMinutes: number | "Infinity" | "-Infinity" | "NaN" totalSetupTimeMinutes: number | "Infinity" | "-Infinity" | "NaN" } costBreakdown: { material: number | "Infinity" | "-Infinity" | "NaN" toolWear: number | "Infinity" | "-Infinity" | "NaN" machineRun: number | "Infinity" | "-Infinity" | "NaN" operator: number | "Infinity" | "-Infinity" | "NaN" setup: number | "Infinity" | "-Infinity" | "NaN" } } }
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}` },
})
// ProductionCostsCalculateEstimateInput
const result = await client["production-costs"].calculateEstimate({
toolpathId: "",
costSettingsId: "",
organizationId: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/production-costs/estimates/calculate" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json جربه
/api/production-costs/material-costs
production-costs.listMaterialCosts يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| materialId | استفسار | خيط | null | خياري |
| organizationId | استفسار | "باطل" | خيط | null | خياري |
200 صفيف <كائن> application/json
Array<{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string materialId: string costPerUnit: number | "Infinity" | "-Infinity" | "NaN" wasteFactor: number | "Infinity" | "-Infinity" | "NaN" minimumCharge: number | "Infinity" | "-Infinity" | "NaN" material: { id: string name: string description: string | null properties: unknown isPublic: boolean createdAt: string updatedAt: string ownerId: string | null organizationId: string | null } owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: string | null } | null }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
رد المثال تم الالتقاط · 200
[] مثال SDK
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ProductionCostsListMaterialCostsInput
const result = await client["production-costs"].listMaterialCosts({}) curl
curl --request GET "${CADCAMFUN_URL}/api/production-costs/material-costs" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
production-costs.createMaterialCost يتطلب Authorization: Bearer <token>.
{ costPerUnit: number | "Infinity" | "-Infinity" | "NaN" wasteFactor?: number | "Infinity" | "-Infinity" | "NaN" | null minimumCharge?: number | "Infinity" | "-Infinity" | "NaN" | null currencyCode?: string | null materialId: string organizationId?: string | null }
201 هدف application/json
{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string materialId: string costPerUnit: number | "Infinity" | "-Infinity" | "NaN" wasteFactor: number | "Infinity" | "-Infinity" | "NaN" minimumCharge: number | "Infinity" | "-Infinity" | "NaN" material: { id: string name: string description: string | null properties: unknown isPublic: boolean createdAt: string updatedAt: string ownerId: string | null organizationId: 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
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ProductionCostsCreateMaterialCostInput
const result = await client["production-costs"].createMaterialCost({
costPerUnit: 0,
wasteFactor: 0,
minimumCharge: 0,
currencyCode: "",
materialId: "",
organizationId: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/production-costs/material-costs" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json جربه
production-costs.getMaterialCost يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
200 كائن | باطل application/json
{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string materialId: string costPerUnit: number | "Infinity" | "-Infinity" | "NaN" wasteFactor: number | "NaN" minimumCharge: number | "NaN" material: { id: string name: string description: string | null properties: unknown isPublic: boolean createdAt: string updatedAt: string ownerId: string | null organizationId: string | null } owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: 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}` },
})
// ProductionCostsGetMaterialCostInput
const result = await client["production-costs"].getMaterialCost({
id: "<id>"
}) curl
curl --request GET "${CADCAMFUN_URL}/api/production-costs/material-costs/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
production-costs.updateMaterialCost يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
{ costPerUnit?: number | "Infinity" | "-Infinity" | "NaN" | null wasteFactor?: number | "Infinity" | "-Infinity" | "NaN" | null minimumCharge?: number | "Infinity" | "-Infinity" | "NaN" | null currencyCode?: string | null }
200 هدف application/json
{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string materialId: string costPerUnit: number | "Infinity" | "-Infinity" | "NaN" wasteFactor: number | "Infinity" | "-Infinity" | "NaN" minimumCharge: number | "Infinity" | "-Infinity" | "NaN" material: { id: string name: string description: string | null properties: unknown isPublic: boolean createdAt: string updatedAt: string ownerId: string | null organizationId: string | 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}` },
})
// ProductionCostsUpdateMaterialCostInput
const result = await client["production-costs"].updateMaterialCost({
id: "<id>",
costPerUnit: 0,
wasteFactor: 0,
minimumCharge: 0,
currencyCode: ""
}) curl
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/material-costs/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json جربه
production-costs.deleteMaterialCost يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
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}` },
})
// ProductionCostsDeleteMaterialCostInput
const result = await client["production-costs"].deleteMaterialCost({
id: "<id>"
}) curl
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/material-costs/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
/api/production-costs/operation-costs
production-costs.listOperationCosts يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| organizationId | استفسار | "باطل" | خيط | null | خياري |
200 صفيف <كائن> application/json
Array<{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string name: string machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN" operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN" setupTime: number | "Infinity" | "-Infinity" | "NaN" owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: string | null } | null }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
رد المثال تم الالتقاط · 200
[] مثال SDK
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ProductionCostsListOperationCostsInput
const result = await client["production-costs"].listOperationCosts({}) curl
curl --request GET "${CADCAMFUN_URL}/api/production-costs/operation-costs" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
production-costs.createOperationCost يتطلب Authorization: Bearer <token>.
{ name: string machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN" operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN" setupTime?: number | "Infinity" | "-Infinity" | "NaN" | null currencyCode?: string | null organizationId?: string | null }
201 هدف application/json
{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string name: string machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN" operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN" setupTime: number | "Infinity" | "-Infinity" | "NaN" owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: string | null } | 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
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ProductionCostsCreateOperationCostInput
const result = await client["production-costs"].createOperationCost({
name: "",
machineHourlyRate: 0,
operatorHourlyRate: 0,
setupTime: 0,
currencyCode: "",
organizationId: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/production-costs/operation-costs" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json جربه
production-costs.getOperationCost يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
200 كائن | باطل application/json
{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string name: string machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN" operatorHourlyRate: number | "NaN" setupTime: number | "NaN" owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: 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}` },
})
// ProductionCostsGetOperationCostInput
const result = await client["production-costs"].getOperationCost({
id: "<id>"
}) curl
curl --request GET "${CADCAMFUN_URL}/api/production-costs/operation-costs/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
production-costs.updateOperationCost يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
{ name?: string | null machineHourlyRate?: number | "Infinity" | "-Infinity" | "NaN" | null operatorHourlyRate?: number | "Infinity" | "-Infinity" | "NaN" | null setupTime?: number | "Infinity" | "-Infinity" | "NaN" | null currencyCode?: string | null }
200 هدف application/json
{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string name: string machineHourlyRate: number | "Infinity" | "-Infinity" | "NaN" operatorHourlyRate: number | "Infinity" | "-Infinity" | "NaN" setupTime: number | "Infinity" | "-Infinity" | "NaN" owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: string | null } | 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
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ProductionCostsUpdateOperationCostInput
const result = await client["production-costs"].updateOperationCost({
id: "<id>",
name: "",
machineHourlyRate: 0,
operatorHourlyRate: 0,
setupTime: 0,
currencyCode: ""
}) curl
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/operation-costs/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json جربه
production-costs.deleteOperationCost يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
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}` },
})
// ProductionCostsDeleteOperationCostInput
const result = await client["production-costs"].deleteOperationCost({
id: "<id>"
}) curl
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/operation-costs/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
/api/production-costs/tool-wear
production-costs.listToolWear يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| toolId | استفسار | خيط | null | خياري |
| organizationId | استفسار | "باطل" | خيط | null | خياري |
200 صفيف <كائن> application/json
Array<{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string toolId: string wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN" replacementCost: number | "Infinity" | "-Infinity" | "NaN" replacementThreshold: number | "Infinity" | "-Infinity" | "NaN" tool: { id: string name: string type: string diameter: number | "Infinity" | "-Infinity" | "NaN" material: string numberOfFlutes: number | "Infinity" | "-Infinity" | "NaN" | null maxRPM: number | "Infinity" | "-Infinity" | "NaN" | null coolantType: string | null cuttingLength: number | "Infinity" | "-Infinity" | "NaN" | null totalLength: number | "Infinity" | "-Infinity" | "NaN" | null shankDiameter: number | "Infinity" | "-Infinity" | "NaN" | null cornerRadius?: number | "Infinity" | "-Infinity" | "NaN" | null tipAngle?: number | "Infinity" | "-Infinity" | "NaN" | null threadPitch?: number | "Infinity" | "-Infinity" | "NaN" | null holderDiameter?: number | "Infinity" | "-Infinity" | "NaN" | null holderLength?: number | "Infinity" | "-Infinity" | "NaN" | null stickout?: number | "Infinity" | "-Infinity" | "NaN" | null notes: string | null isPublic: boolean createdAt: string updatedAt: string ownerId: string | null organizationId: string | null } owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: string | null } | null }>
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
403 ForbiddenEncoded application/json
ForbiddenEncoded
500 InternalErrorEncoded application/json
InternalErrorEncoded
رد المثال تم الالتقاط · 200
[] مثال SDK
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ProductionCostsListToolWearInput
const result = await client["production-costs"].listToolWear({}) curl
curl --request GET "${CADCAMFUN_URL}/api/production-costs/tool-wear" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
production-costs.createToolWear يتطلب Authorization: Bearer <token>.
{ wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN" replacementCost: number | "Infinity" | "-Infinity" | "NaN" replacementThreshold?: number | "Infinity" | "-Infinity" | "NaN" | null currencyCode?: string | null toolId: string organizationId?: string | null }
201 هدف application/json
{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string toolId: string wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN" replacementCost: number | "Infinity" | "-Infinity" | "NaN" replacementThreshold: number | "Infinity" | "-Infinity" | "NaN" tool: { id: string name: string type: string diameter: number | "Infinity" | "-Infinity" | "NaN" material: string numberOfFlutes: number | "Infinity" | "-Infinity" | "NaN" | null maxRPM: number | "Infinity" | "-Infinity" | "NaN" | null coolantType: string | null cuttingLength: number | "Infinity" | "-Infinity" | "NaN" | null totalLength: number | "Infinity" | "-Infinity" | "NaN" | null shankDiameter: number | "Infinity" | "-Infinity" | "NaN" | null cornerRadius?: number | "Infinity" | "-Infinity" | "NaN" | null tipAngle?: number | "Infinity" | "-Infinity" | "NaN" | null threadPitch?: number | "Infinity" | "-Infinity" | "NaN" | null holderDiameter?: number | "Infinity" | "-Infinity" | "NaN" | null holderLength?: number | "Infinity" | "-Infinity" | "NaN" | null stickout?: number | "Infinity" | "-Infinity" | "NaN" | null notes: string | null isPublic: boolean createdAt: string updatedAt: string ownerId: string | null organizationId: 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
import { CadCam } from "@cadcamfun/api/sdk"
const client = CadCam.make({
baseUrl: process.env.CADCAMFUN_URL!,
headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
// ProductionCostsCreateToolWearInput
const result = await client["production-costs"].createToolWear({
wearRatePerMeter: 0,
replacementCost: 0,
replacementThreshold: 0,
currencyCode: "",
toolId: "",
organizationId: ""
}) curl
curl --request POST "${CADCAMFUN_URL}/api/production-costs/tool-wear" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json جربه
production-costs.getToolWear يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
200 كائن | باطل application/json
{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string toolId: string wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN" replacementCost: number | "NaN" replacementThreshold: number | "NaN" tool: { id: string name: string type: string diameter: number | "NaN" material: string numberOfFlutes: number | "NaN" | null maxRPM: number | null coolantType: string | null cuttingLength: number | null totalLength: number | null shankDiameter: number | null cornerRadius?: number | null tipAngle?: number | null threadPitch?: number | null holderDiameter?: number | null holderLength?: number | null stickout?: number | null notes: string | null isPublic: boolean createdAt: string updatedAt: string ownerId: string | null organizationId: string | null } owner: { id: string name: string | null email?: string | null } | null organization: { id: string name: 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}` },
})
// ProductionCostsGetToolWearInput
const result = await client["production-costs"].getToolWear({
id: "<id>"
}) curl
curl --request GET "${CADCAMFUN_URL}/api/production-costs/tool-wear/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
production-costs.updateToolWear يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
{ wearRatePerMeter?: number | "Infinity" | "-Infinity" | "NaN" | null replacementCost?: number | "Infinity" | "-Infinity" | "NaN" | null replacementThreshold?: number | "Infinity" | "-Infinity" | "NaN" | null currencyCode?: string | null }
200 هدف application/json
{ id: string createdAt: string updatedAt: string ownerId: string | null organizationId: string | null currencyCode: string toolId: string wearRatePerMeter: number | "Infinity" | "-Infinity" | "NaN" replacementCost: number | "Infinity" | "-Infinity" | "NaN" replacementThreshold: number | "Infinity" | "-Infinity" | "NaN" tool: { id: string name: string type: string diameter: number | "Infinity" | "-Infinity" | "NaN" material: string numberOfFlutes: number | "Infinity" | "-Infinity" | "NaN" | null maxRPM: number | "Infinity" | "-Infinity" | "NaN" | null coolantType: string | null cuttingLength: number | "Infinity" | "-Infinity" | "NaN" | null totalLength: number | "Infinity" | "-Infinity" | "NaN" | null shankDiameter: number | "Infinity" | "-Infinity" | "NaN" | null cornerRadius?: number | "Infinity" | "-Infinity" | "NaN" | null tipAngle?: number | "Infinity" | "-Infinity" | "NaN" | null threadPitch?: number | "Infinity" | "-Infinity" | "NaN" | null holderDiameter?: number | "Infinity" | "-Infinity" | "NaN" | null holderLength?: number | "Infinity" | "-Infinity" | "NaN" | null stickout?: number | "Infinity" | "-Infinity" | "NaN" | null notes: string | null isPublic: boolean createdAt: string updatedAt: string ownerId: string | null organizationId: string | 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}` },
})
// ProductionCostsUpdateToolWearInput
const result = await client["production-costs"].updateToolWear({
id: "<id>",
wearRatePerMeter: 0,
replacementCost: 0,
replacementThreshold: 0,
currencyCode: ""
}) curl
curl --request PUT "${CADCAMFUN_URL}/api/production-costs/tool-wear/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @request.json جربه
production-costs.deleteToolWear يتطلب Authorization: Bearer <token>.
| اسم | في | يكتب | مطلوب |
|---|---|---|---|
| بطاقة تعريف | طريق | خيط | مطلوب |
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}` },
})
// ProductionCostsDeleteToolWearInput
const result = await client["production-costs"].deleteToolWear({
id: "<id>"
}) curl
curl --request DELETE "${CADCAMFUN_URL}/api/production-costs/tool-wear/<id>" \
--header "Authorization: Bearer ${CADCAMFUN_TOKEN}" جربه
المخططات
يمكن الوصول إلى المخططات المسماة من معلمات هذه المجموعة وأجسامها واستجاباتها. أ ? يمثل حقلاً اختياريًا؛ | null يضع علامة على الحقل الذي قد يكون موجودًا بقيمة فارغة.
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 }
استدعاء هذه المجموعة
معرفات العملية لها النموذج production-costs.<name>. وعد SDK الذي تم إنشاؤه (@cadcamfun/api/sdk) يعرض معظمهم client.<namespace>.<method>(input)، أين input هو كائن مسطح واحد من معلمات المسار وحقول النص؛ يُظهر مثال SDK لكل بطاقة الملحق الدقيق ونوع الإدخال. لا يتم إنشاء التحميلات متعددة الأجزاء والاستجابات الثنائية أو استجابات JavaScript وخطافات الويب الأولية؛ تظهر تلك البطاقات 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" | يتم تقديم المستندات من أصل غير استرجاعي | قم بتشغيل المستندات محليًا أو انسخ الطلب كـ curly. |
| رفض اتصال | تم إعادة تشغيل السايدكار في منفذ جديد | قراءة المنفذ من الجديد ready سطر. |