Dokumentation
Produktionskosten
Kostenvoranschläge, Berechnungsanfragen, Materialkosten, Betriebskosten und Werkzeugverschleißaufzeichnungen.
Automatisch aus dem Englischen übersetzt. Englisches Original ansehen
Senden Sie diese Anfragen an Ihren eigenen laufenden Sidecar. Werte bleiben in diesem Browser.
Wie das funktioniert
Der Sidecar lauscht an einem beim Start ausgewählten Loopback-Port und gibt ihn dort aus ready linie; Verwenden Sie diese URL und die CADCAMFUN_TOKEN es wurde damit begonnen. Anfragen gehen direkt von dieser Seite an diese Adresse.
Der Sidecar sendet CORS-Header nur an die Tauri-Ursprünge und an http://localhost oder http://127.0.0.1 auf jedem Port. Von den gehosteten Dokumenten aus blockiert der Browser die Antwort, also führen Sie die Dokumente lokal aus (bun run dev in packages/web), um den Spielplatz zu nutzen, oder kopieren Sie die Anfrage als Curl. Um zu experimentieren, ohne echte Daten zu berühren, starten Sie den Sidecar mit CADCAMFUN_DATA_DIR zeigte auf ein Wegwerfverzeichnis – siehe die API-Komplettlösung.
Operationen
21 Endpunkte in der production-costs gruppe, generiert aus der eigenen Gruppe des Sidecars OpenAPI-Dokument. Geschützte Operationen dauern Authorization: Bearer $CADCAMFUN_TOKEN; sehen authentifizierung. Verhalten und Grenzen sind in das Subsystemhandbuch.
| erhalten | /api/production-costs/estimates | production-costs.listEstimates |
| post | /api/production-costs/estimates | production-costs.createEstimate |
| erhalten | /api/production-costs/estimates/{id} | production-costs.getEstimate |
| setzen | /api/production-costs/estimates/{id} | production-costs.updateEstimate |
| löschen | /api/production-costs/estimates/{id} | production-costs.deleteEstimate |
| post | /api/production-costs/estimates/calculate | production-costs.calculateEstimate |
| erhalten | /api/production-costs/material-costs | production-costs.listMaterialCosts |
| post | /api/production-costs/material-costs | production-costs.createMaterialCost |
| erhalten | /api/production-costs/material-costs/{id} | production-costs.getMaterialCost |
| setzen | /api/production-costs/material-costs/{id} | production-costs.updateMaterialCost |
| löschen | /api/production-costs/material-costs/{id} | production-costs.deleteMaterialCost |
| erhalten | /api/production-costs/operation-costs | production-costs.listOperationCosts |
| post | /api/production-costs/operation-costs | production-costs.createOperationCost |
| erhalten | /api/production-costs/operation-costs/{id} | production-costs.getOperationCost |
| setzen | /api/production-costs/operation-costs/{id} | production-costs.updateOperationCost |
| löschen | /api/production-costs/operation-costs/{id} | production-costs.deleteOperationCost |
| erhalten | /api/production-costs/tool-wear | production-costs.listToolWear |
| post | /api/production-costs/tool-wear | production-costs.createToolWear |
| erhalten | /api/production-costs/tool-wear/{id} | production-costs.getToolWear |
| setzen | /api/production-costs/tool-wear/{id} | production-costs.updateToolWear |
| löschen | /api/production-costs/tool-wear/{id} | production-costs.deleteToolWear |
/api/production-costs/estimates
production-costs.listEstimates Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| toolpathId | abfrage | zeichenfolge | null | optional |
| projectId | abfrage | zeichenfolge | null | optional |
| organizationId | abfrage | „null“ | zeichenfolge | null | optional |
200 Array<Objekt> 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
Beispielantwort erfasst · 200
[] SDK-Beispiel
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}" Probieren Sie es aus
production-costs.createEstimate Erfordert 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 objekt 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-Beispiel
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 Probieren Sie es aus
production-costs.getEstimate Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
200 objekt 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-Beispiel
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}" Probieren Sie es aus
production-costs.updateEstimate Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
{ currencyCode?: string | null details?: unknown | null notes?: string | null }
200 objekt 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-Beispiel
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 Probieren Sie es aus
production-costs.deleteEstimate Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
200 objekt 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-Beispiel
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}" Probieren Sie es aus
production-costs.calculateEstimate Erfordert Authorization: Bearer <token>.
{ toolpathId: string costSettingsId?: string | null organizationId?: string | null }
200 objekt 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-Beispiel
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 Probieren Sie es aus
/api/production-costs/material-costs
production-costs.listMaterialCosts Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| materialId | abfrage | zeichenfolge | null | optional |
| organizationId | abfrage | „null“ | zeichenfolge | null | optional |
200 Array<Objekt> 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
Beispielantwort erfasst · 200
[] SDK-Beispiel
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}" Probieren Sie es aus
production-costs.createMaterialCost Erfordert 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 objekt 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-Beispiel
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 Probieren Sie es aus
production-costs.getMaterialCost Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
200 objekt | null 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-Beispiel
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}" Probieren Sie es aus
production-costs.updateMaterialCost Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
{ costPerUnit?: number | "Infinity" | "-Infinity" | "NaN" | null wasteFactor?: number | "Infinity" | "-Infinity" | "NaN" | null minimumCharge?: number | "Infinity" | "-Infinity" | "NaN" | null currencyCode?: string | null }
200 objekt 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-Beispiel
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 Probieren Sie es aus
production-costs.deleteMaterialCost Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
200 objekt 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-Beispiel
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}" Probieren Sie es aus
/api/production-costs/operation-costs
production-costs.listOperationCosts Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| organizationId | abfrage | „null“ | zeichenfolge | null | optional |
200 Array<Objekt> 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
Beispielantwort erfasst · 200
[] SDK-Beispiel
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}" Probieren Sie es aus
production-costs.createOperationCost Erfordert 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 objekt 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-Beispiel
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 Probieren Sie es aus
production-costs.getOperationCost Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
200 objekt | null 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-Beispiel
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}" Probieren Sie es aus
production-costs.updateOperationCost Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
{ 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 objekt 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-Beispiel
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 Probieren Sie es aus
production-costs.deleteOperationCost Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
200 objekt 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-Beispiel
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}" Probieren Sie es aus
/api/production-costs/tool-wear
production-costs.listToolWear Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| toolId | abfrage | zeichenfolge | null | optional |
| organizationId | abfrage | „null“ | zeichenfolge | null | optional |
200 Array<Objekt> 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
Beispielantwort erfasst · 200
[] SDK-Beispiel
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}" Probieren Sie es aus
production-costs.createToolWear Erfordert 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 objekt 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-Beispiel
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 Probieren Sie es aus
production-costs.getToolWear Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
200 objekt | null 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-Beispiel
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}" Probieren Sie es aus
production-costs.updateToolWear Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
{ wearRatePerMeter?: number | "Infinity" | "-Infinity" | "NaN" | null replacementCost?: number | "Infinity" | "-Infinity" | "NaN" | null replacementThreshold?: number | "Infinity" | "-Infinity" | "NaN" | null currencyCode?: string | null }
200 objekt 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-Beispiel
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 Probieren Sie es aus
production-costs.deleteToolWear Erfordert Authorization: Bearer <token>.
| Name | In | Typ | Erforderlich |
|---|---|---|---|
| ausweis | weg | zeichenfolge | erforderlich |
200 objekt 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-Beispiel
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}" Probieren Sie es aus
Schemata
Benannte Schemata, die über die Parameter, Körper und Antworten dieser Gruppe erreichbar sind. A ? markiert ein optionales Feld; | null markiert ein Feld, das möglicherweise mit einem Nullwert vorhanden ist.
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 }
Ich rufe diese Gruppe an
Vorgangs-IDs haben die Form production-costs.<name>. Das generierte Promise SDK (@cadcamfun/api/sdk) entlarvt die meisten von ihnen als client.<namespace>.<method>(input), wo input ist ein flaches Objekt aus Pfadparametern und Körperfeldern; Das SDK-Beispiel jeder Karte zeigt den genauen Zugriffs- und Eingabetyp. Mehrteilige Uploads, Binär- oder JavaScript-Antworten und unformatierte Webhooks werden nicht generiert; Diese Karten zeigen fetch stattdessen.
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
}
} Fehlerbehebung
| Symptom | Wahrscheinliche Ursache | Fix |
|---|---|---|
| 401 bei jedem Aufruf | Token von einem früheren Start oder fehlt Bearer präfix | Schicken Authorization: Bearer <token> mit dem Token wurde der Sidecar gestartet. |
| 400 bevor etwas passiert | Text oder Parameter stimmen nicht mit dem Schema überein | Vergleichen Sie die Nutzlast mit dem Anforderungsschema auf der Karte. |
| 403 oder 404 bei einem Datensatz, den du woanders siehst | Das amtierende Konto ist unterschiedlich | Schicken Sie das Richtige x-session-token, oder verwenden Sie das lokale Profil, das Eigentümer des Datensatzes ist. |
| 409 | Widersprüchlicher Status, z. B. ein doppelter Name oder ein veralteter Zweigkopf | Lesen Sie die Ressource erneut und versuchen Sie es erneut mit den aktuellen Daten. |
| Versuchen Sie es mit der Meldung „Von CORS blockiert“. | Die Dokumente werden von einem Nicht-Loopback-Ursprung bereitgestellt | Führen Sie die Dokumente lokal aus oder kopieren Sie die Anfrage als Curl. |
| Verbindung abgelehnt | Der Sidecar wurde an einem neuen Port neu gestartet | Lesen Sie den Port neu ready Zeile. |