Документация
Затраты на производство
Оценки, запросы на расчеты, материальные затраты, эксплуатационные расходы и записи об износе инструментов.
Автоматически переведено с английского. Смотреть оригинал на английском
Отправьте эти запросы на свою работающую сайдкар. Значения остаются в этом браузере.
Как это работает
Сайдкар прослушивает порт обратной связи, выбранный при запуске, и печатает его в своем ready линия; используйте этот URL-адрес и CADCAMFUN_TOKEN с этого началось. Запросы идут прямо с этой страницы на этот адрес.
Sidecar отправляет заголовки CORS только источникам Tauri и http://localhost или http://127.0.0.1 в любом порту. Из размещенных документов браузер блокирует ответ, поэтому запускайте документы локально (bun run dev в packages/web), чтобы использовать игровую площадку, или скопируйте запрос как завиток. Чтобы поэкспериментировать, не затрагивая реальные данные, запустите сайдкар с помощью CADCAMFUN_DATA_DIR указал на одноразовый каталог — см. пошаговое руководство по API.
Операции
21 endpoint в 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>. Сгенерированный Promise 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». | Документы подаются из источника без обратной связи. | Запустите документы локально или скопируйте запрос как curl. |
| В соединении отказано | Сайдкар перезапустилась в новом порту | Прочтите порт из нового ready строка. |