文档
生产成本
估算、计算请求、材料成本、运营成本和工具磨损记录。
从英文自动翻译。 查看英文原文
将这些请求发送到您自己正在运行的 sidecar。值保留在此浏览器中。
这是如何运作的
sidecar 侦听启动时选择的环回端口并将其打印在其中 ready 线;使用该 URL 和 CADCAMFUN_TOKEN 它是从开始的。请求直接从该页面发送到该地址。
sidecar 仅将 CORS 标头发送到 Tauri 源并发送到 http://localhost 或 http://127.0.0.1 在任何端口上。浏览器会阻止托管文档的响应,因此请在本地运行文档(bun run dev 中 packages/web) 使用游乐场,或将请求复制为curl。要在不接触真实数据的情况下进行实验,请使用以下命令启动 sidecar CADCAMFUN_DATA_DIR 指向一个一次性目录 - 请参阅 aPI 演练.
运营
21 个端点,位于 production-costs 组,由 sidecar 自己生成 开放API文档。受保护的操作需要 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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
{ 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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
{ 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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
{ 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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
{ 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>.
| 姓名 | 在 | 类型 | 必需的 |
|---|---|---|---|
| iD | 小路 | 细绳 | 必需的 |
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 }
呼叫该群组
操作 ID 的形式为 production-costs.<name>。生成的Promise SDK(@cadcamfun/api/sdk)将其中大部分暴露为 client.<namespace>.<method>(input), 在哪里 input 是路径参数和主体字段的一个平面对象;每张卡的 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。 |
| 连接被拒绝 | Sidecar 在新端口上重新启动 | 从新读取端口 ready 行。 |