Documentazione
Costi di produzione
Stime, richieste di calcolo, costi dei materiali, costi operativi e registrazioni dell'usura degli utensili.
Tradotto automaticamente dall'inglese. Vedi l'originale in inglese
Invia queste richieste al tuo sidecar in corsa. I valori rimangono in questo browser.
Come funziona
Il sidecar resta in ascolto su una porta di loopback scelta all'avvio e la stampa nel suo file ready linea; usa quell'URL e il file CADCAMFUN_TOKEN è stato iniziato con. Le richieste vanno direttamente da questa pagina a quell'indirizzo.
Il sidecar invia intestazioni CORS solo alle origini Tauri e a http://localhost o http://127.0.0.1 su qualsiasi porto. Dai documenti ospitati il browser blocca la risposta, quindi esegui i documenti localmente (bun run dev in packages/web) per utilizzare il parco giochi, oppure copiare la richiesta come ricciolo. Per sperimentare senza toccare i dati reali, avvia il sidecar con CADCAMFUN_DATA_DIR indicato in una directory usa e getta - vedi la procedura dettagliata dell'API.
Operazioni
21 endpoint nel production-costs gruppo, generato da quello del sidecar Documento OpenAPI. Le operazioni protette richiedono Authorization: Bearer $CADCAMFUN_TOKEN; vedere autenticazione. Comportamenti e limiti sono entrati la guida del sottosistema.
| ottenere | /api/production-costs/estimates | production-costs.listEstimates |
| inviare | /api/production-costs/estimates | production-costs.createEstimate |
| ottenere | /api/production-costs/estimates/{id} | production-costs.getEstimate |
| mettere | /api/production-costs/estimates/{id} | production-costs.updateEstimate |
| eliminare | /api/production-costs/estimates/{id} | production-costs.deleteEstimate |
| inviare | /api/production-costs/estimates/calculate | production-costs.calculateEstimate |
| ottenere | /api/production-costs/material-costs | production-costs.listMaterialCosts |
| inviare | /api/production-costs/material-costs | production-costs.createMaterialCost |
| ottenere | /api/production-costs/material-costs/{id} | production-costs.getMaterialCost |
| mettere | /api/production-costs/material-costs/{id} | production-costs.updateMaterialCost |
| eliminare | /api/production-costs/material-costs/{id} | production-costs.deleteMaterialCost |
| ottenere | /api/production-costs/operation-costs | production-costs.listOperationCosts |
| inviare | /api/production-costs/operation-costs | production-costs.createOperationCost |
| ottenere | /api/production-costs/operation-costs/{id} | production-costs.getOperationCost |
| mettere | /api/production-costs/operation-costs/{id} | production-costs.updateOperationCost |
| eliminare | /api/production-costs/operation-costs/{id} | production-costs.deleteOperationCost |
| ottenere | /api/production-costs/tool-wear | production-costs.listToolWear |
| inviare | /api/production-costs/tool-wear | production-costs.createToolWear |
| ottenere | /api/production-costs/tool-wear/{id} | production-costs.getToolWear |
| mettere | /api/production-costs/tool-wear/{id} | production-costs.updateToolWear |
| eliminare | /api/production-costs/tool-wear/{id} | production-costs.deleteToolWear |
/api/production-costs/estimates
production-costs.listEstimates Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| toolpathId | domanda | corda | null | opzionale |
| projectId | domanda | corda | null | opzionale |
| organizationId | domanda | "nullo" | corda | null | opzionale |
200 Matrice<oggetto> 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
Risposta di esempio catturato · 200
[] Esempio dell'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}" Provalo
production-costs.createEstimate Richiede 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 oggetto 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
Esempio dell'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 Provalo
production-costs.getEstimate Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
200 oggetto 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
Esempio dell'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}" Provalo
production-costs.updateEstimate Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
{ currencyCode?: string | null details?: unknown | null notes?: string | null }
200 oggetto 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
Esempio dell'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 Provalo
production-costs.deleteEstimate Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
200 oggetto 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
Esempio dell'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}" Provalo
production-costs.calculateEstimate Richiede Authorization: Bearer <token>.
{ toolpathId: string costSettingsId?: string | null organizationId?: string | null }
200 oggetto 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
Esempio dell'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 Provalo
/api/production-costs/material-costs
production-costs.listMaterialCosts Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| materialId | domanda | corda | null | opzionale |
| organizationId | domanda | "nullo" | corda | null | opzionale |
200 Matrice<oggetto> 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
Risposta di esempio catturato · 200
[] Esempio dell'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}" Provalo
production-costs.createMaterialCost Richiede 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 oggetto 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
Esempio dell'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 Provalo
production-costs.getMaterialCost Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
200 oggetto | nullo 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
Esempio dell'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}" Provalo
production-costs.updateMaterialCost Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
{ costPerUnit?: number | "Infinity" | "-Infinity" | "NaN" | null wasteFactor?: number | "Infinity" | "-Infinity" | "NaN" | null minimumCharge?: number | "Infinity" | "-Infinity" | "NaN" | null currencyCode?: string | null }
200 oggetto 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
Esempio dell'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 Provalo
production-costs.deleteMaterialCost Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
200 oggetto 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
Esempio dell'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}" Provalo
/api/production-costs/operation-costs
production-costs.listOperationCosts Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| organizationId | domanda | "nullo" | corda | null | opzionale |
200 Matrice<oggetto> 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
Risposta di esempio catturato · 200
[] Esempio dell'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}" Provalo
production-costs.createOperationCost Richiede 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 oggetto 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
Esempio dell'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 Provalo
production-costs.getOperationCost Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
200 oggetto | nullo 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
Esempio dell'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}" Provalo
production-costs.updateOperationCost Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
{ 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 oggetto 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
Esempio dell'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 Provalo
production-costs.deleteOperationCost Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
200 oggetto 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
Esempio dell'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}" Provalo
/api/production-costs/tool-wear
production-costs.listToolWear Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| toolId | domanda | corda | null | opzionale |
| organizationId | domanda | "nullo" | corda | null | opzionale |
200 Matrice<oggetto> 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
Risposta di esempio catturato · 200
[] Esempio dell'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}" Provalo
production-costs.createToolWear Richiede 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 oggetto 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
Esempio dell'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 Provalo
production-costs.getToolWear Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
200 oggetto | nullo 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
Esempio dell'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}" Provalo
production-costs.updateToolWear Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
{ wearRatePerMeter?: number | "Infinity" | "-Infinity" | "NaN" | null replacementCost?: number | "Infinity" | "-Infinity" | "NaN" | null replacementThreshold?: number | "Infinity" | "-Infinity" | "NaN" | null currencyCode?: string | null }
200 oggetto 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
Esempio dell'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 Provalo
production-costs.deleteToolWear Richiede Authorization: Bearer <token>.
| Nome | In | Tipo | Necessario |
|---|---|---|---|
| id | sentiero | corda | necessario |
200 oggetto 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
Esempio dell'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}" Provalo
Schemi
Schemi denominati raggiungibili dai parametri, dai corpi e dalle risposte di questo gruppo. UN ? contrassegna un campo facoltativo; | null contrassegna un campo che può essere presente con un valore nullo.
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 }
Chiamando questo gruppo
Gli ID operazione hanno il formato production-costs.<name>. L'SDK Promise generato (@cadcamfun/api/sdk) ne espone la maggior parte come client.<namespace>.<method>(input), dove input è un oggetto piatto di parametri di percorso e campi del corpo; l'esempio dell'SDK di ciascuna scheda mostra l'esatto accessor e il tipo di input. Non vengono generati caricamenti in più parti, risposte binarie o JavaScript e webhook grezzi; quelle carte mostrano fetch invece.
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
}
} Risoluzione dei problemi
| Sintomo | Probabile causa | Aggiustare |
|---|---|---|
| 401 a ogni chiamata | Token di un lancio precedente o mancante Bearer prefisso | Inviare Authorization: Bearer <token> con il gettone con cui è stato avviato il sidecar. |
| 400 prima che accada qualcosa | Il corpo o il parametro non corrisponde allo schema | Confronta il payload con lo schema di richiesta sulla carta. |
| 403 o 404 su un record visibile altrove | Il resoconto della recitazione è diverso | Invia il diritto x-session-tokenoppure utilizzare il profilo locale proprietario del record. |
| 409 | Stato in conflitto, ad esempio un nome duplicato o una testa di ramo obsoleta | Rileggere la risorsa e riprovare con i dati correnti. |
| Prova, dice "bloccato da CORS" | I documenti vengono serviti da un'origine non di loopback | Esegui i documenti localmente o copia la richiesta come curl. |
| Connessione rifiutata | Il sidecar è ripartito su una nuova porta | Leggi il porto dal nuovo ready riga. |