Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
feat(api): expose the service layer over HTTP with oRPC, reposition the docs (#1589)
Sidbd1f76670695
diff --git a/.ai/lessons.md b/.ai/lessons.mdindex 6a99a053c5..15aacafe0f 100644--- a/.ai/lessons.md+++ b/.ai/lessons.md@@ -1336,3 +1336,23 @@ full-screen ERP route.**Rule:** Before adding a CHECK on an existing column: (1) grep EVERY writer of that column — app services, edge functions, triggers, seeds — and fix any that can produce a violating value in the same change set; (2) repair existing violating rows in the same migration, before the VALIDATE (`UPDATE … WHERE <violates>` with an explainable value); (3) remember old NUMERIC(p,s) clamps — a widened column can still hold rounded-to-zero values from its clamped era.**Applies to:** any `ADD CONSTRAINT … CHECK` + `VALIDATE` migration; `packages/database/supabase/functions/**` writers of the constrained column.++## A shared executor acquires callers nobody planned for — grep every importer before deleting one++**Context:** The oRPC migration plan said MCP `call_tool` and the in-app agent were the two consumers of the MCP `direct-executor.ts`, so once both moved to `callOperation` the file could be deleted. A pre-deletion grep found a THIRD caller: `apps/erp/app/routes/api+/inngest.ts` registered `executeFunction` as the workflow engine's `setWorkflowDispatch` seam — every customer workflow `*.create` action ran through it.++**Problem:** A convenient shared function gets wired into new seams (dependency-injection slots, dispatchers, adapters) without its own file ever changing, so the mental list of "who uses this" goes stale. Deleting it on the strength of the plan's caller list would have broken customer workflow create actions in production while every named caller kept working.++**Rule:** Before deleting or changing the contract of any shared executor/service entry point, grep the WHOLE repo for its name (not just imports of its file — injection sites pass it by value: `setX(fn)`, `register(fn)`, config objects), and treat each hit as a caller to migrate in the same change. A DI/seam registration is a caller even though the dependency arrow points away from the file.++**Applies to:** `apps/erp/app/routes/api+/v1+/lib/call.server.ts` (the shared entry point now), `packages/jobs/src/workflows/actions/dispatcher.ts`, any `set*`/`register*` seam.++## In a bulk API sweep, a 4xx carrying a service's generic fallback string is a finding, not a pass++**Context:** The 1,495-operation API sweep triaged all 274 WRITE-op 400s as "reached the DB, expected FK rejections" and flagged only 500s. `inventory_insertManualInventoryAdjustment` came back 400 with `"Failed to create manual inventory adjustment"` and was waved through — but that string is the service's FALLBACK for an edge-function error whose real message was suppressed. A customer later hit exactly this: the published schema advertised 12 `adjustmentType` values (the validator spread `itemLedgerTypes` into its enum) while the `post-inventory-adjustment` edge function accepts 5, so every LLM-guided "add stock" call failed undiagnosably.++**Problem:** Bucketing sweep results by status code alone treats "the request was validly rejected" and "the error was swallowed somewhere in the chain" as the same outcome. The ops most likely to be broken-by-contract-drift are precisely the ones that fail with a generic message, because the generic message IS the symptom of a suppressed real error.++**Rule:** When triaging sweep failures, grep the response bodies for known fallback strings (`"Failed to *"` service fallbacks, `getEdgeFunctionErrorMessage` second arguments) and treat each match as a defect to root-cause: either the advertised schema disagrees with the actual acceptor (enum/shape drift between a `.models.ts` validator and an edge function's `payloadValidator`), or an error-sanitization layer is eating a legible message. Published-schema enums must be exactly what the write path accepts — never a wider "domain" enum reused for convenience.++**Applies to:** API/MCP sweep scripts, `apps/erp/app/modules/*/[a-z]*.models.ts` validators that feed `client.functions.invoke` wrappers, `packages/database/supabase/functions/lib/response.ts`, `apps/erp/app/utils/error.ts`.diff --git a/.ai/plans/2026-09-04-carbon-api-orpc.md b/.ai/plans/2026-09-04-carbon-api-orpc.mdnew file mode 100644index 0000000000..5253f888ad--- /dev/null+++ b/.ai/plans/2026-09-04-carbon-api-orpc.md@@ -0,0 +1,498 @@+# Carbon API on oRPC + Docs Repositioning — Implementation Plan++> Status: APPROVED 2026-09-04, Part A HTTP transport done+verified (MCP migration + auth+> cache pending); Part B docs restructure done. Check items off in this file as you go;+> run logs go in `.ai/runs/`. Read `.ai/lessons.md` and the Task Router rows in AGENTS.md+> before starting (workflow-edge-function does NOT apply — this is app-route work, not an+> edge function).+>+> 2026-09-05: Zod 4.5.4 merged to main (#1576) and merged into this branch. The follow-on+> schema-accuracy + drill-down type-table work is planned separately in+> `.ai/plans/2026-09-05-api-docs-type-tables.md` — it upgrades `scripts/lib/service-metadata.ts`+> to import validators and convert via native `z.toJSONSchema(v, { io: "input" })`; the richer+> manifest flows through `jsonSchema()`/`CarbonJsonSchemaConverter` into the v1 OpenAPI spec+> and MCP verbatim, no transport changes.++## Context++The docs present the PostgREST surface (`/api-reference`, 464 table/view endpoints generated from+`packages/database/src/swagger-docs-schema.ts`) as "the Carbon API — full read and write access".+That's the wrong surface to headline: PostgREST is the raw data plane; writing through it skips the+service layer, so derived state (stored totals, statuses, ledgers) is not recalculated and can be+silently corrupted. The real primary API is the service layer — 1,495 generated operations already+exposed as MCP tools — but it has no plain-HTTP transport, no per-operation scope enforcement+(MCP passes `{}` to `requirePermissions` and leans on RLS), and no docs identity beyond "MCP".++**Decisions locked with the user (do not relitigate):**+1. Build the HTTP RPC surface AND reposition the docs, phased.+2. Framework: **oRPC, pinned `^1.15.0`** for all `@orpc/*` packages (`server`, `contract`,+ `openapi`, `client`, `openapi-client`). v2 is beta-only; read docs at **v1.orpc.dev** —+ orpc.dev shows v2-beta syntax that will not work.+3. Naming: service layer = **"Carbon API"** (headline surface, transports: HTTP + MCP).+ PostgREST = **"Data API"** (secondary, read-mostly framing).+4. **The oRPC router is the single canonical execution layer.** MCP `call_tool` and the in-app+ agent are migrated to invoke procedures via oRPC's server-side `call()`. Per-op middleware+ (scope gate, blocked tools, DI of auth/db clients) is written once and shared by construction.+5. DI through oRPC context/middleware replaces the hand-assembled `ExecutorContext` — this is+ also the MCP implementation cleanup.+6. The PostgREST swagger file is NOT replaced — it keeps feeding the (demoted) Data API docs.+ The Carbon API's OpenAPI 3 spec is a second, separate artifact.+7. **Build-time everything — ZERO committed generated artifacts.** The manifest (successor of+ `tool-metadata.json`), the contract, and the OpenAPI spec are all produced at build/runtime+ by turbo-wired generate tasks; the committed `tool-metadata.json` is deleted after a one-time+ migration diff. (Note: `@carbon/database` generated DB types are unrelated and untouched.)++## Verified grounding facts (from exploration — trust, but re-verify line numbers)++- Services: `apps/erp/app/modules/{module}/{module}.service.ts`, plain exported async functions,+ first param `client: SupabaseClient<Database>` or `db: Kysely<KyselyDatabase>`, auth fields+ inside payloads. Zod validators in `{module}.models.ts`. Constraint: `{module}.service.ts` must+ never import `*.server` modules (bundled to browser via barrels); server-only additions go in+ `{module}.mcp.server.ts` (precedent: `production.mcp.server.ts`).+- `scripts/generate-mcp.ts` (842 lines, root script `generate:mcp`) textually parses services →+ `apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json`: 1,495 ops / 15 modules, entries+ `{ name, module, classification (READ|WRITE|DESTRUCTIVE), description, paramCount,+ serviceParams, injectAuth, schema }`. Schema is flattened/stripped/merged from the validators+ (single-object params flattened; `CONTEXT_PARAMS` client/db/companyId/createdBy/updatedBy/+ companyGroupId stripped; synthetic required `_operation: "create"|"update"` injected for ~96+ services branching on `"createdBy" in payload`).+- Dispatcher: `apps/erp/app/routes/api+/mcp+/lib/direct-executor.ts` — `executeFunction(name, ctx,+ args)`, static `functionRegistry` (15 `import * as x from "~/modules/x/x.service"` namespaces),+ positional calls from `serviceParams`, `enrichWithAuthContext` payload stamping, thenable await.+ Denylist: `lib/mcp-blocked-tools.ts` (`isMcpBlockedTool`).+- MCP route `apps/erp/app/routes/api+/mcp+/_index.ts`: stateless `@modelcontextprotocol/sdk`+ server registering only `search_tools`/`describe_tool`/`call_tool` (`lib/server.ts`). Auth+ `resolveAuth`: OAuth bearer (oauthToken table, SHA-256) OR `Bearer crbn_…` rewritten to+ `carbon-key` header → `requirePermissions(request, {})` — EMPTY permission set; RLS is the gate.+- In-app agent: `apps/erp/app/modules/agent/agent.tools.ts` imports `executeFunction` ++ metadata directly; restricted to `classification === "READ"`, gated by+ `AGENT_DATA_TOOLS_ENABLED` in `agent.config.ts`.+- API keys: `apiKey` table — `keyHash`, `scopes` JSONB `{"<module>_<action>": [companyIds]}`,+ `rateLimit` (default 60, **platform-controlled**: `settings.service.ts:1321-1359` strips it from+ writes), `rateLimitWindow`, `expiresAt`. App-side carbon-key branch of `requirePermissions` in+ `packages/auth/src/services/auth.server.ts` (~line 231): expiry 401 → `checkApiKeyRateLimit`+ 429 with `X-RateLimit-*`/`Retry-After` → `lastUsedAt` → scope check (empty `scopes` denies) →+ Cloud Starter-plan 403 → returns `getCarbonAPIKeyClient` (RLS).+- No tRPC/oRPC anywhere yet. React Router v7, remix-flat-routes. ERP pnpm package name is+ literally `erp` (not @carbon/erp).+- oRPC v1.15 facts (verified Sept 2026): `OpenAPIHandler` from `@orpc/openapi/fetch` takes a+ fetch `Request` — mounts in a resource-route action. `.route({method, path, tags, summary})`+ overrides default routing; path params `{name}`. Lazy needs `os.prefix('/x').lazy(() =>+ import(...))` — prefix mandatory for real deferral. `OpenAPIGenerator` (`@orpc/openapi`)+ accepts a contract or router; converters are pluggable via Standard Schema vendor check —+ a custom wrapper carrying precomputed JSON Schema works. Server-side invocation: `call(procedure,+ input, { context })` from `@orpc/server`. Reserved router keys: `then`, `bind`, `call`, `apply`,+ `valueOf`, `toString`, `toJSON` — codegen must assert no operation collides.+- Docs app at `docs/` (Fumadocs + Next.js, NOT under apps/). `/api-reference` generated by+ `docs/scripts/generate-api-docs.mjs` from the swagger schema → `docs/lib/api-data.generated.ts`;+ `/mcp` generated from tool-metadata.json → `docs/lib/tools-data.generated.ts`. `/mcp/tools`+ page hardcodes stale counts (1,200+/617/438/152 vs real 1,495/760/500/235). `docs/app/api/`+ exists but only holds `search/route.ts` — `/api` page URL is free. `CARBON_API_URL` is a real+ platform env var meaning the PostgREST origin (`packages/env/src/index.ts:155`) — do not+ confuse with docs snippet vars. Follow `.claude/skills/carbon-docs/SKILL.md` for all docs work.++## Architecture (target state)++```+HTTP: POST /api/v1/{module}/{operation} ─▶ routes/api+/v1+/$.ts (API-key auth)+ └─▶ OpenAPIHandler(router).handle(request)+MCP: POST /api/mcp → call_tool ──────────▶ call(router[module][op], args, { context })+Agent: agent.tools.ts (READ only) ─────────▶ call(router[module][op], args, { context })+ │+ ┌───────────────┴───────────────┐+ │ shared middleware chain │+ │ 1. gate (blocked + scopes) │+ │ 2. db (Kysely if needed) │+ │ 3. bridge handler │+ └───────────────┬───────────────┘+ ▼+ serviceFn(client, companyId, args) ← services unchanged+```++Key sketches (v1.15 API; adjust to reality during Phase 0 spike):++```ts+// packages/api/src/contract.ts — runtime builder, NOT codegen (minimal-artifact strategy):+// loops the committed manifest shards and produces the same shape the sketch below implies.+export const contract = buildContract(manifest); // per op: oc.route({method:"POST",+// path:`/${mod}/${op}`, tags:[mod], summary}).input(jsonSchema(op.schema))++// apps/erp/app/routes/api+/v1+/lib/base.server.ts+export interface AuthedContext {+ client: SupabaseClient<Database>; // RLS-scoped (key) or user-scoped (OAuth)+ userId: string; companyId: string; companyGroupId: string | null;+ authKind: "api-key" | "oauth";+ scopes: Record<string, string[]>;+}+const base = os.$context<AuthedContext>();+const gate = (meta: OperationMeta) => base.middleware(async ({ context, next }) => {+ if (meta.blocked) throw new ORPCError("NOT_FOUND");+ if (context.authKind === "api-key") assertScopes(context, requiredPermissionsFor(meta));+ return next();+});+const withDb = base.middleware(({ next }) => next({ context: { db: getDatabaseClient() } }));++// generated module segment (…/lib/modules/sales.server.ts)+base.route({ method: "POST", path: `/sales/${op}` })+ .use(gate(meta))+ .use(meta.serviceParams.includes("db") ? withDb : passthrough)+ .handler(({ input, context }) => dispatch(sales[op], meta, context, input));+// dispatch = the bridge: positional args from serviceParams + payload stamping+// (enrichWithAuthContext relocated, reading typed context)++// MCP call_tool (lib/server.ts) — the cleanup+const result = await call(router[module][op], args, { context: mcpCtx });+```++Response envelope: unwrap Supabase `{data, error, count}` exactly as `call_tool` does today →+HTTP `200 {data, count?}`; Supabase error → 400; missing scope → 403; blocked/unknown → 404.+Runtime input validation is pass-through in v1 (parity with MCP today); Ajv is deferred.++Why NOT zod-validator-referencing contracts (do not revisit): most ops don't take a single+`z.infer<typeof V>` param; the published schema is a transformed shape (flattening, stripping,+`_operation` injection); `zfd.*`/refinements would reject payloads MCP accepts; importing+`{module}.models.ts` drags app code into a publishable package.++---++## Part A tasks — API++> **STATUS (in progress).** Phase 0 + Phase 1 + the Phase 2 HTTP transport are DONE and+> committed (`fd525fc` foundation, `43de680` HTTP transport). oRPC pinned 1.15.0.+> Verified: 7-test oRPC mechanics suite (prefix match, `call()`, scope-gate 403, custom+> converter → spec); the REAL booted ERP app serves `GET /api/v1/openapi.json` as a valid+> 1495-path spec (route registration + runtime router build + OpenAPIGenerator all work);+> no-key → 401; full typecheck (erp + @carbon/api + @carbon/auth). The service-dispatch+> **happy path is NOT live-verified**: this checkout's `.env.local` is stale (dead Supabase+> domain + JWT keys that don't match the reachable stack), so the app can't reach its DB —+> an environment issue, not a code defect (the key row existed with a matching hash + clean+> FK; the 302 was requirePermissions falling to the session path on an unreachable Supabase).+> A `crbn up` env is needed to run the live smoke tests.+> **NOT DONE:** MCP `call_tool` + agent migration onto `call()` (a production auth/MCP+> behavior change — needs live verification before shipping), the API-key auth cache, and+> parity tests. Decision-7's build-time manifest relocation is deferred to Docs Phase 2+> (tool-metadata.json is also consumed by the workflow-catalog generator — wider blast radius+> than the plan assumed; the committed manifest now carries the `permission` field).++### Phase 0 — spike (½ day, throwaway branch ok)++- [x] Add `@orpc/server @orpc/contract @orpc/openapi @orpc/client @orpc/openapi-client` at+ `^1.15.0` (workspace catalog if the repo uses one; check `pnpm-workspace.yaml`).+- [x] Hand-build a 3-procedure router + splat resource route `apps/erp/app/routes/api+/v1+/$.ts`.+ Verify: (a) splat registers under a `+` folder in remix-flat-routes (NO existing splat in+ repo — if it fails try `api.v1.$.ts` flat name); (b) `handler.handle(request, { prefix:+ "/api/v1", context })` matches; (c) a thrown `Response` (429/403) from the action+ propagates with headers intact; (d) custom Standard-Schema converter output appears+ correctly in `OpenAPIGenerator` output.+- [x] Record findings in `.ai/runs/`; adjust the sketches below before proceeding.++### Phase 1 — codegen + `packages/api`++- [x] Extract the parse core of `scripts/generate-mcp.ts` into `scripts/lib/service-metadata.ts`+ exporting `buildAllToolMetadata(): ToolMetadata[]` (pure, no fs writes). **Verification:+ one-time diff of the new build-time output against the last committed tool-metadata.json —+ identical apart from the new `permission` field and per-module sharding — then delete the+ committed file and gitignore the output path.**+- [x] Add per-op `permission: { module: string | null, actions: ("view"|"create"|"update"|"delete")[] }`:+ - service-module → permission-module map: `items → "parts"`; `account`, `shared` → `null`;+ all others identity.+ - verb → actions: READ → `["view"]`; `insert|create|add|new|copy|duplicate|generate` →+ `["create"]`; `update|modify|set|change|edit|approve|reject|finalize|toggle|move|reorder|+ recalculate|sync|favorite|unfavorite|send|release|close|convert|run` → `["update"]`;+ `delete*` → `["delete"]`; `upsert*` → `["create","update"]`.+ - Unit-test the mapping in `scripts/` tests. Spot-check ~20 ops against the actual route+ permissions they correspond to (some production ops gate on `"quality"` in routes —+ record exceptions as a hand-curated override map in `service-metadata.ts`).+- [~] **DEFERRED (D1 in `.ai/plans/2026-09-07-orpc-completion.md`)** — the manifest stays one+ gitignored file (1.9 MB as of 2026-09-07) with the committed digest as the review contract.+ Revisit when erp typecheck regresses measurably against it, the server bundle carries it+ twice, or it passes ~4 MB; sharding then belongs with Docs Phase 2's generator work.+ Original item: `generate-mcp.ts` writes the manifest as gitignored, build-time per-module shards into+ `packages/api/src/manifest/{module}.json` (op → {schema, classification, description,+ serviceParams, injectAuth, permission, hasOperationFlag}) — replacing the committed+ `apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json` (deleted from git after the+ one-time migration diff); update the ERP MCP imports (`server.ts`, `agent.tools.ts`,+ docs generator, manifest tests) to read `@carbon/api/manifest`. NOTE: this refers to the+ MCP tool manifest ONLY — `@carbon/database` generated types are untouched. Exclude+ `MCP_BLOCKED_TOOL_NAMES` from surface exposure (blocked list stays enforced in middleware+ regardless); assert no op name is an oRPC reserved key (`then`, `call`, `toJSON`, …) —+ fail the generator loudly.+ **PARTIAL (2026-09-05).** The gitignore half is DONE: `tool-metadata.json` is+ untracked and gitignored, regenerated by `postinstall` and by the turbo root task+ `//#generate:mcp` that `typecheck`/`build`/`test` depend on (verified from a+ simulated fresh clone). NOT done: the per-module shards under+ `packages/api/src/manifest/` and the import rewrites — consumers still import the+ single JSON. Sharding is only worth doing if the file's SIZE becomes the problem+ (i.e. when response schemas land); the churn problem it was also meant to solve is+ already gone. Added beyond the plan: a committed digest+ (`tool-manifest.digest.json`, one line per operation) plus `pnpm check:manifest`+ and a pre-commit gate, because gitignoring the manifest otherwise removes the only+ place a contract regression is visible in review.+- [x] Create `packages/api` (`@carbon/api`) — internal workspace package (NOT published to npm;+ user decision — the public contract is the served OpenAPI spec, from which customers+ generate clients in any language). Keep it app-free anyway: the erp server, spec generator,+ and docs build all consume it, and app imports must not leak into the docs build.+ Deps ONLY `@orpc/contract`,+ `@orpc/client`, `@orpc/openapi-client`; devDep `@orpc/openapi`.+ **Build-time-everything strategy (user decision — ZERO committed generated artifacts):**+ - The manifest is generated at BUILD TIME, not committed: a turbo `generate` task in+ `packages/api` runs the service parser and emits gitignored per-module shards to+ `packages/api/src/manifest/{module}.json` (exported as `@carbon/api/manifest`).+ `apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json` is DELETED from git and its+ importers switched to `@carbon/api/manifest`.+ - Turbo wiring: erp `build`/`dev`/`typecheck` and docs `build` declare `dependsOn` the+ `@carbon/api#generate` task (cache keyed on the service files' contents — declare+ `apps/erp/app/modules/*/{*.service.ts,*.mcp.server.ts,*.models.ts}` as task inputs so+ the cache invalidates correctly). Dev ergonomics match today: after editing a service,+ rerun `pnpm generate:mcp` (or restart dev) — same as the current committed-file flow,+ minus the commit.+ - NO generated `types.ts` (typed client inputs were only for the unpublished npm client+ — drop `json-schema-to-typescript` entirely).+ - NO generated per-procedure `contract.ts` files: `src/contract.ts` is a ~50-line+ hand-written builder that constructs the `oc` contract object at module load by looping+ over the manifest shards (`OpenAPIGenerator` accepts a runtime-built contract).+ - NO committed `openapi.json`: the live endpoint generates it at runtime (memoized);+ the docs build runs `scripts/generate-openapi.mjs` itself (docs already run generators+ at build time per `.claude/rules/keep-sources-in-sync.md`).+ - Migration check: BEFORE deleting the committed `tool-metadata.json`, diff it once+ against the new build-time output (must match apart from the `permission` field and+ sharding) — then gitignore. The MCP manifest tests (`manifest.test.ts`,+ `apps/erp/test/mcp-tool-metadata.test.ts`) run against the generated output and must+ be ordered after the generate task in turbo.+ Files: `src/schema.ts` (the `jsonSchema()` Standard-Schema wrapper, vendor+ `"carbon-json-schema"`, pass-through validate + `CarbonJsonSchemaConverter`),+ `src/contract.ts` (runtime builder), optional `src/client.ts` (`createCarbonClient` via+ `OpenAPILink` — untyped inputs, internal dogfooding only, skip if unneeded),+ `scripts/generate-openapi.mjs` (build-time spec for docs; NOT committed;+ `securitySchemes: carbon-key apiKey header`).+ Wire into turbo build + the `generate:mcp` chain.+- [x] Verify: `pnpm generate:mcp` deterministic (run twice, no diff);+ `pnpm exec turbo run typecheck --filter=@carbon/api`;+ `pnpm --filter @carbon/api test` (converter, reserved-key assert, permission derivation).++### Phase 2 — server + MCP/agent migration++- [x] `apps/erp/app/routes/api+/lib/operation-gate.server.ts`: `getOperationMeta(name)`+ (module-lazy shard import), `requiredPermissionsFor(meta)`, `assertScopes`.+- [x] `apps/erp/app/routes/api+/v1+/lib/base.server.ts` (AuthedContext + gate/withDb middleware),+ `lib/router.server.ts` (15 `os.prefix().lazy()` entries), hand-written+ `lib/modules/{module}.server.ts` segments (~15 lines each: import service namespace ++ manifest shard, loop `buildModuleRouter(shard, namespace)` from a shared helper — no+ codegen needed since procedures are built at runtime from the manifest),+ `lib/handler.server.ts` (`new OpenAPIHandler(router)` module-scope singleton),+ `lib/dispatch.server.ts` (the bridge: positional args from `serviceParams`, payload+ stamping per `injectAuth` incl. array elements + `_operation` extraction — port the logic+ from `enrichWithAuthContext`, keep its unit-testable core pure).+- [x] `apps/erp/app/routes/api+/v1+/$.ts`: action = key auth (rewrite `Bearer crbn_…` →+ `carbon-key`, then `requirePermissions(request, {})` for client/rate-limit/plan — the+ per-op scope check lives in gate middleware, so pass the key's scopes into context) →+ `handler.handle` → envelope. OAuth bearers → 401 pointing at MCP (v1 = API keys only).+ Loader: `OPTIONS` 204, else 405. No CORS (keys don't belong in browsers) — document it.+- [x] `apps/erp/app/routes/api+/v1+/openapi[.]json.ts`: GET serving the memoized generated spec,+ `servers: [getAppUrl() + "/api/v1"]`.+- [x] Migrate MCP `call_tool` (`api+/mcp+/lib/server.ts`) and agent (`agent.tools.ts`) to+ `call(router[module][op], args, { context })`; `resolveAuth` output shaped into+ `AuthedContext` (`authKind: "oauth"` skips scope gate). Delete the `ExecutorContext`+ assembly; shrink/remove `direct-executor.ts` (keep `functionRegistry` only if segments+ don't fully replace it).+- [x] **API-key auth cache** (promoted from backlog, user decision): short-TTL (~30s) cache of+ the resolved key row (scopes, companyId, plan, expiry, rate-limit config) keyed by+ `keyHash`, in the carbon-key branch of `requirePermissions`+ (`packages/auth/src/services/auth.server.ts`) via `@carbon/kv` — cuts the per-request DB+ lookup on EVERY API/MCP call. Rate-limit counting stays uncached (it's a counter);+ `lastUsedAt` stays fire-and-forget. Bust the cache on key update/revoke — NOT from+ `settings.service.ts` (service files are browser-bundled via the barrel and must not+ import server-only modules like `@carbon/kv`): bust from the api-keys route actions+ (`x+/settings+/api-keys*.tsx`) or a `settings.server.ts` helper. Accepted tradeoff:+ revocation lags ≤ TTL. Add a test for the busting path.+- [x] **Parity tests**: for a representative op per classification and per `injectAuth` variant,+ assert `call()` result === old `executeFunction` result (fixture the service fn via an+ injectable dispatch). Changelog note: under-scoped API keys now 403 on MCP where RLS+ previously allowed.+- [x] Verify: `pnpm exec turbo run typecheck --filter=erp --filter=@carbon/api`;+ `pnpm --filter erp test`; `pnpm run lint`. Live smoke against `crbn up` stack (do NOT+ rebuild the db; use the user's running stack): curl 200 (READ op), 403 (missing scope),+ 429 (hammer), 404 (blocked op + unknown op), `GET /api/v1/openapi.json` valid JSON;+ MCP still answers `search_tools`/`call_tool` via an MCP client or curl JSON-RPC.++---++## Part B tasks — Docs (docs Phase 1 is independent; can ship before Part A)++Follow `.claude/skills/carbon-docs/SKILL.md` throughout. Grounding corrections already made:+rate limits are platform-controlled (`api-keys.mdx` is RIGHT, the MCP FAQ is WRONG — fix the FAQ);+`CARBON_API_URL` platform var is out of docs scope (only rename reader-facing snippet vars).++### B1 — IA restructure (`/mcp` → `/api`) ✅ committed 964fe09++- [x] Header nav (`docs/components/main-header.tsx`, `docs/components/mobile-nav.tsx`):+ **Reference · Guides · API (/api) · Data API (/api-reference)**. MCP folds INTO the API+ surface — one catalog, two transports; no top-level MCP item.+- [x] Create `docs/app/api/{page,authentication/page,mcp/page,operations/page,operations/[operation]/page}.tsx`+ + `layout.tsx` (clone `docs/app/mcp/layout.tsx`): `/api` overview (Phase 1 documents ONLY+ the MCP transport — no vaporware about HTTP until it ships), `/api/authentication` (from+ `mcp/authentication`), `/api/mcp` "Connect over MCP" (snippets + FAQ from `mcp/page.tsx`),+ `/api/operations[/…]` (from `mcp/tools[/…]`; slug = tool name = future oRPC operation id).+ Rework `docs/components/api/mcp-nav.tsx` → `ApiSurfaceNav`. (New pages compute counts live+ from the generated catalog, so no stale literals were reintroduced.)+- [x] Permanent redirects in `docs/next.config.mjs`: `/mcp`→`/api/mcp`, `/mcp/authentication`→+ `/api/authentication`, `/mcp/tools`→`/api/operations`, `/mcp/tools/:tool`→+ `/api/operations/:tool`. Delete `docs/app/mcp/` after.+- [x] Paired ERP change: `mcpDocs` in `apps/erp/app/utils/path.ts` (~1404) → `/api/mcp`.+ (Also updated the same doc URLs in `agent-setup-prompt.md`, and set the Data API layout's+ `active` to the new `data-api` nav key — the nav-key rename made both necessary.)++### B2 — renaming sweep (PostgREST → "Data API") ✅ committed b1ca4ac++- [x] `docs/app/api-reference/page.tsx`: eyebrow → `Data API`; lead → "direct REST access to+ Carbon's tables and views — the raw data plane under the [Carbon API](/api)"; drop+ "three ways to call it"; snippet env vars → `CARBON_DATA_API_URL`/`CARBON_DATA_API_KEY`.+- [x] `api-reference/authentication/page.tsx` (eyebrow), `[module]/[resource]/page.tsx`+ (title suffix `— Carbon Data API`, breadcrumb `Data API`), `docs/components/api/api-nav.tsx`+ (section label), `docs/components/api/sdk-cards.tsx` (reframe as Data API clients).+- [x] `docs/lib/seo.ts`: `SEO.api.*` → Data API wording; `SEO.carbonApi.*` added in B1;+ "1,200+" was removed with the old `SEO.mcp.tools` block in B1 (none remains).+- [x] `docs/components/search/search-command.tsx`: facets All/Guide/Reference/API/Data API;+ `surfaceOf()` remap (check `/api-reference` before `/api`; new `data-api` tone key).+ `docs/lib/search-index.ts`: resource breadcrumbs `["Data API",…]`; tool breadcrumbs+ `["API",…]` with `/api/operations/…` URLs.+- [x] `docs/app/sitemap.ts` (new /api entries: hub 0.7, ops 0.5; demote Data API resources 0.4,+ `/api-reference` 0.5; drop /mcp), `docs/app/not-found.tsx`, `docs/app/layout.tsx` keywords.++### B3 — steering copy ✅ committed efc1704++- [x] Data API overview: `<Warn title="Writes belong on the Carbon API">` — direct writes skip+ the service layer, derived state is not recalculated; treat Data API as read-mostly (bulk+ reads, analytics, exports). Keep "Always read from the view" as the concrete evidence.+- [x] Per-resource TABLE pages: one steering line via a `WriteSteerCallout` sibling of+ `docs/components/api/view-callout.tsx`, rendered from the page component (not baked into+ the generator). (Also trimmed ViewCallout's old "use this table for writes" line, which+ now contradicts the steer.)+- [x] `api-keys.mdx`: restructure into "The Carbon API" (primary) / "The Data API" (advanced ++ warning); one key unlocks both. (Regenerated agent KB; incidentally fixed pre-existing+ `inspections.md` kb drift.)++### B4 — inconsistency fixes (1,2 ✅ committed a69a3ce · 3 BLOCKED · 4 DECISION PENDING)++- [x] Stale counts on the operations page: compute from generated data — add `toolCounts()` to+ `docs/lib/tools-data.ts`; kill every hardcoded literal (page + seo.ts). (The `/api` and+ `/api/operations` pages route through `toolCounts()`; "1,200+" was already removed in B1.)+- [x] Rate-limit copy: fix the MCP FAQ entry ("each key has its own limit, 60/min default, shown —+ not settable — in Settings → API Keys"); align `/api-reference/authentication` line.+- [x] Bearer-vs-`carbon-key` + path shape — **RESOLVED** (committed baf3063). The user supplied+ the Cloudflare worker: client sends `Authorization: Bearer crbn_…` over **bare** table paths+ (`https://rest.carbon.ms/<table>`), the worker translates to `carbon-key` internally. The+ auth page was already canonical; converged `api-keys.mdx` onto it and added a self-hosted+ note (direct PostgREST → `carbon-key` + `/rest/v1/<table>`). See+ [[reference_rest_carbon_ms_proxy]].+- [~] **SKIPPED (user: "keep going", accepted the recommendation).** Shard the docs generated+ data. Finding: the "tsserver choking"+ rationale is already mitigated by the generator (`@ts-nocheck` + `JSON.parse(<string+ literal>)`, so tsc never infers over the data); the build-speed win is marginal for these+ statically-generated server components (webpack dedupes the shared module — imported once);+ and `search-index.ts` needs ALL resource data (field-level index), so the largest consumer+ can't shard. Blast radius is the generator + `api-data.ts`/`tools-data.ts` + every Data+ API/search/sitemap consumer. Awaiting the user's call: do the full per-module refactor, or+ accept the existing mitigation. Original text:+ `docs/scripts/generate-api-docs.mjs` currently emits one 5.2MB+ `docs/lib/api-data.generated.ts` — split it per module+ (`docs/lib/generated/api/{module}.ts` + a small index), and the per-resource page+ imports only its module's shard. Do the same for `tools-data.generated.ts` (513KB).+ Speeds the docs build and stops editors/tsserver choking on the monoliths. Never+ hand-edit generated output (repo rule); verify with `pnpm --filter docs build`.++### B5 — landing + Building section ✅ committed c64487f++- [x] `docs/content/docs/index.mdx`: add "Build on Carbon" `<Cards>` — Carbon API (/api),+ Data API (/api-reference), API keys, Webhooks.+- [x] Move `reference/api-keys.mdx` → `building/api-keys.mdx`; `building/meta.json` →+ `{"title": "Building on Carbon", "pages": ["api-keys", "webhooks", "local-development"]}`;+ remove from `reference/meta.json`; redirect `/docs/reference/api-keys` →+ `/docs/building/api-keys`; sweep inbound links (permissions ×3, two-factor,+ `company-settings.mdx`, `building/webhooks.mdx` Related card, glossary+ `packages/glossary/src/terms.ts`). The plan's line-number list was partial; swept all.+- [x] Regenerate agent KB (`pnpm run generate:agent-kb`) and commit `apps/erp/app/modules/agent/kb/**`+ in the same commit as MDX changes.++### Docs Phase 2 (after the Carbon API ships)++- [ ] Extend `docs/scripts/generate-api-docs.mjs`: run `packages/api/scripts/generate-openapi.mjs`+ at docs build time (no committed spec — build-time-everything strategy), consume its+ output + `@carbon/api/manifest`, join BY OPERATION NAME → merged+ `docs/lib/operations-data.generated.ts` with+ `{name, module, classification, description, schema, http: {method, path, samples}}`+ (reuse the existing httpsnippet pipeline).+- [ ] `/api/operations/[operation]`: transport `<Tabs>` — HTTP (method badge, path, curl/JS+ samples) + MCP (`call_tool` snippet).+- [ ] `/api` + `/api/authentication`: HTTP quickstart with `CARBON_API_URL`/`CARBON_API_KEY`+ (the primary API now earns the unprefixed names) — curl + "generate a client from+ `GET /api/v1/openapi.json`" (openapi-generator/orval); no npm package (not published).+- [ ] Optional (needs sign-off): `/api-reference` → `/data-api` cutover with permanent+ redirects + ERP `apiDocs` path + sitemap/search/canonicals.++### Docs verification loop (every docs step)++Dev server on port 3002 (`pnpm --filter docs dev`) — NEVER kill/restart a server the user is+running. `pnpm exec fumadocs-mdx` after frontmatter changes; `curl -sS` new pages for 200 ++expected headings (an unquoted colon in frontmatter 500s the whole site); redirect check+`curl -sI /mcp/tools` → 308. Gold standard: `pnpm --filter docs build` green in a clean state+(also runs the generators, catching count regressions). Check search facets in ⌘K, `/sitemap.xml`.++---++## Execution order++1. Docs Phase 1 (B1–B5) — independent, ships immediately, establishes positioning.+2. API Phase 0 spike → Phase 1 codegen/`packages/api` → Phase 2 server + MCP/agent migration.+3. Docs Phase 2.+4. Deferred backlog: READ→GET routing with `Cache-Control`/ETag (classification is in+ metadata — makes reads CDN-able), oRPC batch plugin for HTTP integrators (verify plugin+ identifier against v1.orpc.dev; rate limit MUST count per batched operation, not per+ request, or batching becomes a limit bypass), MCP `call_tools` batch meta-tool (MCP spec+ removed JSON-RPC batching and the oRPC batch plugin is HTTP-only — batch server-side by+ looping `call()`; READ-only first, per-item results, middleware enforcement inherited+ per item), opt-in Ajv request validation, OAuth bearer auth on `/api/v1`, typed client+ outputs, `/data-api` URL cutover.+ (Promoted INTO scope: API-key auth cache — Part A Phase 2; docs generated-data sharding —+ Part B B4. npm publish of `@carbon/api`: explicitly OUT — user decision; customers+ generate clients from the served OpenAPI spec.)++## Open questions (ask the user when reached — do not guess)++1. **rest.carbon.ms proxy** (blocks B4 item 3): which header (`Authorization: Bearer` vs+ `carbon-key`) and path shape (bare `/table` vs `/rest/v1/table`) does it accept? Infra, not+ answerable from the repo.+2. `upsert*` requiring BOTH `create`+`update` scopes — confirm (alternative: branch on `_operation`).+3. `account`/`shared` ops with `permission: null` → gated only by "valid unexpired key of the+ company" (today's MCP behavior) — confirm or hand-curate.+4. `/api-reference` → `/data-api` migration (docs Phase 2) — sign-off.++## Risks++- oRPC v2 migration later (mitigated: the whole surface is regenerable codegen).+- Splat-route registration under `api+/v1+/` unverified (Phase 0 spike de-risks; fallback names listed).+- MCP scope-gate 403s for existing under-scoped keys (accepted; changelog note required).+- Per-op permission verb-mapping heuristic will have exceptions (Phase 1 spot-check + override map).+- Plan gating: the Business-plan 403 in `requirePermissions` applies to the new surface+ automatically via the shared carbon-key branch — verify in smoke tests, don't reimplement.+- Build-time generation makes dev/CI depend on the generate task: turbo `inputs` must list the+ service/model globs correctly or caching serves a stale manifest; in dev, editing a service+ requires rerunning `pnpm generate:mcp` (unchanged from today's flow, but now nothing committed+ catches drift — the manifest tests in CI are the guard).++## Key files++Modify: `scripts/generate-mcp.ts`, `apps/erp/app/routes/api+/mcp+/lib/server.ts`,+`apps/erp/app/routes/api+/mcp+/_index.ts`, `apps/erp/app/modules/agent/agent.tools.ts`,+`packages/auth/src/services/auth.server.ts` (carbon-key branch gains the `@carbon/kv`+short-TTL key cache), api-keys route actions under `x+/settings+/api-keys*.tsx` (cache+busting on key update/revoke — not the service file, which is browser-bundled),+docs files per Part B.+Create: `scripts/lib/service-metadata.ts`,+`packages/api/**` (hand-written core + gitignored build-time `src/manifest/` output),+`apps/erp/app/routes/api+/v1+/**`,+`apps/erp/app/routes/api+/lib/operation-gate.server.ts`, `docs/app/api/**`,+turbo `generate` task wiring in `turbo.json`.+Delete (after migration): committed `apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json`+(one-time diff first, then gitignore the new output path), most of `direct-executor.ts`,+`docs/app/mcp/`.diff --git a/.ai/plans/2026-09-05-api-docs-type-tables.md b/.ai/plans/2026-09-05-api-docs-type-tables.mdnew file mode 100644index 0000000000..293ffc2e41--- /dev/null+++ b/.ai/plans/2026-09-05-api-docs-type-tables.md@@ -0,0 +1,159 @@+# Accurate, drill-down type tables for the API docs (zod-v4-native)++Branch: `feat/carbon-api-orpc` (all prerequisites now live here — no stacking).+Supersedes the pre-zod-v4 draft that planned this as a stacked PR.++## What changed since the first draft++- **Zod 4.5.4 is merged to main** ([#1576](https://github.com/crbnos/carbon/pull/1576)) and main is+ merged into this branch (`c9ee69661f`). The "upgrade zod first" prerequisite is DONE.+- `z.toJSONSchema(validator, { io, unrepresentable: "any" })` is available natively — no+ third-party converter. **Probed 2026-09-05 against real Carbon validator shapes** (results+ below) — the accuracy bar ("drill-down + correct values or it's not worth it") is achievable.+- The refined item validators now carry both generics (`z.ZodType<z.infer<T>, z.input<T>>`,+ restored in `fa790a9410`), so `z.input`/`z.output` distinction is intact end to end.++## Grounding facts (verified on this branch, 2026-09-05)++**Probe results — `z.toJSONSchema(v, { io: "input", unrepresentable: "any" })`:**++| Validator shape | Emitted (input side) |+|---|---|+| `z.enum([...])`, incl. inside `z.preprocess` | real `enum: [...]` values ✓ |+| nested `z.object` | `properties` + `required`, recursive ✓ |+| `.default(1)` | `default: 1` annotation AND omitted from `required` ✓ |+| `zfd.text(z.string().optional())` | optional `{type:"string"}` ✓ (pipe input side resolves through the transform) |+| `zfd.numeric(z.number().min(0).max(1))` | `{type:"number", minimum, maximum}` ✓ |+| `z.record(z.string(), z.number())` | `additionalProperties: {type:"number"}` (+ `propertyNames`) ✓ |+| refined objects (`applyStorageAndShelfLifeRefines` output) | converts fine, all keys preserved ✓ |+| `zfd.checkbox()` | `anyOf: [{const:"on"}, {}, {type:"boolean"}]` — FormData-truthful but noisy → **normalize** (below) |++**`io: "output"` is available but NOT the manifest schema.** Output = the post-parse shape the+service receives (defaults required, transforms applied, checkbox → `{}`), not the API response.+The caller contract is the INPUT side; use it for the manifest/OpenAPI/docs. Response types still+need ReturnType reflection — stays deferred (see Non-goals).++**The transport already forwards whatever the manifest says, verbatim:**+- `apps/erp/app/routes/api+/v1+/lib/router.server.ts` → `.input(jsonSchema(meta.schema))`;+ `packages/api/src/schema.ts` wraps the precomputed JSON Schema as a pass-through Standard+ Schema and `CarbonJsonSchemaConverter` emits it verbatim into the OpenAPI spec.+- MCP `describe_tool`/`search_tools` and the docs generator read the same manifest.+- So Phase 1's richer schemas reach the v1 OpenAPI spec, MCP, and the docs **with zero+ transport changes**. The v1 dispatcher reads only `serviceParams`/`injectAuth`/+ `schema.properties._operation` — richer property schemas cannot break dispatch.++**Generator today:** `scripts/lib/service-metadata.ts` (880 lines, this branch) regex-parses+validator SOURCE text; `parseValidatorFields` resolves `z.infer<typeof X>` textually. That+textual resolution is what Phase 1 replaces with a real import + native conversion. 351 service+params are `z.infer<typeof …>` against 419 validators in the `{module}.models.ts` files.++**Manifest regression tests:** `apps/erp/test/mcp-tool-metadata.test.ts` pins semantic shapes+(array-of-objects `items.properties` sans `createdBy`, DESTRUCTIVE classification, `_operation`).+These should PASS with better schemas; adjust only literal expectations that shift.++## Phase 1 — validator-backed schemas via native conversion++- [ ] In `scripts/lib/service-metadata.ts`: when a param matches `z.infer<typeof X>` (the+ textual detection already yields the validator NAME + module), dynamically import the+ module's models file (`{mod}.models.ts` / `.ee.models.ts` — client-safe by construction,+ tsx can load them) and convert through one seam:+ ```ts+ import { z } from "zod";+ function toJsonSchema(v: z.ZodType): Record<string, unknown> {+ return z.toJSONSchema(v, { io: "input", unrepresentable: "any" });+ }+ ```+- [ ] **Normalization post-pass** (runs on the converted schema before manifest write):+ 1. Drop the `$schema` key.+ 2. Collapse the zfd-checkbox shape (`anyOf` of `{const:"on"}`/`{}`/`{type:"boolean"}`)+ to `{type:"boolean"}` — JSON callers send booleans; the "on" member is FormData plumbing.+ 3. Flatten any `$defs`/`$ref` the converter emits for reused sub-schemas (default is+ inline; verify). A truly cyclic validator → fallback (next item).+- [ ] **Fallback per validator, never silently degrade**: if import or conversion throws, keep+ the existing textual schema for that op and record it in the diff report.+- [ ] Post-conversion invariants unchanged and re-asserted: strip `CONTEXT_PARAMS` (top level+ AND array `items.properties`), single-object flattening, `_operation` injection after+ conversion, blocked tools/descriptions/classification/injectAuth/permission untouched.+- [ ] `(typeof X)[number]` params (today → bare `"string"`): import the const array from the+ models module, emit a real `enum: [...]`.+- [ ] **Diff report**: old→new manifest comparison printing per-op gained/changed properties,+ enums surfaced, nested depth — the accuracy evidence. Exemplars to spot-check:+ `sales_copyQuote.type` (enum `item|quoteLine|method|quoteToQuote`),+ `production_buildAssemblyToolStepLinks` (nested `sourceSteps` items),+ `production_getJobMaterialsWithQuantityOnHand` (depth-2 + defaults).+- [ ] Determinism: generator twice, empty diff. Run manifest tests + `orpc-mechanics.test.ts`;+ `pnpm exec turbo run typecheck --filter=erp --filter=@carbon/api`;+ `pnpm run check:workflow-catalog` (same manifest feeds it).+- [ ] Verify flow-through: `GET /api/v1/openapi.json` carries the richer input schemas+ (spot-check one path's requestBody); MCP `describe_tool` on an exemplar returns them.++## Phase 2 — `SchemaTable`: recursive, expandable type table (docs)++Decision reaffirmed: custom component, NOT fumadocs `AutoTypeTable` — it reflects TS types from+`.ts` files (not JSON Schema), and the repo already re-implemented TypeTable as `<FieldTable>`+for styling reasons. Both are zod-version-independent.++- [ ] New `docs/components/api/schema-table.tsx` (`"use client"`): recursive JSON-Schema+ renderer in the warm-paper style, accordion interaction modeled on+ `docs/components/editorial/field-table.tsx`, row anatomy on `docs/components/api/fields.tsx`.+ Per row: name (mono), type label, `required`/`optional` badge, `default` badge, description.+ Expansion cases (all shapes verified in the probe):+ - `enum` → label `enum`, expand reveals value chips; ≤4 values may render inline.+ - `object` + `properties` → expand recurses (data max depth 2; component arbitrary).+ - `array` + `items.properties` → label `object[]`, expand into element rows; primitive+ arrays label `string[]` etc., no chevron.+ - `record` (`additionalProperties` object w/o `properties`) → label like+ `Record<string, number>`; drill into the value schema when it's an object.+ - union `["string","null"]` → `string | null`; other `anyOf` → joined labels.+ - `{}` → `any` (accurate for `Json`-typed props).+ Rows with nothing to expand render without a chevron.+- [ ] `docs/app/api/operations/[operation]/page.tsx`: replace the flat `Parameters`/`propType`+ block with `<SchemaTable schema={t.schema} />`. Keep "Call it" + raw "Input schema".+ `_operation` renders as an ordinary required enum (it IS the caller contract).+- [ ] `exampleArgs`: enum fields use their first enum value instead of `"string"`.++## Phase 3 — Data API pages: enums + response fields++- [ ] `docs/scripts/generate-api-docs.mjs` `attributesFrom`: carry `enum: p.enum` and+ `default: p.default` into the attribute; extend `ApiAttribute` in `docs/lib/api-types.ts`.+ (The swagger already holds the values — 372 enum lines in `swagger-docs-schema.ts`.)+- [ ] `docs/components/api/fields.tsx`: enum rows become expandable (share the SchemaTable row+ shell), revealing values under the named type (`maintenanceDispatchStatus` → its 5 values).+ JSONB stays `json` — no invented structure.+- [ ] Response fields for reads: list/retrieve endpoints get `responseAttributes` (the table's+ own columns ARE the row shape PostgREST returns) rendered as a collapsed "Response fields"+ table in `endpoint-section.tsx`/`code-panel.tsx`, next to the example JSON.+- [ ] `pnpm --filter docs build` green.++## Unlocked but deferred (each needs a user go-ahead)++- **Runtime input validation on v1**: `packages/api/src/schema.ts`'s `validate()` is a+ deliberate pass-through (parity with MCP). Now that carried schemas are real, Ajv over the+ carried JSON Schema — or importing the actual validators per-op — would give callers proper+ 400s with field errors. Separate change; don't fold into this PR.+- **Operation RESPONSE schemas** (docs + oRPC `.output()`): needs ReturnType reflection over+ service functions (unwrap `Promise<PostgrestResponse<…>>`) — `io: "output"` does NOT provide+ this (it's the validator's post-parse shape, not the service return). Revisit after Phase 1.+- **Deprecated-form modernization** (`errorMap:`→`error:` style sweep, `.merge()`→`.extend()`):+ still works under v4; a later cleanup.++## Verification++1. Diff report reviewed (exemplars show real enums/nesting); double-run determinism; manifest ++ oRPC mechanics tests; erp/@carbon/api typecheck; workflow-catalog check.+2. Live: `describe_tool` + `/api/v1/openapi.json` on the running stack carry richer schemas.+3. Docs dev server: `/api/operations/sales_copyQuote` expands enum values;+ `production_buildAssemblyToolStepLinks` drills into `sourceSteps`; a Data API resource page+ expands a named enum and shows Response fields on GET. Then clean `pnpm --filter docs build`.+4. Commit per phase via /check-and-commit.++## Key files++Modify: `scripts/lib/service-metadata.ts` (+`toJsonSchema` seam + normalization pass),+`scripts/generate-mcp.ts` (diff-report flag), regenerated+`apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json`,+`docs/app/api/operations/[operation]/page.tsx`, `docs/components/api/fields.tsx`,+`docs/scripts/generate-api-docs.mjs`, `docs/lib/api-types.ts`,+`docs/components/api/{endpoint-section,code-panel}.tsx`.+Create: `docs/components/api/schema-table.tsx` (+ shared row shell), diff-report helper in+`scripts/lib/`.diff --git a/.ai/plans/2026-09-07-orpc-completion.md b/.ai/plans/2026-09-07-orpc-completion.mdnew file mode 100644index 0000000000..51019dc79a--- /dev/null+++ b/.ai/plans/2026-09-07-orpc-completion.md@@ -0,0 +1,693 @@+# Carbon API oRPC — completion (MCP + agent on `call()`, API-key cache, parity tests)++Branch: `feat/carbon-api-orpc`. Continuation of `.ai/plans/2026-09-04-carbon-api-orpc.md`+(Part A HTTP transport + Part B docs are done and committed). This plan covers ONLY the+remaining unchecked Part A work. Read the parent plan's "Verified grounding facts" and+locked decisions before starting; decision 4 (the oRPC router is the single canonical+execution layer) is what this plan finishes.++Concurrent change, do NOT touch: `resolveAuth`'s OAuth branch in+`apps/erp/app/routes/api+/mcp+/_index.ts` is gaining a Redis rate limit (60/min per user,+`@carbon/kv` `Ratelimit`) in a separate change. Every edit this plan makes to that file is+additive and outside the OAuth branch's body (Task 5, step 2) — if you hit a merge+conflict there, keep BOTH: the rate-limit call and the two extra context fields.++## Status of the parent plan's unchecked items (verified against code 2026-09-07)++| Parent plan item | Real state |+|---|---|+| Phase 0 spike (deps, splat route, converter) | DONE — `@orpc/*` pinned `^1.15.0` in `pnpm-workspace.yaml` catalog; `apps/erp/app/routes/api+/v1+/$.ts` + `openapi[.]json.ts` live; 8 assertions in `apps/erp/app/routes/api+/v1+/lib/orpc-mechanics.test.ts` green. Checkboxes were never ticked. |+| Phase 1 `scripts/lib/service-metadata.ts` + `permission` field | DONE (1029 lines, `derivePermission` at ~line 635, `PERMISSION_MODULE_MAP`, empty `PERMISSION_OVERRIDES`). **Missing: the unit test of the mapping + the ~20-op spot-check** → Task 8. |+| Per-module manifest shards (line ~206, `[~]`) | **DEFERRED — see D1.** |+| `packages/api` + turbo wiring | DONE (`//#generate:mcp` root task; `typecheck`/`build`/`test` depend on it; `tool-metadata.json` gitignored; `tool-manifest.digest.json` + `pnpm check:manifest` + pre-commit gate). |+| Phase 2 server files | DONE, but laid out differently from the sketch: no `api+/lib/operation-gate.server.ts` and no per-module `lib/modules/*.server.ts` — the gate lives in `lib/base.server.ts` and the whole router is built at module load from the manifest in `lib/router.server.ts`. That is equivalent; do not "fix" it. |+| MCP `call_tool` + agent on `call()` | **NOT DONE** → Tasks 4–7. |+| API-key auth cache | **NOT DONE** → Tasks 2–3. |+| Parity tests | **NOT DONE** → Task 1 (+ converted in Task 7). |+| Live smoke (200/403/404/429, MCP JSON-RPC) | **NOT DONE** (the earlier attempt was blocked by a stale `.env.local`) → Task 9. |++## Grounding facts discovered while planning (trust these; re-verify line numbers)++1. **There is a THIRD caller of `executeFunction`, which the parent plan never mentions:**+ `apps/erp/app/routes/api+/inngest.ts:34` does `setWorkflowDispatch(executeFunction)`.+ `packages/jobs/src/workflows/actions/create.ts` runs every workflow `*.create` action+ through it. Deleting `executeFunction` without migrating this breaks customer workflows.+ Good news: `create.ts` already tolerates an unwrapped payload — it checks+ `envelope.error` first, then `idIn(envelope.data ?? result.data)`, and `idIn` walks+ arrays — so a `{ success, data }` result carrying UNWRAPPED data works unchanged.+ The four `call` ids in `packages/workflows/src/catalog/actions.ts` are+ `production_insertJob`, `quality_insertIssue`, `purchasing_insertPurchaseOrder`,+ `sales_insertSalesOrder` — all `insert*`, so none carries `_operation`.+2. **Blocked tools are already absent from the manifest.**+ `scripts/lib/service-metadata.ts:935` skips `MCP_BLOCKED_TOOL_NAMES`, so they never+ reach `OPERATIONS` and therefore never reach the router. The runtime denylist checks in+ `server.ts` and `agent.tools.ts` are the only ones that produce the "Tool disabled"+ message — keep them.+3. **`apps/erp/app/routes/api+/mcp+/_index.ts` declares its OWN local `McpContext`**+ (lines 32–37, `SupabaseClient` untyped) that duplicates the one in `lib/types.ts`+ (`SupabaseClient<Database>`). `getUserScopedClient` returns `SupabaseClient<Database>`,+ so collapsing them onto `AuthedContext` typechecks.+4. **`dispatch.server.ts` already IS the shared bridge** — it imports+ `functionRegistry` / `enrichWithAuthContext` / `extractOperation` / `ExecutorContext`+ *from* `../../mcp+/lib/direct-executor`. The dependency currently points the wrong way+ (canonical layer → legacy executor); Task 4 inverts it.+5. **`getCompanyIdFromAPIKey` has exactly two callers**:+ `packages/auth/src/services/auth.server.ts:237` (inside `requirePermissions`) and+ `apps/erp/app/routes/api+/v1+/lib/authenticate.server.ts:46`. So ONE HTTP API call+ already does two `apiKey` selects today.+6. **`apps/erp/app/modules/settings/index.ts` does NOT export `settings.server.ts`** —+ safe home for `@carbon/kv` cache busting. `apps/erp/app/modules/agent/index.ts` DOES+ re-export `agent.tools`, but no client component imports `~/modules/agent` (only the+ four resource routes under `routes/api+/agent+/`), which is why today's transitive+ `~/services/database.server` import already builds. Task 6 adds an explicitly+ `.server`-named import there — the `pnpm --filter erp build` in Task 9 is what proves+ the `react-router:dot-server` plugin still accepts it.+7. `oncePerRequest` (`packages/logger/src/context.server.ts:86`) is a pass-through when+ there is no request context (jobs, tests) — safe to use unconditionally.+8. `tool-metadata.json` is now **1.9 MB** (was 1.3 MB before response schemas landed) with+ **8 importers**: `mcp+/lib/{server,direct-executor,manifest,manifest.test}.ts`,+ `v1+/lib/operations.server.ts`, `modules/agent/{agent.tools,agent.prompt}.ts`,+ `apps/erp/test/mcp-tool-metadata.test.ts`, plus `docs/scripts/generate-api-docs.mjs`+ and `scripts/check-workflow-catalog.ts` reading it from disk.++## Decisions taken in this plan (do not relitigate mid-execution)++**D1 — Per-module manifest shards: DEFER, explicitly.** The parent plan's `[~]` item stays+open, with the deferral now on record instead of "partial".+*Why:* the two problems sharding was meant to solve are gone — commit churn (the file is+gitignored, with `tool-manifest.digest.json` + `pnpm check:manifest` giving reviewers a+one-line-per-operation contract diff) and tsserver inference (every consumer already casts+through `ManifestEntry`). What remains is a mechanical rewrite of 8 importers plus the+generator, the digest, the docs generator and the workflow-catalog checker — a broad blast+radius landing in the same PR as a production auth/behaviour change, for no user-visible+gain. Docs Phase 2 already has to touch the docs generator and `@carbon/api` to merge the+OpenAPI spec with the manifest; sharding belongs there.+*Trigger to revisit (record it in the parent plan):* do it when EITHER `pnpm exec turbo run+typecheck --filter=erp` regresses measurably against the manifest, OR the erp server bundle+carries the manifest more than once, OR the file passes ~4 MB. Note the size for the record:+1.9 MB today.++**D2 — The workflow dispatcher migrates too.** `callOperation` (the shim built in Task 4)+becomes the single entry point for all three non-HTTP callers: MCP `call_tool`, the in-app+agent, and `setWorkflowDispatch`. Only then can `direct-executor.ts` be deleted.++**D3 — `AuthedContext.authKind` gains a third value: `"session"`.** The in-app agent and the+workflow engine run as an already-authorized user (route `requirePermissions` / the+workflow owner's client). Reusing `"oauth"` for them would overload a wire-protocol name+with "trust me"; `"session"` says what it means. The gate condition stays+`authKind === "api-key"` — unchanged behaviour for both existing kinds.++**D4 — Output/error parity mapping (MCP `call_tool` text must stay byte-identical).**++| Case | Today (`executeFunction` + `server.ts`) | After (`callOperation` + `server.ts`) |+|---|---|---|+| Supabase result, no error | `JSON.stringify(result.data.data, null, 2)` (count dropped) | `JSON.stringify(result.data, null, 2)` (count dropped) — identical |+| Supabase result, `data: null` | `"null"` | `"null"` (the check is `data === undefined`, not falsiness) |+| Supabase result, `error` set | `Database error: ${JSON.stringify(error)}`, `isError` | identical — `dispatchOperation` attaches the raw error as `ORPCError.data.supabase`, `callOperation` returns `errorKind: "database"` and `server.ts` prints it without the `Error: ` prefix |+| Non-Supabase truthy result | `JSON.stringify(result.data, null, 2)` | identical |+| Non-Supabase `undefined` result | `"Operation completed successfully"` | identical |+| Non-Supabase falsy scalar (`0`/`""`/`false`) | `"Operation completed successfully"` | `"0"` / `""` / `"false"` — **accepted delta**, strictly more informative; no service in the registry returns a bare scalar |+| Service throws | `Error: ${error.message}` | identical (`callOperation` catches; `errorKind: "execution"`) |+| Blocked tool | `Tool disabled: ${name} is not available via MCP.` | identical (denylist check stays in `server.ts`, and is repeated in `callOperation`) |+| Unknown name | `Error: Function not found: x in module y` (thrown, caught by `withErrorHandling`) | `Error: Operation not found: ${name}` — **accepted delta**, wording only |+| `arguments` as an unparseable JSON string | `Invalid JSON arguments` | identical |++Side effect on HTTP, accepted deliberately: a Supabase failure's 400 body now carries+`data.supabase` (Postgres `code`/`details`/`hint`) alongside the message — the same fields+Supabase's own REST API returns, and a real improvement for API integrators.++**D5 — Blocked tools get belt-and-braces enforcement.** Manifest exclusion is the primary+gate; add (a) an `ORPCError("NOT_FOUND")` throw in `gate()` for any entry whose name is+blocked, and (b) a test asserting no `MCP_BLOCKED_TOOL_NAMES` entry appears in `OPERATIONS`.+If exclusion ever regresses, the surface stays closed instead of silently opening.++**D6 — Changelog note (required, from the parent plan's risk list):** after Task 5, an MCP+caller authenticating with an **API key** is subject to the per-operation scope gate.+Under-scoped keys that RLS previously allowed now get 403. OAuth connector sessions are+unaffected. This must appear in the PR description and the release notes.++---++## Task 1 — Parity harness: pin `executeFunction` vs the oRPC dispatch, A/B, before anything moves++Test-first. This test is the contract the rest of the plan must not break; it runs against+BOTH implementations while both still exist.++**Files**+- Create `apps/erp/app/routes/api+/v1+/lib/dispatch-parity.test.ts`.++**Steps**+1. Mock the service layer, not the manifest. At the top of the file:+ - `vi.mock("~/services/database.server", () => ({ getDatabaseClient: () => FAKE_DB }))`+ where `const FAKE_DB = { __kysely: true }`.+ - `vi.mock("../../mcp+/lib/direct-executor", ...)` is **NOT** allowed — the point is to+ exercise the real one. Instead build the fake service namespaces by mocking the module+ that owns them. Since Task 4 has not run yet, mock the two service modules used by the+ exemplars directly, e.g.+ `vi.mock("~/modules/accounting/accounting.ee.service", () => ({ getAccountLedger: spy, upsertAccount: spy }))`,+ `vi.mock("~/modules/sales/sales.service", () => ({ upsertQuoteLinePrices: spy }))`,+ `vi.mock("~/modules/inventory/inventory.service", () => ({ generateInventoryCountLines: spy }))`.+ Every spy records `(...args)` and returns a scripted result.+ - Mock the remaining 12 service modules with `{}` so `direct-executor`'s namespace+ imports don't drag real app code into the test.+2. Use REAL manifest entries (`OPERATIONS` from `./operations.server`) — never hand-written+ metadata — for these exemplars, chosen to cover every dispatch branch:+ | Exemplar | `serviceParams` | Covers |+ |---|---|---|+ | `accounting_getAccountLedger` | `["client","args"]` | READ, `args` passthrough, Supabase unwrap incl. `count` |+ | `accounting_getTrialBalance` | `["client","companyGroupId","companyId","args"]` | context positional params |+ | `accounting_upsertAccount` | `["client","account"]`, `injectAuth ["companyId","createdBy","updatedBy"]`, `_operation` required | `_operation` create/update, `createdBy` suppression on update, named-param stamping |+ | `sales_upsertQuoteLinePrices` | `["db","companyId","quoteId","lineId","quoteLinePrices"]` | Kysely `db` injection + per-element `createdBy` on an ARRAY payload |+ | `inventory_generateInventoryCountLines` | `["db","args"]` | `db` as first param |+ | `account_upsertNotificationPreference` | `["client","preference"]`, `permission.module === null` | the null-permission gate path |+3. Case table (each case asserted against `executeFunction(name, ctx, args)` AND against+ `dispatchOperation(meta, ctx, args)`, comparing the captured service arguments+ element-by-element, plus the mapped result per D4):+ a. `args` passthrough and `client` from context.+ b. `_operation: "create"` at top level → stripped from the payload, `createdBy = userId`,+ `updatedBy = userId`, `companyId` stamped.+ c. `_operation: "update"` nested inside `{ args: {...} }` → stripped from the nested+ object, `createdBy` **deleted**, `updatedBy` stamped.+ d. Caller-supplied `createdBy` on an update → removed (no forged attribution).+ e. Conflicting `_operation` values (top level `create`, nested `update`) → rejected+ before the service is called; service spy not invoked.+ f. Missing/invalid `_operation` on a tool that requires it → rejected, service spy not+ invoked.+ g. Array payload + create → EVERY element gets `createdBy`, stamped AFTER the spread;+ non-object elements pass through untouched; `companyId`/`updatedBy` NOT added to+ elements.+ h. Array payload + update → array returned untouched.+ i. `db` param → `getDatabaseClient()` value injected at the right position.+ j. Thenable-but-not-Promise result (a fake `{ then(res){res({data:1})} }` standing in for+ a Supabase builder) → awaited.+ k. Supabase `{ data: null, error: { message, code, details, hint } }` → `executeFunction`+ returns `{success:true, data:{error}}` and `server.ts` would print `Database error: …`;+ `dispatchOperation` throws `ORPCError("BAD_REQUEST")` whose `.data.supabase` deep-equals+ the raw error and whose `.message` is `error.message`.+ l. Single-key payload whose key matches no param → unwrapped positionally.+ m. Flat-field payload matching no param → whole object passed positionally.+ n. Supabase `{ data, count }` → `count` preserved on the dispatch result.+4. Add the D5 guard in the same file:+ `it("excludes every blocked tool from the operation catalog")` — for each+ `MCP_BLOCKED_TOOL_NAMES` entry, `expect(operationsByName.has(name)).toBe(false)`.++**Verify**+```bash+pnpm --filter erp exec vitest run app/routes/api+/v1+/lib/dispatch-parity.test.ts+```+Expected: all cases pass on the FIRST run against both implementations, printing+`Test Files 1 passed` and ≥ 15 assertions. A failure here means the ported dispatch already+diverges from `executeFunction` — STOP and report the diverging case; do not adjust the+expectation to match the new code.++---++## Task 2 — API-key auth cache (~30s, `@carbon/kv`)++**Files**+- Create `packages/auth/src/services/api-key.server.ts`.+- Modify `packages/auth/src/services/auth.server.ts`.+- Create `packages/auth/src/services/api-key-cache.test.ts`.++**Steps**+1. New module `api-key.server.ts`:+ - `const API_KEY_CACHE_PREFIX = "apikey:auth:"; const API_KEY_CACHE_TTL_SECONDS = 30;`+ - `export function apiKeyCacheKey(keyHash: string)` → `` `${API_KEY_CACHE_PREFIX}${keyHash}` ``.+ - `export async function getApiKeyRecord(rawKey: string): Promise<ApiKeyRecord | null>`:+ hash the key with the existing `hashApiKey`; wrap the whole body in+ `oncePerRequest(\`apikey:${keyHash}\`, …)` from `@carbon/logger/middleware.server`+ (per-request memo collapses the double lookup noted in grounding fact 5 — this is NOT+ `oncePerRead`, but the memoized value is a credential row read at the very start of the+ request, and the request is authenticated *by* that credential);+ then: Redis `get` inside try/catch (log and fall through on error, mirroring+ `loadUserClaims` in `users.server.ts`) → `"null"` means a cached negative → return+ `null`; a JSON payload → return it; on a miss run the same service-role select as+ today's `getCompanyIdFromAPIKey`, then `redis.set(key, JSON.stringify(row ?? null),+ "EX", API_KEY_CACHE_TTL_SECONDS)` best-effort (a failed write must never abort the+ request) and return the row.+ Negative results ARE cached (a bad key hammering the endpoint must not hammer Postgres);+ the same ≤ TTL staleness applies.+ - `export async function bustApiKeyCache(keyHash: string): Promise<void>` — `redis.del`,+ errors swallowed and logged.+ - Move the `ApiKeyRecord` type here and re-export it from `auth.server.ts` so no consumer+ import path changes.+2. In `auth.server.ts`:+ - Re-export from the new module so `@carbon/auth/auth.server` stays the only subpath+ consumers use (do NOT add a new `exports` subpath — see the "new package exports subpath+ 500s until every dev server restarts" lesson):+ `export { getApiKeyRecord, bustApiKeyCache, apiKeyCacheKey } from "./api-key.server";`+ - Reimplement `getCompanyIdFromAPIKey` over the cache, keeping its `{ data, error }`+ return shape (both callers only read `.data`):+ `const data = await getApiKeyRecord(apiKey); return { data, error: data ? null : new Error("API key not found") };`+ — it must stay `async`-compatible with `await getCompanyIdFromAPIKey(...)` at line 237.+ - Nothing else in the carbon-key branch changes: the rate-limit counter+ (`checkApiKeyRateLimit`) stays UNCACHED, `lastUsedAt` stays fire-and-forget, expiry /+ scope / plan checks keep running on every request against the (possibly cached) row.+3. Test `api-key-cache.test.ts`, modelled on+ `packages/auth/src/services/auth-redis-resilience.test.ts` (copy its `vi.mock("@carbon/kv")`+ and `vi.mock("../config/env")` preamble verbatim), with `getCarbonServiceRole` mocked to a+ chainable stub that counts `single()` calls:+ - miss → one DB read, one `redis.set` with `"EX", 30`;+ - hit (redis `get` returns the JSON) → **zero** DB reads;+ - unknown key → `null` returned AND `"null"` written to Redis; a second call does zero DB reads;+ - Redis down (`get`/`set` resolve `null`) → falls through to the DB, returns the row, does not throw;+ - `bustApiKeyCache("abc")` → `redis.del` called with `apikey:auth:abc`.++**Verify**+```bash+pnpm --filter @carbon/auth exec vitest run src/services/api-key-cache.test.ts+pnpm exec turbo run typecheck --filter=@carbon/auth --filter=erp+```+Expected: 5 passing tests; typecheck clean for both packages.++Measurement (a memo is a performance claim — run it, or defer it to Task 9 and record the+numbers there; requires the user's running `crbn up` stack, never rebuild the DB):+```bash+redis-cli -u "$REDIS_URL" monitor | grep --line-buffered apikey:auth &+for i in 1 2 3 4 5; do curl -s -o /dev/null -w '%{http_code}\n' \+ -H "Authorization: Bearer $CARBON_TEST_KEY" -H 'content-type: application/json' \+ -d '{}' "$ERP_URL/api/v1/shared/getCustomFieldsList"; done+```+Expected: exactly ONE `SETEX`/`SET … EX 30` and the remaining calls served by `GET` hits;+five `200`s. Before the change the same loop produces 10 `apiKey` selects (two per request).++---++## Task 3 — Bust the cache when a key is edited or revoked++**Files**+- Modify `apps/erp/app/modules/settings/settings.server.ts` (server-only; NOT in the module barrel).+- Modify `apps/erp/app/routes/x+/settings+/api-keys.$id.tsx`.+- Modify `apps/erp/app/routes/x+/settings+/api-keys.delete.$id.tsx`.+- Create `apps/erp/app/modules/settings/api-key-cache-bust.test.ts`.++**Steps**+1. In `settings.server.ts` add:+ ```ts+ export async function invalidateApiKeyCache(+ client: SupabaseClient<Database>,+ id: string+ ): Promise<void> {+ const { data } = await client.from("apiKey").select("keyHash").eq("id", id).single();+ if (data?.keyHash) await bustApiKeyCache(data.keyHash);+ }+ ```+ importing `bustApiKeyCache` from `@carbon/auth/auth.server`. Never put this in+ `settings.service.ts` — that file is browser-bundled through `~/modules/settings`.+2. `api-keys.$id.tsx`: after `upsertApiKey` succeeds and BEFORE the redirect, `await+ invalidateApiKeyCache(client, id)`. Scope changes must not lag by 30s.+3. `api-keys.delete.$id.tsx`: call `await invalidateApiKeyCache(client, id)` **before**+ `deleteApiKey(client, id)` — after the delete the row (and its `keyHash`) is gone.+4. `api-keys.new.tsx` needs nothing: a freshly generated random key has no cache entry.+5. Test: mock `@carbon/auth/auth.server`'s `bustApiKeyCache` and pass a fake client whose+ `single()` resolves `{ data: { keyHash: "hash-1" } }`; assert `bustApiKeyCache` called+ once with `"hash-1"`, and that a missing row calls it zero times.++**Verify**+```bash+pnpm --filter erp exec vitest run app/modules/settings/api-key-cache-bust.test.ts+pnpm exec turbo run typecheck --filter=erp+```+Expected: 2 passing tests, clean typecheck.++---++## Task 4 — Invert the dependency: own the registry, own the enrichment, add `callOperation`++No behaviour change in this task; it is pure relocation plus one new entry point.++**Files**+- Create `apps/erp/app/routes/api+/v1+/lib/registry.server.ts`.+- Create `apps/erp/app/routes/api+/v1+/lib/call.server.ts`.+- Modify `apps/erp/app/routes/api+/v1+/lib/dispatch.server.ts`.+- Modify `apps/erp/app/routes/api+/v1+/lib/base.server.ts`.+- Modify `apps/erp/app/routes/api+/mcp+/lib/direct-executor.ts` (temporarily; deleted in Task 7).++**Steps**+1. `registry.server.ts`: move the 15 `import * as …Functions` statements and the exported+ `functionRegistry` object out of `direct-executor.ts` verbatim (including the+ `production: { ...productionFunctions, ...productionMcpFunctions }` merge and its comment).+2. `dispatch.server.ts`:+ - Move `enrichWithAuthContext`, `extractOperation` and `type McpOperation` in from+ `direct-executor.ts` **with their comments intact** — those comments record why+ `createdBy` is stamped after the spread, why array elements get only `createdBy`, and+ why `_operation: "update"` deletes `createdBy`. Do not paraphrase them.+ Keep `AuthField` imported as a type from `@carbon/api`.+ - Change the `context` parameter type from `ExecutorContext` to+ `AuthedContext` (import from `./base.server`); import `functionRegistry` from+ `./registry.server`.+ - Attach the raw Supabase error to the thrown error (D4):+ `throw new ORPCError("BAD_REQUEST", { message: supabaseErrorMessage(r.error), data: { supabase: r.error } });`+ - Export `enrichWithAuthContext` / `extractOperation` so the (still-live)+ `direct-executor.ts` can import them back.+3. `direct-executor.ts` (transitional): delete its copies of `functionRegistry`,+ `enrichWithAuthContext`, `extractOperation`, and import them from+ `../../v1+/lib/{registry,dispatch}.server` instead. `ExecutorContext`, `executeFunction`+ and `searchFunctions` stay for now. This keeps Task 1's parity test exercising ONE copy+ of the enrichment logic from here on.+4. `base.server.ts`: widen `authKind` to `"api-key" | "oauth" | "session"` with a comment+ naming the three callers (D3), and add the D5 blocked-name guard as the first statement of+ `gate`:+ ```ts+ if (isMcpBlockedTool(meta.name)) throw new ORPCError("NOT_FOUND");+ ```+ (import from `../../mcp+/lib/mcp-blocked-tools`).+5. New `call.server.ts` — the ONE server-side entry point for MCP, the agent and workflows:+ ```ts+ export type CallResult =+ | { success: true; data: unknown; count?: number }+ | { success: false; error: string; errorKind: "database" | "execution" };++ export async function callOperation(+ name: string,+ context: AuthedContext,+ args?: Record<string, unknown> | string+ ): Promise<CallResult>+ ```+ Body, in this order (order is the contract — it reproduces `executeFunction`'s):+ 1. `args` given as a string → `JSON.parse` a non-empty value, else `{}`; on a throw return+ `{ success: false, error: "Invalid JSON arguments", errorKind: "execution" }`.+ 2. `isMcpBlockedTool(name)` → `{ success: false, error: \`Tool disabled: ${name} is not available via MCP.\`, errorKind: "execution" }`.+ 3. `operationsByName.get(name)` → the procedure via `router[meta.module]?.[operationId(meta)]`;+ either missing → `{ success: false, error: \`Operation not found: ${name}\`, errorKind: "execution" }`.+ 4. `const result = await call(procedure, args ?? {}, { context });` →+ `{ success: true, data: result.data, ...(result.count !== undefined ? { count: result.count } : {}) }`.+ 5. `catch (err)`: an `ORPCError` carrying `data.supabase` →+ `{ success:false, error: \`Database error: ${JSON.stringify(err.data.supabase)}\`, errorKind: "database" }`;+ any other error → `{ success:false, error: err instanceof Error ? err.message : "Function execution failed", errorKind: "execution" }`.++**Verify**+```bash+pnpm --filter erp exec vitest run app/routes/api+/v1+/lib/+pnpm exec turbo run typecheck --filter=erp --filter=@carbon/api+```+Expected: `dispatch-parity.test.ts` and `orpc-mechanics.test.ts` both pass unchanged (the+parity test is asserting on relocated code now — that is the point); typecheck clean.++---++## Task 5 — MCP `call_tool` on `call()`++**Files**+- Modify `apps/erp/app/routes/api+/mcp+/lib/types.ts`.+- Modify `apps/erp/app/routes/api+/mcp+/_index.ts`.+- Modify `apps/erp/app/routes/api+/mcp+/lib/server.ts`.++**Steps**+1. `lib/types.ts`: replace the `McpContext` interface with+ `export type McpContext = AuthedContext;` (type-only import from+ `~/routes/api+/v1+/lib/base.server` — erased at runtime, so no server module enters a+ client graph).+2. `_index.ts` — **additive edits only, stay out of the OAuth branch's body** (the+ concurrent rate-limit change lives there):+ - Delete the local `type McpContext = {…}` (lines 32–37) and+ `import type { McpContext } from "./lib/types";`.+ - OAuth branch: add `authKind: "oauth" as const, scopes: {}` to the returned `ctx` object+ literal. Nothing else.+ - carbon-key branch: after `requirePermissions(request, {})`, read the key's scopes —+ ```ts+ const rawKey = request.headers.get("carbon-key") ?? "";+ const { data: keyRow } = await getCompanyIdFromAPIKey(rawKey);+ const scopes = (keyRow as { scopes?: Record<string, string[]> } | null)?.scopes ?? {};+ ```+ and return `{ …, authKind: "api-key" as const, scopes }`. `request` at that point is the+ rewritten one carrying the `carbon-key` header, so this works for both `Bearer crbn_…`+ and a raw `carbon-key`. Thanks to Task 2 this is a Redis hit, not a second DB read.+3. `lib/server.ts` (`// @ts-nocheck` at the top stays — do not attempt to type this file in+ this task):+ - Replace `import { executeFunction } from "./direct-executor";` with+ `import { callOperation } from "../../v1+/lib/call.server";`.+ - Keep the existing `isMcpBlockedTool(name)` early return verbatim.+ - `const result = await callOperation(name, ctx, args);`+ - Replace the whole success-formatting block with, exactly:+ ```ts+ if (result.success) {+ const output =+ result.data === undefined+ ? "Operation completed successfully"+ : JSON.stringify(result.data, null, 2);+ return { content: [{ type: "text" as const, text: output }] };+ }+ return {+ content: [{+ type: "text" as const,+ text: result.errorKind === "database" ? result.error : `Error: ${result.error}`+ }],+ isError: true+ };+ ```+ - Leave `search_tools` / `describe_tool` untouched — they read the manifest, which is+ unchanged.++**Verify**+```bash+pnpm exec turbo run typecheck --filter=erp+pnpm --filter erp exec vitest run app/routes/api+/+```+Expected: clean typecheck; all MCP/v1 tests green. Live MCP verification is Task 9 — do not+declare this task done on typecheck alone, but do commit it (the live sweep covers Tasks 5–7+together).++---++## Task 6 — In-app agent on `call()`++**Files**+- Modify `apps/erp/app/modules/agent/agent.tools.ts`.+- Modify `apps/erp/app/modules/agent/agent.service.ts`.+- Create `apps/erp/app/modules/agent/agent.tools.test.ts`.++**Steps**+1. `agent.tools.ts`:+ - Replace the `direct-executor` import with+ `import type { AuthedContext } from "~/routes/api+/v1+/lib/base.server";` and+ `import { callOperation } from "~/routes/api+/v1+/lib/call.server";`.+ - `createAgentTools(ctx: AuthedContext)` and `createDataTools(ctx: AuthedContext)`.+ - `call_tool.execute`: keep the READ-index guard EXACTLY as it is (the safety property+ lives in that lookup — see the comment at the top of the file, keep it), then+ `return callOperation(name, ctx, args as Record<string, unknown> | undefined);`.+ - Leave the `toolMetadata` import (the READ index) alone — D1 defers that move.+2. `agent.service.ts`: add `authKind: "session" as const, scopes: {}` to the `ctx` object+ literal (~line 237).+3. Test: with `callOperation` mocked, assert (a) a non-READ tool name returns+ `{ error: 'Tool "…" is not available.' }` and never calls `callOperation`; (b) a blocked+ name likewise; (c) a READ name forwards `(name, ctx, args)` verbatim and returns the+ `CallResult` unchanged (the model now sees UNWRAPPED `data`, not the Supabase envelope —+ pin it, it is the one intentional agent-facing change, and it is inert while+ `AGENT_DATA_TOOLS_ENABLED` is false).++**Verify**+```bash+pnpm --filter erp exec vitest run app/modules/agent/agent.tools.test.ts+pnpm exec turbo run typecheck --filter=erp+```+Expected: 3 passing tests; clean typecheck.++Escape hatch: if `pnpm --filter erp build` (Task 9) fails with *"Server-only module+referenced by client"* pointing at `agent.tools.ts`, the fix is to drop+`export * from "./agent.tools"` from `apps/erp/app/modules/agent/index.ts` and import it+directly in `agent.service.ts` — NOT to un-suffix any `.server` file. Report before doing it.++---++## Task 7 — Workflow dispatcher on `call()`, then delete `direct-executor.ts`++**Files**+- Modify `apps/erp/app/routes/api+/inngest.ts`.+- Delete `apps/erp/app/routes/api+/mcp+/lib/direct-executor.ts`.+- Modify `apps/erp/app/routes/api+/v1+/lib/dispatch-parity.test.ts`.++**Steps**+1. `inngest.ts`: replace the `executeFunction` import with `callOperation` from+ `./v1+/lib/call.server`, and wire+ ```ts+ setWorkflowDispatch((name, context, args) =>+ callOperation(name, { ...context, authKind: "session", scopes: {} }, args)+ );+ ```+ Keep the lazy `wireWorkflowDispatch()` pattern and its comment exactly — a module-scope+ side effect would drag the server graph into the browser bundle.+ `CallResult` satisfies `WorkflowDispatch` structurally; if TS objects to the union, add a+ small explicit adapter returning `{ success, data, error }` rather than casting.+2. Delete `direct-executor.ts`. `searchFunctions` has no other caller (verified); it goes+ with the file. Confirm zero references remain:+ ```bash+ grep -rn "direct-executor\|executeFunction\|searchFunctions" apps packages scripts .claude docs | grep -v node_modules+ ```+ Expected: only `.claude/rules/*.md`, `packages/jobs/AGENTS.md` and the parent plan file —+ all of which Task 9 rewrites.+3. Convert the parity test: delete the `executeFunction` half of every case, keeping the+ `dispatchOperation`/`callOperation` assertions with the values Task 1 captured (they are+ now golden literals, not comparisons). Add two new cases at this point:+ - `callOperation` with the four workflow `call` ids+ (`production_insertJob`, `quality_insertIssue`, `purchasing_insertPurchaseOrder`,+ `sales_insertSalesOrder`) returns `{ success: true, data }` whose `data` is what+ `packages/jobs/src/workflows/actions/create.ts` `idIn()` can read an `id` out of — assert+ `idIn`-equivalent extraction on both an object and a single-element array result.+ - a Supabase error through `callOperation` returns+ `{ success: false, errorKind: "database", error: 'Database error: {…}' }`.++**Verify**+```bash+pnpm --filter erp exec vitest run app/routes/api+/v1+/lib/+pnpm --filter @carbon/jobs exec vitest run src/workflows/actions/+pnpm exec turbo run typecheck --filter=erp --filter=@carbon/jobs+pnpm run check:workflow-catalog+```+Expected: all green; `check:workflow-catalog` prints its OK line (it reads the manifest from+disk, which is unchanged).++---++## Task 8 — Close out Phase 1: permission-derivation tests + the 20-op spot-check++**Files**+- Create `apps/erp/test/mcp-tool-permissions.test.ts`.+- Modify `scripts/lib/service-metadata.ts` (only if the spot-check finds exceptions).++**Steps**+1. The test runs against the REAL generated manifest (turbo's `test` task already depends on+ `//#generate:mcp`), asserting the mapping rules from the parent plan over all 1495 ops:+ - every `items_*` op has `permission.module === "parts"`;+ - every `account_*` and `shared_*` op has `permission.module === null`;+ - every other module maps to itself;+ - every `READ` op has `actions === ["view"]`;+ - every `delete*` op has `actions === ["delete"]`;+ - every `upsert*` op has `actions === ["create","update"]` (the parent plan's open+ question 2 — the current behaviour; pin it so a change is deliberate);+ - `insert|create|add|new|copy|duplicate|generate*` → `["create"]`;+ - the update-verb list → `["update"]`;+ - every op has a non-empty `actions` array;+ - anything in `PERMISSION_OVERRIDES` wins (assert one entry if any exist).+2. Spot-check ~20 operations against the ERP routes that call them, ONE module at a time:+ ```bash+ grep -rn "<serviceFnName>(" apps/erp/app/routes | grep -v node_modules+ grep -n "requirePermissions" -A 3 <route file>+ ```+ Suggested spread (adjust to what exists): 3 sales, 3 purchasing, 3 items, 2 production,+ 2 quality, 2 inventory, 2 accounting, 1 people, 1 resources, 1 settings. Record every+ mismatch as an entry in `PERMISSION_OVERRIDES` in `scripts/lib/service-metadata.ts`, with+ a one-line comment naming the route that proves it, then regenerate.+3. **Escape hatch:** if more than 5 of the 20 mismatch, the verb heuristic is wrong rather+ than incomplete — STOP and report with the list; do not paper over it with 20 overrides.++**Verify**+```bash+pnpm run generate:mcp && pnpm run generate:mcp # determinism+pnpm run check:manifest+pnpm --filter erp exec vitest run test/mcp-tool-permissions.test.ts+```+Expected: the second `generate:mcp` leaves the digest untouched (`check:manifest` prints its+up-to-date line); all permission assertions pass. If overrides were added, the digest DOES+change on the first run — commit the regenerated digest with the override.++---++## Task 9 — Live smoke on the running stack + doc/rule sync++Requires the user's `crbn up` stack. **Never rebuild or reset the database.** If no stack is+reachable, stop and report — do not mark the plan complete on unit tests alone (the parent+plan already carries one round of "not live-verified").++**Steps**+1. HTTP surface (needs an API key with, say, `sales_view` scoped to the company, and one+ without it):+ ```bash+ curl -s -o /dev/null -w '%{http_code}\n' -X POST "$ERP_URL/api/v1/sales/getCustomers" \+ -H "Authorization: Bearer $KEY_WITH_SCOPE" -H 'content-type: application/json' -d '{"args":{"limit":1}}' # 200+ curl -s -o /dev/null -w '%{http_code}\n' -X POST "$ERP_URL/api/v1/sales/getCustomers" \+ -H "Authorization: Bearer $KEY_WITHOUT_SCOPE" -H 'content-type: application/json' -d '{}' # 403+ curl -s -o /dev/null -w '%{http_code}\n' -X POST "$ERP_URL/api/v1/settings/seedCompany" \+ -H "Authorization: Bearer $KEY_WITH_SCOPE" -H 'content-type: application/json' -d '{}' # 404 (blocked)+ curl -s -o /dev/null -w '%{http_code}\n' -X POST "$ERP_URL/api/v1/sales/nope" \+ -H "Authorization: Bearer $KEY_WITH_SCOPE" -H 'content-type: application/json' -d '{}' # 404 (unknown)+ for i in $(seq 1 70); do curl -s -o /dev/null -w '%{http_code} ' -X POST "$ERP_URL/api/v1/sales/getCustomers" \+ -H "Authorization: Bearer $KEY_WITH_SCOPE" -H 'content-type: application/json' -d '{}'; done # trailing 429s+ curl -s "$ERP_URL/api/v1/openapi.json" | jq '.paths | length' # 1495+ ```+2. MCP surface, over JSON-RPC with the SAME key (this is the D6 behaviour change — verify+ both directions):+ ```bash+ curl -s -X POST "$ERP_URL/api/mcp" -H "Authorization: Bearer $KEY_WITH_SCOPE" \+ -H 'content-type: application/json' -H 'accept: application/json, text/event-stream' \+ -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"call_tool","arguments":{"name":"sales_getCustomers","arguments":{"args":{"limit":1}}}}}'+ ```+ Expected: a `content[0].text` JSON array of customers (unwrapped, same as before the+ migration). Repeat with `$KEY_WITHOUT_SCOPE` → `isError: true` and text+ `Error: API key lacks the required scope: sales_view` (the D6 change). Then+ `search_tools` and `describe_tool` once each → unchanged output.+3. A write through MCP that exercises the `_operation` path and the `createdBy` stamp — pick+ a low-risk op on a throwaway record (e.g. `sales_upsertCustomerContact` with+ `_operation: "create"`, then `"update"`), and confirm in the DB that `createdBy` is the+ key's user on the insert and unchanged on the update.+4. `pnpm --filter erp build` — proves the `react-router:dot-server` plugin accepts+ `agent.tools.ts`'s new `.server` import (grounding fact 6).+5. Doc/rule sync (keep-sources-in-sync rule — same commit as the code):+ - `.claude/rules/mcp-tools-reference.md`: rewrite the "How `call_tool` actually runs a+ tool" section — it now runs `callOperation` → `call(router[module][op])` →+ `dispatch.server.ts`; `direct-executor.ts` is gone; the registry lives at+ `api+/v1+/lib/registry.server.ts`; API-key MCP callers are scope-gated (D6); the+ `db`-first-param and `_operation` notes move to `dispatch.server.ts`.+ - `.claude/rules/workflow-actions.md` (the dispatch-seam code block, ~line 91) and+ `packages/jobs/AGENTS.md` (~line 161): the ERP now registers `callOperation`.+ - `.claude/rules/authentication-system.md`: add the 30s API-key cache to the "API key+ auth" section (key shape, TTL, negative caching, busting from the api-keys routes,+ revocation lag ≤ TTL).+ - `.ai/plans/2026-09-04-carbon-api-orpc.md`: tick Phases 0/1/2 and record D1 (shards+ deferred, with the trigger) in place of the `[~]`.+ - `.ai/lessons.md`: add a lesson ONLY if something surprised you (a strong candidate is+ grounding fact 1 — "a shared executor acquires callers you didn't plan for; grep every+ importer before you delete one").+6. PR description + release notes must carry the D6 changelog note.++**Verify**+```bash+pnpm test+pnpm run lint+```+Expected: repo-wide tests green, lint clean, plus the curl/DB results above pasted into the+run log at `.ai/runs/`.++---++## Progress++- [x] T1 — Parity harness: `dispatch-parity.test.ts` A/B against `executeFunction`+- [x] T2 — API-key auth cache (`packages/auth/src/services/api-key.server.ts`, 30s, negative caching)+- [x] T3 — Cache busting from the api-keys route actions + test+- [x] T4 — `registry.server.ts`, enrichment moved into `dispatch.server.ts`, `call.server.ts`, `authKind: "session"`, blocked-name guard in `gate`+- [x] T5 — MCP `call_tool` on `callOperation` (+ `resolveAuth` carries `authKind`/`scopes`)+- [x] T6 — In-app agent on `callOperation`+- [x] T7 — Workflow dispatcher on `callOperation`; `direct-executor.ts` deleted; parity test converted+- [x] T8 — Permission-derivation tests + 20-op spot-check (+ overrides if any)+- [x] T9 — live smoke PASSED on crbn up (run log: `.ai/runs/2026-09-07-orpc-live-smoke.md`), `pnpm --filter erp build` PASSED, doc/rule sync done. Changelog note (D6) still to be carried into the PR description.++## Risks and escape hatches++- **Under-scoped API keys start getting 403 on MCP** (D6). Accepted; it is the whole point of+ the shared gate. Mitigation is communication, not code: changelog + release notes. If a+ named customer would break, STOP and get a decision — do not silently exempt MCP.+- **`resolveAuth` merge conflict** with the concurrent OAuth rate-limit change. Keep both+ hunks; the rate limit belongs before the OAuth branch's return, the two context fields+ inside the returned literal.+- **`react-router:dot-server` rejecting `agent.tools.ts`** — escape hatch in Task 6.+- **Router build cost at import**: `router.server.ts` constructs ~1495 procedures at module+ load, and MCP/agent/inngest now all import it. It is a one-time per-process cost that the+ HTTP route already pays. If cold-start time regresses noticeably in Task 9, report it —+ the fix (lazy per-module segments via `os.prefix().lazy()`) is a separate change, not an+ improvisation inside this plan.+- **Error-text drift** in MCP beyond the two accepted deltas in D4 → treat as a parity-test+ failure, not an expectation to update.+- **Cache staleness** on key edit/revoke is ≤ 30s only if Task 3's busting is wired to BOTH+ the update and the delete route; the delete must bust before the row disappears.++## Out of scope (do not fold in)++> Request validation is no longer deferred — it landed after this plan, via+> `jsonSchemaInput()` in `@carbon/api` using zod's `fromJSONSchema`, so it needed+> no Ajv and no new dependency. See `.claude/rules/mcp-tools-reference.md`.++Per-module manifest shards (D1); OAuth bearer auth on `/api/v1`;+READ→GET routing with ETag/Cache-Control; oRPC batch plugin and the MCP `call_tools` batch+meta-tool; typed client outputs; Docs Phase 2 (`operations-data.generated.ts`, HTTP transport+tabs); the `/api-reference` → `/data-api` cutover.diff --git a/.ai/runs/2026-09-07-orpc-live-smoke.md b/.ai/runs/2026-09-07-orpc-live-smoke.mdnew file mode 100644index 0000000000..a1a7d68d4c--- /dev/null+++ b/.ai/runs/2026-09-07-orpc-live-smoke.md@@ -0,0 +1,40 @@+# oRPC completion — live smoke (T9)++Stack: `crbn up` on branch `feat/carbon-api-orpc`, ERP dev server at 127.0.0.1:57011.+Keys: two throwaway `apiKey` rows minted directly in the dev DB (scoped:+`sales_view/create/update` for the company; unscoped: `{}`), deleted after the run+along with the test record.++## HTTP surface (`/api/v1`)++| Check | Expected | Got |+|---|---|---|+| `POST /api/v1/sales/getCustomers`, scoped key | 200, unwrapped `{data:[…]}` | 200 ✓ (real customer rows) |+| same, unscoped key | 403 | 403 ✓ |+| `POST /api/v1/settings/seedCompany` (blocked) | 404 | 404 ✓ |+| `POST /api/v1/sales/nope` (unknown) | 404 | 404 ✓ |+| `GET /api/v1/openapi.json` `.paths | length` | 1495 | 1495 ✓ |+| 70-request flood, scoped key | trailing 429s | 200×~48 then 429s ✓ (60/min window shared with earlier calls) |+| 429 headers | X-RateLimit-* + Retry-After | `retry-after: 8`, `x-ratelimit-limit: 60`, `x-ratelimit-remaining: 0`, `x-ratelimit-reset` ✓ |++## MCP surface (`/api/mcp`, JSON-RPC)++| Check | Got |+|---|---|+| `call_tool sales_getCustomers`, scoped key | customer JSON array, unwrapped, `isError` unset ✓ |+| same, unscoped key (**D6 behavior change**) | `isError: true`, text `Error: API key lacks the required scope: sales_view` ✓ |+| `search_tools {query:"customer contact"}` | 5 tools, module-grouped output unchanged ✓ |+| `describe_tool` | responds (note: `sales_upsertCustomerContact` does not exist; contact writes are `insert`/`updateCustomerContact`) |+| `call_tool sales_upsertCustomerStatus _operation:create` | created `cs_VoeWxqy1Fk25ngVvxvZ7p7`; DB row `createdBy` = the key's user ✓ |+| `_operation:update` with forged `createdBy:"forged-user"` | name updated, `createdBy` UNCHANGED (forgery stripped) ✓; output text `null` matches the D4 contract |++## API-key cache (T2 measurement, deferred here)++Fresh key, 5 requests: all 200; `apikey:auth:<keyHash>` present in Redis with the+full record and TTL 29 (one 30s SET on the first request; the rest were cache hits).++## Build++`pnpm --filter erp build` exit 0 — `react-router:dot-server` accepts the+`agent.tools.ts` → `call.server` import (grounding fact 6 proven; Task 6 escape+hatch unused).diff --git a/.claude/rules/authentication-system.md b/.claude/rules/authentication-system.mdindex 0c9c5329b7..e7277cddab 100644--- a/.claude/rules/authentication-system.md+++ b/.claude/rules/authentication-system.md@@ -294,8 +294,18 @@ flows call `redis.del(getPermissionCacheKey(userId))`.## API key auth-`carbon-key: <key>` header. `requirePermissions` resolves it via service role-(`getCompanyIdFromAPIKey` → `apiKey` lookup by `keyHash`), then:+`carbon-key: <key>` header. `requirePermissions` resolves it through+`getCompanyIdFromAPIKey`, which now reads via `getApiKeyRecord`+(`packages/auth/src/services/api-key.server.ts`): a **30s Redis cache** at+`apikey:auth:<keyHash>`, per-request memoized (`oncePerRequest`) so one HTTP call+does one lookup even though both `requirePermissions` and the v1 scope read need+the row. Unknown keys are cached too (the literal `"null"`), so a bad key+hammering the endpoint doesn't hammer Postgres. Redis being down falls through to+the DB. Busting: the api-keys settings routes call `invalidateApiKeyCache`+(`~/modules/settings/settings.server.ts` → `bustApiKeyCache`) after an edit and+BEFORE a delete (the keyHash is unreadable once the row is gone), so a scope+change or revocation takes effect immediately; the worst-case lag for any other+writer is the 30s TTL. Then:- Reject if `expiresAt` passed (401).- Rate-limit via `checkApiKeyRateLimit` (`@carbon/database/ratelimit`, Postgres functiondiff --git a/.claude/rules/database-migration-patterns.md b/.claude/rules/database-migration-patterns.mdindex 1411fc0f8b..4596e761df 100644--- a/.claude/rules/database-migration-patterns.md+++ b/.claude/rules/database-migration-patterns.md@@ -63,7 +63,7 @@ ALTER TABLE "documentTemplate" ADD CONSTRAINT "documentTemplate_companyId_documeseparate named FK constraints.- **MANDATORY: every table with `createdBy` MUST also have `updatedBy`** — a nullable`"updatedBy" TEXT REFERENCES "user"("id")`. The shared audit-injection path (MCP- `direct-executor`, service writes) stamps `updatedBy` on every write, so a table that has+ the Carbon API dispatch, service writes) stamps `updatedBy` on every write, so a table that has`createdBy` but omits `updatedBy` fails those callers with `column "updatedBy" does not exist`.Include it even on append-only ledger tables (it just stays NULL there). When authoring amigration that adds `createdBy`, add `updatedBy` in the same statement.diff --git a/.claude/rules/mcp-tools-reference.md b/.claude/rules/mcp-tools-reference.mdindex 923ef6255b..8fb4aa9267 100644--- a/.claude/rules/mcp-tools-reference.md+++ b/.claude/rules/mcp-tools-reference.md@@ -14,6 +14,17 @@ service functions as ERP tools. It lives entirely under> `inventory_getShelf`, removed when `shelf` was renamed to `storageUnit`). The> live tool list is `apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json`;> `describe_tool` / `search_tools` read from it at runtime.+>+> That manifest is **gitignored build output** (1.9 MB, rewritten wholesale on every+> run — it churned 250+ commits). It is produced by `pnpm generate:mcp`, which runs+> from `postinstall` and as the turbo root task `//#generate:mcp` that `typecheck`,+> `build` and `test` depend on — so a fresh clone regenerates it before anything+> imports it. The committed record of the published contract is its small companion+> `tool-manifest.digest.json`: one line per operation carrying classification,+> permission, injectAuth, argument count and a hash of the schema, so a contract+> change is still one visible line in review. `pnpm check:manifest` regenerates and+> fails if the digest is stale; pre-commit runs it when a service, models or+> generator file is staged.## Endpoint & transport@@ -78,26 +89,107 @@ registered individually:| `describe_tool` | Return the JSON-Schema + classification + description for one tool name. || `call_tool` | Execute any ERP tool: `{ name, arguments }`. `arguments` may arrive as a JSON string and is normalized to an object. |-## How `call_tool` actually runs a tool (`lib/direct-executor.ts`)+## How `call_tool` actually runs a tool (the canonical oRPC dispatch)`call_tool` does **not** go back through the MCP protocol — it calls-`executeFunction(name, ctx, args)` directly:+`callOperation(name, ctx, args)` from `api+/v1+/lib/call.server.ts`, the ONE+server-side entry point shared by MCP, the in-app agent, and the workflow+dispatcher (`apps/erp/app/routes/api+/inngest.ts`). There is no separate+`direct-executor.ts` any more; it was deleted when all three callers migrated.-- Tool name is `"<module>_<funcName>"`; split on the first `_`. `functionRegistry`- maps the 15 modules to their `~/modules/<module>/<module>.service` namespace.+- `callOperation` resolves the manifest entry (`operationsByName`) and runs the+ real oRPC procedure via server-side `call()` — gate middleware included, so an+ **API-key** caller is scope-checked per operation (403 when the key lacks+ `<module>_<action>` for the company). OAuth-connector and in-process+ (`authKind: "session"`) callers skip the scope gate; RLS/role bounds them.+- The service registry lives at `api+/v1+/lib/registry.server.ts` (the 15 module+ namespaces); the arg assembly lives in `api+/v1+/lib/dispatch.server.ts`.+- **Input is validated** against the operation's own schema before dispatch.+ `router.server.ts` wires `.input(jsonSchemaInput(meta.schema))` from+ `@carbon/api/schema`, which converts the manifest's JSON Schema back to zod at+ first use (`z.fromJSONSchema`; no validator library is involved). Because+ `callOperation` runs the real procedure, this covers MCP, the agent and+ workflows as well as HTTP — a malformed payload gets a 400 naming the field+ instead of silently reaching a service. `.output()` deliberately keeps the+ pass-through `jsonSchema()`: `shapeHttpBody` rewrites the body, so a correct+ response does not match the declared response schema. The validator preserves+ unknown keys (no generated schema sets `additionalProperties: false`) and+ accepts a lone wrapper's contents sent flat, since the dispatcher does too.- `tool-metadata.json` provides `serviceParams` (positional arg order, e.g.- `["client", "args"]`) and `injectAuth`. The executor builds the positional- arg array: `client`/`userId`/`companyId`/`companyGroupId` come from `ctx`;- payload params are stamped with auth fields via `enrichWithAuthContext`. When a- payload param is an **array** of rows, `enrichWithAuthContext` stamps- `createdBy` into each element (insert only) — the top-level stamp never reached- inside, so a NOT NULL `createdBy` on the row table (e.g. `quoteLinePrice`) used- to fail. Only `createdBy` is injected per element; `companyId`/`updatedBy` are- left to the service, since element keys spread straight into an INSERT.-- Blocked tools (`lib/mcp-blocked-tools.ts`, `MCP_BLOCKED_TOOL_NAMES`) are rejected- in both `call_tool` and the executor. Currently only `settings_seedCompany`.-- Supabase query builders returned by services are awaited; result is- `{ success, data | error }`. Supabase `{ data, error, count }` shape is unwrapped.+ `["client", "args"]`) and `injectAuth`. The dispatch builds the positional+ arg array: `client`/`userId`/`companyId`/`companyGroupId` come from `ctx`; a+ service whose param is `db` is handed `getDatabaseClient()`; payload params are+ stamped with auth fields via `enrichWithAuthContext` (now in+ `dispatch.server.ts`). A param literally named `args` is stamped too, and+ which wire shape it takes is read off the operation's schema: a declared `args`+ object means the body wraps it (`{ args: {...} }`) and the inner object is+ unwrapped; a flat schema means the body already IS the args object. A flat body+ is still accepted either way. A param the schema declares as a **scalar** is+ passed `undefined` when no key matches rather than being handed the whole+ payload object — that fallback made `deleteApiKey` run `.eq("id", {...})` and+ return `200 null`. Reading a key by the param's own name is likewise gated+ (`addressesWholeParam`): a service whose sole payload param is a destructured+ object can share its name with one of that object's FIELDS —+ `insertNote(client, note: { note, documentId, … })` — and reading `body.note`+ there handed the service the note STRING instead of the record. The schema+ decides: a wrapper op declares one property named for the param, so read it; an+ op listing the param's own fields is describing it, so pass the whole body.+ `_operation` and any property that is itself another serviceParam (`args`, and+ scalar siblings like `locationId`) don't count toward that, since each is+ addressed on its own pass. When a payload param is an **array** of rows,+ `enrichWithAuthContext` stamps `createdBy` into each element (insert only) —+ the top-level stamp never reached inside, so a NOT NULL `createdBy` on the row+ table (e.g. `quoteLinePrice`) used to fail. Only `createdBy` is injected per+ element; `companyId`/`updatedBy` are left to the service, since element keys+ spread straight into an INSERT.+- Blocked tools (`lib/mcp-blocked-tools.ts`, `MCP_BLOCKED_TOOL_NAMES`) are+ rejected in `call_tool`, in `callOperation`, and (belt-and-braces) in the+ `gate()` middleware — though the primary gate is that the generator excludes+ them from the manifest entirely. Tenant-level operations belong here:+ `settings_insertCompany` and `settings_deleteSubsidiary` are both bare+ `company` writes whose only scoping is a companyId the dispatcher fills from+ the caller's own key, so an empty body would create or destroy a tenant. Their+ "internal users only" gate lives in the settings ROUTE (`isInternalEmail`),+ which no API/MCP call passes through. So do operations whose table carries+ **user-scoped RLS** (`"createdBy"::uuid = auth.uid()` — `note`,+ `maintenanceDispatchComment` and the six `*Favorite` tables, migration+ `20260228000000_rls-refactor-3.sql`). An API key authenticates with the+ `carbon-key` header rather than a Supabase JWT, so `auth.uid()` is NULL and the+ predicate never matches. The failure splits by verb, and the silent half is the+ reason these are blocked rather than left to fail: an INSERT raises a visible RLS+ error, but an UPDATE/DELETE matching zero rows is not an error — PostgREST+ returns success, so `deleteNote` answered `200` while the row stayed untouched.+ `*_upsertMaintenanceDispatchComment` and `shared_insertNote` are deliberately NOT+ blocked: their INSERT path is companyId-scoped and works. The upserts' `update`+ branch still no-ops silently — making it work is an RLS decision, not an app-code+ one.+- **A thrown service error is mapped to a 422 carrying its message** by the+ `mapThrownErrors` middleware (`lib/base.server.ts`), composed ahead of `gate`+ in `router.server.ts`. Services are meant to return the Supabase+ `{ data, error }` envelope, but ~51 of them `throw` instead; oRPC rewrites any+ non-`ORPCError` throw to a 500 and keeps the message only as `cause`, which the+ encoder drops — so HTTP answered a bad id opaquely while MCP showed the real+ text (`callOperation` reads `err.message` itself). Classification is by+ constructor, since the ERP service layer has no domain-error class: a plain+ `Error` is surfaced, while `TypeError`/`ReferenceError`/`RangeError`/+ `SyntaxError` keep their opaque 500 because they mean Carbon has a bug. The+ mapper must never attach `data.supabase` — `callOperation` keys its+ `Database error:` envelope off that field.+- `eliminationClient` is a **context param**, filled from `context.client` (which+ is what the service itself defaults it to). Left out of the generator's+ `CONTEXT_PARAMS` it became a required field a caller cannot express — a+ Supabase client — so the two consolidated-balance ops failed every call.+- Supabase query builders returned by services are awaited and the+ `{ data, error, count }` envelope is **unwrapped by the dispatch**:+ `callOperation` returns `{ success: true, data, count? }` or+ `{ success: false, error, errorKind: "database" | "execution" }`. A Supabase+ failure keeps MCP's exact `Database error: ${JSON.stringify(error)}` text+ (the raw error rides on `ORPCError.data.supabase`), and HTTP callers get the+ Postgres `code`/`details`/`hint` in the 400 body.+- The dispatch behavior is pinned by+ `api+/v1+/lib/dispatch-parity.test.ts` (golden cases carried over from the+ deleted `executeFunction`) — a change there is a behavior change for MCP,+ the agent, workflows and HTTP at once.## Tool metadata & the generator (`scripts/generate-mcp.ts`)@@ -106,8 +198,8 @@ registered individually:(falling back to the `.ee`-licensed `<module>.ee.service.ts` — e.g. `accounting`),plus an optional server-only companion `<module>.mcp.server.ts` when present (for MCPfunctions that must import `*.server` modules — see the gotcha below — e.g.-`production.mcp.server.ts`; `direct-executor.ts` merges its exports into the same module-namespace), and writes `apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json`+`production.mcp.server.ts`; the registry (`api+/v1+/lib/registry.server.ts`) merges its+exports into the same module namespace), and writes `apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json`(`{ generated, totalTools, modules, tools }`). Each tool entry:`{ name, module, classification, description, paramCount, serviceParams, injectAuth, schema }`.@@ -129,11 +221,11 @@ namespace), and writes `apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json`- **`_operation`** (`usesCreatedByDiscriminator`): the ~96 tools whose service picksinsert-vs-update with `if ("createdBy" in …)` get a **required**`_operation: "create" | "update"` in their schema — the schema is the only marker,- there is no parallel metadata flag. `direct-executor.ts` strips `_operation` from the- args (top level *and* the `{ args: {...} }` wrapper) before building the payload, then+ there is no parallel metadata flag. The dispatch (`api+/v1+/lib/dispatch.server.ts`)+ strips `_operation` from the args (top level *and* the `{ args: {...} }` wrapper) before building the payload, thensuppresses the `createdBy` stamp when it is `"update"` — otherwise every MCP edit wouldtake the insert branch. Missing/invalid `_operation` on such a tool is rejected before- the service is called; `call_tool.arguments` is `z.any()`, so the executor is the gate.+ the service is called; `call_tool.arguments` is `z.any()`, so the dispatch is the gate.## The 15 modules (current `tool-metadata.json`)@@ -159,7 +251,7 @@ namespace), and writes `apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json``//` comments above the function, not inside the parameter list (a comment thereis parsed as a property name).- A service whose first parameter is `db` (a Kysely transaction client) is served- `getDatabaseClient()` by `direct-executor.ts`, the same way `client` is served+ `getDatabaseClient()` by `dispatch.server.ts`, the same way `client` is servedthe supabase one. A first parameter named anything else falls through to thepositional-argument branches and receives a business argument as its client.- Don't enumerate individual tools in docs — `search_tools` is the source of truth.@@ -177,6 +269,6 @@ namespace), and writes `apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json`React Router's `react-router:dot-server` plugin then fails the build with *"Server-onlymodule referenced by client"*. Put such MCP write functions in a server-only companion`{module}.mcp.server.ts` instead (never re-exported by the barrel). The generator parses it- and `direct-executor.ts` spreads its exports into the module namespace, so the tool names and+ and `registry.server.ts` spreads its exports into the module namespace, so the tool names andmetadata are identical to a service-file function. Precedent: `production.mcp.server.ts`holds `issueMaterial` / `completeJob`.diff --git a/.claude/rules/workflow-actions.md b/.claude/rules/workflow-actions.mdindex 99c720e13a..e3c1ab6315 100644--- a/.claude/rules/workflow-actions.md+++ b/.claude/rules/workflow-actions.md@@ -84,26 +84,36 @@ export function setWorkflowDispatch(fn: WorkflowDispatch): voidexport function getWorkflowDispatch(): WorkflowDispatch | undefined```-`apps/erp/app/routes/api+/inngest.ts` fills it at boot:+`apps/erp/app/routes/api+/inngest.ts` fills it on first request (lazy, so the+client build can tree-shake the server graph):```tsimport { functions, inngest, setWorkflowDispatch } from "@carbon/jobs/inngest";-import { executeFunction } from "./mcp+/lib/direct-executor";+import { callOperation } from "./v1+/lib/call.server";-setWorkflowDispatch(executeFunction);+setWorkflowDispatch((name, context, args) =>+ callOperation(name, { ...context, authKind: "session", scopes: {} }, args)+);```-`WorkflowDispatch` is declared to be **structurally** satisfied by-`executeFunction`, so nothing in `@carbon/jobs` names an app type. An unfilled-slot is not a crash: `runAction` returns+`callOperation` is the Carbon API's canonical entry point (the same one MCP+`call_tool` and the in-app agent use) — it runs the operation through the real+oRPC procedure. `authKind: "session"` marks the workflow engine as an+already-authorized in-process caller, so the per-operation API-key scope gate+does not apply; the owner-scoped client's RLS still does. `WorkflowDispatch` is+**structurally** satisfied by the wrapper, so nothing in `@carbon/jobs` names an+app type. An unfilled slot is not a crash: `runAction` returns`"This step is not available in this environment."``runCreateAction` (`actions/create.ts`) converts each `RuntimeValue` with-`toPlainValue`, dispatches, then digs the new row's id out of whatever came back-— the service functions return a Supabase envelope whose `error` it checks-separately, and `idIn` walks a list if one came back. No id means-`"The record was created but could not be read back."`, never a silent success.-`companyId`, `createdBy` and `updatedBy` are stamped by the dispatcher.+`toPlainValue`, dispatches, then digs the new row's id out of whatever came back.+`callOperation` returns the service data already UNWRAPPED (`{ success, data }`),+and `create.ts` handles both that and the legacy envelope shape: it checks+`envelope.error` when the payload looks like one, and `idIn` walks a list if one+came back. No id means `"The record was created but could not be read back."`,+never a silent success. `companyId`, `createdBy` and `updatedBy` are stamped by+the dispatch layer (`enrichWithAuthContext` in+`apps/erp/app/routes/api+/v1+/lib/dispatch.server.ts`).## `createWorkflowServices` — the one portdiff --git a/.claude/rules/workflow-event-catalog.md b/.claude/rules/workflow-event-catalog.mdindex 115d44da55..aa64a90af4 100644--- a/.claude/rules/workflow-event-catalog.md+++ b/.claude/rules/workflow-event-catalog.md@@ -147,7 +147,8 @@ Three rules the raise sites follow:- **Raise in the service function, not the route, wherever a service function exists.** Every`apps/erp/app/modules/*/*.service.ts` export is also callable over `POST /api/mcp` through- `apps/erp/app/routes/api+/mcp+/lib/direct-executor.ts`, whose blocklist is one entry long. A+ `apps/erp/app/routes/api+/mcp+/lib/mcp-blocked-tools.ts` (enforced by the Carbon API+dispatch and the `gate()` middleware). Aroute-level raise silently misses every MCP caller. After changing a service signature, run`pnpm run generate:mcp` — the executor maps arguments by declared parameter name.- **Raise after the write commits, and only if it did.** For the four posting moments the writediff --git a/.gitignore b/.gitignoreindex 0cdf867e95..cb5330d346 100644--- a/.gitignore+++ b/.gitignore@@ -96,3 +96,8 @@ memory/daily-notes/# Legacy llm/ — consolidated into .ai/ (docs, specs, runs)llm/++# Generated MCP/Carbon API manifest — 1.3MB, rewritten wholesale on every run.+# Produced by `pnpm generate:mcp` (postinstall + turbo). The committed record of+# the published contract is its small companion, tool-manifest.digest.json.+apps/erp/app/routes/api+/mcp+/lib/tool-metadata.jsondiff --git a/.husky/pre-commit b/.husky/pre-commitindex b9a2db1eb6..bb7877f133 100755--- a/.husky/pre-commit+++ b/.husky/pre-commit@@ -36,7 +36,10 @@ if git diff --cached --name-only | grep -q '\.service\.ts$'; thenecho "✗ MCP tool metadata could not be regenerated. Nothing was staged."exit 1fi- git add apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json+ # The manifest itself is gitignored (see 633f134b0b) — the DIGEST is what is+ # committed, and `git add` on an ignored path exits 1, which failed this hook+ # for every commit that touched a *.service.ts.+ git add apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.jsonfi# Demo-dataset drift only shows up when the datasets actually run. This dry-runs@@ -64,4 +67,18 @@ if [ -z "$CARBON_SKIP_BACKUP_CHECK" ] && git diff --cached --name-only | grep -qecho "Skip it with: CARBON_SKIP_BACKUP_CHECK=1 git commit ..."exit 1fi-fi\ No newline at end of file+fi+# The published operation contract lives in a GITIGNORED manifest, so its committed+# digest is the only record a reviewer can see. Regenerate and refuse the commit if+# a service or validator change did not update it — a stale digest is worse than+# none, since it reads as "nothing changed".+# Set CARBON_SKIP_MANIFEST_CHECK=1 to skip.+if [ -z "$CARBON_SKIP_MANIFEST_CHECK" ] && git diff --cached --name-only | grep -qE '^(apps/erp/app/modules/[^/]+/[^/]+\.(service|models|mcp\.server)\.ts|apps/erp/app/routes/api\+/mcp\+/lib/mcp-blocked-tools\.ts|scripts/(generate-mcp|lib/.*)\.ts)$'; then+ echo "Checking the API operation manifest digest..."+ if ! pnpm --silent check:manifest; then+ echo ""+ echo "Run: pnpm generate:mcp then stage tool-manifest.digest.json"+ echo "Skip it with: CARBON_SKIP_MANIFEST_CHECK=1 git commit ..."+ exit 1+ fi+fidiff --git a/apps/academy/react-router.config.ts b/apps/academy/react-router.config.tsindex a21eb292cc..c5235e2463 100644--- a/apps/academy/react-router.config.ts+++ b/apps/academy/react-router.config.ts@@ -4,5 +4,5 @@ import { vercelPreset } from "@vercel/react-router/vite";export default {ssr: true,presets: process.env.VERCEL ? [vercelPreset()] : undefined,- future: { unstable_optimizeDeps: true, v8_middleware: true },+ future: { unstable_optimizeDeps: true, v8_middleware: true, v8_viteEnvironmentApi: true },} satisfies Config;diff --git a/apps/erp/app/modules/agent/agent.service.ts b/apps/erp/app/modules/agent/agent.service.tsindex c9bb5e3541..922ec12ec3 100644--- a/apps/erp/app/modules/agent/agent.service.ts+++ b/apps/erp/app/modules/agent/agent.service.ts@@ -238,7 +238,11 @@ export function streamChat(client,companyId: args.companyId,companyGroupId: args.companyGroupId,- userId: args.userId+ userId: args.userId,+ // Already authorized by the chat route's requirePermissions; the per-operation+ // scope gate applies to API keys only.+ authKind: "session" as const,+ scopes: {}};const modelMessages = injectContext(diff --git a/apps/erp/app/modules/agent/agent.tools.test.ts b/apps/erp/app/modules/agent/agent.tools.test.tsnew file mode 100644index 0000000000..d527d59b77--- /dev/null+++ b/apps/erp/app/modules/agent/agent.tools.test.ts@@ -0,0 +1,87 @@+import { describe, expect, it, vi } from "vitest";++const callOperation = vi.hoisted(() => vi.fn());++// call.server drags the full oRPC router (and with it every service module) in at+// module load — the agent's guard logic is what's under test, not the dispatch.+vi.mock("~/routes/api+/v1+/lib/call.server", () => ({ callOperation }));+// Data tools are gated off in v1; enable them so call_tool exists to test.+vi.mock("./agent.config", () => ({ AGENT_DATA_TOOLS_ENABLED: true }));++// agent.pages → ~/utils/path → @carbon/glossary, whose module-load-time Lingui `msg`+// macros aren't transformed under plain vitest and throw. The tools under test need+// none of it. Same stub as production.service.test.ts.+vi.mock("@lingui/core/macro", () => ({+ msg: (strings: TemplateStringsArray | string, ...values: unknown[]) =>+ Array.isArray(strings)+ ? strings.reduce(+ (acc, s, i) => acc + s + (i < values.length ? String(values[i]) : ""),+ ""+ )+ : String(strings)+}));++import type { AuthedContext } from "~/routes/api+/v1+/lib/base.server";+import { createAgentTools } from "./agent.tools";++const ctx: AuthedContext = {+ client: {} as AuthedContext["client"],+ companyId: "c1",+ companyGroupId: "g1",+ userId: "u1",+ authKind: "session",+ scopes: {}+};++const toolOptions = { toolCallId: "t1", messages: [] } as never;++function callTool(name: string, args?: Record<string, unknown>) {+ const tools = createAgentTools(ctx) as unknown as Record<+ string,+ { execute: (input: unknown, options: never) => Promise<unknown> }+ >;+ return tools.call_tool.execute({ name, arguments: args }, toolOptions);+}++describe("agent call_tool", () => {+ it("refuses a non-READ tool without reaching the dispatch", async () => {+ callOperation.mockClear();+ const result = await callTool("accounting_upsertAccount", {});+ expect(result).toEqual({+ error: 'Tool "accounting_upsertAccount" is not available.'+ });+ expect(callOperation).not.toHaveBeenCalled();+ });++ it("refuses a blocked tool without reaching the dispatch", async () => {+ callOperation.mockClear();+ const result = await callTool("settings_seedCompany", {});+ expect(result).toEqual({+ error: 'Tool "settings_seedCompany" is not available.'+ });+ expect(callOperation).not.toHaveBeenCalled();+ });++ it("forwards a READ tool to callOperation verbatim and returns its result unchanged", async () => {+ callOperation.mockClear();+ // Pins the intentional agent-facing change: the model sees UNWRAPPED data+ // ({ success, data, count }), not the raw Supabase envelope.+ const dispatchResult = {+ success: true,+ data: [{ id: "e1" }],+ count: 1+ };+ callOperation.mockResolvedValue(dispatchResult);++ const args = { args: { limit: 1 } };+ const result = await callTool("accounting_getAccountLedger", args);++ expect(callOperation).toHaveBeenCalledTimes(1);+ expect(callOperation).toHaveBeenCalledWith(+ "accounting_getAccountLedger",+ ctx,+ args+ );+ expect(result).toBe(dispatchResult);+ });+});diff --git a/apps/erp/app/modules/agent/agent.tools.ts b/apps/erp/app/modules/agent/agent.tools.tsindex 6fda87108b..67412cfd6b 100644--- a/apps/erp/app/modules/agent/agent.tools.ts+++ b/apps/erp/app/modules/agent/agent.tools.ts@@ -1,11 +1,9 @@import { tool } from "ai";import { z } from "zod";-import {- type ExecutorContext,- executeFunction-} from "~/routes/api+/mcp+/lib/direct-executor";import { isMcpBlockedTool } from "~/routes/api+/mcp+/lib/mcp-blocked-tools";import toolMetadata from "~/routes/api+/mcp+/lib/tool-metadata.json";+import type { AuthedContext } from "~/routes/api+/v1+/lib/base.server";+import { callOperation } from "~/routes/api+/v1+/lib/call.server";import {buttonBlock,choiceBlock,@@ -23,7 +21,7 @@ import { findPages } from "./agent.pages";const readTools = toolMetadata.tools.filter((t) => t.classification === "READ");const readToolByName = new Map(readTools.map((t) => [t.name, t]));-export function createAgentTools(ctx: ExecutorContext) {+export function createAgentTools(ctx: AuthedContext) {// v1 is docs-only (see agent.config.ts): the live-data tools are wired up but gated// off. When disabled they're simply omitted from the tool set, so the model never// sees them and can't fan out large row payloads into context.@@ -86,7 +84,7 @@ export function createAgentTools(ctx: ExecutorContext) {// Live-data ERP tools. Gated behind AGENT_DATA_TOOLS_ENABLED (off in v1). Kept intact// so the agent-with-actions milestone can re-enable them behind an enforcement gate.-function createDataTools(ctx: ExecutorContext) {+function createDataTools(ctx: AuthedContext) {return {search_tools: tool({description:@@ -152,7 +150,9 @@ function createDataTools(ctx: ExecutorContext) {if (!readToolByName.has(name) || isMcpBlockedTool(name)) {return { error: `Tool "${name}" is not available.` };}- return executeFunction(+ // The model now sees the UNWRAPPED data (not the Supabase envelope) — the+ // one intentional agent-facing change, pinned in agent.tools.test.ts.+ return callOperation(name,ctx,args as Record<string, unknown> | undefineddiff --git a/apps/erp/app/modules/agent/kb/docs/reference/api-keys.md b/apps/erp/app/modules/agent/kb/docs/building/api-keys.mdsimilarity index 76%rename from apps/erp/app/modules/agent/kb/docs/reference/api-keys.mdrename to apps/erp/app/modules/agent/kb/docs/building/api-keys.mdindex e62fcac3f1..5885bfc961 100644--- a/apps/erp/app/modules/agent/kb/docs/reference/api-keys.md+++ b/apps/erp/app/modules/agent/kb/docs/building/api-keys.md@@ -18,12 +18,12 @@ The full format is `crbn_` followed by a random token. The same dialog also hand## How a key authenticates a request-Send the key in the **`carbon-key`** HTTP header on every request:+Send the key as a bearer token on every request. The hosted Data API lives at `rest.carbon.ms`:```http-GET /rest/v1/salesOrder?select=id,salesOrderId,status-Host: your-carbon-host-carbon-key: crbn_your_key_here+GET /salesOrder?select=id,salesOrderId,status+Host: rest.carbon.ms+Authorization: Bearer crbn_your_key_here```Carbon hashes the incoming key, looks up the matching record, and checks two things before it lets the request through:@@ -31,7 +31,9 @@ Carbon hashes the incoming key, looks up the matching record, and checks two thi- **Expiry.** If the key has an `expiresAt` in the past, the request is rejected.- **Rate limit.** The request is counted against the key's window; if the window is full, the request is rejected.-There is no separate login step and no token to refresh. The header is the whole handshake. The same `carbon-key` header works for the REST API, the edge functions, and (rewritten from a `Bearer` token) the MCP endpoint.+There is no separate login step and no token to refresh. The header is the whole handshake.++`rest.carbon.ms` takes the key as `Authorization: Bearer crbn_…` and forwards it internally as the `carbon-key` header that the database reads. If you run Carbon yourself and call PostgREST directly, send `carbon-key: crbn_…` against `/rest/v1/<table>` instead. The MCP endpoint that fronts the Carbon API takes the same `Bearer` token either way.## Permission scoping@@ -54,15 +56,21 @@ The limit is counted per key, not per company, so one integration burning its alA rejected request comes back `429` with `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` and `Retry-After` (`packages/auth/src/services/auth.server.ts:255`). Read `Retry-After` and wait it out rather than hammering through the rejection.-## The REST and OpenAPI surface+## What the key unlocks++One key unlocks two surfaces. Reach for the Carbon API first; drop to the Data API only when you need raw table access.++### The Carbon API++The [Carbon API](/api) is Carbon's service layer — the safe way to read and write, running the same validation, recalculation, and permission checks the app itself uses. Reach it over plain HTTP at `POST /api/v1/{module}/{operation}` — the key goes in an `Authorization: Bearer` header, and the full operation catalogue is described by [`/api/v1/openapi.json`](/api). The same surface is also exposed over MCP: the creation dialog hands you a ready-to-paste command that registers the key with an AI assistant, which then operates strictly within the key's scopes. See [Connect over MCP](/api/mcp).-The key unlocks Carbon's auto-generated REST API. Every table Carbon exposes is reachable at a PostgREST endpoint (`/rest/v1/<table>`), and the same row-level security that governs the app governs these calls — a request carrying a `carbon-key` is scoped to that key's company and permissions by the database itself, not just the application layer. That means the key can only ever touch data its scopes allow, the same rules the UI enforces.+### The Data API-The full endpoint catalogue, with request and response shapes per resource, lives in the generated [API reference](/api-reference). Point your client at those endpoints, send the `carbon-key` header, and you have programmatic read/write across the modules your key is scoped for.+The same key also unlocks the [Data API](/api/data) — direct REST access to every table and view, hosted at `rest.carbon.ms` (the full endpoint catalogue is generated in the [reference](/api/data)). The same row-level security that governs the app governs these calls: the key is scoped to its company and permissions by the database itself, not just the application layer, so it can only ever touch data its scopes allow.-## The MCP endpoint+The Data API writes straight to tables, so Carbon does not recalculate the derived values — totals, statuses, ledger entries — that it maintains when you write through the Carbon API. It's the escape hatch: reach for the Carbon API first, and use the Data API when it doesn't cover what you need and you know exactly what the table touches.-Carbon also exposes an MCP endpoint (`/api/mcp`) so an AI assistant can call Carbon's tools with your key. The creation dialog gives you the exact command to register it, passing the key as an `Authorization: Bearer` token that Carbon resolves the same way as the `carbon-key` header. The assistant then operates strictly within the key's scopes — the same permission boundary as any other API call.+The full endpoint catalogue, with request and response shapes per resource, lives in the generated [Data API reference](/api/data).## Keys versus webhooks@@ -74,7 +82,7 @@ API keys and `docs/building/webhooks` are two halves of an integration, pullingThey are independent: a webhook is not authenticated with an API key (Carbon does not sign webhook payloads at all), and an API key does not subscribe to anything. The common pattern is to use both together: let a webhook tell you *that* a record changed, then use your API key to fetch the full, current record from the REST API.- Webhooks Get an HTTP callback when a Carbon record changes, then pull the detail with your key.- - API reference The generated endpoint catalogue for every table and resource.+ - Data API The generated endpoint catalogue for every table and view.## Troubleshootingdiff --git a/apps/erp/app/modules/agent/kb/docs/building/webhooks.md b/apps/erp/app/modules/agent/kb/docs/building/webhooks.mdindex fb837d5676..cf99f1d53c 100644--- a/apps/erp/app/modules/agent/kb/docs/building/webhooks.md+++ b/apps/erp/app/modules/agent/kb/docs/building/webhooks.md@@ -67,4 +67,4 @@ Carbon does **not** sign webhook payloads. There is no shared secret or signatur## Related- Integrations Prefer a packaged connector? See the first-party integrations.- - Authentication Pull the full record from the API after a webhook tells you it changed.+ - API keys Pull the full record from the Carbon API after a webhook tells you it changed.diff --git a/apps/erp/app/modules/agent/kb/docs/index.md b/apps/erp/app/modules/agent/kb/docs/index.mdindex 4a79aadd09..331c605655 100644--- a/apps/erp/app/modules/agent/kb/docs/index.md+++ b/apps/erp/app/modules/agent/kb/docs/index.md@@ -15,3 +15,10 @@ Come here when you already know the noun you need and want the precise detail be- Self-hosting Run Carbon on your own infrastructure — a single VPS with Docker, or your own AWS account with SST.- Environment variables Every variable that configures a Carbon instance, grouped by concern.- Reference The entities behind the Guide: methods, reordering, routings, and more.++## Build on Carbon++ - Carbon API The service layer — read and write your data the safe way, over HTTP or MCP.+ - Data API Direct table access — the escape hatch, when the Carbon API doesn't cover it.+ - API keys Scoped secrets that let an external system call Carbon on your behalf.+ - Webhooks Get an HTTP callback the moment a subscribed record changes.diff --git a/apps/erp/app/modules/agent/kb/docs/reference/inspections.md b/apps/erp/app/modules/agent/kb/docs/reference/inspections.mdindex f26e0d8066..d8dbe01afa 100644--- a/apps/erp/app/modules/agent/kb/docs/reference/inspections.md+++ b/apps/erp/app/modules/agent/kb/docs/reference/inspections.md@@ -76,7 +76,7 @@ Sampling decides *how many* to inspect. An **inspection template** decides *what- **File**: An attachment — a photo, a scan, a cert.- **Inspection**: A nested inspection reference.-The step validator (`qualityDocumentStepValidator`, `quality.models.ts:591`) enforces the type-specific rules: a **Measurement** step must have a unit of measure, a **List** step must have at least one non-empty option, and when both `minValue` and `maxValue` are set the max must be greater than or equal to the min. This same step model backs versioned quality documents (SOPs and work instructions), so an inspection template and a procedure share their building blocks.+The step validator (`qualityDocumentStepValidator`, `quality.models.ts:591`) enforces the type-specific rules: a **Measurement** step must have a unit of measure, a **List** step must have at least one non-empty option, and when both `minValue` and `maxValue` are set the max must be greater than or equal to the min.## FAI, inspection documents, and balloonsdiff --git a/apps/erp/app/modules/agent/kb/docs/reference/permissions.md b/apps/erp/app/modules/agent/kb/docs/reference/permissions.mdindex 79430cc358..99eb4f419c 100644--- a/apps/erp/app/modules/agent/kb/docs/reference/permissions.md+++ b/apps/erp/app/modules/agent/kb/docs/reference/permissions.md@@ -4,7 +4,7 @@Everyone who works in Carbon signs in against one company, and Carbon decides what they can do from a set of small, explicit grants. A grant is a pair: a **module** (a slice of the app, like Sales or Inventory) and an **action** on it (view, create, update, or delete). Grant someone `sales_view` and they can read sales orders; grant `inventory_update` and they can edit inventory. Nothing is implied and nothing is global. A person with no grants can sign in and see nothing.-You rarely set those grants one at a time. Each employee gets an **employee type** that carries a template of grants, and you tune the exceptions per person from there. This page is the map of that system, from the permission model at the bottom to the people at the top. For the individuals themselves see `docs/reference/people`; for programmatic access that uses the same model, see `docs/reference/api-keys`. Permissions decide what someone may do once they are in; for how they prove who they are on the way in, see `docs/reference/two-factor`.+You rarely set those grants one at a time. Each employee gets an **employee type** that carries a template of grants, and you tune the exceptions per person from there. This page is the map of that system, from the permission model at the bottom to the people at the top. For the individuals themselves see `docs/reference/people`; for programmatic access that uses the same model, see `docs/building/api-keys`. Permissions decide what someone may do once they are in; for how they prove who they are on the way in, see `docs/reference/two-factor`.## The module-action model@@ -23,7 +23,7 @@ Every permission screen in Carbon is the same widget: a matrix with a **row perInternally each grant stores the list of companies it applies to, so one person can hold different permissions in each company they belong to. In the UI you always edit permissions for the company you're currently in. The special value `"0"` means "all companies" and is how a true cross-company administrator is represented. See `docs/reference/intercompany` for how a user spans several companies.-Carbon enforces these grants in two places at once. The app checks them to show or hide screens and buttons, and the database enforces the same grants through row-level security, so a request that skips the UI still can't reach data the grant doesn't allow. That second layer is what makes the same model safe for `docs/reference/api-keys`, which carry scopes in exactly this `module_action` shape.+Carbon enforces these grants in two places at once. The app checks them to show or hide screens and buttons, and the database enforces the same grants through row-level security, so a request that skips the UI still can't reach data the grant doesn't allow. That second layer is what makes the same model safe for `docs/building/api-keys`, which carry scopes in exactly this `module_action` shape.## Employee typesdiff --git a/apps/erp/app/modules/agent/kb/docs/reference/two-factor.md b/apps/erp/app/modules/agent/kb/docs/reference/two-factor.mdindex 4b7dc8fadb..831d9a67b6 100644--- a/apps/erp/app/modules/agent/kb/docs/reference/two-factor.md+++ b/apps/erp/app/modules/agent/kb/docs/reference/two-factor.md@@ -72,7 +72,7 @@ It also means at least two people should hold user-management permission. If youMachine access is never challenged, and that's by design — there's nobody present to read a code off a phone.- - **API keys**: Keep working exactly as before. They carry their own scopes and rate limits; see `docs/reference/api-keys`.+ - **API keys**: Keep working exactly as before. They carry their own scopes and rate limits; see `docs/building/api-keys`.- **Integrations**: Anything authenticating as the company rather than as a person is unaffected.- **Shop-floor PIN operators**: Never prompted. Operators pin in at a shared terminal rather than signing in, so there's no personal session to protect and no phone to scan with. The person who signed the terminal in is the one two-factor applies to.diff --git a/apps/erp/app/modules/agent/kb/manifest.json b/apps/erp/app/modules/agent/kb/manifest.jsonindex 7173c80c9b..e7925e9f47 100644--- a/apps/erp/app/modules/agent/kb/manifest.json+++ b/apps/erp/app/modules/agent/kb/manifest.json@@ -1,6 +1,28 @@{"_comment": "GENERATED by scripts/generate-agent-kb.ts from docs/content. Do not hand-edit — run `pnpm run generate:agent-kb`.","docs": [+ {+ "slug": "docs/building/api-keys",+ "title": "API keys",+ "description": "A scoped secret that lets an external system call the Carbon API on your behalf, with its own permissions.",+ "keywords": ["api", "keys", "docs", "building"],+ "headings": [+ "Creating a key",+ "How a key authenticates a request",+ "Permission scoping",+ "Rate limiting",+ "What the key unlocks",+ "The Carbon API",+ "The Data API",+ "Keys versus webhooks",+ "Troubleshooting",+ "\"API key lacks required permissions\"",+ "\"Rate limit exceeded\"",+ "\"API key has expired\"",+ "\"API key not found\"",+ "I lost the key / can't find where to see it again"+ ]+ },{"slug": "docs/building/local-development","title": "Local development",@@ -40,7 +62,7 @@"title": "Overview","description": "Carbon is a manufacturing system: ERP for the office, MES for the floor. These are the technical docs.","keywords": ["overview", "docs", "index"],- "headings": ["How the docs are organized"]+ "headings": ["How the docs are organized", "Build on Carbon"]},{"slug": "docs/integrations/accounting",@@ -333,27 +355,6 @@"The assistant says it can't read my data"]},- {- "slug": "docs/reference/api-keys",- "title": "API keys",- "description": "A scoped secret that lets an external system call the Carbon API on your behalf, with its own permissions.",- "keywords": ["api", "keys", "docs", "reference"],- "headings": [- "Creating a key",- "How a key authenticates a request",- "Permission scoping",- "Rate limiting",- "The REST and OpenAPI surface",- "The MCP endpoint",- "Keys versus webhooks",- "Troubleshooting",- "\"API key lacks required permissions\"",- "\"Rate limit exceeded\"",- "\"API key has expired\"",- "\"API key not found\"",- "I lost the key / can't find where to see it again"- ]- },{"slug": "docs/reference/approvals","title": "Approvals",diff --git a/apps/erp/app/modules/inventory/inventory.models.ts b/apps/erp/app/modules/inventory/inventory.models.tsindex dece2426d3..9f72775d24 100644--- a/apps/erp/app/modules/inventory/inventory.models.ts+++ b/apps/erp/app/modules/inventory/inventory.models.ts@@ -160,8 +160,14 @@ export const inventoryAdjustmentValidator = zlocationId: zfd.text(z.string().optional()),storageUnitId: zfd.text(z.string().optional()),originalStorageUnitId: zfd.text(z.string().optional()),+ // Exactly the types the post-inventory-adjustment edge function accepts —+ // NOT itemLedgerTypes. That wider ledger enum leaked into the published API+ // schema here, so API/MCP callers were offered "Purchase" etc. and every+ // such call failed with the generic fallback message. Keep in sync with+ // the edge function's payloadValidator.adjustmentType: z.enum([- ...itemLedgerTypes,+ "Positive Adjmt.",+ "Negative Adjmt.","Set Quantity","Scrap","Unscrap"diff --git a/apps/erp/app/modules/production/production.mcp.server.ts b/apps/erp/app/modules/production/production.mcp.server.tsindex 178595ed76..32f03fc2ff 100644--- a/apps/erp/app/modules/production/production.mcp.server.ts+++ b/apps/erp/app/modules/production/production.mcp.server.ts@@ -16,7 +16,8 @@ import { recalculateJobOperationDependencies } from "./production.service";// part of the client bundle and React Router's dot-server plugin rejects any// `.server` reference reachable from it. This module is server-only (never// re-exported by the barrel) and is pulled into the MCP tool set by-// `scripts/generate-mcp.ts` + `direct-executor.ts`, which run server-side only.+// `scripts/generate-mcp.ts` + the Carbon API registry+// (`api+/v1+/lib/registry.server.ts`), which run server-side only.//// The MCP executor injects companyId/userId from the OAuth token but performs no// per-tool permission check, and some of these writes reach privileged paths (adiff --git a/apps/erp/app/modules/production/production.service.ts b/apps/erp/app/modules/production/production.service.tsindex 95f69b0523..44cbcf35c6 100644--- a/apps/erp/app/modules/production/production.service.ts+++ b/apps/erp/app/modules/production/production.service.ts@@ -8569,16 +8569,7 @@ export async function getInspectionDocuments(companyId: string,args?: { search: string | null } & GenericQueryFilters) {- const documentClient = client as unknown as {- from: (table: string) => {- select: (- columns: string,- options?: { count?: "exact" | "planned" | "estimated"; head?: boolean }- ) => any;- };- };-- let query = documentClient+ let query = client.from("inspectionDocuments").select("*", { count: "exact" }).eq("companyId", companyId);diff --git a/apps/erp/app/modules/quality/quality.service.ts b/apps/erp/app/modules/quality/quality.service.tsindex dbd9b9be10..6958e33acd 100644--- a/apps/erp/app/modules/quality/quality.service.ts+++ b/apps/erp/app/modules/quality/quality.service.ts@@ -2244,7 +2244,7 @@ export async function getInspections() {// No receipt embed: the generic sourceDocumentId carries no FK, so the// source document is denormalized onto the row (sourceDocumentReadableId).- let query = (client as any)+ let query = client.from("inspection").select("*, item(readableId, name), supplier(name), inspectionSample(status)",@@ -2298,7 +2298,7 @@ export async function getReceiptInspections(receiptId: string,companyId: string) {- return (client as any)+ return client.from("inspection").select("id, inspectionId, itemId, itemReadableId, status").eq("sourceDocument", "Receipt")diff --git a/apps/erp/app/modules/sales/sales.service.ts b/apps/erp/app/modules/sales/sales.service.tsindex 2141dbbed8..a4dfce0c21 100644--- a/apps/erp/app/modules/sales/sales.service.ts+++ b/apps/erp/app/modules/sales/sales.service.ts@@ -1169,18 +1169,6 @@ export async function getQuote(return client.from("quotes").select("*").eq("id", quoteId).single();}-export async function getQuoteFavorites(- client: SupabaseClient<Database>,- companyId: string,- userId: string-) {- return client- .from("quoteFavorite")- .select("*")- .eq("companyId", companyId)- .eq("userId", userId);-}-export async function getQuotes(client: SupabaseClient<Database>,companyId: string,@@ -1617,18 +1605,6 @@ export async function getSalesOrderCustomerDetails(.single();}-export async function getSalesOrderFavorites(- client: SupabaseClient<Database>,- companyId: string,- userId: string-) {- return client- .from("salesOrderFavorite")- .select("*")- .eq("companyId", companyId)- .eq("userId", userId);-}-export async function getSalesOrderRelatedItems(client: SupabaseClient<Database>,salesOrderId: string,@@ -1844,18 +1820,6 @@ export async function getSalesRFQ(return client.from("salesRfqs").select("*").eq("id", id).single();}-export async function getSalesRFQFavorites(- client: SupabaseClient<Database>,- companyId: string,- userId: string-) {- return client- .from("salesRfqFavorite")- .select("*")- .eq("companyId", companyId)- .eq("userId", userId);-}-export async function getSalesRFQs(client: SupabaseClient<Database>,companyId: string,diff --git a/apps/erp/app/modules/settings/api-key-cache-bust.test.ts b/apps/erp/app/modules/settings/api-key-cache-bust.test.tsnew file mode 100644index 0000000000..3b71491912--- /dev/null+++ b/apps/erp/app/modules/settings/api-key-cache-bust.test.ts@@ -0,0 +1,53 @@+import { describe, expect, it, vi } from "vitest";++const bustApiKeyCache = vi.hoisted(() => vi.fn());+const getCarbonServiceRole = vi.hoisted(() => vi.fn());++// settings.server.ts drags @carbon/ee and the integration hooks in at module load;+// none of that is under test here.+vi.mock("@carbon/auth/auth.server", () => ({ bustApiKeyCache }));+vi.mock("@carbon/auth/client.server", () => ({ getCarbonServiceRole }));+vi.mock("@carbon/ee", () => ({+ getIntegrationConfigById: vi.fn(),+ resolveIntegrationSecrets: vi.fn(),+ splitSecrets: vi.fn()+}));+vi.mock("@carbon/ee/hooks.server", () => ({+ getIntegrationServerHooks: vi.fn()+}));++import { invalidateApiKeyCache } from "./settings.server";++/** Records the `.eq()` filters so the companyId scoping can be asserted. */+function stubServiceRole(row: { keyHash: string } | null) {+ const eq = vi.fn();+ const chain: Record<string, unknown> = {};+ chain.from = vi.fn(() => chain);+ chain.select = vi.fn(() => chain);+ chain.eq = vi.fn((column: string, value: string) => {+ eq(column, value);+ return chain;+ });+ chain.maybeSingle = vi.fn(async () => ({ data: row, error: null }));+ getCarbonServiceRole.mockReturnValue(chain);+ return eq;+}++describe("invalidateApiKeyCache", () => {+ it("busts the cache with the row's keyHash and returns it for a post-delete re-bust", async () => {+ bustApiKeyCache.mockClear();+ stubServiceRole({ keyHash: "hash-1" });+ const hash = await invalidateApiKeyCache("key-1", "company-1");+ expect(hash).toBe("hash-1");+ expect(bustApiKeyCache).toHaveBeenCalledTimes(1);+ expect(bustApiKeyCache).toHaveBeenCalledWith("hash-1");+ });++ it("does nothing and returns null when the row is missing", async () => {+ bustApiKeyCache.mockClear();+ stubServiceRole(null);+ const hash = await invalidateApiKeyCache("key-gone", "company-1");+ expect(hash).toBeNull();+ expect(bustApiKeyCache).not.toHaveBeenCalled();+ });+});diff --git a/apps/erp/app/modules/settings/settings.server.ts b/apps/erp/app/modules/settings/settings.server.tsindex ee6656eabc..7cecd7ac1f 100644--- a/apps/erp/app/modules/settings/settings.server.ts+++ b/apps/erp/app/modules/settings/settings.server.ts@@ -1,3 +1,4 @@+import { bustApiKeyCache } from "@carbon/auth/auth.server";import { getCarbonServiceRole } from "@carbon/auth/client.server";import type { Database, Json } from "@carbon/database";import {@@ -18,6 +19,42 @@ import type { customFieldValidator } from "./settings.models";const INTEGRATION_CACHE_TTL = 3600;const logger = getLogger("erp", "settings");+/**+ * Drop the cached auth record for an API key so a scope change or revocation+ * takes effect immediately in the common case. An in-flight auth read can still+ * re-prime the cache with the pre-write row, so the hard bound is the 30s TTL —+ * callers that delete the row should bust AGAIN after the delete commits, using+ * the returned keyHash (unreadable from the DB once the row is gone).+ *+ * Service-role on purpose: apiKey's RLS SELECT requires `settings_view`, but the+ * routes that revoke or rescope a key gate on `users_update`, so the caller's own+ * client cannot see the row and the bust would silently do nothing.+ */+export async function invalidateApiKeyCache(+ id: string,+ companyId: string+): Promise<string | null> {+ const { data, error } = await getCarbonServiceRole()+ .from("apiKey")+ .select("keyHash")+ .eq("id", id)+ .eq("companyId", companyId)+ .maybeSingle();+ // A failed lookup is indistinguishable from a missing row at the return type,+ // and neither may block the revoke — log it so a stale scope surviving its TTL+ // is diagnosable rather than silent.+ if (error) {+ logger.error("Failed to read api key for cache bust", {+ error,+ id,+ companyId+ });+ }+ if (!data?.keyHash) return null;+ await bustApiKeyCache(data.keyHash);+ return data.keyHash;+}+export async function clearCustomFieldsCache(companyId?: string) {const keys = companyId ? `customFields:${companyId}:*` : "customFields:*";redis.keys(keys).then(function (keys) {@@ -508,7 +545,8 @@ export async function invalidateIntegrationHealthCache(// Server-only (needs the service-role client for the Vault RPC). Lives here rather// than in settings.service.ts because that file is re-exported by the client barrel;// a client.server import there would leak the service-role client into the browser-// bundle. Reached by the MCP direct-executor, which imports this module server-side.+// bundle. Reached by the Carbon API registry (api+/v1+/lib/registry.server.ts),+// which imports this module server-side.export async function updateIntegrationMetadata(client: SupabaseClient<Database>,companyId: string,diff --git a/apps/erp/app/modules/settings/settings.service.ts b/apps/erp/app/modules/settings/settings.service.tsindex 6479edba46..55720643f1 100644--- a/apps/erp/app/modules/settings/settings.service.ts+++ b/apps/erp/app/modules/settings/settings.service.ts@@ -888,10 +888,15 @@ export async function updateDefaultCustomerCc(companyId: string,defaultCustomerCc: string[]) {- return client- .from("companySettings")- .update({ defaultCustomerCc })- .eq("companyId", companyId);+ return (+ client+ .from("companySettings")+ .update({ defaultCustomerCc })+ // `companySettings` is keyed by `id` (which IS the companyId) — it has no+ // `companyId` column, so the old predicate made every save fail with a+ // PostgREST error surfaced straight to the user on Settings → Sales.+ .eq("id", companyId)+ );}export async function updateCompany(diff --git a/apps/erp/app/routes/api+/inngest.ts b/apps/erp/app/routes/api+/inngest.tsindex 2ab0af1455..4727eb8ace 100644--- a/apps/erp/app/routes/api+/inngest.ts+++ b/apps/erp/app/routes/api+/inngest.ts@@ -1,7 +1,7 @@import { functions, inngest, setWorkflowDispatch } from "@carbon/jobs/inngest";import { serve } from "inngest/remix";import type { ActionFunctionArgs, LoaderFunctionArgs } from "react-router";-import { executeFunction } from "./mcp+/lib/direct-executor";+import { callOperation } from "./v1+/lib/call.server";/*** Inngest API endpoint.@@ -31,7 +31,11 @@ const handler = serve({let dispatchWired = false;function wireWorkflowDispatch() {if (dispatchWired) return;- setWorkflowDispatch(executeFunction);+ // A running workflow acts as its already-authorized owner; the per-operation+ // scope gate applies to API keys only.+ setWorkflowDispatch((name, context, args) =>+ callOperation(name, { ...context, authKind: "session", scopes: {} }, args)+ );dispatchWired = true;}diff --git a/apps/erp/app/routes/api+/mcp+/_index.ts b/apps/erp/app/routes/api+/mcp+/_index.tsindex 559141e502..e427023953 100644--- a/apps/erp/app/routes/api+/mcp+/_index.ts+++ b/apps/erp/app/routes/api+/mcp+/_index.ts@@ -1,15 +1,17 @@-import { hashOAuthSecret, requirePermissions } from "@carbon/auth/auth.server";+import { hashOAuthSecret } from "@carbon/auth/auth.server";import {getCarbonServiceRole,getUserScopedClient} from "@carbon/auth/client.server";import { getAppUrl } from "@carbon/env";+import { Ratelimit, redis } from "@carbon/kv";import { datetime } from "@carbon/utils";import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";-import type { SupabaseClient } from "@supabase/supabase-js";import type { ActionFunctionArgs } from "react-router";import { getCompanyTimeZone } from "~/modules/shared/timezone.server";+import { authenticateApiKey } from "../v1+/lib/authenticate.server";import { createMcpServer } from "./lib/server";+import type { McpContext } from "./lib/types";const corsHeaders = {"Access-Control-Allow-Origin": "*",@@ -29,13 +31,6 @@ function addCorsHeaders(response: Response): Response {});}-type McpContext = {- client: SupabaseClient;- companyId: string;- companyGroupId: string;- userId: string;-};-async function authenticateOAuthToken(accessToken: string): Promise<{ userId: string; companyId: string } | null> {@@ -55,6 +50,36 @@ async function authenticateOAuthToken(};}+/**+ * OAuth (connector) callers get the same allowance an API key gets by default —+ * 60 requests/minute — but through the app's Redis limiter rather than the+ * Postgres one: `apiKeyRateLimit` has an FK to `apiKey`, so it cannot count a+ * synthetic per-user id, and this route only exists in the Node app where Redis+ * is the house tool (the login limiter is the precedent). Keyed by USER, not by+ * token, so minting extra tokens does not multiply the allowance. Without this,+ * the OAuth branch was the one authenticated path with no rate limit at all —+ * it never touches requirePermissions, where the API-key limit lives.+ */+const OAUTH_RATE_LIMIT = 60;+const oauthRatelimit = new Ratelimit({+ redis,+ limiter: Ratelimit.slidingWindow(OAUTH_RATE_LIMIT, "1 m")+});++function make429Response(reset: number, remaining: number): Response {+ const retryAfterSeconds = Math.max(1, Math.ceil((reset - Date.now()) / 1000));+ return new Response(JSON.stringify({ error: "Rate limit exceeded" }), {+ status: 429,+ headers: {+ "X-RateLimit-Limit": OAUTH_RATE_LIMIT.toString(),+ "X-RateLimit-Remaining": remaining.toString(),+ "X-RateLimit-Reset": reset.toString(),+ "Retry-After": retryAfterSeconds.toString(),+ ...corsHeaders+ }+ });+}+function make401Response(request: Request): Response {const origin = getAppUrl() || new URL(request.url).origin;return new Response(null, {@@ -80,6 +105,11 @@ async function resolveAuth(request: Request): Promise<{if (!token.startsWith("crbn_")) {const oauthAuth = await authenticateOAuthToken(token);if (oauthAuth) {+ const rl = await oauthRatelimit.limit(`mcp-oauth:${oauthAuth.userId}`);+ if (!rl.success) {+ throw make429Response(rl.reset, rl.remaining);+ }+const client = await getUserScopedClient(oauthAuth.userId);const companyResult = await client.from("company")@@ -93,7 +123,9 @@ async function resolveAuth(request: Request): Promise<{companyId: oauthAuth.companyId,companyGroupId:companyResult.data?.companyGroupId ?? oauthAuth.companyId,- userId: oauthAuth.userId+ userId: oauthAuth.userId,+ authKind: "oauth" as const,+ scopes: {}},request};@@ -113,11 +145,12 @@ async function resolveAuth(request: Request): Promise<{throw make401Response(request);}- const { client, companyId, companyGroupId, userId } =- await requirePermissions(request, {});-+ // `request` here carries the carbon-key header for both entry forms+ // (`Bearer crbn_…` was rewritten above). Same helper as the v1 HTTP transport,+ // so the requirePermissions-then-read-scopes dance exists once.+ const rawKey = request.headers.get("carbon-key") ?? "";return {- ctx: { client, companyId, companyGroupId, userId },+ ctx: await authenticateApiKey(request.url, rawKey),request};}diff --git a/apps/erp/app/routes/api+/mcp+/lib/agent-setup-prompt.md b/apps/erp/app/routes/api+/mcp+/lib/agent-setup-prompt.mdindex 95b12338b7..d944133d2b 100644--- a/apps/erp/app/routes/api+/mcp+/lib/agent-setup-prompt.md+++ b/apps/erp/app/routes/api+/mcp+/lib/agent-setup-prompt.md@@ -199,8 +199,9 @@ Settings → API Keys.## Resources-- MCP guide — https://docs.carbon.ms/mcp-- Authentication — https://docs.carbon.ms/mcp/authentication-- Tools reference — https://docs.carbon.ms/mcp/tools+- Carbon API guide — https://docs.carbon.ms/api+- Connect over MCP — https://docs.carbon.ms/api/mcp+- Authentication — https://docs.carbon.ms/api/authentication+- Operations reference — https://docs.carbon.ms/api/operations- API keys — https://docs.carbon.ms/docs/reference/api-keys- Server manifest — {{ORIGIN}}/.well-known/mcp.jsondiff --git a/apps/erp/app/routes/api+/mcp+/lib/direct-executor.ts b/apps/erp/app/routes/api+/mcp+/lib/direct-executor.tsdeleted file mode 100644index 2c501b0dc1..0000000000--- a/apps/erp/app/routes/api+/mcp+/lib/direct-executor.ts+++ /dev/null@@ -1,337 +0,0 @@-// Direct executor for ERP functions without MCP protocol wrapper--import type { Database } from "@carbon/database";-import { getLogger } from "@carbon/logger";-import type { SupabaseClient } from "@supabase/supabase-js";-import * as accountFunctions from "~/modules/account/account.service";-import * as accountingFunctions from "~/modules/accounting/accounting.ee.service";-import * as documentsFunctions from "~/modules/documents/documents.service";-import * as inventoryFunctions from "~/modules/inventory/inventory.service";-import * as invoicingFunctions from "~/modules/invoicing/invoicing.service";-import * as itemsFunctions from "~/modules/items/items.service";-import * as peopleFunctions from "~/modules/people/people.service";-import * as productionMcpFunctions from "~/modules/production/production.mcp.server";-import * as productionFunctions from "~/modules/production/production.service";-import * as purchasingFunctions from "~/modules/purchasing/purchasing.service";-import * as qualityFunctions from "~/modules/quality/quality.service";-import * as resourcesFunctions from "~/modules/resources/resources.service";-import * as salesFunctions from "~/modules/sales/sales.service";-import * as settingsFunctions from "~/modules/settings/settings.service";-import * as sharedFunctions from "~/modules/shared/shared.service";-import * as usersFunctions from "~/modules/users/users.service";-import { getDatabaseClient } from "~/services/database.server";-import { isMcpBlockedTool } from "./mcp-blocked-tools";-import toolMetadata from "./tool-metadata.json";-import type { AuthField } from "./types";--const logger = getLogger("erp", "mcp", "direct-executor");--// Combine all functions into a single registry-const functionRegistry = {- account: accountFunctions,- accounting: accountingFunctions,- documents: documentsFunctions,- inventory: inventoryFunctions,- invoicing: invoicingFunctions,- items: itemsFunctions,- people: peopleFunctions,- production: { ...productionFunctions, ...productionMcpFunctions },- purchasing: purchasingFunctions,- quality: qualityFunctions,- resources: resourcesFunctions,- sales: salesFunctions,- settings: settingsFunctions,- shared: sharedFunctions,- users: usersFunctions-};--export interface ExecutorContext {- client: SupabaseClient<Database>;- companyId: string;- companyGroupId: string;- userId: string;-}--export type McpOperation = "create" | "update";--// Stamps auth identity onto typed payloads. Carbon's services expect auth-// fields inside the payload (predates MCP). `fields` is per-tool from-// tool-metadata.json so reads stay clean and updates don't overwrite createdBy.-function enrichWithAuthContext(- value: unknown,- context: ExecutorContext,- fields: AuthField[],- operation?: McpOperation-): unknown {- if (!value || typeof value !== "object") return value;- if (fields.length === 0) return value;-- // Array payloads (e.g. the row list for upsertQuoteLinePrices) need per-element- // stamping — enrichment never reached inside them, so a NOT NULL createdBy on- // the row table failed. Only createdBy is injected into elements (and only for- // an insert): element keys are spread straight into an INSERT, so injecting- // companyId/updatedBy could add a column the row table doesn't have. The- // service owns companyId for these rows. createdBy is stamped AFTER the spread- // so a caller can't forge audit attribution by supplying it in a row.- if (Array.isArray(value)) {- if (operation === "update" || !fields.includes("createdBy")) return value;- return value.map((element) =>- element && typeof element === "object" && !Array.isArray(element)- ? { ...(element as Record<string, unknown>), createdBy: context.userId }- : element- );- }-- const enriched: Record<string, unknown> = {- ...(value as Record<string, unknown>)- };-- // A caller-supplied createdBy would send the service down its insert branch.- if (operation === "update") {- delete enriched.createdBy;- } else if (fields.includes("createdBy") && !("createdBy" in enriched)) {- enriched.createdBy = context.userId;- }- if (fields.includes("updatedBy")) {- enriched.updatedBy = context.userId;- }- if (fields.includes("companyId")) {- enriched.companyId = context.companyId;- }- if (fields.includes("companyGroupId")) {- enriched.companyGroupId = context.companyGroupId;- }-- return enriched;-}--// Pulls the MCP-only `_operation` flag out of the args, top level or nested.-// Returns every value it found so the caller can reject contradictory ones.-function extractOperation(args: Record<string, any> | undefined): {- operations: string[];- args: Record<string, any> | undefined;-} {- if (!args) return { operations: [], args };-- const operations: string[] = [];- const cleaned: Record<string, any> = {};-- if (args._operation !== undefined) operations.push(String(args._operation));-- for (const [key, value] of Object.entries(args)) {- if (key === "_operation") continue;- if (value && typeof value === "object" && !Array.isArray(value)) {- const { _operation, ...rest } = value as Record<string, any>;- if (_operation !== undefined) {- operations.push(String(_operation));- cleaned[key] = rest;- continue;- }- }- cleaned[key] = value;- }-- return { operations, args: cleaned };-}--export async function executeFunction(- functionName: string,- context: ExecutorContext,- args?: Record<string, any> | string-) {- if (typeof args === "string") {- try {- args = args.trim().length > 0 ? JSON.parse(args) : {};- } catch {- return {- success: false,- error: "Invalid JSON arguments"- };- }- }- const rawArgs = args && typeof args === "object" ? args : undefined;-- // Strip before use — the branches below hand args straight to the service.- const { operations: requestedOperations, args: normalizedArgs } =- extractOperation(rawArgs);-- if (isMcpBlockedTool(functionName)) {- return {- success: false,- error: `Tool disabled: ${functionName} is not available via MCP.`- };- }-- // Parse the function name to get module and function- const parts = functionName.split("_");- if (parts.length < 2) {- logger.error("Invalid function name format", { functionName });- throw new Error(`Invalid function name format: ${functionName}`);- }-- const moduleName = parts[0];- const funcName = parts.slice(1).join("_");-- // Get the module functions- const moduleFunctions =- functionRegistry[moduleName as keyof typeof functionRegistry];- if (!moduleFunctions) {- logger.error("Module not found", { moduleName });- throw new Error(`Module not found: ${moduleName}`);- }-- // Get the specific function- const func = moduleFunctions[funcName as keyof typeof moduleFunctions];- if (!func || typeof func !== "function") {- logger.error("Function not found", { funcName, moduleName });- throw new Error(`Function not found: ${funcName} in module ${moduleName}`);- }-- try {- const toolMeta = toolMetadata.tools.find(- (t: { name: string }) => t.name === functionName- );- const paramNames: string[] =- toolMeta && "serviceParams" in toolMeta- ? (toolMeta as any).serviceParams- : [];- const injectAuth: AuthField[] =- toolMeta && "injectAuth" in toolMeta- ? ((toolMeta as any).injectAuth as AuthField[])- : [];- const needsOperation = Boolean(- (toolMeta as any)?.schema?.properties?._operation- );-- const distinctOperations = [...new Set(requestedOperations)];- if (needsOperation && distinctOperations.length > 1) {- return {- success: false,- error: `${functionName} received conflicting _operation values (${distinctOperations.join(", ")}).`- };- }- const requestedOperation = distinctOperations[0];- if (- needsOperation &&- requestedOperation !== "create" &&- requestedOperation !== "update"- ) {- return {- success: false,- error: `${functionName} requires _operation to be "create" (insert a new record) or "update" (modify an existing one).`- };- }- const operation = needsOperation- ? (requestedOperation as McpOperation)- : undefined;-- // Build arguments array based on parameter names- const functionArgs: any[] = [];-- for (const paramName of paramNames) {- if (paramName === "client") {- functionArgs.push(context.client);- } else if (paramName === "db") {- functionArgs.push(getDatabaseClient());- } else if (paramName === "userId") {- functionArgs.push(context.userId);- } else if (paramName === "companyId") {- functionArgs.push(context.companyId);- } else if (paramName === "companyGroupId") {- functionArgs.push(context.companyGroupId);- } else if (paramName === "args") {- // For 'args' parameter, pass the entire args object or a default- // This is the parameter that most service functions expect- const argsValue = normalizedArgs || {};- functionArgs.push(argsValue);- } else if (normalizedArgs && paramName in normalizedArgs) {- functionArgs.push(- enrichWithAuthContext(- normalizedArgs[paramName],- context,- injectAuth,- operation- )- );- } else if (- normalizedArgs &&- Object.keys(normalizedArgs).length === 1 &&- !paramNames.some((p: string) => p in normalizedArgs) &&- typeof Object.values(normalizedArgs)[0] === "object" &&- Object.values(normalizedArgs)[0] !== null- ) {- // Single-key payload whose name doesn't match any parameter — unwrap- // and use as positional. Hits the documented `{ args: {...} }` wrapper- // and any LLM that guesses a key name (e.g. `{ item: {...} }`).- const value = Object.values(normalizedArgs)[0];- functionArgs.push(- enrichWithAuthContext(value, context, injectAuth, operation)- );- } else if (normalizedArgs && Object.keys(normalizedArgs).length > 0) {- // No key matched — pass the entire args object as a positional param.- // Handles functions like upsertPart(client, part) where the caller- // passes flat fields instead of nesting under the param name.- functionArgs.push(- enrichWithAuthContext(- { ...normalizedArgs },- context,- injectAuth,- operation- )- );- } else {- // Skip optional parameters- continue;- }- }-- // Execute the function- let result = await (func as Function)(...functionArgs);-- // Check if result is a Supabase query builder (it's thenable but not yet executed)- // Supabase queries are thenable objects that need to be awaited- if (- result &&- typeof result === "object" &&- typeof result.then === "function"- ) {- try {- const executedResult = await result;- result = executedResult;- } catch (queryError: any) {- logger.error("Query execution failed", { error: queryError });- throw queryError;- }- }-- return {- success: true,- data: result- };- } catch (error: any) {- logger.error("Function execution failed", { error, stack: error.stack });- return {- success: false,- error: error.message || "Function execution failed"- };- }-}--// Helper to search available functions-export function searchFunctions(query?: string, module?: string): string[] {- const results: string[] = [];-- Object.entries(functionRegistry).forEach(([moduleName, functions]) => {- if (module && moduleName !== module) return;-- Object.keys(functions).forEach((funcName) => {- const fullName = `${moduleName}_${funcName}`;- if (isMcpBlockedTool(fullName)) return;- if (!query || fullName.toLowerCase().includes(query.toLowerCase())) {- results.push(fullName);- }- });- });-- return results;-}diff --git a/apps/erp/app/routes/api+/mcp+/lib/mcp-blocked-tools.ts b/apps/erp/app/routes/api+/mcp+/lib/mcp-blocked-tools.tsindex cc4f786547..ab21bde7b7 100644--- a/apps/erp/app/routes/api+/mcp+/lib/mcp-blocked-tools.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/mcp-blocked-tools.ts@@ -7,6 +7,15 @@ export const MCP_BLOCKED_TOOL_NAMES: readonly string[] = [// Creating a company is an account-level operation that must not be exposed// as an MCP tool (it would let a company-scoped token create new tenants)."settings_insertCompany",+ // The mirror of insertCompany: a bare `company` delete whose only argument is a+ // companyId the dispatcher fills from the caller's own key, so an empty body+ // deletes the caller's tenant. Its "internal users only" gate lives in the+ // settings ROUTE, which no API/MCP call passes through.+ "settings_deleteSubsidiary",+ // Its first parameter is a service-role (RLS-bypassing) client. Blocking keeps+ // a privileged client off the public API rather than teaching the dispatcher to+ // hand one out.+ "purchasing_getSupplierApprovalContext",// Internal sweep orchestration invoked by job/operation completion flows.// Their args require a userId the MCP executor cannot inject (AuthField has// no such payload field), so direct calls would only ever fail validation.@@ -16,7 +25,23 @@ export const MCP_BLOCKED_TOOL_NAMES: readonly string[] = [// no permission check of its own (every ERP route gates on `production` update// before calling it). `production_scheduleJob` is the intended MCP entry point —// it re-applies that gate — so the raw trigger must not be reachable via MCP.- "production_triggerJobSchedule"+ "production_triggerJobSchedule",+ // Unreachable by construction: these tables carry USER-scoped RLS+ // (`"createdBy"::uuid = auth.uid()`, migration 20260228000000_rls-refactor-3.sql),+ // but an API key authenticates by header rather than a Supabase JWT, so+ // `auth.uid()` is NULL and the predicate can never match. Blocked rather than+ // left to fail because the failure is silent for half of them — an UPDATE or+ // DELETE matching zero rows is not an error, so `deleteNote` answered 200 with+ // the row untouched. Making them work is an RLS decision, not an app-code one.+ "shared_updateNote",+ "shared_deleteNote",+ "production_deleteMaintenanceDispatchComment",+ "resources_deleteMaintenanceDispatchComment",+ "sales_updateQuoteFavorite",+ "sales_updateSalesOrderFavorite",+ "sales_updateSalesRFQFavorite",+ "purchasing_updateSupplierQuoteFavorite",+ "resources_insertTrainingCompletion"];export function isMcpBlockedTool(name: string): boolean {diff --git a/apps/erp/app/routes/api+/mcp+/lib/server.ts b/apps/erp/app/routes/api+/mcp+/lib/server.tsindex c1ecb71404..6a841ffaa5 100644--- a/apps/erp/app/routes/api+/mcp+/lib/server.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/server.ts@@ -6,7 +6,7 @@ import { z } from "zod";import { withErrorHandling, READ_ONLY_ANNOTATIONS, WRITE_ANNOTATIONS } from "./types";import toolMetadata from "./tool-metadata.json";import { isMcpBlockedTool } from "./mcp-blocked-tools";-import { executeFunction } from "./direct-executor";+import { callOperation } from "../../v1+/lib/call.server";const logger = getLogger("erp", "mcp");@@ -147,56 +147,31 @@ export function createMcpServer(ctx: McpContext, today: string): McpServer {};}- // Use direct executor instead of MCP protocol- const result = await executeFunction(name, ctx, args);-+ // Runs through the canonical oRPC dispatch (gate middleware included); the+ // Supabase envelope arrives already unwrapped to `data`/`count`.+ const result = await callOperation(name, ctx, args);+logger.info("Execution result", {success: result.success,- hasData: !!result.data,- error: result.error+ hasData: result.success && result.data !== undefined,+ error: result.success ? undefined : result.error});-- if (result.success) {- // Format successful response- let output = "";-- // Check if the result.data is a Supabase response format- if (result.data && typeof result.data === 'object' && 'data' in result.data) {- // Supabase format: { data: [...], error: null, count: ... }- const supabaseData = result.data.data;- logger.info("Detected Supabase response format", {- dataLength: Array.isArray(supabaseData) ? supabaseData.length : "not array"- });-- if (result.data.error) {- logger.error("Supabase error", { error: result.data.error });- return {- content: [{ type: "text" as const, text: `Database error: ${JSON.stringify(result.data.error)}` }],- isError: true- };- }-- output = JSON.stringify(supabaseData, null, 2);- } else if (result.data) {- output = JSON.stringify(result.data, null, 2);- logger.info("Using result.data for output");- } else {- output = "Operation completed successfully";- logger.info("No data in result, using default message");- }-- logger.info("Returning output", { output: output.substring(0, 200) });- return {- content: [{ type: "text" as const, text: output }]- };- } else {- logger.error("Tool execution failed", { error: result.error });- return {- content: [{ type: "text" as const, text: `Error: ${result.error}` }],- isError: true- };+ if (result.success) {+ const output =+ result.data === undefined+ ? "Operation completed successfully"+ : JSON.stringify(result.data, null, 2);+ return { content: [{ type: "text" as const, text: output }] };}+ logger.error("Tool execution failed", { error: result.error });+ return {+ content: [{+ type: "text" as const,+ text: result.errorKind === "database" ? result.error : `Error: ${result.error}`+ }],+ isError: true+ };}, "Call tool failed"));diff --git a/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json b/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.jsonnew file mode 100644index 0000000000..f925e53253--- /dev/null+++ b/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json@@ -0,0 +1,1488 @@+{+ "totalTools": 1482,+ "modules": 15,+ "tools": [+ {"name":"account_deleteUserAttributeValue","classification":"DESTRUCTIVE","paramCount":2,"schema":"0d38e12233b4","response":"bcde375ebd4c","injectAuth":"companyId","permission":"none"},+ {"name":"account_getAccount","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"8adb0e14ee10","injectAuth":"companyId","permission":"none"},+ {"name":"account_getAllAttributeCategories","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"e93d76f694fe","injectAuth":"companyId","permission":"none"},+ {"name":"account_getAttributeCategoryWithValues","classification":"READ","paramCount":1,"schema":"34d65afdb82e","response":"32112b6759f8","injectAuth":"companyId","permission":"none"},+ {"name":"account_getAttributes","classification":"READ","paramCount":1,"schema":"f69289b8004c","response":"e93d76f694fe","injectAuth":"companyId","permission":"none"},+ {"name":"account_getCurrentUser","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ddc730821e71","injectAuth":"companyId","permission":"none"},+ {"name":"account_getNotificationPreferences","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0486649779fc","injectAuth":"companyId","permission":"none"},+ {"name":"account_getPrivateAttributes","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"e93d76f694fe","injectAuth":"companyId","permission":"none"},+ {"name":"account_getPublicAttributes","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"e93d76f694fe","injectAuth":"companyId","permission":"none"},+ {"name":"account_updateAvatar","classification":"WRITE","paramCount":1,"schema":"a2f2d0de3049","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"none"},+ {"name":"account_updatePublicAccount","classification":"WRITE","paramCount":5,"schema":"1995f647bdcf","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"none"},+ {"name":"account_upsertNotificationPreference","classification":"WRITE","paramCount":3,"schema":"4bf056fb8af6","response":"bcde375ebd4c","injectAuth":"companyId","permission":"none"},+ {"name":"account_upsertUserAttributeValue","classification":"WRITE","paramCount":4,"schema":"258c7a7e8f4e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"none"},+ {"name":"accounting_addCloseTask","classification":"WRITE","paramCount":5,"schema":"6bf4c2d84b80","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create"},+ {"name":"accounting_closeAccountingPeriod","classification":"WRITE","paramCount":1,"schema":"7e5905ac5974","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"accounting:update"},+ {"name":"accounting_closePeriodWithChecklist","classification":"WRITE","paramCount":1,"schema":"7e5905ac5974","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"accounting:update"},+ {"name":"accounting_completeCloseTask","classification":"WRITE","paramCount":2,"schema":"5d2e9a90637b","response":"none","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_createFiscalYearPeriods","classification":"WRITE","paramCount":1,"schema":"de7d8726d5e4","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create"},+ {"name":"accounting_createIntercompanyTransaction","classification":"WRITE","paramCount":8,"schema":"9c3c11f4059c","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create"},+ {"name":"accounting_createJournalEntry","classification":"WRITE","paramCount":3,"schema":"cf9466cad960","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create"},+ {"name":"accounting_createOpeningBalanceJournal","classification":"DESTRUCTIVE","paramCount":2,"schema":"bca168088fb2","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create"},+ {"name":"accounting_deleteAccount","classification":"DESTRUCTIVE","paramCount":1,"schema":"ecb746f60913","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deleteAccountingPeriod","classification":"DESTRUCTIVE","paramCount":1,"schema":"7e5905ac5974","response":"none","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deleteCostCenter","classification":"DESTRUCTIVE","paramCount":1,"schema":"f8a3e6fec03f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deleteDepreciationRun","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deleteDimension","classification":"DESTRUCTIVE","paramCount":1,"schema":"96e5d0fb89ae","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deleteExchangeRateOverride","classification":"DESTRUCTIVE","paramCount":1,"schema":"cc2bce783cc5","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deleteFixedAsset","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deleteFixedAssetClass","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deleteJournalEntry","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deleteJournalEntryLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deletePaymentTerm","classification":"DESTRUCTIVE","paramCount":1,"schema":"5386fbcf056f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deletePeriodCloseTaskDefinition","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_deleteReportView","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete"},+ {"name":"accounting_evaluateCloseChecklist","classification":"WRITE","paramCount":3,"schema":"ea8a51023972","response":"10fdf56c425e","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_generateEliminations","classification":"WRITE","paramCount":1,"schema":"6205bcefb9ed","response":"cddf8275afa1","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create"},+ {"name":"accounting_getAccount","classification":"READ","paramCount":1,"schema":"ecb746f60913","response":"9d6890743f52","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getAccountingPeriodDeletability","classification":"READ","paramCount":1,"schema":"7e5905ac5974","response":"fdd16df03940","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getAccountingPeriods","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"bd245bd0358c","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getAccountingSyncTieOut","classification":"READ","paramCount":3,"schema":"4feda8437359","response":"5483e69d7515","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getAccountingSyncTieOutCell","classification":"READ","paramCount":1,"schema":"1a84bfebf9e9","response":"a5febf12f4bd","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getAccountLedger","classification":"READ","paramCount":6,"schema":"8ad7f551d78b","response":"1b822ed7461f","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getAccountLedgerSummary","classification":"READ","paramCount":3,"schema":"aad65f7c3f63","response":"0a28a92b28ff","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getAccountPeriodSeries","classification":"READ","paramCount":2,"schema":"d5db2abee293","response":"2c75339d9fde","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getAccounts","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"84821cb96b68","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getAccountsInScope","classification":"READ","paramCount":2,"schema":"84dd5553cbc0","response":"4c52cef1b6ab","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getAccountsList","classification":"READ","paramCount":3,"schema":"6a0ee88f3f9d","response":"05b2ffc4c3d4","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getActiveDimensionsWithValues","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"d5c49ad8eb75","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getAssetDepreciationHistory","classification":"READ","paramCount":1,"schema":"91f483e6fee8","response":"24eb238bd6da","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getBaseCurrency","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"11af3b92d80f","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getBaseCurrencyDecimalPlaces","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"cddf8275afa1","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getChartOfAccounts","classification":"READ","paramCount":3,"schema":"b3b2e96654e5","response":"f561243f144b","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getCompaniesInGroup","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"032bba337af7","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getConsolidatedBalances","classification":"READ","paramCount":4,"schema":"966a7b50605d","response":"a74dd3597c00","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getConsolidatedPeriodSeries","classification":"READ","paramCount":3,"schema":"5b547443efed","response":"5483e69d7515","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getCostCenter","classification":"READ","paramCount":1,"schema":"f8a3e6fec03f","response":"f7b898d20847","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getCostCenters","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"a27593ffa2de","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getCostCentersList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getCostCentersTree","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"b4505b9334e6","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getCurrencies","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"1d6055ff487c","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getCurrenciesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"01628a6ebd21","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getCurrency","classification":"READ","paramCount":1,"schema":"0e98c276626d","response":"6d5bae3dafd5","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getCurrencyByCode","classification":"READ","paramCount":1,"schema":"cc2bce783cc5","response":"300e136d14d0","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getCurrentAccountingPeriod","classification":"READ","paramCount":1,"schema":"2f19cae7bae1","response":"923d00cf55d7","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getDefaultAccounts","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"d15f0531072e","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getDepreciationRun","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"22ccbb1556ab","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getDepreciationRunLines","classification":"READ","paramCount":1,"schema":"e83946bf5ea7","response":"b9642696fc4d","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getDepreciationRuns","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"829d729e81c9","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getDimension","classification":"READ","paramCount":1,"schema":"96e5d0fb89ae","response":"f1188a72b6fa","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getDimensionPivot","classification":"READ","paramCount":6,"schema":"fc55061951df","response":"c7069f830357","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getDimensionPivotLines","classification":"READ","paramCount":17,"schema":"219ffd94b82c","response":"100f0689af3e","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getDimensions","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"eeecad695570","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getExchangeRate","classification":"READ","paramCount":1,"schema":"cc2bce783cc5","response":"cddf8275afa1","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getExchangeRateHistory","classification":"READ","paramCount":1,"schema":"cc2bce783cc5","response":"ab784d246338","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getExchangeRates","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"7089bfe7df7a","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getExistingOpeningBalanceEntry","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3797626bd17e","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFinancialStatementBalances","classification":"READ","paramCount":3,"schema":"267691af8c66","response":"f561243f144b","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFinancialStatementPeriodSeries","classification":"READ","paramCount":3,"schema":"fad550797360","response":"5483e69d7515","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFiscalCalendarCommitted","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"854b90f7a9d3","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFiscalYearSettings","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3a18729ffcd7","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFixedAsset","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"8fc3060e3b11","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFixedAssetClass","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"c9303619cf96","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFixedAssetClasses","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"03a52bf94953","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFixedAssetClassesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"123f9f4a60f8","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFixedAssetDisposal","classification":"READ","paramCount":1,"schema":"91f483e6fee8","response":"a079c03cd910","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFixedAssets","classification":"READ","paramCount":4,"schema":"1fcf7d2f5c87","response":"c787a7af07fc","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFixedAssetsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0c62226f500a","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFixedAssetsListForSale","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0c62226f500a","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getFixedAssetUsageLogs","classification":"READ","paramCount":1,"schema":"91f483e6fee8","response":"517f4c28c365","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getGroupAccounts","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"a9a2c5be8164","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getIntercompanyBalance","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f2f76b33a3df","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getIntercompanyEliminationLines","classification":"READ","paramCount":1,"schema":"b9efe4d053a7","response":"e23adccbd115","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getIntercompanyTransactions","classification":"READ","paramCount":3,"schema":"5ba9d4ce2300","response":"9f7c14f790f8","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getJournalEntries","classification":"READ","paramCount":4,"schema":"099269e45600","response":"82596bef98a4","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getJournalEntry","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"c082027fdda4","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getJournalLineDimensions","classification":"READ","paramCount":1,"schema":"4a6413e2bb5a","response":"b731368c1d3c","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getJournalSyncCompleteness","classification":"READ","paramCount":3,"schema":"6eb0a36bbd4b","response":"58d45b19b00c","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getOrCreateAccountingPeriod","classification":"READ","paramCount":2,"schema":"7dd9558cffe4","response":"00404e686415","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getPaymentTerm","classification":"READ","paramCount":1,"schema":"5386fbcf056f","response":"f7f39c0d662f","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getPaymentTerms","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7e3500d5e372","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getPaymentTermsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getPeriodCloseChecklist","classification":"READ","paramCount":1,"schema":"7e5905ac5974","response":"032d2a02eff5","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getPeriodCloseReadiness","classification":"READ","paramCount":1,"schema":"7e5905ac5974","response":"50c6eb31af49","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getPeriodCloseTaskDefinitions","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"273a27083497","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getPeriodExternalGlSyncReadiness","classification":"READ","paramCount":2,"schema":"265827be4a3e","response":"0963c785f5ca","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getPurchaseLinePivot","classification":"READ","paramCount":4,"schema":"7ff90424b018","response":"c7069f830357","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getPurchaseLinePivotLines","classification":"READ","paramCount":10,"schema":"d23c9f2398a4","response":"a12b8efe2d62","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getReportPins","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3536c9c9a314","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getReportViews","classification":"READ","paramCount":1,"schema":"f60ae5d8a496","response":"7f6aad3009db","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getScrapAccountIds","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"681004346c78","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_getTrialBalance","classification":"READ","paramCount":2,"schema":"3eb7f553b21b","response":"e782cb2b76dc","injectAuth":"companyId","permission":"accounting:view"},+ {"name":"accounting_insertDepreciationRun","classification":"DESTRUCTIVE","paramCount":3,"schema":"9379f046fe62","response":"70d7ca41be81","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create"},+ {"name":"accounting_insertFixedAsset","classification":"WRITE","paramCount":17,"schema":"edafa07d33e5","response":"e0e9c463a967","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create"},+ {"name":"accounting_lockAccountingPeriod","classification":"WRITE","paramCount":1,"schema":"7e5905ac5974","response":"none","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_postJournalEntry","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_reopenAccountingPeriod","classification":"DESTRUCTIVE","paramCount":1,"schema":"7e5905ac5974","response":"none","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_reverseJournalEntry","classification":"WRITE","paramCount":2,"schema":"d25804b3560c","response":"3797626bd17e","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_runIntercompanyMatching","classification":"WRITE","paramCount":0,"schema":"efddc7bd8bbc","response":"c07d47c6ac75","injectAuth":"companyId+updatedBy","permission":"accounting:update"},+ {"name":"accounting_saveJournalEntryWithLines","classification":"DESTRUCTIVE","paramCount":4,"schema":"c5b3821a9688","response":"8394fbabd845","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_saveJournalLineDimensions","classification":"DESTRUCTIVE","paramCount":2,"schema":"83fd1843d6ff","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_skipCloseTask","classification":"WRITE","paramCount":2,"schema":"8d4ab2b60f5f","response":"none","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_translateCompanyBalances","classification":"WRITE","paramCount":4,"schema":"2e961eb702d9","response":"be5b093fb6e6","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_translateCompanyPeriodSeries","classification":"WRITE","paramCount":3,"schema":"decaf5350e1f","response":"0c01d5ac39c2","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_unlockAccountingPeriod","classification":"WRITE","paramCount":1,"schema":"7e5905ac5974","response":"none","injectAuth":"companyId","permission":"accounting:update"},+ {"name":"accounting_updateDefaultBalanceSheetAccounts","classification":"WRITE","paramCount":21,"schema":"af820410074b","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"accounting:update"},+ {"name":"accounting_updateDefaultIncomeAccounts","classification":"WRITE","paramCount":28,"schema":"d386cfbc865f","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"accounting:update"},+ {"name":"accounting_updateFiscalYearSettings","classification":"WRITE","paramCount":2,"schema":"b13ac9bf329b","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"accounting:update"},+ {"name":"accounting_updateFixedAsset","classification":"WRITE","paramCount":16,"schema":"72982c8925a1","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"accounting:update"},+ {"name":"accounting_updateJournalEntry","classification":"WRITE","paramCount":2,"schema":"f1c6f0ff1a41","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"accounting:update"},+ {"name":"accounting_upsertAccount","classification":"WRITE","paramCount":9,"schema":"0ab752a6344d","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertCostCenter","classification":"WRITE","paramCount":4,"schema":"3b9d2c78ddb6","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertCurrency","classification":"WRITE","paramCount":4,"schema":"82ebe032e069","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertDimension","classification":"DESTRUCTIVE","paramCount":2,"schema":"05f87f3a4893","response":"660c8bead643","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertExchangeRateOverride","classification":"WRITE","paramCount":2,"schema":"4576f689f2fa","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertFixedAsset","classification":"WRITE","paramCount":1,"schema":"6c75306b5d0e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertFixedAssetClass","classification":"WRITE","paramCount":1,"schema":"6c75306b5d0e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertFixedAssetUsageLog","classification":"WRITE","paramCount":1,"schema":"12272e046f40","response":"3797626bd17e","injectAuth":"companyId+createdBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertJournalEntryLine","classification":"WRITE","paramCount":6,"schema":"ca2ee4db3127","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertPaymentTerm","classification":"WRITE","paramCount":6,"schema":"893974263c78","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertPeriodCloseTaskDefinition","classification":"WRITE","paramCount":9,"schema":"5b9d3a16980b","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertReportPin","classification":"WRITE","paramCount":2,"schema":"28ab82d5033e","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"accounting_upsertReportView","classification":"WRITE","paramCount":1,"schema":"480a01fce4bd","response":"b8ded59f5c56","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update"},+ {"name":"documents_deleteDocument","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"documents:delete"},+ {"name":"documents_deleteDocumentFavorite","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"documents:delete"},+ {"name":"documents_deleteDocumentLabel","classification":"DESTRUCTIVE","paramCount":2,"schema":"5c453c6c156d","response":"bcde375ebd4c","injectAuth":"companyId","permission":"documents:delete"},+ {"name":"documents_getDocument","classification":"READ","paramCount":1,"schema":"e7617eb689c8","response":"d414b248d2e5","injectAuth":"companyId","permission":"documents:view"},+ {"name":"documents_getDocumentExtensions","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"b24f77557f86","injectAuth":"companyId","permission":"documents:view"},+ {"name":"documents_getDocumentLabels","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"7e2eeb0066ab","injectAuth":"companyId","permission":"documents:view"},+ {"name":"documents_getDocuments","classification":"READ","paramCount":6,"schema":"848cac7bea79","response":"1531ae9cb61a","injectAuth":"companyId","permission":"documents:view"},+ {"name":"documents_insertDocumentExtraction","classification":"WRITE","paramCount":4,"schema":"790f2b883984","response":"d181256b2684","injectAuth":"companyId+createdBy+updatedBy","permission":"documents:create"},+ {"name":"documents_insertDocumentFavorite","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"documents:create"},+ {"name":"documents_insertDocumentLabel","classification":"WRITE","paramCount":2,"schema":"5c453c6c156d","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"documents:create"},+ {"name":"documents_moveDocumentToTrash","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"documents:update"},+ {"name":"documents_restoreDocument","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"documents:update"},+ {"name":"documents_updateDocumentFavorite","classification":"DESTRUCTIVE","paramCount":2,"schema":"85769b943e30","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"documents:update"},+ {"name":"documents_updateDocumentLabels","classification":"DESTRUCTIVE","paramCount":2,"schema":"0adc09fa2bb3","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"documents:update"},+ {"name":"documents_upsertDocument","classification":"WRITE","paramCount":7,"schema":"41a5ffb927ac","response":"e44071b67bea","injectAuth":"companyId+createdBy+updatedBy","permission":"documents:create+update"},+ {"name":"inventory_correctStockMovement","classification":"WRITE","paramCount":2,"schema":"d0f2e5a204cd","response":"3797626bd17e","injectAuth":"companyId","permission":"inventory:update"},+ {"name":"inventory_createInventoryReconciliationJournal","classification":"WRITE","paramCount":1,"schema":"00e9099a963a","response":"a9f23ceb9dc1","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create"},+ {"name":"inventory_deleteBatchProperty","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteInventoryCount","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteKanban","classification":"DESTRUCTIVE","paramCount":1,"schema":"369f807bc840","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deletePickingList","classification":"DESTRUCTIVE","paramCount":1,"schema":"0a4ec3e7319b","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deletePickingListLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"063a6777d378","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteReceipt","classification":"DESTRUCTIVE","paramCount":1,"schema":"e00a9764517d","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteReceiptLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"17337505bb69","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteShipment","classification":"DESTRUCTIVE","paramCount":1,"schema":"2e39a760a5ca","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteShipmentLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"84320a09c1ac","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteShippingMethod","classification":"DESTRUCTIVE","paramCount":1,"schema":"493e990b5f3d","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteStockTransfer","classification":"DESTRUCTIVE","paramCount":1,"schema":"38111ae0fa2a","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteStockTransferLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"0bbd6a946791","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteStorageTypeWithCascade","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"567547d42955","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteStorageUnit","classification":"DESTRUCTIVE","paramCount":1,"schema":"c728bf7e5b37","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteStorageUnitCascade","classification":"DESTRUCTIVE","paramCount":1,"schema":"c728bf7e5b37","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteWarehouseTransfer","classification":"DESTRUCTIVE","paramCount":1,"schema":"d51f098ead24","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_deleteWarehouseTransferLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"d99fddf5e39e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"inventory:delete"},+ {"name":"inventory_expandStorageUnitIdsWithDescendants","classification":"WRITE","paramCount":1,"schema":"f413382980a7","response":"681004346c78","injectAuth":"companyId","permission":"inventory:update"},+ {"name":"inventory_generateInventoryCountLines","classification":"DESTRUCTIVE","paramCount":4,"schema":"7cf62698d5f8","response":"cddf8275afa1","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create"},+ {"name":"inventory_generatePickingList","classification":"DESTRUCTIVE","paramCount":4,"schema":"412bd8dbff31","response":"81802516b555","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create"},+ {"name":"inventory_getAvailableTrackedEntities","classification":"READ","paramCount":5,"schema":"a254ee2edef1","response":"723554a256de","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getBatchNumbersForItem","classification":"READ","paramCount":2,"schema":"786c6e7af03b","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getBatchProperties","classification":"READ","paramCount":1,"schema":"c4ca22fd1816","response":"9a2b986c906d","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getDefaultStorageUnitForJob","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"174e29b899b9","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getDefaultStorageUnitOrStorageUnitWithHighestQuantity","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"174e29b899b9","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getEffectiveWorkCenterId","classification":"READ","paramCount":1,"schema":"c728bf7e5b37","response":"00404e686415","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getInventoryCount","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"b707251b11c4","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getInventoryCountLines","classification":"READ","paramCount":2,"schema":"05dd6f9fd306","response":"e4219573b12b","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getInventoryCountLineSummary","classification":"READ","paramCount":1,"schema":"e354150046fe","response":"7a06e37fcf2a","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getInventoryCountMovements","classification":"READ","paramCount":1,"schema":"e354150046fe","response":"9611cab7fe2e","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getInventoryCounts","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"43536f2bda72","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getInventoryItems","classification":"READ","paramCount":2,"schema":"68cb4a73d5a9","response":"5baddb3a890c","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getInventoryItemsCount","classification":"READ","paramCount":2,"schema":"68cb4a73d5a9","response":"8394fbabd845","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getInventoryValuation","classification":"READ","paramCount":2,"schema":"288f0d29701b","response":"4005e935f8f1","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getInventoryValuationTieOut","classification":"READ","paramCount":1,"schema":"cb789596bf56","response":"20aee38c95a3","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getItemLedgerActivity","classification":"READ","paramCount":5,"schema":"b898b72c5939","response":"c27606350e62","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getItemLedgerPage","classification":"READ","paramCount":4,"schema":"de680470ebb1","response":"c27606350e62","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getKanban","classification":"READ","paramCount":1,"schema":"369f807bc840","response":"a54d43903486","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getKanbans","classification":"READ","paramCount":2,"schema":"68cb4a73d5a9","response":"1e5027ab2d56","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getPickingList","classification":"READ","paramCount":1,"schema":"0a4ec3e7319b","response":"227255936b96","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getPickingListAvailability","classification":"READ","paramCount":1,"schema":"0a4ec3e7319b","response":"eb258ef68905","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getPickingListLine","classification":"READ","paramCount":1,"schema":"063a6777d378","response":"b51ad23d436f","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getPickingListLines","classification":"READ","paramCount":1,"schema":"0a4ec3e7319b","response":"cc66c1b66f31","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getPickingListLineTrackedEntities","classification":"READ","paramCount":1,"schema":"063a6777d378","response":"51dd622ce168","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getPickingListRecommendations","classification":"READ","paramCount":1,"schema":"0a4ec3e7319b","response":"24283057a15d","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getPickingLists","classification":"READ","paramCount":6,"schema":"3599c50bdc36","response":"2112d9a1ea1d","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getPickingSchedule","classification":"READ","paramCount":2,"schema":"b3a9deeaf0d0","response":"19467666efcd","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getPickOrder","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"7fa0311f0d0a","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getReceipt","classification":"READ","paramCount":1,"schema":"e00a9764517d","response":"912bc3c9329d","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getReceiptFiles","classification":"READ","paramCount":1,"schema":"749e5d81384a","response":"5483e69d7515","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getReceiptLines","classification":"READ","paramCount":1,"schema":"e00a9764517d","response":"15b7b17f7652","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getReceiptLineTracking","classification":"READ","paramCount":1,"schema":"17337505bb69","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getReceipts","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"a19e9d631841","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getReceiptTracking","classification":"READ","paramCount":1,"schema":"e00a9764517d","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getSerialNumbersForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShelfLifeForItems","classification":"READ","paramCount":1,"schema":"c4ca22fd1816","response":"4c5d680d898e","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShipment","classification":"READ","paramCount":1,"schema":"2e39a760a5ca","response":"d8a84a1f08ec","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShipmentFiles","classification":"READ","paramCount":1,"schema":"749e5d81384a","response":"5483e69d7515","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShipmentLines","classification":"READ","paramCount":1,"schema":"2e39a760a5ca","response":"79327e63ff25","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShipmentLinesWithDetails","classification":"READ","paramCount":1,"schema":"2e39a760a5ca","response":"c158915aa9b9","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShipmentLineTracking","classification":"READ","paramCount":1,"schema":"84320a09c1ac","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShipmentRelatedItems","classification":"READ","paramCount":2,"schema":"f81a81d39efa","response":"cc306d2530cc","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShipments","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"b8b287b3a17f","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShipmentTracking","classification":"READ","paramCount":1,"schema":"2e39a760a5ca","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShippingMethod","classification":"READ","paramCount":1,"schema":"493e990b5f3d","response":"65413dd34c52","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShippingMethods","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"104aa0df039d","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShippingMethodsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getShippingTermsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStockMovementEffectiveQuantity","classification":"READ","paramCount":1,"schema":"a40494d32d29","response":"2e1967d88231","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStockMovements","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"9611cab7fe2e","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStockTransfer","classification":"READ","paramCount":1,"schema":"38111ae0fa2a","response":"0f59b3fa09f8","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStockTransferLine","classification":"READ","paramCount":1,"schema":"0bbd6a946791","response":"a34287fc1477","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStockTransferLines","classification":"READ","paramCount":1,"schema":"38111ae0fa2a","response":"bcb01288cc29","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStockTransfers","classification":"READ","paramCount":4,"schema":"88605456fa2d","response":"77ebb4ee443b","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStockTransferTracking","classification":"READ","paramCount":1,"schema":"38111ae0fa2a","response":"20f8627b948f","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageType","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"4bbb50609deb","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"28837d034643","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageTypeUsage","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageUnit","classification":"READ","paramCount":1,"schema":"c728bf7e5b37","response":"a5bf237a9aeb","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageUnitChildren","classification":"READ","paramCount":1,"schema":"06f6e8f8f9f5","response":"7eea15677f40","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageUnitDescendants","classification":"READ","paramCount":1,"schema":"c728bf7e5b37","response":"3bae190e2656","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageUnitParentIdsWithChildren","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"681004346c78","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageUnitRoots","classification":"READ","paramCount":2,"schema":"68cb4a73d5a9","response":"7eea15677f40","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageUnits","classification":"READ","paramCount":2,"schema":"68cb4a73d5a9","response":"7eea15677f40","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageUnitsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageUnitsListForLocation","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageUnitsTreeForLocation","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"ecdf2c570468","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageUnitSubtrees","classification":"READ","paramCount":3,"schema":"c5258b49b1b9","response":"10e6a05f40e5","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getStorageUnitTree","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"3bae190e2656","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getTrackedEntities","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getTrackedEntitiesByMakeMethodId","classification":"READ","paramCount":1,"schema":"c32158774ba3","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getTrackedEntitiesByOperationId","classification":"READ","paramCount":1,"schema":"c407a9edb930","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getTrackedEntity","classification":"READ","paramCount":1,"schema":"5d58d420052a","response":"d485710baf81","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getTrackedEntityExpirations","classification":"READ","paramCount":1,"schema":"2d3f4e6f5875","response":"fff84b1ee888","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getUnresolvedPickingListLines","classification":"READ","paramCount":1,"schema":"0a4ec3e7319b","response":"ce45e49e333f","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getWarehouseTransfer","classification":"READ","paramCount":1,"schema":"d51f098ead24","response":"45af922ea324","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getWarehouseTransferLine","classification":"READ","paramCount":2,"schema":"31f24bda931b","response":"945dc2c1255f","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getWarehouseTransferLines","classification":"READ","paramCount":1,"schema":"d51f098ead24","response":"8a92aaed64aa","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_getWarehouseTransfers","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"66ec9f5f0ca8","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_insertInventoryCount","classification":"WRITE","paramCount":6,"schema":"f9ea90011f9a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create"},+ {"name":"inventory_insertManualInventoryAdjustment","classification":"WRITE","paramCount":13,"schema":"1d55e3807e60","response":"3797626bd17e","injectAuth":"companyId+createdBy","permission":"inventory:create"},+ {"name":"inventory_insertStockTransfer","classification":"DESTRUCTIVE","paramCount":4,"schema":"3eef751fc699","response":"910187eb9b58","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create"},+ {"name":"inventory_insertWarehouseTransfer","classification":"WRITE","paramCount":9,"schema":"c046002e6304","response":"8e9431d157a2","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create"},+ {"name":"inventory_pickPickingListLine","classification":"WRITE","paramCount":3,"schema":"0371c6fecc9c","response":"3797626bd17e","injectAuth":"companyId","permission":"inventory:update"},+ {"name":"inventory_reconcileReceiptSerialEntities","classification":"DESTRUCTIVE","paramCount":2,"schema":"317d393d5b4a","response":"none","injectAuth":"companyId","permission":"inventory:update"},+ {"name":"inventory_searchStorageUnitsWithAncestors","classification":"READ","paramCount":2,"schema":"bf8906da76a5","response":"04385ce721d8","injectAuth":"companyId","permission":"inventory:view"},+ {"name":"inventory_setPickingListLineTrackedEntity","classification":"WRITE","paramCount":5,"schema":"a628dabab831","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"inventory:update"},+ {"name":"inventory_updateBatchPropertyOrder","classification":"WRITE","paramCount":2,"schema":"cf28ccd3b252","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"inventory:update"},+ {"name":"inventory_updateInventoryCountLine","classification":"WRITE","paramCount":2,"schema":"2410b43d0eeb","response":"ae8f99e1d130","injectAuth":"companyId+updatedBy","permission":"inventory:update"},+ {"name":"inventory_updateInventoryCountStatus","classification":"WRITE","paramCount":3,"schema":"01c00102b62c","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"inventory:update"},+ {"name":"inventory_updatePickingListStatus","classification":"WRITE","paramCount":2,"schema":"6aa0d63ec431","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"inventory:update"},+ {"name":"inventory_updateStockTransfer","classification":"WRITE","paramCount":4,"schema":"a10345a94a51","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"inventory:update"},+ {"name":"inventory_updateStockTransferStatus","classification":"WRITE","paramCount":4,"schema":"4d1bb7a8de25","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"inventory:update"},+ {"name":"inventory_updateTrackedEntityExpiry","classification":"WRITE","paramCount":4,"schema":"ebdc5286d20c","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"inventory:update"},+ {"name":"inventory_updateWarehouseTransfer","classification":"WRITE","paramCount":10,"schema":"a0f3ac5d7ad8","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"inventory:update"},+ {"name":"inventory_updateWarehouseTransferStatus","classification":"WRITE","paramCount":2,"schema":"954122a30a71","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"inventory:update"},+ {"name":"inventory_upsertBatchProperty","classification":"WRITE","paramCount":6,"schema":"6fcfef7093ed","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertKanban","classification":"WRITE","paramCount":12,"schema":"4c86c371e2dc","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertPickingList","classification":"WRITE","paramCount":6,"schema":"d14da5a24597","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertPickingListLine","classification":"WRITE","paramCount":8,"schema":"a674c3f5c5e8","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertReceipt","classification":"WRITE","paramCount":8,"schema":"353c030ac288","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertShipment","classification":"WRITE","paramCount":9,"schema":"83ab6ffb6bca","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertShippingMethod","classification":"WRITE","paramCount":5,"schema":"be0de282ee7e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertStockTransfer","classification":"WRITE","paramCount":1,"schema":"7fe3d3c03abb","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertStockTransferLine","classification":"WRITE","paramCount":9,"schema":"2cee4e21fd8e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertStockTransferLines","classification":"WRITE","paramCount":2,"schema":"e378968808f6","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertStorageType","classification":"WRITE","paramCount":2,"schema":"df56b99ec46e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertStorageUnit","classification":"WRITE","paramCount":7,"schema":"eee03a9c523b","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertWarehouseTransfer","classification":"WRITE","paramCount":9,"schema":"893e85262ecf","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"inventory_upsertWarehouseTransferLine","classification":"WRITE","paramCount":1,"schema":"2862afc7b8d9","response":"237082879d41","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update"},+ {"name":"invoicing_applyCreditsToInvoices","classification":"DESTRUCTIVE","paramCount":4,"schema":"a9944c8799d0","response":"none","injectAuth":"companyId","permission":"invoicing:update"},+ {"name":"invoicing_computeInvoiceDateDue","classification":"READ","paramCount":2,"schema":"f956a0fbb7d8","response":"174e29b899b9","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_createPurchaseInvoiceFromPurchaseOrder","classification":"WRITE","paramCount":1,"schema":"28cffcd9d6e8","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create"},+ {"name":"invoicing_createSalesInvoiceFromSalesOrder","classification":"WRITE","paramCount":1,"schema":"d160a49d6787","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create"},+ {"name":"invoicing_createSalesInvoiceFromShipment","classification":"WRITE","paramCount":1,"schema":"2e39a760a5ca","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create"},+ {"name":"invoicing_deleteInvoiceSettlement","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"invoicing:delete"},+ {"name":"invoicing_deleteMemo","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"invoicing:delete"},+ {"name":"invoicing_deletePayment","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"invoicing:delete"},+ {"name":"invoicing_deletePurchaseInvoice","classification":"DESTRUCTIVE","paramCount":1,"schema":"9fcbb4e4e012","response":"bcde375ebd4c","injectAuth":"companyId","permission":"invoicing:delete"},+ {"name":"invoicing_deletePurchaseInvoiceLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"af656ed8709f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"invoicing:delete"},+ {"name":"invoicing_deleteSalesInvoice","classification":"DESTRUCTIVE","paramCount":1,"schema":"9e382a0affeb","response":"bcde375ebd4c","injectAuth":"companyId","permission":"invoicing:delete"},+ {"name":"invoicing_deleteSalesInvoiceLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"352db7d38a15","response":"bcde375ebd4c","injectAuth":"companyId","permission":"invoicing:delete"},+ {"name":"invoicing_getApAging","classification":"READ","paramCount":2,"schema":"8c0a142b94d0","response":"eca97da3238d","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getApOpenBySupplier","classification":"READ","paramCount":1,"schema":"00e9099a963a","response":"cfaa2af435c0","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getApTieOut","classification":"READ","paramCount":1,"schema":"00e9099a963a","response":"194f80599d96","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getArAging","classification":"READ","paramCount":2,"schema":"8c0a142b94d0","response":"10729e9f1c72","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getArOpenByCustomer","classification":"READ","paramCount":1,"schema":"00e9099a963a","response":"8cd731dddf0d","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getArTieOut","classification":"READ","paramCount":1,"schema":"00e9099a963a","response":"194f80599d96","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getAvailableCreditsForParty","classification":"READ","paramCount":2,"schema":"1244f0b75d04","response":"c6cf3ad92e74","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getAvailableOnAccountCredit","classification":"READ","paramCount":1,"schema":"e34265556db2","response":"cddf8275afa1","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getCompanyHasOpenCredits","classification":"READ","paramCount":1,"schema":"ffed91643c1d","response":"7cb541e84f22","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getInvoiceSettlements","classification":"READ","paramCount":1,"schema":"bd163ca304cd","response":"dd022cfb2135","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getInvoiceSettlementsForInvoice","classification":"READ","paramCount":2,"schema":"9d6509fa2229","response":"3c49e0950f22","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getMemo","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"ee27f56e2f82","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getMemoApplications","classification":"READ","paramCount":1,"schema":"188417093a55","response":"667060f6a7e4","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getMemos","classification":"READ","paramCount":6,"schema":"b120ea106813","response":"4b05f5647015","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getOpenPurchaseInvoicesForSupplier","classification":"READ","paramCount":1,"schema":"67043a31b1b5","response":"1e5e706e6a7c","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getOpenSalesInvoicesForCustomer","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"1e5e706e6a7c","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getPayment","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"dcd7a2b028c7","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getPayments","classification":"READ","paramCount":8,"schema":"0e0e62822fd1","response":"cb3415df82d8","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getPurchaseInvoice","classification":"READ","paramCount":1,"schema":"9fcbb4e4e012","response":"8af6fcfff1cc","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getPurchaseInvoiceDelivery","classification":"READ","paramCount":1,"schema":"9fcbb4e4e012","response":"57af27aeef3b","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getPurchaseInvoiceLine","classification":"READ","paramCount":1,"schema":"af656ed8709f","response":"4bbbdc4a9046","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getPurchaseInvoiceLines","classification":"READ","paramCount":1,"schema":"9fcbb4e4e012","response":"d40f758d4c25","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getPurchaseInvoices","classification":"READ","paramCount":4,"schema":"53339fd228e4","response":"e14efcf49a89","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getSalesInvoice","classification":"READ","paramCount":1,"schema":"9e382a0affeb","response":"89f9f8ed1224","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getSalesInvoiceCustomerDetails","classification":"READ","paramCount":1,"schema":"9e382a0affeb","response":"d592e414f201","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getSalesInvoiceLine","classification":"READ","paramCount":1,"schema":"352db7d38a15","response":"05a4fb9e3bcf","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getSalesInvoiceLines","classification":"READ","paramCount":1,"schema":"9e382a0affeb","response":"b7f2e34a7b22","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getSalesInvoices","classification":"READ","paramCount":4,"schema":"f682a832527b","response":"d0445b461305","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getSalesInvoiceShipment","classification":"READ","paramCount":1,"schema":"9e382a0affeb","response":"43114f5895a3","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_getStagedCreditsForPayment","classification":"READ","paramCount":2,"schema":"d67008f41829","response":"76136dba6f93","injectAuth":"companyId","permission":"invoicing:view"},+ {"name":"invoicing_insertPurchaseInvoice","classification":"DESTRUCTIVE","paramCount":15,"schema":"15dc8b208ca1","response":"24b4b1602470","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create"},+ {"name":"invoicing_insertSalesInvoice","classification":"DESTRUCTIVE","paramCount":14,"schema":"56c402cfa5a8","response":"24b4b1602470","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create"},+ {"name":"invoicing_replaceInvoiceSettlements","classification":"DESTRUCTIVE","paramCount":2,"schema":"8e2be60e02a8","response":"none","injectAuth":"companyId","permission":"invoicing:update"},+ {"name":"invoicing_updatePurchaseInvoice","classification":"WRITE","paramCount":15,"schema":"304bf354aa67","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"invoicing:update"},+ {"name":"invoicing_updatePurchaseInvoiceExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"invoicing:update"},+ {"name":"invoicing_updatePurchaseInvoiceLineOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"none","injectAuth":"companyId+updatedBy","permission":"invoicing:update"},+ {"name":"invoicing_updatePurchaseInvoiceStatus","classification":"WRITE","paramCount":4,"schema":"6d1af1e358a1","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"invoicing:update"},+ {"name":"invoicing_updateSalesInvoice","classification":"WRITE","paramCount":15,"schema":"71a9939b9245","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"invoicing:update"},+ {"name":"invoicing_updateSalesInvoiceExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"invoicing:update"},+ {"name":"invoicing_updateSalesInvoiceLineOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"none","injectAuth":"companyId+updatedBy","permission":"invoicing:update"},+ {"name":"invoicing_updateSalesInvoiceStatus","classification":"WRITE","paramCount":4,"schema":"6d1af1e358a1","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"invoicing:update"},+ {"name":"invoicing_upsertInvoiceSettlement","classification":"WRITE","paramCount":12,"schema":"57d0974a2e67","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update"},+ {"name":"invoicing_upsertMemo","classification":"WRITE","paramCount":11,"schema":"889305b36a13","response":"1e0d0fa1a854","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update"},+ {"name":"invoicing_upsertPayment","classification":"WRITE","paramCount":12,"schema":"ddc7440ce8f9","response":"1a922c685a61","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update"},+ {"name":"invoicing_upsertPurchaseInvoice","classification":"DESTRUCTIVE","paramCount":15,"schema":"3f3f211831ed","response":"5cc94f07494c","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update"},+ {"name":"invoicing_upsertPurchaseInvoiceDelivery","classification":"WRITE","paramCount":8,"schema":"b8c735d9fdc9","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update"},+ {"name":"invoicing_upsertPurchaseInvoiceLine","classification":"WRITE","paramCount":22,"schema":"1154ead8cbfb","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update"},+ {"name":"invoicing_upsertSalesInvoice","classification":"DESTRUCTIVE","paramCount":15,"schema":"4e5461f79410","response":"5cc94f07494c","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update"},+ {"name":"invoicing_upsertSalesInvoiceLine","classification":"WRITE","paramCount":20,"schema":"62890727d9c3","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update"},+ {"name":"invoicing_upsertSalesInvoiceShipment","classification":"WRITE","paramCount":8,"schema":"f7667f28735c","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update"},+ {"name":"items_activateMethodVersion","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"5cb338fa12e6","injectAuth":"companyId","permission":"parts:update"},+ {"name":"items_addChangeNoticeAffectedItem","classification":"DESTRUCTIVE","paramCount":5,"schema":"9e73cf6d50c7","response":"3cc309ba4541","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create"},+ {"name":"items_assertMethodOperationIsDraft","classification":"WRITE","paramCount":1,"schema":"c407a9edb930","response":"none","injectAuth":"companyId","permission":"parts:update"},+ {"name":"items_cascadeItemTrackingType","classification":"WRITE","paramCount":2,"schema":"36e294cd2253","response":"none","injectAuth":"companyId","permission":"parts:update"},+ {"name":"items_copyItem","classification":"WRITE","paramCount":8,"schema":"9c8674273b59","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create"},+ {"name":"items_copyItemPostingGroup","classification":"WRITE","paramCount":2,"schema":"5219ef529638","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create"},+ {"name":"items_copyMakeMethod","classification":"WRITE","paramCount":8,"schema":"9c8674273b59","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create"},+ {"name":"items_createChangeNoticeDraftMethod","classification":"DESTRUCTIVE","paramCount":4,"schema":"c176998a54a1","response":"dbe070b1fcb2","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create"},+ {"name":"items_createRevision","classification":"WRITE","paramCount":3,"schema":"6a0f8669f4a7","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create"},+ {"name":"items_deleteChangeNotice","classification":"DESTRUCTIVE","paramCount":1,"schema":"29578070edb2","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteChangeNoticeAction","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteChangeNoticeRequiredAction","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteChangeNoticeType","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteConfigurationParameter","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteConfigurationParameterGroup","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteConfigurationRule","classification":"DESTRUCTIVE","paramCount":2,"schema":"4eaf102cddd9","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteItem","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteItemCustomerPart","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteItemPostingGroup","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMaterialDimension","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMaterialFinish","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMaterialForm","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMaterialGrade","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMaterialSubstance","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMaterialType","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMethodMaterial","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMethodOperation","classification":"DESTRUCTIVE","paramCount":1,"schema":"09c7108756e9","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMethodOperationParameter","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMethodOperationStep","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMethodOperationStepSlide","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteMethodOperationTool","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteSupplierPart","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_deleteUnitOfMeasure","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete"},+ {"name":"items_diffMethod","classification":"WRITE","paramCount":1,"schema":"76ee0d3b025e","response":"945cb97c37b8","injectAuth":"companyId","permission":"parts:update"},+ {"name":"items_duplicateMethodOperationStep","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create"},+ {"name":"items_findChangeNoticesForItem","classification":"READ","paramCount":2,"schema":"bdfe8d67fc22","response":"e0196d4b0041","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_findOtherOpenChangeNoticesForItem","classification":"READ","paramCount":2,"schema":"8a1da983320d","response":"e0196d4b0041","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getBomHasShelfLifeManagedInput","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"7cb541e84f22","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getBomItemAttributes","classification":"READ","paramCount":1,"schema":"c4ca22fd1816","response":"eb258ef68905","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNotice","classification":"READ","paramCount":1,"schema":"29578070edb2","response":"09c0b464284c","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNoticeActions","classification":"READ","paramCount":1,"schema":"29578070edb2","response":"949f86b5cda3","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNoticeAffectedItems","classification":"READ","paramCount":1,"schema":"29578070edb2","response":"5483e69d7515","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNoticeDiff","classification":"READ","paramCount":1,"schema":"29578070edb2","response":"4da0de080834","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNoticeRequiredAction","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a76ce814b1b8","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNoticeRequiredActions","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"4c8439fedd7e","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNoticeRequiredActionsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNotices","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"ef2c88bb20cc","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNoticesForNonConformance","classification":"READ","paramCount":1,"schema":"a78c6c21c084","response":"47b99abee3a5","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNoticeType","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"d15ce193a0df","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNoticeTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"4d341af72c49","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getChangeNoticeTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getConfigurationParameters","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"c36ad21b447b","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getConfigurationRules","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"530f6f787ce7","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getConsumable","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"105e334bcf5b","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getConsumables","classification":"READ","paramCount":4,"schema":"53339fd228e4","response":"9302fcd8ff2d","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getConsumablesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f674f76b8278","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getDemandForecastSources","classification":"READ","paramCount":3,"schema":"ba3de97105ef","response":"2309abe0b767","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItem","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"87a9b87208d5","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemChangeNoticeData","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"a9f8d291a4dd","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemCost","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"38fa8e41fdd1","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemCostHistory","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"8016b4ef896a","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemCustomerPart","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"4c6e08919580","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemCustomerParts","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"458a8cdb47f2","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemDemand","classification":"READ","paramCount":3,"schema":"ba3de97105ef","response":"d669af1cc644","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemFiles","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"c8f657a900dd","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemManufacturing","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"f399bb7eda67","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemMpnsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3ff28fd20707","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemPlanning","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"dd5cfe4cf204","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemPostingGroup","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"d38ff3570b60","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemPostingGroups","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"5019b8dab137","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemPostingGroupsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemQuantities","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"9fc7a6c9f2e3","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemReplenishment","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"f399bb7eda67","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemShelfLife","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"a406f3a83a89","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemStorageUnitQuantities","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"880fa3aa7279","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemSupersededBy","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"8e2ea57c0664","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemSupersession","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"0c693c4f3dcb","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemSupply","classification":"READ","paramCount":3,"schema":"ba3de97105ef","response":"696523b54f52","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getItemUnitSalePrice","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"7281903c959e","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getJobMaterialUsageForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"67faac8214ed","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMakeMethodById","classification":"READ","paramCount":1,"schema":"2796fbbcab70","response":"cb9ae031b551","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMakeMethods","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"6cdfe33178ce","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterial","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"fce6ec47472d","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialDimension","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"5a634d31e2f3","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialDimensionList","classification":"READ","paramCount":2,"schema":"f614c4ca7d64","response":"b72364e0a391","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialDimensions","classification":"READ","paramCount":4,"schema":"184b995188c0","response":"98486ac80bcc","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialFinish","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"07a225161151","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialFinishes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"04cf1f4f7909","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialFinishList","classification":"READ","paramCount":1,"schema":"069f6f1436cd","response":"b57774d02b4d","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialForm","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"f69bdbb31d76","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialForms","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"ca926bd97ca1","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialFormsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"a59b0ccd150e","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialGrade","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"07a225161151","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialGradeList","classification":"READ","paramCount":1,"schema":"069f6f1436cd","response":"b57774d02b4d","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialGrades","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"04cf1f4f7909","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterials","classification":"READ","paramCount":4,"schema":"53339fd228e4","response":"5a10e7f3c854","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f674f76b8278","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialSubstance","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"f69bdbb31d76","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialSubstances","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"ca926bd97ca1","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialSubstancesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"a59b0ccd150e","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialType","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"0cc848ca86e3","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialTypeList","classification":"READ","paramCount":2,"schema":"babec8528804","response":"c3dfbc0fdf89","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"cbbbd5d9c38d","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMaterialUsedIn","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"6c20410ebbf7","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMethodMaterial","classification":"READ","paramCount":1,"schema":"5aa329400da2","response":"4f986471aaee","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMethodMaterials","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"16cb0357007c","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMethodMaterialsByMakeMethod","classification":"READ","paramCount":1,"schema":"2796fbbcab70","response":"ed99eb62f33c","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMethodOperations","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"44cb9313b74c","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMethodOperationsByMakeMethodId","classification":"READ","paramCount":1,"schema":"2796fbbcab70","response":"4ec7d6bf5468","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMethodTree","classification":"READ","paramCount":1,"schema":"2796fbbcab70","response":"18cc03a418b4","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getMethodTreeArray","classification":"READ","paramCount":1,"schema":"2796fbbcab70","response":"6481a47cef6d","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getNextRevision","classification":"READ","paramCount":1,"schema":"96527a3bce32","response":"00404e686415","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getOpenJobMaterials","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"a4e238c7dc68","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getOpenProductionOrders","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"6f4bb8737e15","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getOpenPurchaseOrderLines","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"ee9244a3a03b","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getOpenSalesOrderLines","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"ee9244a3a03b","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getPart","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"85d85a501c26","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getParts","classification":"READ","paramCount":4,"schema":"53339fd228e4","response":"b134f22017b9","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getPartsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f674f76b8278","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getPartUsedIn","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"bc331becb999","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getPickMethod","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"781e7f3fc24f","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getPickMethods","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"f1260811ebd4","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getRecipeProcessIdsForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"681004346c78","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getService","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"85d85a501c26","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getServices","classification":"READ","paramCount":5,"schema":"6ed7babb59bc","response":"0bc4d668f038","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getServicesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f674f76b8278","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getSupersessionChain","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"57cd7c34e332","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getSupplierPartPriceBreaks","classification":"READ","paramCount":1,"schema":"0b5fc4acf371","response":"87777c880401","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getSupplierParts","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"4089d780d70d","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getSupplierPriceBreaksForItems","classification":"READ","paramCount":1,"schema":"c4ca22fd1816","response":"dc0d300695e0","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getTool","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"85d85a501c26","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getTools","classification":"READ","paramCount":4,"schema":"53339fd228e4","response":"2b6244653ec7","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getToolsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f674f76b8278","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getTopLevelProductsForItems","classification":"READ","paramCount":1,"schema":"c4ca22fd1816","response":"b56efd7a527e","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getUnitOfMeasure","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"124234df769c","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getUnitOfMeasures","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"e19fb7f07a6a","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_getUnitOfMeasuresList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"1333b6f93ca5","injectAuth":"companyId","permission":"parts:view"},+ {"name":"items_insertChangeNotice","classification":"WRITE","paramCount":12,"schema":"6484a298a4fc","response":"9645fed81b3e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create"},+ {"name":"items_lookupBuyPrice","classification":"WRITE","paramCount":3,"schema":"c440ca0b7efc","response":"cddf8275afa1","injectAuth":"companyId","permission":"parts:update"},+ {"name":"items_matchItemIdByText","classification":"WRITE","paramCount":1,"schema":"2dc8ca9c0272","response":"174e29b899b9","injectAuth":"companyId","permission":"parts:update"},+ {"name":"items_mintPlaceholderPart","classification":"WRITE","paramCount":3,"schema":"c65d3a570f8f","response":"3797626bd17e","injectAuth":"companyId","permission":"parts:update"},+ {"name":"items_removeChangeNoticeAffectedItem","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:update"},+ {"name":"items_replaceMethodMaterialSteps","classification":"DESTRUCTIVE","paramCount":2,"schema":"4f13bc7f5929","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:update"},+ {"name":"items_resolveItemIdFromExtractedText","classification":"WRITE","paramCount":2,"schema":"9738115cfb58","response":"174e29b899b9","injectAuth":"companyId","permission":"parts:update"},+ {"name":"items_seedDefaultChangeNoticeActions","classification":"WRITE","paramCount":1,"schema":"29578070edb2","response":"ce08332e0ce6","injectAuth":"companyId","permission":"parts:update"},+ {"name":"items_setChangeNoticeActionTasks","classification":"DESTRUCTIVE","paramCount":2,"schema":"0a99ac2dd23d","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_setMethodMaterialStepLink","classification":"DESTRUCTIVE","paramCount":4,"schema":"9a5230c97e72","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_setMethodOperationToolStepLink","classification":"DESTRUCTIVE","paramCount":4,"schema":"3912df9a58b9","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateChangeNotice","classification":"WRITE","paramCount":13,"schema":"b694e9d87b83","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateChangeNoticeActionOrder","classification":"WRITE","paramCount":2,"schema":"cab02bf4c21b","response":"none","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateChangeNoticeActionStatus","classification":"WRITE","paramCount":2,"schema":"9c945ec6b5da","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateChangeNoticeAffectedItemChangeType","classification":"WRITE","paramCount":2,"schema":"8a7a0a0714f3","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateChangeNoticeAffectedItemCutover","classification":"WRITE","paramCount":4,"schema":"13157b1f687d","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateChangeNoticeStatus","classification":"WRITE","paramCount":4,"schema":"6cd1a6bb0d0d","response":"b7cda6fcc03b","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateConfigurationParameterGroupOrder","classification":"WRITE","paramCount":2,"schema":"cf28ccd3b252","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateConfigurationParameterOrder","classification":"WRITE","paramCount":3,"schema":"9d8b30e80b61","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateDefaultRevision","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"6411d1997ad5","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateItem","classification":"WRITE","paramCount":17,"schema":"6ae29fcc4866","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateItemCost","classification":"WRITE","paramCount":2,"schema":"c55de757a7e4","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateItemMethodAndSourcing","classification":"WRITE","paramCount":3,"schema":"213a6c0c5c09","response":"none","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateMaterialOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateOperationOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_updateRevision","classification":"WRITE","paramCount":2,"schema":"25c295d358ea","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update"},+ {"name":"items_upsertChangeNoticeRequiredAction","classification":"WRITE","paramCount":3,"schema":"e790518da1ff","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertChangeNoticeType","classification":"WRITE","paramCount":1,"schema":"db0af119a60c","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertConfigurationParameter","classification":"WRITE","paramCount":8,"schema":"4dc6f3365b3b","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertConfigurationParameterGroup","classification":"WRITE","paramCount":1,"schema":"b0f8920a311d","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertConfigurationRule","classification":"WRITE","paramCount":2,"schema":"0037cb90af3e","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertConsumable","classification":"WRITE","paramCount":17,"schema":"b8ce121d5e09","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertItemCost","classification":"WRITE","paramCount":4,"schema":"e8a91b5bae07","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertItemCustomerPart","classification":"WRITE","paramCount":5,"schema":"cde0dd9223dd","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertItemDefaultPickMethod","classification":"WRITE","paramCount":2,"schema":"690ef95891d4","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertItemManufacturing","classification":"WRITE","paramCount":5,"schema":"2b31055222f1","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertItemPlanning","classification":"WRITE","paramCount":11,"schema":"47f23c9db53e","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertItemPostingGroup","classification":"WRITE","paramCount":3,"schema":"13c649d83ad7","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertItemPurchasing","classification":"WRITE","paramCount":5,"schema":"a2cbed8e5d35","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertItemShelfLife","classification":"DESTRUCTIVE","paramCount":6,"schema":"bb2787a068a4","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertItemSupersession","classification":"DESTRUCTIVE","paramCount":8,"schema":"e50423246d68","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertItemUnitSalePrice","classification":"WRITE","paramCount":2,"schema":"bb7953ee0819","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMakeMethodVersion","classification":"WRITE","paramCount":3,"schema":"068ef4e9b168","response":"83e06908ebb7","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMaterial","classification":"WRITE","paramCount":24,"schema":"5d155ecf8748","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMaterialDimension","classification":"WRITE","paramCount":3,"schema":"9108cdce336c","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMaterialFinish","classification":"WRITE","paramCount":3,"schema":"d23a9b1a2253","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMaterialForm","classification":"WRITE","paramCount":3,"schema":"9e8f0911ed01","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMaterialGrade","classification":"WRITE","paramCount":3,"schema":"d23a9b1a2253","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMaterialSubstance","classification":"WRITE","paramCount":3,"schema":"9e8f0911ed01","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMaterialType","classification":"WRITE","paramCount":5,"schema":"c033d56db90c","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMethodMaterial","classification":"WRITE","paramCount":12,"schema":"63c4478aafe4","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMethodOperation","classification":"WRITE","paramCount":21,"schema":"dee73e5d9bab","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMethodOperationParameter","classification":"WRITE","paramCount":4,"schema":"8288299a333f","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMethodOperationStep","classification":"WRITE","paramCount":10,"schema":"5ffff374f25b","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMethodOperationStepSlide","classification":"WRITE","paramCount":8,"schema":"87de21981e80","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertMethodOperationTool","classification":"WRITE","paramCount":4,"schema":"b24b1efca1f6","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertPart","classification":"WRITE","paramCount":20,"schema":"993efbca44fe","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertPickMethod","classification":"WRITE","paramCount":4,"schema":"945a705285fe","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertPickMethodWithShelfLife","classification":"DESTRUCTIVE","paramCount":6,"schema":"467c1510f3ba","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertService","classification":"WRITE","paramCount":18,"schema":"e2c0493d62c4","response":"245d08618b2e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertSupplierPart","classification":"WRITE","paramCount":9,"schema":"38704df2c4f2","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertTool","classification":"WRITE","paramCount":20,"schema":"993efbca44fe","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"items_upsertUnitOfMeasure","classification":"WRITE","paramCount":3,"schema":"854e456ba211","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update"},+ {"name":"people_clockIn","classification":"WRITE","paramCount":1,"schema":"3d90cb5d0437","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:update"},+ {"name":"people_clockOut","classification":"WRITE","paramCount":3,"schema":"f1fa7800aa59","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:update"},+ {"name":"people_createTimeCardEntry","classification":"WRITE","paramCount":4,"schema":"d88eff32bf40","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create"},+ {"name":"people_deleteAttribute","classification":"DESTRUCTIVE","paramCount":1,"schema":"437fb5c5c303","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:delete"},+ {"name":"people_deleteAttributeCategory","classification":"DESTRUCTIVE","paramCount":1,"schema":"b773edae357b","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:delete"},+ {"name":"people_deleteDepartment","classification":"DESTRUCTIVE","paramCount":1,"schema":"01883d2055a5","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:delete"},+ {"name":"people_deleteHoliday","classification":"DESTRUCTIVE","paramCount":1,"schema":"9189cc10f756","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:delete"},+ {"name":"people_deleteShift","classification":"DESTRUCTIVE","paramCount":1,"schema":"fbdb1fa56a88","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:delete"},+ {"name":"people_deleteTimeCardEntry","classification":"DESTRUCTIVE","paramCount":1,"schema":"c53dc26677e4","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:delete"},+ {"name":"people_getAttribute","classification":"READ","paramCount":1,"schema":"437fb5c5c303","response":"9c635d811516","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getAttributeCategories","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"64bbb296aaa1","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getAttributeCategory","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a52b87433b3b","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getAttributeDataTypes","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"885ca485a3b9","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getClockedInEmployees","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"579660621675","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getContacts","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"de41996ed14c","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getDepartment","classification":"READ","paramCount":1,"schema":"01883d2055a5","response":"10600fcaa49e","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getDepartments","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"f483d2bc2259","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getDepartmentsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getDepartmentsTree","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"8476e48a3c04","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getEmployeeDepartments","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"94b797b98edf","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getEmployeeJob","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"34566072edc2","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getEmployeeShifts","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"68279ed68276","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getEmployeeSummary","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"afd28b3efe9e","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getHoliday","classification":"READ","paramCount":1,"schema":"9189cc10f756","response":"8d2b62b6a13b","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getHolidays","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"1fedcd5adb59","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getHolidayYears","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"7dd467066555","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getOpenClockEntry","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"48d1ac3381b4","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getPeople","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"5483e69d7515","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getRecentTimecards","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"579660621675","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getScheduledEmployeesToday","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"c93c10ff0dbe","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getShift","classification":"READ","paramCount":1,"schema":"fbdb1fa56a88","response":"86e4039d95bd","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getShifts","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"92fec9db1b7e","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getShiftsList","classification":"READ","paramCount":1,"schema":"b76e1039273f","response":"ce08332e0ce6","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getShiftsWithTimes","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"5b99e0634dc7","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getTimecardEntries","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"579660621675","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getTimeCardEntries","classification":"READ","paramCount":3,"schema":"bcbe153859d6","response":"f6358cdc55d3","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getTimeCardEntry","classification":"READ","paramCount":1,"schema":"c53dc26677e4","response":"48d1ac3381b4","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_getWeeklyHoursForEmployees","classification":"READ","paramCount":1,"schema":"392d5681b870","response":"96915ea19193","injectAuth":"companyId","permission":"people:view"},+ {"name":"people_insertAttribute","classification":"WRITE","paramCount":5,"schema":"a9cc1aa15a69","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create"},+ {"name":"people_insertAttributeCategory","classification":"WRITE","paramCount":3,"schema":"0f2b5b298e7f","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create"},+ {"name":"people_insertEmployeeJob","classification":"WRITE","paramCount":2,"schema":"98c5e52f7c8e","response":"34566072edc2","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create"},+ {"name":"people_updateAttribute","classification":"WRITE","paramCount":4,"schema":"f66dbb270538","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"people:update"},+ {"name":"people_updateAttributeCategory","classification":"WRITE","paramCount":4,"schema":"7bf8c03306de","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"people:update"},+ {"name":"people_updateAttributeSortOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"people:update"},+ {"name":"people_updateEmployeeJob","classification":"DESTRUCTIVE","paramCount":2,"schema":"836cc62db1b0","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"people:update"},+ {"name":"people_updateTimeCardEntry","classification":"WRITE","paramCount":4,"schema":"486c249ce3fa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"people:update"},+ {"name":"people_upsertDepartment","classification":"WRITE","paramCount":3,"schema":"897d7bd7e80b","response":"10600fcaa49e","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create+update"},+ {"name":"people_upsertHoliday","classification":"WRITE","paramCount":3,"schema":"296d3a64abbc","response":"8d2b62b6a13b","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create+update"},+ {"name":"people_upsertShift","classification":"WRITE","paramCount":12,"schema":"d1ecbe5cb610","response":"4cc67c58f3c9","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create+update"},+ {"name":"production_activateAssemblyInstructionVersion","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_assignPeopleWeek","classification":"WRITE","paramCount":5,"schema":"ea0a43e3afd6","response":"31035ceec7a6","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_autoMatchAssemblyComponents","classification":"WRITE","paramCount":1,"schema":"f9ddf194f67e","response":"41dc031a100a","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_buildAssemblyToolStepLinks","classification":"WRITE","paramCount":4,"schema":"050136ded025","response":"560413db6168","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_calculateJobPriority","classification":"WRITE","paramCount":4,"schema":"5f41a05ee0ca","response":"cddf8275afa1","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_clearPeopleAbsence","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"11d6b03b19bc","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_completeJob","classification":"WRITE","paramCount":4,"schema":"722de9754d1b","response":"b520ca8e3ab4","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_completeOperation","classification":"WRITE","paramCount":2,"schema":"92c192733c55","response":"none","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_convertSalesOrderLinesToJobs","classification":"WRITE","paramCount":1,"schema":"94c4cbf5579d","response":"f100e8f75ce0","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_copyAssemblyInstructionAsVersion","classification":"WRITE","paramCount":1,"schema":"87207f927319","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create"},+ {"name":"production_copyPeopleBoard","classification":"WRITE","paramCount":4,"schema":"3cb969f05928","response":"cbf943bfb8ed","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create"},+ {"name":"production_copyPeopleWeek","classification":"WRITE","paramCount":4,"schema":"bd6e745b6883","response":"cbf943bfb8ed","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create"},+ {"name":"production_createAssemblyPlanJob","classification":"WRITE","paramCount":1,"schema":"277f7d872d8c","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create"},+ {"name":"production_deleteAssemblyComponentMapping","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteAssemblyInstruction","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteAssemblyInstructionStep","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteAssemblyInstructionStepMaterial","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteAssemblyInstructionStepSlide","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteAssemblyInstructionStepTool","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteAssemblyUnit","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteDemandForecasts","classification":"DESTRUCTIVE","paramCount":3,"schema":"078059f848ea","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteDemandProjections","classification":"DESTRUCTIVE","paramCount":3,"schema":"078059f848ea","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteFailureMode","classification":"DESTRUCTIVE","paramCount":1,"schema":"4a3e0384d72f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteInspectionDocument","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"e92dda062549","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteJob","classification":"DESTRUCTIVE","paramCount":1,"schema":"4999bd4be598","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteJobMaterial","classification":"DESTRUCTIVE","paramCount":1,"schema":"9b0d4f228240","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteJobOperation","classification":"DESTRUCTIVE","paramCount":1,"schema":"6889e2589fdc","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteJobOperationParameter","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteJobOperationStep","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteJobOperationStepSlide","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteJobOperationTool","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteMaintenanceDispatch","classification":"DESTRUCTIVE","paramCount":1,"schema":"34cb412f1fae","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteMaintenanceDispatchEvent","classification":"DESTRUCTIVE","paramCount":1,"schema":"281c418606f0","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteMaintenanceDispatchItem","classification":"DESTRUCTIVE","paramCount":1,"schema":"623ca47a6c74","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteMaintenanceDispatchWorkCenter","classification":"DESTRUCTIVE","paramCount":1,"schema":"7f43ff7a4fc5","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteMaintenanceSchedule","classification":"DESTRUCTIVE","paramCount":1,"schema":"c61245800a33","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteMaintenanceScheduleItem","classification":"DESTRUCTIVE","paramCount":1,"schema":"623ca47a6c74","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deletePeopleAssignment","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"6ce160f0feca","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteProcedure","classification":"DESTRUCTIVE","paramCount":1,"schema":"0611728fa5e0","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteProcedureParameter","classification":"DESTRUCTIVE","paramCount":1,"schema":"2a17205fafa2","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteProcedureStep","classification":"DESTRUCTIVE","paramCount":1,"schema":"6b6d6162de02","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteProductionEvent","classification":"DESTRUCTIVE","paramCount":1,"schema":"e749b308e49d","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteProductionQuantity","classification":"DESTRUCTIVE","paramCount":1,"schema":"6b2dd7541ea3","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_deleteScrapReason","classification":"DESTRUCTIVE","paramCount":1,"schema":"a5f822fb0806","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete"},+ {"name":"production_duplicateJobOperationStep","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create"},+ {"name":"production_generateAssemblyStepsFromPlan","classification":"DESTRUCTIVE","paramCount":2,"schema":"80eeb7b6dd7c","response":"6a32a10b17d9","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create"},+ {"name":"production_getActiveEmployeeAbilities","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"54a54ff0565e","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getActiveJobOperationByJobId","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"ebe9a86ba8b7","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getActiveJobOperationsByLocation","classification":"READ","paramCount":2,"schema":"bcf41dd63247","response":"7a37dba0adee","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getActiveProductionEvents","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"5dbbc31f5f44","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getAssemblyComponentMappings","classification":"READ","paramCount":1,"schema":"277f7d872d8c","response":"da74e5f4208a","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getAssemblyInstruction","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"76b132dcfb0d","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getAssemblyInstructions","classification":"READ","paramCount":5,"schema":"f5c7cefefe81","response":"845b5a451089","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getAssemblyInstructionsForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"c881f4ef7d23","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getAssemblyInstructionStepMaterials","classification":"READ","paramCount":1,"schema":"0f56299d6859","response":"89a5f52bebf8","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getAssemblyInstructionSteps","classification":"READ","paramCount":1,"schema":"f9ddf194f67e","response":"1a7606a0a35b","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getAssemblyInstructionStepSlides","classification":"READ","paramCount":1,"schema":"0f56299d6859","response":"60aa9b57a118","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getAssemblyInstructionStepTools","classification":"READ","paramCount":1,"schema":"0f56299d6859","response":"d771814f7578","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getAssemblyInstructionVersions","classification":"READ","paramCount":2,"schema":"0c21424ecd86","response":"81c6e04c54bd","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getAssemblyPlanJson","classification":"READ","paramCount":1,"schema":"277f7d872d8c","response":"b4083e6fbe8b","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getAssemblyUnits","classification":"READ","paramCount":1,"schema":"277f7d872d8c","response":"7224ef8546c1","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getBalloons","classification":"READ","paramCount":1,"schema":"c25fe011e891","response":"3fec0abbc97d","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getCapacityReservationsByJob","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"8ea855e0971b","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getCapacityReservationsForResources","classification":"READ","paramCount":2,"schema":"c0f9784197a0","response":"acf514307eea","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getDemandForecasts","classification":"READ","paramCount":3,"schema":"c24ad31f1eaa","response":"21892ee9e3b8","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getDemandProjections","classification":"READ","paramCount":3,"schema":"c24ad31f1eaa","response":"3f9a097c510e","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getFailureMode","classification":"READ","paramCount":1,"schema":"4a3e0384d72f","response":"2f49c8d39495","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getFailureModes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"6fe6b1e0f957","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getFailureModesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getFlattenedBomMaterials","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"7f3fb0d1aeb3","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getInspectionDocument","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a82889f583de","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getInspectionDocuments","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"0daf2106401c","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getInspectionDocumentsForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"cfa5f1f7b8aa","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getInspectionFeatures","classification":"READ","paramCount":1,"schema":"c25fe011e891","response":"1029909fcf82","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getInspectionPlan","classification":"READ","paramCount":1,"schema":"c25fe011e891","response":"83a9b3640e41","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJob","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"3067c24178e5","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobByOperationId","classification":"READ","paramCount":1,"schema":"c407a9edb930","response":"07382c86b3b8","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobDocuments","classification":"READ","paramCount":4,"schema":"f41144061088","response":"5483e69d7515","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobDocumentsWithItemId","classification":"READ","paramCount":2,"schema":"046fecc650c6","response":"5483e69d7515","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobExpediteForecast","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"d377dc3a1fd5","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobMakeMethodById","classification":"READ","paramCount":1,"schema":"c32158774ba3","response":"96389acf0c72","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobMaterial","classification":"READ","paramCount":1,"schema":"5aa329400da2","response":"7cdf48a49d7f","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobMaterialItemIds","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"32068a500dfe","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobMaterialPurchaseOrderLines","classification":"READ","paramCount":2,"schema":"4a84595038c7","response":"b12e99320d04","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobMaterialsByMethodId","classification":"READ","paramCount":1,"schema":"c32158774ba3","response":"562cd876b859","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobMaterialShortfallByItem","classification":"READ","paramCount":3,"schema":"60d889cdd8c0","response":"f43f2fa5a47f","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobMaterialSupplyJobLines","classification":"READ","paramCount":2,"schema":"4a84595038c7","response":"8e048b6a60ce","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobMaterialsWithQuantityOnHand","classification":"READ","paramCount":3,"schema":"0e9e6edbd779","response":"be0a4b3c547b","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobMethodTree","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"a0e7ca5d166e","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobMethodTreeArray","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"74f0f766ca05","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobOperation","classification":"READ","paramCount":1,"schema":"6889e2589fdc","response":"44b8494dd1da","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobOperationAttachments","classification":"READ","paramCount":1,"schema":"0715cdbaa5fb","response":"9a8b9c571a6b","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobOperationDependencies","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"9214ed6d51dd","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobOperations","classification":"READ","paramCount":2,"schema":"d772b12a956e","response":"ad9c353b7718","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobOperationsAssignedToEmployee","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"20f7748935c7","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobOperationsByMethodId","classification":"READ","paramCount":1,"schema":"c32158774ba3","response":"e49a15b6ee95","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobOperationsForTimeline","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"6f0169823721","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobOperationsList","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"4e5425835530","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobOperationStepRecords","classification":"READ","paramCount":2,"schema":"2e4f0768fe43","response":"272548978b28","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobOrderStatusMap","classification":"READ","paramCount":4,"schema":"d81c582bf406","response":"3f77244fd820","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobPromiseDate","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"f6521bc077a4","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobPurchaseOrderLines","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"309dea2a265c","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobs","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"630059095fdc","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobsByDateRange","classification":"READ","paramCount":3,"schema":"00794c516592","response":"737259a0d747","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobsBySalesOrderLine","classification":"READ","paramCount":1,"schema":"58e3c9762923","response":"630059095fdc","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getJobsList","classification":"READ","paramCount":1,"schema":"b77fb638cb98","response":"232ee7305e73","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getLatestAssemblyPlan","classification":"READ","paramCount":1,"schema":"277f7d872d8c","response":"c15540ea30a1","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getLatestAssemblyPlanJob","classification":"READ","paramCount":1,"schema":"277f7d872d8c","response":"d45b1cde8dd5","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getLocationEmployees","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"72ccccdcfc21","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getMaintenanceDispatch","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"f0addd41ad4e","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getMaintenanceDispatchComments","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"7df6d6b7ba88","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getMaintenanceDispatches","classification":"READ","paramCount":4,"schema":"06e82ba1a75a","response":"8cdb79a1ff07","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getMaintenanceDispatchEvents","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"fc0af15629d8","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getMaintenanceDispatchItems","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"7d22c1b8235d","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getMaintenanceDispatchWorkCenters","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"245d61ef36d3","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getMaintenanceDowntimeForResources","classification":"READ","paramCount":1,"schema":"935cc20961b6","response":"1bd2fbd329dd","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getMaintenanceSchedule","classification":"READ","paramCount":1,"schema":"c61245800a33","response":"d794f5e4efb7","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getMaintenanceScheduleItems","classification":"READ","paramCount":1,"schema":"c61245800a33","response":"6e7c564b202a","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getMaintenanceSchedules","classification":"READ","paramCount":4,"schema":"b48b875ac337","response":"80c9953d43e5","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getModelForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"a64658053ae5","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getOutsideOperationsByJobId","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"b75ab9ed0211","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getPeopleAbsences","classification":"READ","paramCount":1,"schema":"2f19cae7bae1","response":"f98df1954626","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getPeopleAbsencesRange","classification":"READ","paramCount":2,"schema":"265827be4a3e","response":"90f4a38d3460","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getPeopleAssignments","classification":"READ","paramCount":2,"schema":"0a3119f1e6d7","response":"6bf01853c73a","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getPeopleAssignmentsRange","classification":"READ","paramCount":3,"schema":"00794c516592","response":"ba9f9d495de9","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getPeopleCapacityOperations","classification":"READ","paramCount":3,"schema":"19f229146b3b","response":"9bbc101347c4","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProcedure","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"54f86be1acc6","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProcedureParameters","classification":"READ","paramCount":1,"schema":"0611728fa5e0","response":"07629bf64853","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProcedures","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"ba57bd0be81d","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProceduresList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"fe6a24448aaa","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProcedureSteps","classification":"READ","paramCount":1,"schema":"0611728fa5e0","response":"fd4f59b40560","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProcedureVersions","classification":"READ","paramCount":2,"schema":"89111eab017d","response":"f97efca67bd3","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProductionDataByOperations","classification":"READ","paramCount":1,"schema":"0715cdbaa5fb","response":"4b2f38744663","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProductionEvent","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"3e58d124670b","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProductionEvents","classification":"READ","paramCount":2,"schema":"304bd714250f","response":"20bfd0be3ad2","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProductionEventsByJob","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"0c36813c32a1","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProductionEventsByOperations","classification":"READ","paramCount":1,"schema":"0715cdbaa5fb","response":"20bfd0be3ad2","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProductionEventsPage","classification":"READ","paramCount":3,"schema":"86ca80961401","response":"cb6201fb9f56","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProductionPlanning","classification":"READ","paramCount":3,"schema":"d561f840242a","response":"684c3b20f68c","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProductionProjections","classification":"READ","paramCount":3,"schema":"d561f840242a","response":"4973a62dfd1b","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProductionQuantities","classification":"READ","paramCount":2,"schema":"304bd714250f","response":"3b4cf7a6bc87","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getProductionQuantity","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"c506c8c71d8f","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getRootMakeMethod","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"96389acf0c72","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getScrapReason","classification":"READ","paramCount":1,"schema":"a5f822fb0806","response":"4bbb50609deb","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getScrapReasons","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"a5e736373756","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getScrapReasonsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getTrackedEntitiesByJobId","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"c20d7cb06756","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getTrackedEntityByJobId","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"d485710baf81","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getUnscheduledJobs","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"5bab58ad74bd","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getWorkCenterRequiredAbilities","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"7418ea1fc0a7","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getWorkCenterReservationsRange","classification":"READ","paramCount":2,"schema":"99ea73b8e7a1","response":"a7e9bc09d2ab","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_getWorkCenterShifts","classification":"READ","paramCount":1,"schema":"e94892850934","response":"2b4835f80e6c","injectAuth":"companyId","permission":"production:view"},+ {"name":"production_insertJob","classification":"WRITE","paramCount":2,"schema":"096204f059d8","response":"ad63dfd9d877","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create"},+ {"name":"production_invalidateAssemblyModelCache","classification":"DESTRUCTIVE","paramCount":1,"schema":"277f7d872d8c","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_issueMaterial","classification":"WRITE","paramCount":7,"schema":"0408bd8c9bde","response":"none","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_maxToolQuantityByItem","classification":"WRITE","paramCount":1,"schema":"8b9e90037b9a","response":"eb258ef68905","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_movePeopleAssignment","classification":"DESTRUCTIVE","paramCount":2,"schema":"a726aa587ccc","response":"fe5e1dc03da5","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_movePeopleWeek","classification":"DESTRUCTIVE","paramCount":5,"schema":"fec8ebf1add4","response":"3badaa1686e8","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_notifyScheduleInputsChanged","classification":"WRITE","paramCount":3,"schema":"de0d8dcb6949","response":"none","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_planAssemblyStepMarkerSync","classification":"WRITE","paramCount":2,"schema":"f32958f213ae","response":"535dff9a42da","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_pullJobMaterialMakeMethod","classification":"WRITE","paramCount":2,"schema":"e27f48bbab4c","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_reassignAssemblyStepComponents","classification":"DESTRUCTIVE","paramCount":4,"schema":"99f3d689165d","response":"none","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_recalculateJobMakeMethodRequirements","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_recalculateJobOperationDependencies","classification":"WRITE","paramCount":1,"schema":"4999bd4be598","response":"a70079765330","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_recalculateJobRequirements","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_replaceJobMaterialSteps","classification":"DESTRUCTIVE","paramCount":2,"schema":"876f8375508a","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_runMRP","classification":"WRITE","paramCount":2,"schema":"c874ccd8ce6b","response":"9e056a59d695","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_saveInspectionDocumentAtomic","classification":"WRITE","paramCount":7,"schema":"302bbaaf5d0c","response":"none","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_scheduleJob","classification":"WRITE","paramCount":1,"schema":"4999bd4be598","response":"a70079765330","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_setJobMaterialStepLink","classification":"DESTRUCTIVE","paramCount":4,"schema":"805d2a5ebf8e","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_setJobOperationToolStepLink","classification":"DESTRUCTIVE","paramCount":4,"schema":"2d14950ae331","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_setPeopleAbsence","classification":"WRITE","paramCount":4,"schema":"efea076202c2","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_setPeopleAbsenceRange","classification":"WRITE","paramCount":5,"schema":"f40e1c93667c","response":"9859df3143fe","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_setPeopleAssignmentHours","classification":"WRITE","paramCount":2,"schema":"29aa7bdf6d50","response":"3ca729812149","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_setPeopleDay","classification":"DESTRUCTIVE","paramCount":7,"schema":"e5c972d7b8c3","response":"b4c094a53e37","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_setPeopleOvertimeBulk","classification":"WRITE","paramCount":6,"schema":"8f082483561d","response":"577d7088b794","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_syncAssemblyInstructionToOperation","classification":"DESTRUCTIVE","paramCount":2,"schema":"8160f8d92b1b","response":"4348d3bad80b","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_syncAssemblyStepMaterialsFromMappings","classification":"WRITE","paramCount":4,"schema":"7f7346bb3bd0","response":"5815c4dbf43d","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_toViewerStep","classification":"WRITE","paramCount":1,"schema":"3f809a44cba0","response":"ecca5ca73c50","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_unassignPeopleWeek","classification":"DESTRUCTIVE","paramCount":4,"schema":"06ead5d3d9ce","response":"9658926b2cd2","injectAuth":"companyId","permission":"production:update"},+ {"name":"production_updateAssemblyInstructionStatus","classification":"WRITE","paramCount":2,"schema":"fcc328285ff9","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateAssemblyInstructionStepMaterialOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"none","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateAssemblyInstructionStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"none","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateAssemblyInstructionStepStatus","classification":"WRITE","paramCount":2,"schema":"fcc328285ff9","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateAssemblyStepComponents","classification":"WRITE","paramCount":2,"schema":"d7ea6b1800f7","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateAssemblyStepMotion","classification":"WRITE","paramCount":3,"schema":"9c66a3d128cb","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateInspectionDocumentSampling","classification":"WRITE","paramCount":6,"schema":"4eec4e364093","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateJob","classification":"WRITE","paramCount":21,"schema":"d7d469f65590","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateJobBatchNumber","classification":"WRITE","paramCount":2,"schema":"a4c2a31bb8a6","response":"f7a40899c090","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateJobMaterialOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateJobOperationDueDate","classification":"WRITE","paramCount":2,"schema":"e04478fc58f7","response":"44b8494dd1da","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateJobOperationOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateJobOperationStatus","classification":"WRITE","paramCount":2,"schema":"9c945ec6b5da","response":"44b8494dd1da","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateJobOperationStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateJobStatus","classification":"WRITE","paramCount":3,"schema":"15a6c8d11a4f","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateKanbanJob","classification":"WRITE","paramCount":2,"schema":"2c22838be2d2","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateMethodOperationStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateProcedureStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateProductionQuantity","classification":"WRITE","paramCount":6,"schema":"6ea5f7475d17","response":"7cb043dcb64d","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_updateQuoteOperationStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"production:update"},+ {"name":"production_upsertAssemblyComponentMapping","classification":"WRITE","paramCount":4,"schema":"9ed1f38ce764","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertAssemblyInstruction","classification":"WRITE","paramCount":4,"schema":"a1796f1bd347","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertAssemblyInstructionStep","classification":"WRITE","paramCount":16,"schema":"fd846a77a304","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertAssemblyInstructionStepMaterial","classification":"WRITE","paramCount":5,"schema":"a21b4fac4b90","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertAssemblyInstructionStepSlide","classification":"WRITE","paramCount":8,"schema":"87de21981e80","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertAssemblyInstructionStepTool","classification":"WRITE","paramCount":5,"schema":"d64500fd5c94","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertAssemblyUnit","classification":"WRITE","paramCount":5,"schema":"74497d782594","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertDemandForecasts","classification":"DESTRUCTIVE","paramCount":1,"schema":"5c1a48b7ff1e","response":"57a0b3d217fb","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertDemandProjections","classification":"DESTRUCTIVE","paramCount":1,"schema":"5c1a48b7ff1e","response":"57a0b3d217fb","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertFailureMode","classification":"WRITE","paramCount":2,"schema":"df56b99ec46e","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertInspectionDocument","classification":"WRITE","paramCount":7,"schema":"bb8780ca9841","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertJob","classification":"WRITE","paramCount":2,"schema":"af52630c8fc8","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertJobMaterial","classification":"WRITE","paramCount":15,"schema":"a8485ce0c973","response":"af9af3838934","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertJobMaterialMakeMethod","classification":"WRITE","paramCount":5,"schema":"0c413abd68ad","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertJobMethod","classification":"WRITE","paramCount":2,"schema":"000e3baf94c3","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertJobOperation","classification":"WRITE","paramCount":24,"schema":"17d8a3d4ceaf","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertJobOperationParameter","classification":"WRITE","paramCount":4,"schema":"8288299a333f","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertJobOperationStep","classification":"WRITE","paramCount":10,"schema":"5ffff374f25b","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertJobOperationStepSlide","classification":"WRITE","paramCount":8,"schema":"87de21981e80","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertJobOperationTool","classification":"WRITE","paramCount":4,"schema":"b24b1efca1f6","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertMaintenanceDispatch","classification":"WRITE","paramCount":12,"schema":"1cabf1e5521f","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertMaintenanceDispatchComment","classification":"WRITE","paramCount":3,"schema":"f79295d5eb89","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertMaintenanceDispatchEvent","classification":"WRITE","paramCount":7,"schema":"834d4e0bf908","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertMaintenanceDispatchItem","classification":"WRITE","paramCount":6,"schema":"04fec211f623","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertMaintenanceDispatchWorkCenter","classification":"WRITE","paramCount":3,"schema":"d5b48775f398","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertMaintenanceSchedule","classification":"WRITE","paramCount":8,"schema":"474f19565321","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertMaintenanceScheduleItem","classification":"WRITE","paramCount":5,"schema":"00e2e6d24e50","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertMakeMethodFromJob","classification":"WRITE","paramCount":3,"schema":"32b3a0f5efa0","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertMakeMethodFromJobMethod","classification":"WRITE","paramCount":3,"schema":"32b3a0f5efa0","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertPeopleAssignment","classification":"DESTRUCTIVE","paramCount":7,"schema":"1ec71dfcea20","response":"a726aa587ccc","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertProcedure","classification":"WRITE","paramCount":6,"schema":"1956f23f1d21","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertProcedureParameter","classification":"WRITE","paramCount":4,"schema":"d58a41fa9f2f","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertProcedureStep","classification":"WRITE","paramCount":10,"schema":"e0352a783337","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertProductionEvent","classification":"WRITE","paramCount":8,"schema":"487f567809f9","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertProductionQuantity","classification":"WRITE","paramCount":6,"schema":"6ea5f7475d17","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"production_upsertScrapReason","classification":"WRITE","paramCount":2,"schema":"df56b99ec46e","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update"},+ {"name":"purchasing_closePurchaseOrder","classification":"WRITE","paramCount":1,"schema":"28cffcd9d6e8","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_convertSupplierQuoteToOrder","classification":"WRITE","paramCount":2,"schema":"c31a76296c27","response":"5cb338fa12e6","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_deletePurchaseOrder","classification":"DESTRUCTIVE","paramCount":1,"schema":"28cffcd9d6e8","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete"},+ {"name":"purchasing_deletePurchaseOrderLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"ed69a5b8e424","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete"},+ {"name":"purchasing_deletePurchasingRFQ","classification":"DESTRUCTIVE","paramCount":1,"schema":"4e16cef99961","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete"},+ {"name":"purchasing_deletePurchasingRFQLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"943916e70d0b","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete"},+ {"name":"purchasing_deleteSupplier","classification":"DESTRUCTIVE","paramCount":1,"schema":"67043a31b1b5","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete"},+ {"name":"purchasing_deleteSupplierContact","classification":"DESTRUCTIVE","paramCount":2,"schema":"041a4bd97ec8","response":"700b93baa3ef","injectAuth":"companyId","permission":"purchasing:delete"},+ {"name":"purchasing_deleteSupplierLocation","classification":"DESTRUCTIVE","paramCount":2,"schema":"dad5decd6951","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete"},+ {"name":"purchasing_deleteSupplierProcess","classification":"DESTRUCTIVE","paramCount":1,"schema":"fe73a000b6f7","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete"},+ {"name":"purchasing_deleteSupplierQuote","classification":"DESTRUCTIVE","paramCount":1,"schema":"5db39f9abf41","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete"},+ {"name":"purchasing_deleteSupplierQuoteLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete"},+ {"name":"purchasing_deleteSupplierType","classification":"DESTRUCTIVE","paramCount":1,"schema":"900045091850","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete"},+ {"name":"purchasing_duplicatePurchaseOrder","classification":"WRITE","paramCount":1,"schema":"b6bf3abf506d","response":"f5212679d580","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create"},+ {"name":"purchasing_finalizePurchaseOrder","classification":"WRITE","paramCount":1,"schema":"28cffcd9d6e8","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_finalizeSupplierQuote","classification":"WRITE","paramCount":1,"schema":"5db39f9abf41","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_getDefaultAttachmentsForPO","classification":"READ","paramCount":2,"schema":"17cccb0ea3ef","response":"4a42c6b9da80","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getLinkedPurchasingRfqs","classification":"READ","paramCount":1,"schema":"5db39f9abf41","response":"9c82bc9ce35e","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getLinkedPurchasingRfqsForInteraction","classification":"READ","paramCount":1,"schema":"6e2899e1731e","response":"c7f7518e09d1","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getLinkedPurchasingRfqsForOrder","classification":"READ","paramCount":1,"schema":"28cffcd9d6e8","response":"9c82bc9ce35e","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getLinkedSupplierQuotes","classification":"READ","paramCount":1,"schema":"4e16cef99961","response":"cb143b1fe761","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchaseOrder","classification":"READ","paramCount":1,"schema":"28cffcd9d6e8","response":"3797db2be7c6","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchaseOrderDelivery","classification":"READ","paramCount":1,"schema":"28cffcd9d6e8","response":"0564bac29ef5","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchaseOrderLine","classification":"READ","paramCount":1,"schema":"ed69a5b8e424","response":"56c9d7ca858b","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchaseOrderLines","classification":"READ","paramCount":1,"schema":"28cffcd9d6e8","response":"4e2a81139b3b","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchaseOrderLocations","classification":"READ","paramCount":1,"schema":"28cffcd9d6e8","response":"d4d4c42eb761","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchaseOrderPayment","classification":"READ","paramCount":1,"schema":"28cffcd9d6e8","response":"c7a62e53e09b","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchaseOrders","classification":"READ","paramCount":5,"schema":"9d3e5d4db447","response":"fbaa9ca23142","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchaseOrderSuppliers","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"fc7a0345fc53","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchasingDocumentsAssignedToMe","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"dd8b869650b8","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchasingPlanning","classification":"READ","paramCount":3,"schema":"d561f840242a","response":"0cd4f8e33cdc","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchasingRFQ","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"08cb90c207da","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchasingRFQLine","classification":"READ","paramCount":1,"schema":"063a6777d378","response":"045f66457f11","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchasingRFQLines","classification":"READ","paramCount":1,"schema":"4e16cef99961","response":"24a761144b4a","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchasingRFQs","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"a2661a189775","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchasingRFQSuppliers","classification":"READ","paramCount":1,"schema":"4e16cef99961","response":"5483e69d7515","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchasingRFQSuppliersWithLinks","classification":"READ","paramCount":1,"schema":"4e16cef99961","response":"5483e69d7515","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getPurchasingTerms","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"91b7924d48bd","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSiblingQuotesForQuote","classification":"READ","paramCount":1,"schema":"5db39f9abf41","response":"cb143b1fe761","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplier","classification":"READ","paramCount":1,"schema":"67043a31b1b5","response":"10c7209cc38a","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierContact","classification":"READ","paramCount":1,"schema":"bc2c630a873e","response":"6d2aa722b1ce","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierContacts","classification":"READ","paramCount":1,"schema":"67043a31b1b5","response":"e28ccbd2c417","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierInteraction","classification":"READ","paramCount":1,"schema":"5e54451f6705","response":"a2d087005b56","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierInteractionDocuments","classification":"READ","paramCount":1,"schema":"2df4b3d111cd","response":"18998cbb23b4","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierInteractionLineDocuments","classification":"READ","paramCount":1,"schema":"063a6777d378","response":"18998cbb23b4","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierLocation","classification":"READ","paramCount":1,"schema":"bc2c630a873e","response":"4603d06d1055","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierLocations","classification":"READ","paramCount":1,"schema":"67043a31b1b5","response":"6dad1063175d","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierPayment","classification":"READ","paramCount":1,"schema":"67043a31b1b5","response":"24b286adf1ff","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierProcessById","classification":"READ","paramCount":1,"schema":"fe73a000b6f7","response":"7d3e895a1991","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierProcessesByProcess","classification":"READ","paramCount":1,"schema":"01edb53077b2","response":"c2eb609c8ad1","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierProcessesBySupplier","classification":"READ","paramCount":1,"schema":"67043a31b1b5","response":"c2eb609c8ad1","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierQuote","classification":"READ","paramCount":1,"schema":"5db39f9abf41","response":"f998bf4f97dc","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierQuoteByExternalLinkId","classification":"READ","paramCount":1,"schema":"feb52bb98a20","response":"8c242582e5e6","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierQuoteByInteractionId","classification":"READ","paramCount":1,"schema":"2df4b3d111cd","response":"f998bf4f97dc","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierQuoteLine","classification":"READ","paramCount":1,"schema":"88823065a537","response":"549f0e57572d","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierQuoteLinePrices","classification":"READ","paramCount":1,"schema":"88823065a537","response":"22abc40c4789","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierQuoteLinePricesByQuoteId","classification":"READ","paramCount":1,"schema":"5db39f9abf41","response":"22abc40c4789","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierQuoteLines","classification":"READ","paramCount":1,"schema":"5db39f9abf41","response":"50759a9c2b79","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierQuotes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"9e311e59b82e","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierQuotesForComparison","classification":"READ","paramCount":1,"schema":"4e16cef99961","response":"540207b2c74e","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierQuotesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"967dcad15168","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSuppliers","classification":"READ","paramCount":5,"schema":"3fbb04d0ef7e","response":"947b627d845e","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierShipping","classification":"READ","paramCount":1,"schema":"67043a31b1b5","response":"17117a952d24","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSuppliersList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierTax","classification":"READ","paramCount":1,"schema":"67043a31b1b5","response":"303387b4fc28","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierType","classification":"READ","paramCount":1,"schema":"900045091850","response":"8b3eca34dbfd","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7c6550dea5b1","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_getSupplierTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"purchasing:view"},+ {"name":"purchasing_insertPurchaseOrder","classification":"WRITE","paramCount":15,"schema":"f6ac6968d7fb","response":"f5212679d580","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create"},+ {"name":"purchasing_insertPurchasingRFQ","classification":"WRITE","paramCount":8,"schema":"85bc9241d4ce","response":"0c1a1b93cca3","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create"},+ {"name":"purchasing_insertSupplier","classification":"WRITE","paramCount":9,"schema":"2ec780d8d3b7","response":"9d2416e8ad75","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create"},+ {"name":"purchasing_insertSupplierContact","classification":"WRITE","paramCount":4,"schema":"39adceeb4a9a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create"},+ {"name":"purchasing_insertSupplierInteraction","classification":"WRITE","paramCount":1,"schema":"67043a31b1b5","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create"},+ {"name":"purchasing_insertSupplierLocation","classification":"WRITE","paramCount":4,"schema":"c903cae736f0","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create"},+ {"name":"purchasing_insertSupplierQuote","classification":"WRITE","paramCount":13,"schema":"cda383eec983","response":"77e21c1e2e32","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create"},+ {"name":"purchasing_reopenPurchaseOrderAsRevision","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"cddf8275afa1","injectAuth":"companyId","permission":"purchasing:update"},+ {"name":"purchasing_sendSupplierQuote","classification":"WRITE","paramCount":1,"schema":"5db39f9abf41","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_shortClosePurchaseOrderLine","classification":"WRITE","paramCount":3,"schema":"fc9c2f370fc5","response":"none","injectAuth":"companyId","permission":"purchasing:update"},+ {"name":"purchasing_updatePurchaseOrder","classification":"WRITE","paramCount":11,"schema":"9af985c65a2a","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updatePurchaseOrderExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updatePurchaseOrderFavorite","classification":"DESTRUCTIVE","paramCount":2,"schema":"85769b943e30","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updatePurchaseOrderLineOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"none","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updatePurchaseOrderStatus","classification":"WRITE","paramCount":3,"schema":"927b3801fc77","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updatePurchaseOrderStatusLegacy","classification":"WRITE","paramCount":2,"schema":"9c945ec6b5da","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updatePurchasingRFQ","classification":"WRITE","paramCount":8,"schema":"cf82797b6b1f","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updatePurchasingRFQLineOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"none","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updatePurchasingRFQStatus","classification":"WRITE","paramCount":3,"schema":"15a6c8d11a4f","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updateSupplierAccounting","classification":"WRITE","paramCount":2,"schema":"00634b037a3e","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updateSupplierContact","classification":"WRITE","paramCount":4,"schema":"c9ae3c1faa92","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updateSupplierLocation","classification":"WRITE","paramCount":4,"schema":"9d205b68ee4f","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updateSupplierPayment","classification":"WRITE","paramCount":5,"schema":"fb1e83d5ea1d","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updateSupplierQuote","classification":"WRITE","paramCount":8,"schema":"86d26b1b1646","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updateSupplierQuoteExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updateSupplierQuoteLineOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"none","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updateSupplierQuoteStatus","classification":"WRITE","paramCount":3,"schema":"927b3801fc77","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updateSupplierShipping","classification":"WRITE","paramCount":7,"schema":"b48646e8787e","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_updateSupplierTax","classification":"WRITE","paramCount":7,"schema":"69723b06a410","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update"},+ {"name":"purchasing_upsertPurchaseOrder","classification":"WRITE","paramCount":2,"schema":"a71344ea8b26","response":"1b33aad6f934","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"purchasing_upsertPurchaseOrderDelivery","classification":"WRITE","paramCount":14,"schema":"7fc3a93fa13e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"purchasing_upsertPurchaseOrderLine","classification":"WRITE","paramCount":24,"schema":"e1f43613f0fb","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"purchasing_upsertPurchaseOrderPayment","classification":"WRITE","paramCount":5,"schema":"9bcc224cec6a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"purchasing_upsertPurchasingRFQ","classification":"WRITE","paramCount":8,"schema":"4dd6c07ac6b6","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"purchasing_upsertPurchasingRFQLine","classification":"WRITE","paramCount":1,"schema":"cda537a351eb","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"purchasing_upsertPurchasingRFQSuppliers","classification":"DESTRUCTIVE","paramCount":2,"schema":"fa459fc25bca","response":"5c9ba5bee3f1","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"purchasing_upsertSupplier","classification":"WRITE","paramCount":9,"schema":"0d5630743956","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"purchasing_upsertSupplierProcess","classification":"WRITE","paramCount":5,"schema":"5a7e436c185b","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"purchasing_upsertSupplierQuote","classification":"WRITE","paramCount":14,"schema":"658460f00d66","response":"4ed5e2358875","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"purchasing_upsertSupplierQuoteLine","classification":"WRITE","paramCount":13,"schema":"1a191d8fa690","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"purchasing_upsertSupplierType","classification":"WRITE","paramCount":2,"schema":"df56b99ec46e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update"},+ {"name":"quality_activateGauge","classification":"WRITE","paramCount":1,"schema":"f65da45a1155","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:update"},+ {"name":"quality_deactivateGauge","classification":"WRITE","paramCount":1,"schema":"f65da45a1155","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:update"},+ {"name":"quality_deleteGauge","classification":"DESTRUCTIVE","paramCount":1,"schema":"f65da45a1155","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:delete"},+ {"name":"quality_deleteGaugeCalibrationRecord","classification":"DESTRUCTIVE","paramCount":1,"schema":"81eca1e58f6e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:delete"},+ {"name":"quality_deleteGaugeType","classification":"DESTRUCTIVE","paramCount":1,"schema":"24fb90489cd4","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:delete"},+ {"name":"quality_deleteIssue","classification":"DESTRUCTIVE","paramCount":1,"schema":"a78c6c21c084","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:delete"},+ {"name":"quality_deleteIssueAssociation","classification":"DESTRUCTIVE","paramCount":2,"schema":"5e9621fb955d","response":"none","injectAuth":"companyId","permission":"quality:delete"},+ {"name":"quality_deleteIssueType","classification":"DESTRUCTIVE","paramCount":1,"schema":"bb6b04f68710","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:delete"},+ {"name":"quality_deleteIssueWorkflow","classification":"DESTRUCTIVE","paramCount":1,"schema":"15a80db054e6","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:delete"},+ {"name":"quality_deleteQualityDocument","classification":"DESTRUCTIVE","paramCount":1,"schema":"6d79e6870690","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:delete"},+ {"name":"quality_deleteQualityDocumentStep","classification":"DESTRUCTIVE","paramCount":1,"schema":"6d1c301b650d","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:delete"},+ {"name":"quality_deleteRequiredAction","classification":"DESTRUCTIVE","paramCount":1,"schema":"cca3bf9f3ebb","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:delete"},+ {"name":"quality_deleteRisk","classification":"DESTRUCTIVE","paramCount":1,"schema":"7002f7ae1c58","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:delete"},+ {"name":"quality_getGauge","classification":"READ","paramCount":1,"schema":"f65da45a1155","response":"19d84b9bffdb","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getGaugeCalibrationRecord","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"90fb86d6af14","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getGaugeCalibrationRecords","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7ed9f83a9f0f","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getGaugeCalibrationRecordsByGaugeId","classification":"READ","paramCount":1,"schema":"f65da45a1155","response":"7ed9f83a9f0f","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getGauges","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7d2b6ae79d59","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getGaugesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"34b9a5801676","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getGaugeType","classification":"READ","paramCount":1,"schema":"24fb90489cd4","response":"63b5b3f8f143","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getGaugeTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"95195653f3fc","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getGaugeTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getInspection","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getInspectionMeasurements","classification":"READ","paramCount":1,"schema":"d88996520fca","response":"c6a90b70c17b","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getInspections","classification":"READ","paramCount":5,"schema":"ab64e3131c2d","response":"b942685a303b","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getInspectionSamplingPlans","classification":"READ","paramCount":1,"schema":"d88996520fca","response":"e8400eb0460f","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getInspectionTrackedEntities","classification":"READ","paramCount":1,"schema":"17337505bb69","response":"c20d7cb06756","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssue","classification":"READ","paramCount":1,"schema":"a78c6c21c084","response":"1a2ca8014c88","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueActionTasks","classification":"READ","paramCount":2,"schema":"989a1bef3af7","response":"0f3a25ff459d","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueApprovalTasks","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"60bd02d2af2c","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueAssociations","classification":"READ","paramCount":1,"schema":"a78c6c21c084","response":"e7079254e6dc","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueFromExternalLink","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"81ecd90279ab","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueItems","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"65ba0c27d388","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueReviewers","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"fa7631f38515","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssues","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"e08ce0758580","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueSuppliers","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"2a7e42e2f8c2","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueTasks","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"4a4afab580ba","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueType","classification":"READ","paramCount":1,"schema":"bb6b04f68710","response":"63b5b3f8f143","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueTypeByName","classification":"READ","paramCount":2,"schema":"858a6cb73bbb","response":"3797626bd17e","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"95195653f3fc","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueWorkflow","classification":"READ","paramCount":1,"schema":"15a80db054e6","response":"3272b87b8442","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueWorkflows","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"38608ae87f0d","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getIssueWorkflowsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"38608ae87f0d","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getItemInspectionDocumentAssignments","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"9bedeef9a12b","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getQualityActions","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"76d10ad61a21","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getQualityDocument","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a8b2d87af029","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getQualityDocuments","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"8bb4ab685129","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getQualityDocumentsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"fe6a24448aaa","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getQualityDocumentSteps","classification":"READ","paramCount":1,"schema":"6d79e6870690","response":"55202747c3b2","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getQualityDocumentVersions","classification":"READ","paramCount":2,"schema":"89111eab017d","response":"63e52c70cbef","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getQualityFiles","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"c8f657a900dd","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getReceiptInspections","classification":"READ","paramCount":1,"schema":"e00a9764517d","response":"e30d015c0242","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getRequiredAction","classification":"READ","paramCount":1,"schema":"cca3bf9f3ebb","response":"00f7e228e469","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getRequiredActions","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"477e4aa9ac3b","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getRequiredActionsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getRisk","classification":"READ","paramCount":1,"schema":"7002f7ae1c58","response":"f0e54ff68cc5","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_getRisks","classification":"READ","paramCount":6,"schema":"1014eebba2f1","response":"72f8ffc765cc","injectAuth":"companyId","permission":"quality:view"},+ {"name":"quality_insertGauge","classification":"WRITE","paramCount":15,"schema":"239f996ac519","response":"3269d4609ad2","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create"},+ {"name":"quality_insertIssue","classification":"WRITE","paramCount":20,"schema":"e3caac7b562f","response":"bf12cbd0f560","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create"},+ {"name":"quality_insertIssueReviewer","classification":"WRITE","paramCount":1,"schema":"9924d077e3cf","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create"},+ {"name":"quality_updateGauge","classification":"WRITE","paramCount":16,"schema":"1f4985688c90","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"quality:update"},+ {"name":"quality_updateIssue","classification":"WRITE","paramCount":16,"schema":"6a91e2298369","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"quality:update"},+ {"name":"quality_updateIssueActionProcesses","classification":"DESTRUCTIVE","paramCount":2,"schema":"9dbd38e74ee8","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"quality:update"},+ {"name":"quality_updateIssueStatus","classification":"WRITE","paramCount":4,"schema":"73fb4040e2c9","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"quality:update"},+ {"name":"quality_updateIssueTaskContent","classification":"WRITE","paramCount":3,"schema":"dcd51db087bc","response":"a78c6c21c084","injectAuth":"companyId+updatedBy","permission":"quality:update"},+ {"name":"quality_updateIssueTaskStatus","classification":"WRITE","paramCount":4,"schema":"cd763f773f42","response":"a78c6c21c084","injectAuth":"companyId+updatedBy","permission":"quality:update"},+ {"name":"quality_updateQualityDocumentStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"quality:update"},+ {"name":"quality_updateRiskStatus","classification":"WRITE","paramCount":2,"schema":"a7bf8ea968ae","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"quality:update"},+ {"name":"quality_upsertGauge","classification":"WRITE","paramCount":14,"schema":"eefc7a6beba2","response":"3ec91e2c9200","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update"},+ {"name":"quality_upsertGaugeCalibrationRecord","classification":"WRITE","paramCount":13,"schema":"3752cb379c41","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update"},+ {"name":"quality_upsertGaugeType","classification":"WRITE","paramCount":2,"schema":"df56b99ec46e","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update"},+ {"name":"quality_upsertIssue","classification":"WRITE","paramCount":20,"schema":"bb3051113bbe","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update"},+ {"name":"quality_upsertIssueType","classification":"WRITE","paramCount":2,"schema":"df56b99ec46e","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update"},+ {"name":"quality_upsertIssueWorkflow","classification":"WRITE","paramCount":7,"schema":"ed37ccdc2f7a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update"},+ {"name":"quality_upsertItemInspectionDocumentAssignment","classification":"DESTRUCTIVE","paramCount":3,"schema":"3e4ebfc49e2a","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update"},+ {"name":"quality_upsertQualityDocument","classification":"WRITE","paramCount":5,"schema":"6ddca1e4a601","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update"},+ {"name":"quality_upsertQualityDocumentStep","classification":"WRITE","paramCount":10,"schema":"cd38e003477a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update"},+ {"name":"quality_upsertRequiredAction","classification":"WRITE","paramCount":2,"schema":"df56b99ec46e","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update"},+ {"name":"quality_upsertRisk","classification":"WRITE","paramCount":12,"schema":"4d76f902a7df","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update"},+ {"name":"resources_activateProcess","classification":"WRITE","paramCount":1,"schema":"01edb53077b2","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:update"},+ {"name":"resources_activateWorkCenter","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:update"},+ {"name":"resources_deleteAbility","classification":"DESTRUCTIVE","paramCount":2,"schema":"f642be0f483d","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteContractor","classification":"DESTRUCTIVE","paramCount":1,"schema":"c178e4a4c21e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteEmployeeAbility","classification":"DESTRUCTIVE","paramCount":1,"schema":"5ccac46fc41e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteFailureMode","classification":"DESTRUCTIVE","paramCount":1,"schema":"4a3e0384d72f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteLocation","classification":"DESTRUCTIVE","paramCount":1,"schema":"de371a276a58","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteMaintenanceDispatch","classification":"DESTRUCTIVE","paramCount":1,"schema":"34cb412f1fae","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteMaintenanceDispatchEvent","classification":"DESTRUCTIVE","paramCount":1,"schema":"281c418606f0","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteMaintenanceDispatchItem","classification":"DESTRUCTIVE","paramCount":1,"schema":"623ca47a6c74","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteMaintenanceDispatchWorkCenter","classification":"DESTRUCTIVE","paramCount":1,"schema":"7f43ff7a4fc5","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteMaintenanceSchedule","classification":"DESTRUCTIVE","paramCount":1,"schema":"c61245800a33","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteMaintenanceScheduleItem","classification":"DESTRUCTIVE","paramCount":1,"schema":"623ca47a6c74","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deletePartner","classification":"DESTRUCTIVE","paramCount":1,"schema":"74d289586b4f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteProcess","classification":"DESTRUCTIVE","paramCount":1,"schema":"01edb53077b2","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteShift","classification":"DESTRUCTIVE","paramCount":1,"schema":"fbdb1fa56a88","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteSuggestion","classification":"DESTRUCTIVE","paramCount":1,"schema":"3a7f44ccb395","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteTraining","classification":"DESTRUCTIVE","paramCount":1,"schema":"3f6f0a410b0f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteTrainingAssignment","classification":"DESTRUCTIVE","paramCount":1,"schema":"7d3fe60cc8ed","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteTrainingQuestion","classification":"DESTRUCTIVE","paramCount":1,"schema":"b4f48c09ba9f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_deleteWorkCenter","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete"},+ {"name":"resources_ensureProcessAbility","classification":"WRITE","paramCount":2,"schema":"8fdfbeae8f5b","response":"3797626bd17e","injectAuth":"companyId","permission":"resources:update"},+ {"name":"resources_getAbilities","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"6392190334f3","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getAbilitiesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getAbility","classification":"READ","paramCount":1,"schema":"5133c0e3b586","response":"08d21fab64be","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getContractor","classification":"READ","paramCount":1,"schema":"c178e4a4c21e","response":"995cb2d28a3e","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getContractors","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"155b783e2512","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getEmployeeAbilities","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"af06259134bf","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getEmployeeAbility","classification":"READ","paramCount":1,"schema":"5ccac46fc41e","response":"f0d72cd0ea38","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getFailureMode","classification":"READ","paramCount":1,"schema":"4a3e0384d72f","response":"2f49c8d39495","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getFailureModes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"6fe6b1e0f957","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getFailureModesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getLocation","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"5fe568931f57","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getLocations","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7df90335f683","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getLocationsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"e19c89c1e8a0","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceDispatch","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"5547ae49213e","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceDispatchComments","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"7df6d6b7ba88","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceDispatches","classification":"READ","paramCount":4,"schema":"06e82ba1a75a","response":"8cdb79a1ff07","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceDispatchesByLocation","classification":"READ","paramCount":2,"schema":"802416175b36","response":"774cad94afc0","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceDispatchEvents","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"fc0af15629d8","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceDispatchItems","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"595d666b79ec","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceDispatchItemTrackedEntities","classification":"READ","paramCount":1,"schema":"63ddd4fe05c0","response":"0ae53e4d5350","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceDispatchWorkCenters","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"245d61ef36d3","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceSchedule","classification":"READ","paramCount":1,"schema":"c61245800a33","response":"d794f5e4efb7","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceScheduleItems","classification":"READ","paramCount":1,"schema":"c61245800a33","response":"6e7c564b202a","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceSchedules","classification":"READ","paramCount":4,"schema":"b48b875ac337","response":"80c9953d43e5","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getMaintenanceSchedulesByLocation","classification":"READ","paramCount":2,"schema":"f360e7c8e35a","response":"8a3485dcbdc1","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getOutstandingTrainingsForUser","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"2b901764b425","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getPartner","classification":"READ","paramCount":2,"schema":"7a4efbb751fd","response":"280a38a37b61","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getPartnerBySupplierId","classification":"READ","paramCount":1,"schema":"74d289586b4f","response":"280a38a37b61","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getPartners","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"780345005c48","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getProcess","classification":"READ","paramCount":1,"schema":"01edb53077b2","response":"609465b78672","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getProcesses","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"65a97668ecb1","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getProcessesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getSuggestion","classification":"READ","paramCount":1,"schema":"3a7f44ccb395","response":"77bb66a1249a","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getSuggestions","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"9e90aae0404b","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getTraining","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"84c264919a14","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getTrainingAssignment","classification":"READ","paramCount":1,"schema":"7d3fe60cc8ed","response":"cb917b5ce4eb","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getTrainingAssignmentForCompletion","classification":"READ","paramCount":1,"schema":"7d3fe60cc8ed","response":"41a2c00f121a","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getTrainingAssignments","classification":"READ","paramCount":1,"schema":"d541f0a7e11f","response":"bb328cb9e34a","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getTrainingAssignmentStatus","classification":"READ","paramCount":3,"schema":"4b28f853e5b7","response":"2b901764b425","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getTrainingAssignmentStatusForEmployee","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"2b901764b425","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getTrainingAssignmentSummary","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"c3f55a28a4ac","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getTrainingGrantedAbilityId","classification":"READ","paramCount":1,"schema":"fbebd108a3c4","response":"174e29b899b9","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getTrainingQuestions","classification":"READ","paramCount":1,"schema":"3f6f0a410b0f","response":"cbc84076fe3b","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getTrainings","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"cc28f2dfe36f","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getTrainingsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"8a9d99ad8810","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getWorkCenter","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a715589eaffc","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getWorkCenters","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"6ee53f0ab42d","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getWorkCentersByLocation","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"8b2381d0f8d4","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getWorkCentersList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"6ee53f0ab42d","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_getWorkCentersListWithBlockingStatus","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0317b0f9e0df","injectAuth":"companyId","permission":"resources:view"},+ {"name":"resources_insertAbility","classification":"WRITE","paramCount":2,"schema":"c164542b8323","response":"3522ac255982","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create"},+ {"name":"resources_insertMaintenanceDispatch","classification":"WRITE","paramCount":14,"schema":"0a2553167d77","response":"ede36af7307d","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create"},+ {"name":"resources_processDeactivate","classification":"WRITE","paramCount":1,"schema":"01edb53077b2","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:update"},+ {"name":"resources_resolveEmployeeAbilityExpiresAt","classification":"WRITE","paramCount":3,"schema":"ec5fc6dfaa43","response":"174e29b899b9","injectAuth":"companyId","permission":"resources:update"},+ {"name":"resources_updateAbility","classification":"WRITE","paramCount":2,"schema":"5f9356e36090","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"resources:update"},+ {"name":"resources_updateMaintenanceDispatch","classification":"WRITE","paramCount":18,"schema":"7103c4ed8e2d","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"resources:update"},+ {"name":"resources_updateSuggestionEmoji","classification":"WRITE","paramCount":2,"schema":"dc61bce0f764","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"resources:update"},+ {"name":"resources_updateSuggestionTags","classification":"WRITE","paramCount":2,"schema":"ab3b2e298cdb","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"resources:update"},+ {"name":"resources_updateTrainingQuestionOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"resources:update"},+ {"name":"resources_upsertContractor","classification":"DESTRUCTIVE","paramCount":1,"schema":"bf6ec0d9d5bc","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertEmployeeAbilityCell","classification":"WRITE","paramCount":4,"schema":"800b78f5bbae","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertFailureMode","classification":"WRITE","paramCount":3,"schema":"f3f1ebb1655b","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertLocation","classification":"WRITE","paramCount":12,"schema":"906dda1f374f","response":"5fe568931f57","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertMaintenanceDispatch","classification":"WRITE","paramCount":14,"schema":"3e24a86007a1","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertMaintenanceDispatchComment","classification":"WRITE","paramCount":3,"schema":"f79295d5eb89","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertMaintenanceDispatchEvent","classification":"WRITE","paramCount":7,"schema":"834d4e0bf908","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertMaintenanceDispatchItem","classification":"WRITE","paramCount":6,"schema":"04fec211f623","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertMaintenanceDispatchWorkCenter","classification":"WRITE","paramCount":3,"schema":"d5b48775f398","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertMaintenanceSchedule","classification":"WRITE","paramCount":20,"schema":"89ff27d11274","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertMaintenanceScheduleItem","classification":"WRITE","paramCount":5,"schema":"00e2e6d24e50","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertPartner","classification":"WRITE","paramCount":3,"schema":"dc6bf062f805","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertProcess","classification":"DESTRUCTIVE","paramCount":7,"schema":"32f04af561d3","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertTraining","classification":"WRITE","paramCount":4,"schema":"be53f09f9856","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertTrainingAssignment","classification":"WRITE","paramCount":3,"schema":"9f8996544bb7","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertTrainingQuestion","classification":"WRITE","paramCount":12,"schema":"f27342252292","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"resources_upsertWorkCenter","classification":"DESTRUCTIVE","paramCount":12,"schema":"99a81bd9eb66","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update"},+ {"name":"sales_applyPriceRules","classification":"WRITE","paramCount":2,"schema":"46aca77d25d7","response":"457db36e71eb","injectAuth":"companyId","permission":"sales:update"},+ {"name":"sales_buildMakeToOrderPriceRows","classification":"WRITE","paramCount":4,"schema":"9ca94f5219fe","response":"89e850aef11d","injectAuth":"companyId","permission":"sales:update"},+ {"name":"sales_buildPullFromInventoryPriceRows","classification":"WRITE","paramCount":4,"schema":"9ca94f5219fe","response":"89e850aef11d","injectAuth":"companyId","permission":"sales:update"},+ {"name":"sales_buildPurchaseToOrderPriceRows","classification":"WRITE","paramCount":4,"schema":"9ca94f5219fe","response":"89e850aef11d","injectAuth":"companyId","permission":"sales:update"},+ {"name":"sales_calculatePricesForQuantities","classification":"WRITE","paramCount":3,"schema":"160e0d2cf116","response":"af602e7b257e","injectAuth":"companyId","permission":"sales:update"},+ {"name":"sales_cancelSalesOrder","classification":"WRITE","paramCount":2,"schema":"745d2b9e6ebc","response":"903bb804a4ff","injectAuth":"companyId","permission":"sales:update"},+ {"name":"sales_closeSalesOrder","classification":"WRITE","paramCount":1,"schema":"d160a49d6787","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_convertQuoteToOrder","classification":"WRITE","paramCount":5,"schema":"c6aa4b6e493a","response":"5cb338fa12e6","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_convertSalesRfqToQuote","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"5cb338fa12e6","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_copyQuote","classification":"WRITE","paramCount":9,"schema":"692ceb74fe3d","response":"225932f823fc","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create"},+ {"name":"sales_copyQuoteLine","classification":"WRITE","paramCount":9,"schema":"692ceb74fe3d","response":"24c3c39326f6","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create"},+ {"name":"sales_createPricingRule","classification":"WRITE","paramCount":15,"schema":"306872f9cb7b","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create"},+ {"name":"sales_deleteCustomer","classification":"DESTRUCTIVE","paramCount":1,"schema":"09e48c79fb16","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteCustomerContact","classification":"DESTRUCTIVE","paramCount":2,"schema":"3fd22b0165d4","response":"700b93baa3ef","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteCustomerItemPriceOverride","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteCustomerLocation","classification":"DESTRUCTIVE","paramCount":2,"schema":"1786ebad8e35","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteCustomerStatus","classification":"DESTRUCTIVE","paramCount":1,"schema":"d9fee396ed8f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteCustomerType","classification":"DESTRUCTIVE","paramCount":1,"schema":"b79bc02c5595","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteNoQuoteReason","classification":"DESTRUCTIVE","paramCount":1,"schema":"a37352ef51ef","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deletePricingRule","classification":"DESTRUCTIVE","paramCount":1,"schema":"360072ef68fd","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteQuote","classification":"DESTRUCTIVE","paramCount":1,"schema":"c726ae407913","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteQuoteLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"e0050938a2c8","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteQuoteMakeMethod","classification":"DESTRUCTIVE","paramCount":1,"schema":"899e2f637661","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteQuoteMaterial","classification":"DESTRUCTIVE","paramCount":1,"schema":"5718812a5810","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteQuoteOperation","classification":"DESTRUCTIVE","paramCount":1,"schema":"9d2e26473601","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteQuoteOperationParameter","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteQuoteOperationStep","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteQuoteOperationTool","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteSalesOrder","classification":"DESTRUCTIVE","paramCount":1,"schema":"d160a49d6787","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteSalesOrderLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"58e3c9762923","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteSalesRFQ","classification":"DESTRUCTIVE","paramCount":1,"schema":"1f7e47a99145","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_deleteSalesRFQLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"8b2f2f9d8451","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete"},+ {"name":"sales_duplicatePricingRule","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create"},+ {"name":"sales_finalizeQuote","classification":"WRITE","paramCount":1,"schema":"c726ae407913","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_getAllCustomersItemPriceOverride","classification":"READ","paramCount":3,"schema":"a6cc9782168c","response":"2dfcd06e591d","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getBaseCatalog","classification":"READ","paramCount":3,"schema":"cae7e7e05408","response":"d3d1929f70c6","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getConfigurationParametersByQuoteLineId","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"c36ad21b447b","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomer","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"8642159293c2","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerContact","classification":"READ","paramCount":1,"schema":"ad038ec2602b","response":"d16ba475ee9a","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerContacts","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"acc29dbe9746","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerItemPriceOverride","classification":"READ","paramCount":4,"schema":"8e0420ef7552","response":"2dfcd06e591d","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerItemPriceOverrideById","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerItemPriceOverridesList","classification":"READ","paramCount":6,"schema":"d5065f366ab1","response":"bae32978787b","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerLocation","classification":"READ","paramCount":1,"schema":"339ac15c3167","response":"be52ec9b4436","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerLocations","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"bcf222d6d73a","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerPayment","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"4357e4e42177","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomers","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"07fbe06b66b8","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerShipping","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"68f579c7eb78","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomersList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerStatus","classification":"READ","paramCount":1,"schema":"d9fee396ed8f","response":"9203566a8ab4","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerStatuses","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"a5e736373756","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerStatusesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerTax","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"35cfe732826b","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerType","classification":"READ","paramCount":1,"schema":"b79bc02c5595","response":"8b3eca34dbfd","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerTypeItemPriceOverride","classification":"READ","paramCount":4,"schema":"4da3cd3b0779","response":"2dfcd06e591d","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7c6550dea5b1","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getCustomerTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getExternalSalesOrderLines","classification":"READ","paramCount":2,"schema":"dbfcdb73551d","response":"11d204566b43","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getModelByQuoteLineId","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"none","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getNoQuoteReason","classification":"READ","paramCount":1,"schema":"a37352ef51ef","response":"4bbb50609deb","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getNoQuoteReasons","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"28837d034643","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getNoQuoteReasonsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getOpenSalesOrderLinesForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"2acc181b331c","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getOpportunity","classification":"READ","paramCount":1,"schema":"5e54451f6705","response":"7fb7fcca33ba","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getOpportunityDocuments","classification":"READ","paramCount":1,"schema":"a4fcfa20a027","response":"18998cbb23b4","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getOpportunityLineDocuments","classification":"READ","paramCount":2,"schema":"067400ea63f8","response":"5483e69d7515","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getPricingRule","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"f7007e889f64","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getPricingRules","classification":"READ","paramCount":3,"schema":"cae7e7e05408","response":"af7bb9de307a","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuote","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"ee5f623bf074","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteAssemblies","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"9807da529af1","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteAssembliesByLine","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"9807da529af1","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteByExternalId","classification":"READ","paramCount":1,"schema":"21801463053a","response":"22f48d816de0","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteCustomerDetails","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"7656953707c3","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteLine","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"2e0476c17730","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteLinePrices","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"902defd23e04","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteLinePricesByItemId","classification":"READ","paramCount":2,"schema":"17311e00ca6f","response":"2d479ad29d1f","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteLinePricesByItemIds","classification":"READ","paramCount":2,"schema":"64b602e1a6e4","response":"2d479ad29d1f","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteLinePricesByQuoteId","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"902defd23e04","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteLines","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"31ca07c6139c","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteLinesList","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"5ebff9af923d","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteMakeMethod","classification":"READ","paramCount":1,"schema":"899e2f637661","response":"9bc4f5e58344","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteMaterial","classification":"READ","paramCount":1,"schema":"5aa329400da2","response":"1600eb794a06","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteMaterials","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"98a32a315556","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteMaterialsByLine","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"98a32a315556","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteMaterialsByMethodId","classification":"READ","paramCount":1,"schema":"899e2f637661","response":"d8257d5ecd6b","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteMaterialsByOperation","classification":"READ","paramCount":1,"schema":"9d2e26473601","response":"98a32a315556","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteMethodTreeArray","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"37f28086fadc","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteMethodTrees","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"5cf44f338f23","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteOperation","classification":"READ","paramCount":1,"schema":"9d2e26473601","response":"cc467608e48d","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteOperations","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"9e17db1d5582","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteOperationsByLine","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"9e17db1d5582","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteOperationsByMethodId","classification":"READ","paramCount":1,"schema":"899e2f637661","response":"0ee46500fe67","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuotePayment","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"c94b5d1f2b47","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuotes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"dea28b562b72","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuoteShipment","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"ee2ac29cff92","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getQuotesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0ff25946068c","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getRelatedPricesForQuoteLine","classification":"READ","paramCount":2,"schema":"71f31780bb98","response":"0aa8762cb43e","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getRootQuoteMakeMethod","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"9bc4f5e58344","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesDocumentsAssignedToMe","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3e8aab076fd0","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrder","classification":"READ","paramCount":1,"schema":"d160a49d6787","response":"9678723e1ea2","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderCustomerDetails","classification":"READ","paramCount":1,"schema":"d160a49d6787","response":"141326b70f84","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderCustomers","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"fc7a0345fc53","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderInvoiceLines","classification":"READ","paramCount":1,"schema":"d160a49d6787","response":"1ff852ae9154","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderInvoicesByIds","classification":"READ","paramCount":1,"schema":"d51ae9969843","response":"b06c9fe383e6","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderLine","classification":"READ","paramCount":1,"schema":"58e3c9762923","response":"680c6abfc2c8","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderLines","classification":"READ","paramCount":1,"schema":"d160a49d6787","response":"12480eaf2ca4","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderLinesByItemId","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"12480eaf2ca4","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderLinesByItemIds","classification":"READ","paramCount":1,"schema":"c4ca22fd1816","response":"12480eaf2ca4","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderLineShipments","classification":"READ","paramCount":1,"schema":"58e3c9762923","response":"131473831fc0","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderPayment","classification":"READ","paramCount":1,"schema":"d160a49d6787","response":"e52a6a8beddf","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderRelatedItems","classification":"READ","paramCount":2,"schema":"651e9f51b36d","response":"370e3de53e8e","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrders","classification":"READ","paramCount":5,"schema":"3999756dbbb5","response":"1c8f748b3671","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrdersByIds","classification":"READ","paramCount":1,"schema":"0eb0c2be01ed","response":"5cc20a44d4fe","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrderShipment","classification":"READ","paramCount":1,"schema":"d160a49d6787","response":"0f0a39ddefae","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesOrdersList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"5cc20a44d4fe","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesRFQ","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"be949b1d682b","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesRFQLine","classification":"READ","paramCount":1,"schema":"063a6777d378","response":"a53064f9e7fe","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesRFQLines","classification":"READ","paramCount":1,"schema":"1f7e47a99145","response":"17f5b7f57e4c","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesRFQs","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"cb436531316b","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_getSalesTerms","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"9819ae68df9b","injectAuth":"companyId","permission":"sales:view"},+ {"name":"sales_insertCustomerContact","classification":"WRITE","paramCount":4,"schema":"f92fe41e337f","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create"},+ {"name":"sales_insertCustomerLocation","classification":"WRITE","paramCount":4,"schema":"c30fcaea26e0","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create"},+ {"name":"sales_insertQuote","classification":"WRITE","paramCount":16,"schema":"f6a23f4c685e","response":"9e29b49e1dc8","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create"},+ {"name":"sales_insertSalesOrder","classification":"WRITE","paramCount":17,"schema":"5a7987b78980","response":"dbfc22813350","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create"},+ {"name":"sales_insertSalesOrderLines","classification":"WRITE","paramCount":1,"schema":"49b8ebc95aa7","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create"},+ {"name":"sales_insertSalesRFQ","classification":"WRITE","paramCount":13,"schema":"5a54a12e500f","response":"0c1a1b93cca3","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create"},+ {"name":"sales_recalculateQuoteLinePrices","classification":"WRITE","paramCount":2,"schema":"55ee981d3d94","response":"6db20595d1b7","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_releaseSalesOrder","classification":"WRITE","paramCount":1,"schema":"d160a49d6787","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_resolvePrice","classification":"WRITE","paramCount":1,"schema":"76ee0d3b025e","response":"e21c67b9c2e5","injectAuth":"companyId","permission":"sales:update"},+ {"name":"sales_resolvePriceList","classification":"WRITE","paramCount":6,"schema":"2ee3c5668f0c","response":"d3d1929f70c6","injectAuth":"companyId","permission":"sales:update"},+ {"name":"sales_resolvePurchaseToOrderPrices","classification":"WRITE","paramCount":3,"schema":"160e0d2cf116","response":"af602e7b257e","injectAuth":"companyId","permission":"sales:update"},+ {"name":"sales_resolveQuoteLinePrices","classification":"WRITE","paramCount":3,"schema":"160e0d2cf116","response":"af602e7b257e","injectAuth":"companyId","permission":"sales:update"},+ {"name":"sales_updateCustomerAccounting","classification":"WRITE","paramCount":2,"schema":"165c42d97441","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateCustomerContact","classification":"WRITE","paramCount":4,"schema":"bcf2e3fd9c9a","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateCustomerLocation","classification":"WRITE","paramCount":4,"schema":"9d205b68ee4f","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateCustomerPayment","classification":"WRITE","paramCount":5,"schema":"f4b0bf1f4ec1","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateCustomerShipping","classification":"WRITE","paramCount":7,"schema":"1c4be8a465fb","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateCustomerTax","classification":"WRITE","paramCount":7,"schema":"a8f82f9f4f9e","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updatePricingRule","classification":"WRITE","paramCount":2,"schema":"f1c6f0ff1a41","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateQuote","classification":"WRITE","paramCount":17,"schema":"72bf7fd44e59","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateQuoteExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateQuoteLineOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"none","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateQuoteLinePrecision","classification":"WRITE","paramCount":3,"schema":"90f52ec96806","response":"none","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateQuoteMaterialOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateQuoteOperationOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateQuoteStatus","classification":"WRITE","paramCount":3,"schema":"927b3801fc77","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateSalesOrder","classification":"WRITE","paramCount":9,"schema":"86c84a1ee2a3","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateSalesOrderExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateSalesOrderLineOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"none","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateSalesOrderStatus","classification":"WRITE","paramCount":3,"schema":"927b3801fc77","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateSalesRFQ","classification":"WRITE","paramCount":13,"schema":"29d3ed584bda","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateSalesRFQLineOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"none","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_updateSalesRFQStatus","classification":"WRITE","paramCount":4,"schema":"777446b7a259","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update"},+ {"name":"sales_upsertCustomer","classification":"WRITE","paramCount":10,"schema":"a122315f37f4","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertCustomerItemPriceOverride","classification":"DESTRUCTIVE","paramCount":10,"schema":"f5f7dcf0edfd","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertCustomerStatus","classification":"WRITE","paramCount":2,"schema":"df56b99ec46e","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertCustomerType","classification":"WRITE","paramCount":2,"schema":"df56b99ec46e","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertMakeMethodFromQuoteLine","classification":"WRITE","paramCount":4,"schema":"ca78a9869ff2","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertMakeMethodFromQuoteMethod","classification":"WRITE","paramCount":3,"schema":"32b3a0f5efa0","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertNoQuoteReason","classification":"WRITE","paramCount":2,"schema":"df56b99ec46e","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuote","classification":"WRITE","paramCount":20,"schema":"baedfb5095e4","response":"3acbb53b8c04","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuoteLine","classification":"WRITE","paramCount":16,"schema":"b91682e7d7a1","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuoteLineAdditionalCharges","classification":"WRITE","paramCount":2,"schema":"b0bee4bfebe8","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuoteLineMethod","classification":"WRITE","paramCount":5,"schema":"fb840c4177a4","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuoteLinePrices","classification":"DESTRUCTIVE","paramCount":3,"schema":"72f6d907091e","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuoteMaterial","classification":"WRITE","paramCount":14,"schema":"7f9d99db0c39","response":"af9af3838934","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuoteMaterialMakeMethod","classification":"WRITE","paramCount":4,"schema":"0b17fb5ddd10","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuoteOperation","classification":"WRITE","paramCount":24,"schema":"603cab4aa2b7","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuoteOperationParameter","classification":"WRITE","paramCount":4,"schema":"8288299a333f","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuoteOperationStep","classification":"WRITE","paramCount":10,"schema":"5ffff374f25b","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuoteOperationTool","classification":"WRITE","paramCount":4,"schema":"b24b1efca1f6","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuotePayment","classification":"WRITE","paramCount":5,"schema":"9b71e63ed715","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertQuoteShipment","classification":"WRITE","paramCount":7,"schema":"b67f297e5398","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertSalesOrder","classification":"WRITE","paramCount":18,"schema":"5905f0bd6c11","response":"5cc20a44d4fe","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertSalesOrderLine","classification":"WRITE","paramCount":22,"schema":"adf04f193356","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertSalesOrderPayment","classification":"WRITE","paramCount":7,"schema":"7d1da2a2c3c6","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertSalesOrderShipment","classification":"WRITE","paramCount":16,"schema":"cf174047c5db","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertSalesRFQ","classification":"WRITE","paramCount":14,"schema":"381974307d21","response":"2e56e1180d37","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"sales_upsertSalesRFQLine","classification":"WRITE","paramCount":10,"schema":"f33e2b0b1313","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update"},+ {"name":"settings_deactivateWebhooks","classification":"WRITE","paramCount":0,"schema":"efddc7bd8bbc","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update"},+ {"name":"settings_deleteApiKey","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"users:update"},+ {"name":"settings_deleteDocumentSection","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:delete"},+ {"name":"settings_deleteItemSerialSequence","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:delete"},+ {"name":"settings_deleteWebhook","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:delete"},+ {"name":"settings_getAccountsPayableBillingAddress","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"7c0b9dc6d441","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getAccountsReceivableBillingAddress","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"7c0b9dc6d441","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getApiKeys","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"eec810be5b96","injectAuth":"companyId","permission":"users:update"},+ {"name":"settings_getCompanies","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"a521b8a3bee8","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getCompany","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"8abc93835023","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getCompanyIntegrations","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3a98b34db51d","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getCompanyPlan","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"none","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getCompanySettings","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"9e95c96c5750","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getConfig","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"aa1021ff34cf","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getCurrentSequence","classification":"READ","paramCount":1,"schema":"f55836d6d401","response":"00404e686415","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getCustomField","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a533a796c094","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getCustomFields","classification":"READ","paramCount":1,"schema":"f55836d6d401","response":"4dd4a7dca597","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getCustomFieldsTables","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"4d68a1d346ce","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getDocumentSection","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"955f14940530","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getDocumentSections","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"d8b65982e0d9","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getDocumentSectionsByIds","classification":"READ","paramCount":1,"schema":"0eb0c2be01ed","response":"d8b65982e0d9","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getDocumentTemplate","classification":"READ","paramCount":1,"schema":"aeac292b00cb","response":"99cae633d7cb","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getDocumentTemplateConfig","classification":"READ","paramCount":1,"schema":"aeac292b00cb","response":"ef5479de5c47","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getEmployeeCompanies","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"a521b8a3bee8","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getIndustries","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"5dcce0f224dd","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getIntegration","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"099545249106","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getIntegrations","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"66d5dad6d7fc","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getItemSerialSequence","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"16afb36e5f82","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getItemSerialSequenceByItemId","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"1a875b64a77f","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getItemSerialSequences","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"ef60889e0cf5","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getKanbanOutputSetting","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ca53dc098fc8","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getNextSequence","classification":"READ","paramCount":1,"schema":"f55836d6d401","response":"00404e686415","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getPlanById","classification":"READ","paramCount":1,"schema":"a77c6a03353f","response":"none","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getPlans","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"5483e69d7515","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getSequence","classification":"READ","paramCount":1,"schema":"f55836d6d401","response":"ef17e2453ded","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getSequences","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"395e5a595aba","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getSequencesList","classification":"READ","paramCount":1,"schema":"f55836d6d401","response":"8394fbabd845","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getSubsidiaries","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"577bb278c46e","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getSubsidiary","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"9a8cb2196df7","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getTerms","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"deb82bb77180","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getWebhook","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"cb2b17a3252e","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getWebhooks","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"f236afae1a37","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_getWebhookTables","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"633f9f3bffc6","injectAuth":"companyId","permission":"settings:view"},+ {"name":"settings_insertSubsidiary","classification":"WRITE","paramCount":19,"schema":"82b2e088fca6","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"settings:create"},+ {"name":"settings_resolveSections","classification":"WRITE","paramCount":1,"schema":"0eb0c2be01ed","response":"9cf53d9645e3","injectAuth":"companyId","permission":"settings:update"},+ {"name":"settings_updateAccountingEnabledSetting","classification":"WRITE","paramCount":1,"schema":"82d5e14a67e0","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateAccountsPayableAddressSetting","classification":"WRITE","paramCount":1,"schema":"7a679bb0d746","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateAccountsPayableBillingAddress","classification":"WRITE","paramCount":10,"schema":"e8f633d64584","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateAccountsPayableEmail","classification":"WRITE","paramCount":1,"schema":"3347035d0954","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateAccountsReceivableAddressSetting","classification":"WRITE","paramCount":1,"schema":"aee1361e5321","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateAccountsReceivableBillingAddress","classification":"WRITE","paramCount":10,"schema":"e8f633d64584","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateAccountsReceivableEmail","classification":"WRITE","paramCount":1,"schema":"6ad4f62b500d","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateAllowLowercaseItemIdsSetting","classification":"WRITE","paramCount":1,"schema":"4bfa8b2e5538","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateAssetTaxDepreciationSettings","classification":"WRITE","paramCount":2,"schema":"6decaad55e9c","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateAutoSelectMaterialWithoutPickingListSetting","classification":"WRITE","paramCount":1,"schema":"c8c780d1ee3a","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateCompany","classification":"WRITE","paramCount":17,"schema":"4c31f2dd02e0","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateCompanyPlan","classification":"WRITE","paramCount":4,"schema":"dc5417676df7","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateCompanyWithBaseCurrencyChange","classification":"DESTRUCTIVE","paramCount":17,"schema":"4c31f2dd02e0","response":"none","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateConsoleSetting","classification":"WRITE","paramCount":1,"schema":"2607ea1770b9","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateDefaultCustomerCc","classification":"WRITE","paramCount":1,"schema":"69d7696df422","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateDefaultSupplierCc","classification":"WRITE","paramCount":1,"schema":"862b3d182ce1","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateDigitalQuoteSetting","classification":"WRITE","paramCount":3,"schema":"01dcd07bf6d9","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateIncludeMaterialsOnTravelerSetting","classification":"WRITE","paramCount":1,"schema":"c44d043f2507","response":"none","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateIncompletePickingListPolicySetting","classification":"WRITE","paramCount":1,"schema":"0f134dc7536d","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateKanbanOutputSetting","classification":"WRITE","paramCount":1,"schema":"ca53dc098fc8","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateLeadTimesOnReceiptSetting","classification":"WRITE","paramCount":1,"schema":"95c137844a39","response":"none","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateLogoDark","classification":"WRITE","paramCount":1,"schema":"f2a952625b72","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateLogoDarkIcon","classification":"WRITE","paramCount":1,"schema":"cc8cf36714fa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateLogoLight","classification":"WRITE","paramCount":1,"schema":"9baa1881adb6","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateLogoLightIcon","classification":"WRITE","paramCount":1,"schema":"17c809b3aebf","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateLogoWatermark","classification":"WRITE","paramCount":1,"schema":"22e7a3b83c3a","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateMaintenanceDispatchNotificationSettings","classification":"WRITE","paramCount":4,"schema":"c857a8ae87fd","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateMaterialGeneratedIdsSetting","classification":"WRITE","paramCount":1,"schema":"8de91cc6fb4f","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateMetricSettings","classification":"WRITE","paramCount":1,"schema":"6310a488e8b2","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updatePlmReleaseControlSetting","classification":"WRITE","paramCount":1,"schema":"b74d1adb972d","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateProductLabelSize","classification":"WRITE","paramCount":1,"schema":"26bfb6ebfdda","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updatePurchasePriceUpdateTimingSetting","classification":"WRITE","paramCount":1,"schema":"6e01697e737c","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateQuoteLineCategoryMarkups","classification":"WRITE","paramCount":1,"schema":"f6ee47e543f7","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateRequireMfaSetting","classification":"WRITE","paramCount":1,"schema":"1a5429a80ff2","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateReturnPickedMaterialTimingSetting","classification":"WRITE","paramCount":1,"schema":"59acd7763b9c","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateRfqReadySetting","classification":"WRITE","paramCount":1,"schema":"8828dbf1724d","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateSequence","classification":"WRITE","paramCount":2,"schema":"3437401da992","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateShelfLifeSettings","classification":"WRITE","paramCount":4,"schema":"b5a62de45c29","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateShowCurrencyTrailingZerosSetting","classification":"WRITE","paramCount":1,"schema":"42d586011b23","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateShowCustomerReadableIdSetting","classification":"WRITE","paramCount":1,"schema":"8b384c0bd6a0","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateShowSupplierReadableIdSetting","classification":"WRITE","paramCount":1,"schema":"e28a3e070640","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateSubsidiary","classification":"WRITE","paramCount":2,"schema":"ac5e3cb29875","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateSuggestionNotificationSetting","classification":"WRITE","paramCount":1,"schema":"ac461e36d464","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateSupplierQuoteNotificationSetting","classification":"WRITE","paramCount":1,"schema":"56a6d061d358","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_updateTimeCardSetting","classification":"WRITE","paramCount":1,"schema":"9389085b800b","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update"},+ {"name":"settings_upsertApiKey","classification":"WRITE","paramCount":4,"schema":"3a3b50bdf902","response":"5eaddbfb67de","injectAuth":"companyId+createdBy+updatedBy","permission":"users:update"},+ {"name":"settings_upsertDocumentSection","classification":"WRITE","paramCount":5,"schema":"f517486c1bfa","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"settings:create+update"},+ {"name":"settings_upsertDocumentTemplate","classification":"WRITE","paramCount":6,"schema":"5d28da0e0ad6","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"settings:create+update"},+ {"name":"settings_upsertItemSerialSequence","classification":"WRITE","paramCount":7,"schema":"95750d9ab5ae","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"settings:create+update"},+ {"name":"settings_upsertWebhook","classification":"WRITE","paramCount":8,"schema":"6927ad505114","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"settings:create+update"},+ {"name":"shared_approveRequest","classification":"WRITE","paramCount":2,"schema":"db4abb0e3532","response":"ce9d372b6b54","injectAuth":"companyId+updatedBy","permission":"none"},+ {"name":"shared_canApproveRequest","classification":"WRITE","paramCount":1,"schema":"daf3a5d97135","response":"7cb541e84f22","injectAuth":"companyId","permission":"none"},+ {"name":"shared_canApproveRequestInWindow","classification":"WRITE","paramCount":1,"schema":"daf3a5d97135","response":"7cb541e84f22","injectAuth":"companyId","permission":"none"},+ {"name":"shared_canCancelRequest","classification":"WRITE","paramCount":1,"schema":"daf3a5d97135","response":"7cb541e84f22","injectAuth":"companyId","permission":"none"},+ {"name":"shared_cancelApprovalRequest","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId","permission":"none"},+ {"name":"shared_canViewApprovalRequest","classification":"WRITE","paramCount":1,"schema":"daf3a5d97135","response":"7cb541e84f22","injectAuth":"companyId","permission":"none"},+ {"name":"shared_createApprovalRequest","classification":"WRITE","paramCount":1,"schema":"e50230948301","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"none"},+ {"name":"shared_deleteApprovalRule","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"none"},+ {"name":"shared_deleteCustomerPortal","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"none"},+ {"name":"shared_deleteSavedView","classification":"DESTRUCTIVE","paramCount":1,"schema":"1fbe3d41dab0","response":"bcde375ebd4c","injectAuth":"companyId","permission":"none"},+ {"name":"shared_generateEmbedding","classification":"WRITE","paramCount":1,"schema":"e3dce8d1afb8","response":"569f4d6b0385","injectAuth":"companyId+createdBy+updatedBy","permission":"none"},+ {"name":"shared_getApprovalById","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"4ed114babb27","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getApprovalRequestsByDocument","classification":"READ","paramCount":2,"schema":"e62553303843","response":"9b323eaa3f11","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getApprovalRuleByAmount","classification":"READ","paramCount":2,"schema":"025f2e3e5643","response":"294486cea4b0","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getApprovalRuleById","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"294486cea4b0","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getApprovalRules","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"247632dde180","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getApprovalRulesForApprover","classification":"READ","paramCount":1,"schema":"38ad7ed76197","response":"247632dde180","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getApprovalsForUser","classification":"READ","paramCount":2,"schema":"48cdb7c44686","response":"8a720d482238","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getApproverUserIdsForRule","classification":"READ","paramCount":1,"schema":"46007bdc770d","response":"681004346c78","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getBase64ImageFromSupabase","classification":"READ","paramCount":1,"schema":"923b083c9bca","response":"174e29b899b9","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getCountries","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0e8a11b4e81c","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getCustomerPortal","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getCustomerPortals","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"fbffc4ca5fac","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getDocumentType","classification":"READ","paramCount":1,"schema":"0e1fe86f73c0","response":"1cc9297ced55","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getExternalLink","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"0f7860db4299","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getLatestApprovalRequestForDocument","classification":"READ","paramCount":2,"schema":"e62553303843","response":"a46647e8d6f1","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getLowerTierApproverUserIds","classification":"READ","paramCount":2,"schema":"488020533b43","response":"681004346c78","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getModelByItemId","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"none","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getNotes","classification":"READ","paramCount":1,"schema":"e7617eb689c8","response":"1a052a4417b5","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getPendingApprovalsForApprover","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"8a720d482238","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getPeriods","classification":"READ","paramCount":2,"schema":"265827be4a3e","response":"ab7e6c36be29","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getSavedViews","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"be2b0aada3eb","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getTagsList","classification":"READ","paramCount":1,"schema":"43c92414cb2f","response":"b837740e18f4","injectAuth":"companyId","permission":"none"},+ {"name":"shared_getTimezoneNames","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"93968ed2dcdb","injectAuth":"companyId","permission":"none"},+ {"name":"shared_hasPendingApproval","classification":"READ","paramCount":2,"schema":"e62553303843","response":"7cb541e84f22","injectAuth":"companyId","permission":"none"},+ {"name":"shared_importCsv","classification":"WRITE","paramCount":4,"schema":"e825a3503da4","response":"none","injectAuth":"companyId","permission":"none"},+ {"name":"shared_insertNote","classification":"WRITE","paramCount":2,"schema":"260839f76e18","response":"c2fb0e5225f8","injectAuth":"companyId+createdBy+updatedBy","permission":"none"},+ {"name":"shared_insertTag","classification":"WRITE","paramCount":1,"schema":"3aae7d222b2e","response":"27f67ae1958c","injectAuth":"companyId+createdBy+updatedBy","permission":"none"},+ {"name":"shared_isApprovalRequired","classification":"READ","paramCount":2,"schema":"025f2e3e5643","response":"7cb541e84f22","injectAuth":"companyId","permission":"none"},+ {"name":"shared_lookupBuyPriceFromMap","classification":"WRITE","paramCount":4,"schema":"cd30e98f3b65","response":"cddf8275afa1","injectAuth":"companyId","permission":"none"},+ {"name":"shared_lookupPriceFromBreaks","classification":"WRITE","paramCount":3,"schema":"c5e91b506909","response":"cddf8275afa1","injectAuth":"companyId","permission":"none"},+ {"name":"shared_rejectRequest","classification":"WRITE","paramCount":2,"schema":"db4abb0e3532","response":"ce9d372b6b54","injectAuth":"companyId+updatedBy","permission":"none"},+ {"name":"shared_resolveBuyUnitCost","classification":"WRITE","paramCount":3,"schema":"9c9dafbedcc7","response":"cddf8275afa1","injectAuth":"companyId","permission":"none"},+ {"name":"shared_resolveSupplierPrice","classification":"WRITE","paramCount":4,"schema":"dc92bab559a2","response":"cddf8275afa1","injectAuth":"companyId","permission":"none"},+ {"name":"shared_updateModelThumbnail","classification":"WRITE","paramCount":2,"schema":"7d1e1e5f7144","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"none"},+ {"name":"shared_updateSavedViewOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"ce209a810cd2","injectAuth":"companyId+updatedBy","permission":"none"},+ {"name":"shared_upsertApprovalRule","classification":"WRITE","paramCount":1,"schema":"46007bdc770d","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"none"},+ {"name":"shared_upsertExternalLink","classification":"WRITE","paramCount":1,"schema":"a7220d31ca5e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"none"},+ {"name":"shared_upsertModelUpload","classification":"WRITE","paramCount":1,"schema":"453b8ca791e8","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"none"},+ {"name":"shared_upsertSavedView","classification":"WRITE","paramCount":10,"schema":"d4e689c889b2","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"none"},+ {"name":"users_deleteEmployeeType","classification":"DESTRUCTIVE","paramCount":1,"schema":"dba2936b2a4e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"users:delete"},+ {"name":"users_deleteGroup","classification":"DESTRUCTIVE","paramCount":1,"schema":"c4dcdfdf8647","response":"bcde375ebd4c","injectAuth":"companyId","permission":"users:delete"},+ {"name":"users_getCompaniesForUser","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"681004346c78","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getConsoleOperators","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"42c3353a5284","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getCustomers","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"79cad34eb92a","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getEmployee","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"fddbdf17260d","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getEmployees","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"42c3353a5284","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getEmployeeType","classification":"READ","paramCount":1,"schema":"dba2936b2a4e","response":"02c4f766f388","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getEmployeeTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"2851c6c5b230","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getGroup","classification":"READ","paramCount":1,"schema":"c4dcdfdf8647","response":"f06d2d858884","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getGroupEmails","classification":"READ","paramCount":1,"schema":"ab09ef9264af","response":"681004346c78","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getGroupMembers","classification":"READ","paramCount":1,"schema":"c4dcdfdf8647","response":"f218e882144b","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getGroups","classification":"READ","paramCount":4,"schema":"7d58cdeaf0dc","response":"878696d68be4","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getInvitable","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3173c3a99146","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getItarCertificationReport","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"203ea6eb1a16","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getItarCertificationStatus","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"6afd62a22e82","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getItarEntityCertification","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"c5ae95ca48db","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getModules","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3f7ca035e170","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getPermissionsByEmployeeType","classification":"READ","paramCount":1,"schema":"dba2936b2a4e","response":"9b77a39f3bec","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getSuppliers","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"c096e3fa1fac","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getUnrevokedInviteEmails","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"a6b0124b4410","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getUserEmails","classification":"READ","paramCount":1,"schema":"e0b0d488de80","response":"681004346c78","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getUsers","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"e2e6268ff023","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getUserSelectGroupMembers","classification":"READ","paramCount":1,"schema":"c4dcdfdf8647","response":"b754519017cb","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getUserSelectGroups","classification":"READ","paramCount":4,"schema":"b459d00208b5","response":"51b54791b40a","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_getUsersWithVerifiedMfa","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"4c1fdc714231","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_insertEmployeeType","classification":"WRITE","paramCount":1,"schema":"098974972159","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"users:create"},+ {"name":"users_insertGroup","classification":"WRITE","paramCount":1,"schema":"098974972159","response":"06c8b45796ca","injectAuth":"companyId+createdBy+updatedBy","permission":"users:create"},+ {"name":"users_resolveUserSelectIds","classification":"WRITE","paramCount":1,"schema":"0eb0c2be01ed","response":"62ac845cad71","injectAuth":"companyId","permission":"users:update"},+ {"name":"users_searchUsersForSelect","classification":"READ","paramCount":4,"schema":"230b4891a4e5","response":"80d2a04ba04a","injectAuth":"companyId","permission":"users:view"},+ {"name":"users_upsertEmployeeType","classification":"WRITE","paramCount":1,"schema":"bfbacf03f731","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"users:create+update"},+ {"name":"users_upsertEmployeeTypePermissions","classification":"WRITE","paramCount":2,"schema":"7c50af05abd4","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"users:create+update"},+ {"name":"users_upsertGroup","classification":"WRITE","paramCount":2,"schema":"f06d2d858884","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"users:create+update"},+ {"name":"users_upsertGroupMembers","classification":"DESTRUCTIVE","paramCount":2,"schema":"b32a69080685","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"users:create+update"}+ ]+}diff --git a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json b/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.jsondeleted file mode 100644index b69d183a57..0000000000--- a/apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json+++ /dev/null@@ -1,49350 +0,0 @@-{- "generated": "2026-09-07T12:30:34.123Z",- "totalTools": 1496,- "modules": 15,- "tools": [- {- "name": "account_getNotificationPreferences",- "module": "account",- "classification": "READ",- "description": "get notification preferences",- "paramCount": 0,- "serviceParams": [- "client",- "userId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "account_upsertNotificationPreference",- "module": "account",- "classification": "WRITE",- "description": "upsert notification preference",- "paramCount": 3,- "serviceParams": [- "client",- "preference"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "topic": {- "type": "string"- },- "channel": {- "type": "string",- "enum": [- "email",- "slack"- ]- },- "enabled": {- "type": "boolean"- }- },- "required": [- "topic",- "channel",- "enabled"- ]- }- },- {- "name": "account_deleteUserAttributeValue",- "module": "account",- "classification": "DESTRUCTIVE",- "description": "delete user attribute value",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "userAttributeId": {- "type": "string"- },- "userAttributeValueId": {- "type": "string"- }- },- "required": [- "userAttributeId",- "userAttributeValueId"- ]- }- },- {- "name": "account_getAccount",- "module": "account",- "classification": "READ",- "description": "get account",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "account_getCurrentUser",- "module": "account",- "classification": "READ",- "description": "get current user",- "paramCount": 0,- "serviceParams": [- "client",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "account_getAttributes",- "module": "account",- "classification": "READ",- "description": "get attributes",- "paramCount": 1,- "serviceParams": [- "client",- "userId",- "companyId",- "isPublic"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "isPublic": {- "type": "boolean"- }- },- "required": [- "isPublic"- ]- }- },- {- "name": "account_getPrivateAttributes",- "module": "account",- "classification": "READ",- "description": "get private attributes",- "paramCount": 0,- "serviceParams": [- "client",- "userId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "account_getPublicAttributes",- "module": "account",- "classification": "READ",- "description": "get public attributes",- "paramCount": 0,- "serviceParams": [- "client",- "userId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "account_getAllAttributeCategories",- "module": "account",- "classification": "READ",- "description": "get all attribute categories",- "paramCount": 0,- "serviceParams": [- "client",- "userId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "account_getAttributeCategoryWithValues",- "module": "account",- "classification": "READ",- "description": "get attribute category with values",- "paramCount": 1,- "serviceParams": [- "client",- "categoryId",- "userId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "categoryId": {- "type": "string"- }- },- "required": [- "categoryId"- ]- }- },- {- "name": "account_updateAvatar",- "module": "account",- "classification": "WRITE",- "description": "update avatar",- "paramCount": 1,- "serviceParams": [- "client",- "userId",- "avatarUrl"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "avatarUrl": {- "type": [- "string",- "null"- ]- }- },- "required": [- "avatarUrl"- ]- }- },- {- "name": "account_updatePublicAccount",- "module": "account",- "classification": "WRITE",- "description": "update public account",- "paramCount": 5,- "serviceParams": [- "client",- "account"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "firstName": {- "type": "string"- },- "lastName": {- "type": "string"- },- "about": {- "type": "string"- },- "phone": {- "type": "string"- }- },- "required": [- "id",- "firstName",- "lastName"- ]- }- },- {- "name": "account_upsertUserAttributeValue",- "module": "account",- "classification": "WRITE",- "description": "upsert user attribute value",- "paramCount": 4,- "serviceParams": [- "client",- "update"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "userAttributeValueId": {},- "userAttributeId": {- "type": "string"- },- "value": {},- "type": {- "type": "string"- }- },- "required": [- "userAttributeId",- "value",- "type"- ]- }- },- {- "name": "accounting_getTrialBalance",- "module": "accounting",- "classification": "READ",- "description": "get trial balance",- "paramCount": 2,- "serviceParams": [- "client",- "companyGroupId",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "startDate": {- "type": [- "string",- "null"- ]- },- "endDate": {- "type": [- "string",- "null"- ]- }- },- "required": [- "startDate",- "endDate"- ]- }- },- {- "name": "accounting_getAccountLedger",- "module": "accounting",- "classification": "READ",- "description": "get account ledger",- "paramCount": 6,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "accountId": {- "type": "string"- },- "companyIds": {- "type": "array",- "items": {- "type": "string"- }- },- "startDate": {- "type": [- "string",- "null"- ]- },- "endDate": {- "type": [- "string",- "null"- ]- },- "limit": {- "type": "number"- },- "offset": {- "type": "number"- }- },- "required": [- "accountId",- "startDate",- "endDate",- "limit",- "offset"- ]- }- },- {- "name": "accounting_getAccountLedgerSummary",- "module": "accounting",- "classification": "READ",- "description": "get account ledger summary",- "paramCount": 3,- "serviceParams": [- "client",- "companyGroupId",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "accountId": {- "type": "string"- },- "startDate": {- "type": [- "string",- "null"- ]- },- "endDate": {- "type": [- "string",- "null"- ]- }- },- "required": [- "accountId",- "startDate",- "endDate"- ]- }- },- {- "name": "accounting_getFinancialStatementBalances",- "module": "accounting",- "classification": "READ",- "description": "get financial statement balances",- "paramCount": 3,- "serviceParams": [- "client",- "companyGroupId",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "startDate": {- "type": [- "string",- "null"- ]- },- "endDate": {- "type": [- "string",- "null"- ]- },- "includeCurrentYearEarnings": {- "type": "boolean"- }- },- "required": [- "startDate",- "endDate"- ]- }- },- {- "name": "accounting_getAccountPeriodSeries",- "module": "accounting",- "classification": "READ",- "description": "get account period series",- "paramCount": 2,- "serviceParams": [- "client",- "companyGroupId",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "start": {- "type": "string"- },- "periodEnds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "start",- "periodEnds"- ]- }- },- {- "name": "accounting_translateCompanyPeriodSeries",- "module": "accounting",- "classification": "WRITE",- "description": "translate company period series",- "paramCount": 3,- "serviceParams": [- "client",- "companyGroupId",- "companyId",- "targetCurrency",- "buckets",- "series"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "targetCurrency": {- "type": "string"- },- "buckets": {- "type": "array",- "items": {}- },- "series": {}- },- "required": [- "targetCurrency",- "buckets",- "series"- ]- }- },- {- "name": "accounting_getFinancialStatementPeriodSeries",- "module": "accounting",- "classification": "READ",- "description": "get financial statement period series",- "paramCount": 3,- "serviceParams": [- "client",- "companyGroupId",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "buckets": {- "type": "array",- "items": {}- },- "includeCurrentYearEarnings": {- "type": "boolean"- },- "translate": {- "type": "object",- "properties": {- "targetCurrency": {- "type": "string"- }- },- "required": [- "targetCurrency"- ]- }- },- "required": [- "buckets"- ]- }- },- {- "name": "accounting_getConsolidatedPeriodSeries",- "module": "accounting",- "classification": "READ",- "description": "get consolidated period series",- "paramCount": 6,- "serviceParams": [- "client",- "companyGroupId",- "companyIds",- "targetCurrency",- "args",- "// Privileged (service-role) client used ONLY to read elimination entities.\n // Those are synthetic consolidation companies that no user is a member of",- "so\n // their ledger is invisible to the RLS-scoped `client` and their reversing\n // entries would silently drop out of the consolidation (intercompany balances\n // never eliminate). The route already authorized the user for this group",- "and\n // reads stay scoped to `companyGroupId`. Operating companies still read via the\n // RLS `client`. Defaults to `client` (no elimination visibility) when omitted.\n eliminationClient"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "companyIds": {- "type": "array",- "items": {- "type": "string"- }- },- "targetCurrency": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "buckets": {- "type": "array",- "items": {}- },- "includeCurrentYearEarnings": {- "type": "boolean"- }- },- "required": [- "buckets"- ]- },- "// Privileged (service-role) client used ONLY to read elimination entities.\n // Those are synthetic consolidation companies that no user is a member of": {},- "so\n // their ledger is invisible to the RLS-scoped `client` and their reversing\n // entries would silently drop out of the consolidation (intercompany balances\n // never eliminate). The route already authorized the user for this group": {},- "and\n // reads stay scoped to `companyGroupId`. Operating companies still read via the\n // RLS `client`. Defaults to `client` (no elimination visibility) when omitted.\n eliminationClient": {}- },- "required": [- "companyIds",- "targetCurrency",- "args",- "// Privileged (service-role) client used ONLY to read elimination entities.\n // Those are synthetic consolidation companies that no user is a member of",- "so\n // their ledger is invisible to the RLS-scoped `client` and their reversing\n // entries would silently drop out of the consolidation (intercompany balances\n // never eliminate). The route already authorized the user for this group",- "and\n // reads stay scoped to `companyGroupId`. Operating companies still read via the\n // RLS `client`. Defaults to `client` (no elimination visibility) when omitted.\n eliminationClient"- ]- }- },- {- "name": "accounting_getReportPins",- "module": "accounting",- "classification": "READ",- "description": "get report pins",- "paramCount": 0,- "serviceParams": [- "client",- "userId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_upsertReportPin",- "module": "accounting",- "classification": "WRITE",- "description": "upsert report pin",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "reportKey": {- "type": "string"- },- "pinned": {- "type": "boolean"- }- },- "required": [- "reportKey",- "pinned"- ]- }- },- {- "name": "accounting_getAccountsInScope",- "module": "accounting",- "classification": "READ",- "description": "get accounts in scope",- "paramCount": 2,- "serviceParams": [- "client",- "companyGroupId",- "scope",- "scrapAccountIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "scope": {},- "scrapAccountIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "scope"- ]- }- },- {- "name": "accounting_getDimensionPivot",- "module": "accounting",- "classification": "READ",- "description": "get dimension pivot",- "paramCount": 6,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "report": {},- "scrapAccountIds": {- "type": "array",- "items": {- "type": "string"- }- },- "startDate": {- "type": "string"- },- "endDate": {- "type": "string"- },- "periodEnds": {- "type": "array",- "items": {- "type": "string"- }- },- "state": {}- },- "required": [- "report",- "startDate",- "endDate",- "state"- ]- }- },- {- "name": "accounting_getDimensionPivotLines",- "module": "accounting",- "classification": "READ",- "description": "get dimension pivot lines",- "paramCount": 17,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "report": {},- "scrapAccountIds": {- "type": "array",- "items": {- "type": "string"- }- },- "startDate": {- "type": "string"- },- "endDate": {- "type": "string"- },- "filters": {},- "rowDimension1": {- "type": "string"- },- "rowValue1": {- "type": "string"- },- "rowValue1IsNull": {- "type": "boolean"- },- "rowDimension2": {- "type": "string"- },- "rowValue2": {- "type": "string"- },- "rowValue2IsNull": {- "type": "boolean"- },- "columnDimension": {- "type": "string"- },- "columnValue": {- "type": "string"- },- "columnValueIsNull": {- "type": "boolean"- },- "columnPeriodStart": {- "type": "string"- },- "columnPeriodEnd": {- "type": "string"- },- "accountIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "report",- "startDate",- "endDate",- "filters"- ]- }- },- {- "name": "accounting_getPurchaseLinePivot",- "module": "accounting",- "classification": "READ",- "description": "get purchase line pivot",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "startDate": {- "type": "string"- },- "endDate": {- "type": "string"- },- "periodEnds": {- "type": "array",- "items": {- "type": "string"- }- },- "state": {}- },- "required": [- "startDate",- "endDate",- "state"- ]- }- },- {- "name": "accounting_getPurchaseLinePivotLines",- "module": "accounting",- "classification": "READ",- "description": "get purchase line pivot lines",- "paramCount": 10,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "startDate": {- "type": "string"- },- "endDate": {- "type": "string"- },- "rowField1": {- "type": "string"- },- "rowValue1": {- "type": "string"- },- "rowField2": {- "type": "string"- },- "rowValue2": {- "type": "string"- },- "columnField": {- "type": "string"- },- "columnValue": {- "type": "string"- },- "columnPeriodStart": {- "type": "string"- },- "columnPeriodEnd": {- "type": "string"- }- },- "required": [- "startDate",- "endDate"- ]- }- },- {- "name": "accounting_getReportViews",- "module": "accounting",- "classification": "READ",- "description": "get report views",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "reportKey": {- "type": "string"- }- }- }- },- {- "name": "accounting_upsertReportView",- "module": "accounting",- "classification": "WRITE",- "description": "upsert report view",- "paramCount": 1,- "serviceParams": [- "client",- "view"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "view": {}- },- "required": [- "view"- ]- }- },- {- "name": "accounting_deleteReportView",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete report view",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_getCompaniesInGroup",- "module": "accounting",- "classification": "READ",- "description": "get companies in group",- "paramCount": 0,- "serviceParams": [- "client",- "companyGroupId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_deleteAccount",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete account",- "paramCount": 1,- "serviceParams": [- "client",- "accountId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "accountId": {- "type": "string"- }- },- "required": [- "accountId"- ]- }- },- {- "name": "accounting_deletePaymentTerm",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete payment term",- "paramCount": 1,- "serviceParams": [- "client",- "paymentTermId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "paymentTermId": {- "type": "string"- }- },- "required": [- "paymentTermId"- ]- }- },- {- "name": "accounting_getAccount",- "module": "accounting",- "classification": "READ",- "description": "get account",- "paramCount": 1,- "serviceParams": [- "client",- "accountId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "accountId": {- "type": "string"- }- },- "required": [- "accountId"- ]- }- },- {- "name": "accounting_getAccounts",- "module": "accounting",- "classification": "READ",- "description": "get accounts",- "paramCount": 3,- "serviceParams": [- "client",- "companyGroupId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "accounting_getAccountsList",- "module": "accounting",- "classification": "READ",- "description": "get accounts list",- "paramCount": 3,- "serviceParams": [- "client",- "companyGroupId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "isGroup": {- "type": [- "boolean",- "null"- ]- },- "incomeBalance": {},- "classes": {- "type": "array",- "items": {}- }- }- }- },- {- "name": "accounting_getGroupAccounts",- "module": "accounting",- "classification": "READ",- "description": "get group accounts",- "paramCount": 0,- "serviceParams": [- "client",- "companyGroupId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getBaseCurrency",- "module": "accounting",- "classification": "READ",- "description": "get base currency",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getChartOfAccounts",- "module": "accounting",- "classification": "READ",- "description": "get chart of accounts",- "paramCount": 3,- "serviceParams": [- "client",- "companyGroupId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "incomeBalance": {- "type": [- "string",- "null"- ],- "enum": [- "Income Statement",- "Balance Sheet"- ]- },- "startDate": {- "type": [- "string",- "null"- ]- },- "endDate": {- "type": [- "string",- "null"- ]- }- },- "required": [- "incomeBalance",- "startDate",- "endDate"- ]- }- },- {- "name": "accounting_getCurrency",- "module": "accounting",- "classification": "READ",- "description": "get currency",- "paramCount": 1,- "serviceParams": [- "client",- "currencyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "currencyId": {- "type": "string"- }- },- "required": [- "currencyId"- ]- }- },- {- "name": "accounting_getBaseCurrencyDecimalPlaces",- "module": "accounting",- "classification": "READ",- "description": "get base currency decimal places",- "paramCount": 0,- "serviceParams": [- "client",- "companyId",- "companyGroupId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getCurrencyByCode",- "module": "accounting",- "classification": "READ",- "description": "get currency by code",- "paramCount": 1,- "serviceParams": [- "client",- "companyGroupId",- "currencyCode"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "currencyCode": {- "type": "string"- }- },- "required": [- "currencyCode"- ]- }- },- {- "name": "accounting_getExchangeRate",- "module": "accounting",- "classification": "READ",- "description": "get exchange rate",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "currencyCode"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "currencyCode": {- "type": "string"- }- },- "required": [- "currencyCode"- ]- }- },- {- "name": "accounting_getExchangeRates",- "module": "accounting",- "classification": "READ",- "description": "get exchange rates",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_upsertExchangeRateOverride",- "module": "accounting",- "classification": "WRITE",- "description": "upsert exchange rate override",- "paramCount": 2,- "serviceParams": [- "client",- "override"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "currencyCode": {- "type": "string"- },- "rate": {- "type": "number"- }- },- "required": [- "currencyCode",- "rate"- ]- }- },- {- "name": "accounting_deleteExchangeRateOverride",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete exchange rate override",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "currencyCode"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "currencyCode": {- "type": "string"- }- },- "required": [- "currencyCode"- ]- }- },- {- "name": "accounting_getCurrencies",- "module": "accounting",- "classification": "READ",- "description": "get currencies",- "paramCount": 3,- "serviceParams": [- "client",- "companyGroupId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "accounting_getCurrenciesList",- "module": "accounting",- "classification": "READ",- "description": "get currencies list",- "paramCount": 0,- "serviceParams": [- "client",- "companyGroupId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getCurrentAccountingPeriod",- "module": "accounting",- "classification": "READ",- "description": "get current accounting period",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "date"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "date": {- "type": "string"- }- },- "required": [- "date"- ]- }- },- {- "name": "accounting_getOrCreateAccountingPeriod",- "module": "accounting",- "classification": "READ",- "description": "get or create accounting period",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "date",- "source"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "date": {- "type": "string"- },- "source": {}- },- "required": [- "date",- "source"- ]- }- },- {- "name": "accounting_getAccountingPeriods",- "module": "accounting",- "classification": "READ",- "description": "get accounting periods",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getAccountingPeriodDeletability",- "module": "accounting",- "classification": "READ",- "description": "get accounting period deletability",- "paramCount": 1,- "serviceParams": [- "client",- "periodId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "periodId": {- "type": "string"- }- },- "required": [- "periodId"- ]- }- },- {- "name": "accounting_deleteAccountingPeriod",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete accounting period",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "periodId": {- "type": "string"- }- },- "required": [- "periodId"- ]- }- },- {- "name": "accounting_getFiscalCalendarCommitted",- "module": "accounting",- "classification": "READ",- "description": "get fiscal calendar committed",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_lockAccountingPeriod",- "module": "accounting",- "classification": "WRITE",- "description": "lock accounting period",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "periodId": {- "type": "string"- }- },- "required": [- "periodId"- ]- }- },- {- "name": "accounting_unlockAccountingPeriod",- "module": "accounting",- "classification": "WRITE",- "description": "unlock accounting period",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "periodId": {- "type": "string"- }- },- "required": [- "periodId"- ]- }- },- {- "name": "accounting_closeAccountingPeriod",- "module": "accounting",- "classification": "WRITE",- "description": "close accounting period",- "paramCount": 1,- "serviceParams": [- "client",- "db",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "periodId": {- "type": "string"- }- },- "required": [- "periodId"- ]- }- },- {- "name": "accounting_closePeriodWithChecklist",- "module": "accounting",- "classification": "WRITE",- "description": "close period with checklist",- "paramCount": 1,- "serviceParams": [- "client",- "db",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "periodId": {- "type": "string"- }- },- "required": [- "periodId"- ]- }- },- {- "name": "accounting_reopenAccountingPeriod",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "reopen accounting period",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "periodId": {- "type": "string"- }- },- "required": [- "periodId"- ]- }- },- {- "name": "accounting_createFiscalYearPeriods",- "module": "accounting",- "classification": "WRITE",- "description": "create fiscal year periods",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "fiscalYear": {- "type": "number"- }- },- "required": [- "fiscalYear"- ]- }- },- {- "name": "accounting_getPeriodExternalGlSyncReadiness",- "module": "accounting",- "classification": "READ",- "description": "get period external gl sync readiness",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "startDate",- "endDate"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "startDate": {- "type": "string"- },- "endDate": {- "type": "string"- }- },- "required": [- "startDate",- "endDate"- ]- }- },- {- "name": "accounting_getPeriodCloseReadiness",- "module": "accounting",- "classification": "READ",- "description": "get period close readiness",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "periodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "periodId": {- "type": "string"- }- },- "required": [- "periodId"- ]- }- },- {- "name": "accounting_evaluateCloseChecklist",- "module": "accounting",- "classification": "WRITE",- "description": "evaluate close checklist",- "paramCount": 3,- "serviceParams": [- "tasks",- "checks",- "closeStatus"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "tasks": {- "type": "array",- "items": {}- },- "checks": {- "type": "array",- "items": {}- },- "closeStatus": {- "type": "string"- }- },- "required": [- "tasks",- "checks",- "closeStatus"- ]- }- },- {- "name": "accounting_getPeriodCloseChecklist",- "module": "accounting",- "classification": "READ",- "description": "get period close checklist",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "periodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "periodId": {- "type": "string"- }- },- "required": [- "periodId"- ]- }- },- {- "name": "accounting_completeCloseTask",- "module": "accounting",- "classification": "WRITE",- "description": "complete close task",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "taskId": {- "type": "string"- },- "notes": {- "type": "string"- }- },- "required": [- "taskId"- ]- }- },- {- "name": "accounting_skipCloseTask",- "module": "accounting",- "classification": "WRITE",- "description": "skip close task",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "taskId": {- "type": "string"- },- "skippedReason": {- "type": "string"- }- },- "required": [- "taskId",- "skippedReason"- ]- }- },- {- "name": "accounting_addCloseTask",- "module": "accounting",- "classification": "WRITE",- "description": "add close task",- "paramCount": 5,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "periodId": {- "type": "string"- },- "name": {- "type": "string"- },- "taskType": {- "type": "string"- },- "required": {- "type": "boolean"- },- "assigneeId": {- "type": "string"- }- },- "required": [- "periodId",- "name",- "taskType",- "required"- ]- }- },- {- "name": "accounting_getPeriodCloseTaskDefinitions",- "module": "accounting",- "classification": "READ",- "description": "get period close task definitions",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_upsertPeriodCloseTaskDefinition",- "module": "accounting",- "classification": "WRITE",- "description": "upsert period close task definition",- "paramCount": 9,- "serviceParams": [- "client",- "definition"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "taskType": {- "type": "string"- },- "autoCheckKey": {- "type": "string"- },- "sortOrder": {- "type": "number"- },- "required": {- "type": "string"- },- "severity": {- "type": "string"- },- "active": {- "type": "string"- },- "defaultAssigneeId": {- "type": "string"- }- },- "required": [- "name",- "taskType",- "required",- "active"- ]- }- },- {- "name": "accounting_deletePeriodCloseTaskDefinition",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete period close task definition",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_getDefaultAccounts",- "module": "accounting",- "classification": "READ",- "description": "get default accounts",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getScrapAccountIds",- "module": "accounting",- "classification": "READ",- "description": "get scrap account ids",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getFiscalYearSettings",- "module": "accounting",- "classification": "READ",- "description": "get fiscal year settings",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getPaymentTerm",- "module": "accounting",- "classification": "READ",- "description": "get payment term",- "paramCount": 1,- "serviceParams": [- "client",- "paymentTermId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "paymentTermId": {- "type": "string"- }- },- "required": [- "paymentTermId"- ]- }- },- {- "name": "accounting_getPaymentTerms",- "module": "accounting",- "classification": "READ",- "description": "get payment terms",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "accounting_getPaymentTermsList",- "module": "accounting",- "classification": "READ",- "description": "get payment terms list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_updateDefaultBalanceSheetAccounts",- "module": "accounting",- "classification": "WRITE",- "description": "update default balance sheet accounts",- "paramCount": 21,- "serviceParams": [- "client",- "defaultAccounts"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "rawMaterialsAccount": {- "type": "string"- },- "finishedGoodsAccount": {- "type": "string"- },- "goodsReceivedNotInvoicedAccount": {- "type": "string"- },- "workInProgressAccount": {- "type": "string"- },- "receivablesAccount": {- "type": "string"- },- "bankCashAccount": {- "type": "string"- },- "bankLocalCurrencyAccount": {- "type": "string"- },- "bankForeignCurrencyAccount": {- "type": "string"- },- "assetAquisitionCostAccount": {- "type": "string"- },- "assetAquisitionCostOnDisposalAccount": {- "type": "string"- },- "accumulatedDepreciationAccount": {- "type": "string"- },- "accumulatedDepreciationOnDisposalAccount": {- "type": "string"- },- "prepaymentAccount": {- "type": "string"- },- "supplierPrepaymentAccount": {- "type": "string"- },- "payablesAccount": {- "type": "string"- },- "salesTaxPayableAccount": {- "type": "string"- },- "purchaseTaxPayableAccount": {- "type": "string"- },- "reverseChargeSalesTaxPayableAccount": {- "type": "string"- },- "retainedEarningsAccount": {- "type": "string"- },- "currencyTranslationAccount": {- "type": "string"- },- "deferredTaxLiabilityAccountId": {- "type": "string"- }- },- "required": [- "rawMaterialsAccount",- "finishedGoodsAccount",- "goodsReceivedNotInvoicedAccount",- "workInProgressAccount",- "receivablesAccount",- "bankCashAccount",- "bankLocalCurrencyAccount",- "bankForeignCurrencyAccount",- "assetAquisitionCostAccount",- "assetAquisitionCostOnDisposalAccount",- "accumulatedDepreciationAccount",- "accumulatedDepreciationOnDisposalAccount",- "prepaymentAccount",- "supplierPrepaymentAccount",- "payablesAccount",- "salesTaxPayableAccount",- "purchaseTaxPayableAccount",- "reverseChargeSalesTaxPayableAccount",- "retainedEarningsAccount",- "currencyTranslationAccount",- "deferredTaxLiabilityAccountId"- ]- }- },- {- "name": "accounting_updateDefaultIncomeAccounts",- "module": "accounting",- "classification": "WRITE",- "description": "update default income accounts",- "paramCount": 28,- "serviceParams": [- "client",- "defaultAccounts"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "salesAccount": {- "type": "string"- },- "salesDiscountAccount": {- "type": "string"- },- "costOfGoodsSoldAccount": {- "type": "string"- },- "purchaseVarianceAccount": {- "type": "string"- },- "inventoryAdjustmentVarianceAccount": {- "type": "string"- },- "scrapAccount": {- "type": "string"- },- "materialVarianceAccount": {- "type": "string"- },- "laborAndMachineVarianceAccount": {- "type": "string"- },- "overheadVarianceAccount": {- "type": "string"- },- "lotSizeVarianceAccount": {- "type": "string"- },- "subcontractingVarianceAccount": {- "type": "string"- },- "laborAbsorptionAccount": {- "type": "string"- },- "overheadAbsorptionAccount": {- "type": "string"- },- "indirectCostAccount": {- "type": "string"- },- "maintenanceAccount": {- "type": "string"- },- "assetDepreciationExpenseAccount": {- "type": "string"- },- "assetGainOnDisposalAccount": {- "type": "string"- },- "assetLossOnDisposalAccount": {- "type": "string"- },- "serviceChargeAccount": {- "type": "string"- },- "interestAccount": {- "type": "string"- },- "supplierPaymentDiscountAccount": {- "type": "string"- },- "customerPaymentDiscountAccount": {- "type": "string"- },- "customerWriteOffAccount": {- "type": "string"- },- "supplierWriteOffAccount": {- "type": "string"- },- "realizedExchangeGainAccount": {- "type": "string"- },- "realizedExchangeLossAccount": {- "type": "string"- },- "roundingAccount": {- "type": "string"- },- "deferredTaxExpenseAccountId": {- "type": "string"- }- },- "required": [- "salesAccount",- "salesDiscountAccount",- "costOfGoodsSoldAccount",- "purchaseVarianceAccount",- "inventoryAdjustmentVarianceAccount",- "materialVarianceAccount",- "laborAndMachineVarianceAccount",- "overheadVarianceAccount",- "lotSizeVarianceAccount",- "subcontractingVarianceAccount",- "laborAbsorptionAccount",- "indirectCostAccount",- "maintenanceAccount",- "assetDepreciationExpenseAccount",- "assetGainOnDisposalAccount",- "assetLossOnDisposalAccount",- "serviceChargeAccount",- "interestAccount",- "supplierPaymentDiscountAccount",- "customerPaymentDiscountAccount",- "customerWriteOffAccount",- "supplierWriteOffAccount",- "realizedExchangeGainAccount",- "realizedExchangeLossAccount",- "roundingAccount",- "deferredTaxExpenseAccountId"- ]- }- },- {- "name": "accounting_updateFiscalYearSettings",- "module": "accounting",- "classification": "WRITE",- "description": "update fiscal year settings",- "paramCount": 2,- "serviceParams": [- "client",- "fiscalYearSettings"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "startMonth": {- "type": "string"- },- "taxStartMonth": {- "type": "string"- }- },- "required": [- "startMonth",- "taxStartMonth"- ]- }- },- {- "name": "accounting_upsertAccount",- "module": "accounting",- "classification": "WRITE",- "description": "upsert account",- "paramCount": 1,- "serviceParams": [- "client",- "account"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "account": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "account",- "_operation"- ]- }- },- {- "name": "accounting_upsertCurrency",- "module": "accounting",- "classification": "WRITE",- "description": "upsert currency",- "paramCount": 4,- "serviceParams": [- "client",- "currency"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "code": {- "type": "string"- },- "decimalPlaces": {- "type": "number"- },- "historicalExchangeRate": {- "type": "number"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "code",- "_operation"- ]- }- },- {- "name": "accounting_upsertPaymentTerm",- "module": "accounting",- "classification": "WRITE",- "description": "upsert payment term",- "paramCount": 6,- "serviceParams": [- "client",- "paymentTerm"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "daysDue": {- "type": "number"- },- "daysDiscount": {- "type": "number"- },- "discountPercentage": {- "type": "number"- },- "calculationMethod": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "calculationMethod",- "_operation"- ]- }- },- {- "name": "accounting_deleteCostCenter",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete cost center",- "paramCount": 1,- "serviceParams": [- "client",- "costCenterId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "costCenterId": {- "type": "string"- }- },- "required": [- "costCenterId"- ]- }- },- {- "name": "accounting_getCostCenter",- "module": "accounting",- "classification": "READ",- "description": "get cost center",- "paramCount": 1,- "serviceParams": [- "client",- "costCenterId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "costCenterId": {- "type": "string"- }- },- "required": [- "costCenterId"- ]- }- },- {- "name": "accounting_getCostCenters",- "module": "accounting",- "classification": "READ",- "description": "get cost centers",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "accounting_getCostCentersList",- "module": "accounting",- "classification": "READ",- "description": "get cost centers list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getCostCentersTree",- "module": "accounting",- "classification": "READ",- "description": "get cost centers tree",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_upsertCostCenter",- "module": "accounting",- "classification": "WRITE",- "description": "upsert cost center",- "paramCount": 4,- "serviceParams": [- "client",- "costCenter"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "parentCostCenterId": {- "type": "string"- },- "ownerId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "ownerId",- "_operation"- ]- }- },- {- "name": "accounting_getDimensions",- "module": "accounting",- "classification": "READ",- "description": "get dimensions",- "paramCount": 3,- "serviceParams": [- "client",- "companyGroupId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "accounting_getDimension",- "module": "accounting",- "classification": "READ",- "description": "get dimension",- "paramCount": 1,- "serviceParams": [- "client",- "dimensionId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dimensionId": {- "type": "string"- }- },- "required": [- "dimensionId"- ]- }- },- {- "name": "accounting_upsertDimension",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "upsert dimension",- "paramCount": 2,- "serviceParams": [- "client",- "dimension",- "dimensionValues"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "dimension": {},- "dimensionValues": {- "type": "array",- "items": {- "type": "string"- }- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "dimension",- "_operation"- ]- }- },- {- "name": "accounting_deleteDimension",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete dimension",- "paramCount": 1,- "serviceParams": [- "client",- "dimensionId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dimensionId": {- "type": "string"- }- },- "required": [- "dimensionId"- ]- }- },- {- "name": "accounting_getActiveDimensionsWithValues",- "module": "accounting",- "classification": "READ",- "description": "get active dimensions with values",- "paramCount": 0,- "serviceParams": [- "client",- "companyGroupId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getJournalLineDimensions",- "module": "accounting",- "classification": "READ",- "description": "get journal line dimensions",- "paramCount": 1,- "serviceParams": [- "client",- "journalLineIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "journalLineIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "journalLineIds"- ]- }- },- {- "name": "accounting_saveJournalLineDimensions",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "save journal line dimensions",- "paramCount": 2,- "serviceParams": [- "client",- "journalLineId",- "companyId",- "dimensions"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "journalLineId": {- "type": "string"- },- "dimensions": {}- },- "required": [- "journalLineId",- "dimensions"- ]- }- },- {- "name": "accounting_translateCompanyBalances",- "module": "accounting",- "classification": "WRITE",- "description": "translate company balances",- "paramCount": 5,- "serviceParams": [- "client",- "companyGroupId",- "companyId",- "targetCurrency",- "periodEnd",- "periodStart",- "// Rows from getFinancialStatementBalances for the same company/dates —\n // translation only needs balanceAtDate + consolidatedRate",- "so re-running\n // the full journalLine scan through the translateTrialBalance RPC would\n // double the cost of every translated statement.\n balances"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "targetCurrency": {- "type": "string"- },- "periodEnd": {- "type": "string"- },- "periodStart": {},- "// Rows from getFinancialStatementBalances for the same company/dates —\n // translation only needs balanceAtDate + consolidatedRate": {},- "so re-running\n // the full journalLine scan through the translateTrialBalance RPC would\n // double the cost of every translated statement.\n balances": {}- },- "required": [- "targetCurrency",- "periodEnd",- "periodStart",- "// Rows from getFinancialStatementBalances for the same company/dates —\n // translation only needs balanceAtDate + consolidatedRate",- "so re-running\n // the full journalLine scan through the translateTrialBalance RPC would\n // double the cost of every translated statement.\n balances"- ]- }- },- {- "name": "accounting_getConsolidatedBalances",- "module": "accounting",- "classification": "READ",- "description": "get consolidated balances",- "paramCount": 5,- "serviceParams": [- "client",- "companyGroupId",- "companyIds",- "targetCurrency",- "periodEnd",- "periodStart",- "// Privileged (service-role) client used ONLY for elimination entities — see\n // getConsolidatedPeriodSeries. Without it their reversing entries are hidden by\n // RLS and intercompany balances never eliminate. Defaults to `client`.\n eliminationClient"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "companyIds": {- "type": "array",- "items": {- "type": "string"- }- },- "targetCurrency": {- "type": "string"- },- "periodEnd": {- "type": "string"- },- "periodStart": {- "type": "string"- },- "// Privileged (service-role) client used ONLY for elimination entities — see\n // getConsolidatedPeriodSeries. Without it their reversing entries are hidden by\n // RLS and intercompany balances never eliminate. Defaults to `client`.\n eliminationClient": {}- },- "required": [- "companyIds",- "targetCurrency",- "periodEnd",- "// Privileged (service-role) client used ONLY for elimination entities — see\n // getConsolidatedPeriodSeries. Without it their reversing entries are hidden by\n // RLS and intercompany balances never eliminate. Defaults to `client`.\n eliminationClient"- ]- }- },- {- "name": "accounting_getIntercompanyTransactions",- "module": "accounting",- "classification": "READ",- "description": "get intercompany transactions",- "paramCount": 3,- "serviceParams": [- "client",- "companyGroupId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "status": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "accounting_createIntercompanyTransaction",- "module": "accounting",- "classification": "WRITE",- "description": "create intercompany transaction",- "paramCount": 1,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "input": {}- },- "required": [- "input"- ]- }- },- {- "name": "accounting_getIntercompanyEliminationLines",- "module": "accounting",- "classification": "READ",- "description": "get intercompany elimination lines",- "paramCount": 1,- "serviceParams": [- "client",- "transactionIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "transactionIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "transactionIds"- ]- }- },- {- "name": "accounting_runIntercompanyMatching",- "module": "accounting",- "classification": "WRITE",- "description": "run intercompany matching",- "paramCount": 0,- "serviceParams": [- "client",- "companyGroupId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_generateEliminations",- "module": "accounting",- "classification": "WRITE",- "description": "generate eliminations",- "paramCount": 1,- "serviceParams": [- "client",- "companyGroupId",- "userId",- "regenerate = false"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "regenerate = false": {}- },- "required": [- "regenerate = false"- ]- }- },- {- "name": "accounting_getIntercompanyBalance",- "module": "accounting",- "classification": "READ",- "description": "get intercompany balance",- "paramCount": 0,- "serviceParams": [- "client",- "companyGroupId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getExchangeRateHistory",- "module": "accounting",- "classification": "READ",- "description": "get exchange rate history",- "paramCount": 1,- "serviceParams": [- "client",- "currencyCode"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "currencyCode": {- "type": "string"- }- },- "required": [- "currencyCode"- ]- }- },- {- "name": "accounting_getJournalEntries",- "module": "accounting",- "classification": "READ",- "description": "get journal entries",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "status": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "accounting_getJournalEntry",- "module": "accounting",- "classification": "READ",- "description": "get journal entry",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_createJournalEntry",- "module": "accounting",- "classification": "WRITE",- "description": "create journal entry",- "paramCount": 3,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "description": {- "type": "string"- },- "postingDate": {- "type": "string"- }- },- "required": [- "postingDate"- ]- }- },- {- "name": "accounting_updateJournalEntry",- "module": "accounting",- "classification": "WRITE",- "description": "update journal entry",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "data": {}- },- "required": [- "id",- "data"- ]- }- },- {- "name": "accounting_deleteJournalEntry",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete journal entry",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_upsertJournalEntryLine",- "module": "accounting",- "classification": "WRITE",- "description": "upsert journal entry line",- "paramCount": 35,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "entityType": {- "type": "string"- },- "active": {- "type": "string"- },- "required": {- "type": "string"- },- "dimensionValues": {- "type": "string"- },- "description": {- "type": "string"- },- "depreciationMethod": {- "type": "string"- },- "usefulLifeMonths": {- "type": "number"- },- "residualValuePercent": {- "type": "number"- },- "assetAccountId": {- "type": "string"- },- "accumulatedDepreciationAccountId": {- "type": "string"- },- "depreciationExpenseAccountId": {- "type": "string"- },- "writeOffAccountId": {- "type": "string"- },- "writeDownAccountId": {- "type": "string"- },- "gainOnDisposalAccountId": {- "type": "string"- },- "lossOnDisposalAccountId": {- "type": "string"- },- "taxDepreciationMethod": {- "type": "string"- },- "taxUsefulLifeMonths": {- "type": "number"- },- "taxResidualValuePercent": {- "type": "number"- },- "macrsPropertyClass": {- "type": "string"- },- "macrsConvention": {- "type": "string"- },- "bonusDepreciationPercent": {- "type": "number"- },- "fixedAssetClassId": {- "type": "string"- },- "serialNumber": {- "type": "string"- },- "assetLifetimeUsage": {- "type": "number"- },- "locationId": {- "type": "string"- },- "periodEnd": {- "type": "string"- },- "fixedAssetId": {- "type": "string"- },- "periodStart": {- "type": "string"- },- "unitsProduced": {- "type": "number"- },- "disposalDate": {- "type": "string"- },- "acquisitionCost": {- "type": "number"- },- "acquisitionDate": {- "type": "string"- },- "accumulatedDepreciation": {- "type": "number"- }- },- "required": [- "name",- "entityType",- "active",- "required",- "depreciationMethod",- "assetAccountId",- "accumulatedDepreciationAccountId",- "depreciationExpenseAccountId",- "writeOffAccountId",- "writeDownAccountId",- "gainOnDisposalAccountId",- "lossOnDisposalAccountId",- "fixedAssetClassId",- "periodEnd",- "fixedAssetId",- "periodStart",- "disposalDate",- "acquisitionDate"- ]- }- },- {- "name": "accounting_deleteJournalEntryLine",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete journal entry line",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_saveJournalEntryWithLines",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "save journal entry with lines",- "paramCount": 4,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "journalEntryId": {- "type": "string"- },- "postingDate": {- "type": "string"- },- "description": {- "type": "string"- },- "lines: Array<{\n accountId: string;\n description": {}- },- "required": [- "journalEntryId",- "postingDate"- ]- }- },- {- "name": "accounting_postJournalEntry",- "module": "accounting",- "classification": "WRITE",- "description": "post journal entry",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_getExistingOpeningBalanceEntry",- "module": "accounting",- "classification": "READ",- "description": "get existing opening balance entry",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_createOpeningBalanceJournal",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "create opening balance journal",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "postingDate": {- "type": "string"- },- "balances": {}- },- "required": [- "postingDate",- "balances"- ]- }- },- {- "name": "accounting_reverseJournalEntry",- "module": "accounting",- "classification": "WRITE",- "description": "reverse journal entry",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "data"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "data": {- "type": "object",- "properties": {- "journalEntryId": {- "type": "string"- }- }- }- },- "required": [- "id",- "data"- ]- }- },- {- "name": "accounting_getFixedAssetClasses",- "module": "accounting",- "classification": "READ",- "description": "get fixed asset classes",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "accounting_getFixedAssetClass",- "module": "accounting",- "classification": "READ",- "description": "get fixed asset class",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_getFixedAssetClassesList",- "module": "accounting",- "classification": "READ",- "description": "get fixed asset classes list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_upsertFixedAssetClass",- "module": "accounting",- "classification": "WRITE",- "description": "upsert fixed asset class",- "paramCount": 1,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "data": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "data",- "_operation"- ]- }- },- {- "name": "accounting_deleteFixedAssetClass",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete fixed asset class",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_getFixedAssets",- "module": "accounting",- "classification": "READ",- "description": "get fixed assets",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "status": {}- }- }- }- }- },- {- "name": "accounting_getFixedAsset",- "module": "accounting",- "classification": "READ",- "description": "get fixed asset",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_getFixedAssetsList",- "module": "accounting",- "classification": "READ",- "description": "get fixed assets list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_getFixedAssetsListForSale",- "module": "accounting",- "classification": "READ",- "description": "get fixed assets list for sale",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "accounting_insertFixedAsset",- "module": "accounting",- "classification": "WRITE",- "description": "insert fixed asset",- "paramCount": 17,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "fixedAssetId": {- "type": "string"- },- "fixedAssetClassId": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "serialNumber": {- "type": "string"- },- "depreciationMethod": {- "type": "string"- },- "usefulLifeMonths": {- "type": "number"- },- "residualValuePercent": {- "type": "number"- },- "assetLifetimeUsage": {- "type": [- "number",- "null"- ]- },- "locationId": {- "type": "string"- },- "status": {- "type": "string"- },- "taxDepreciationMethod": {- "type": [- "string",- "null"- ]- },- "taxUsefulLifeMonths": {- "type": [- "number",- "null"- ]- },- "taxResidualValuePercent": {- "type": [- "number",- "null"- ]- },- "macrsPropertyClass": {- "type": [- "string",- "null"- ]- },- "macrsConvention": {- "type": [- "string",- "null"- ]- },- "bonusDepreciationPercent": {- "type": [- "number",- "null"- ]- }- },- "required": [- "fixedAssetClassId",- "name",- "depreciationMethod",- "usefulLifeMonths",- "residualValuePercent"- ]- }- },- {- "name": "accounting_updateFixedAsset",- "module": "accounting",- "classification": "WRITE",- "description": "update fixed asset",- "paramCount": 16,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "fixedAssetClassId": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": [- "string",- "null"- ]- },- "serialNumber": {- "type": [- "string",- "null"- ]- },- "depreciationMethod": {- "type": "string"- },- "usefulLifeMonths": {- "type": "number"- },- "residualValuePercent": {- "type": "number"- },- "assetLifetimeUsage": {- "type": [- "number",- "null"- ]- },- "locationId": {- "type": [- "string",- "null"- ]- },- "taxDepreciationMethod": {- "type": [- "string",- "null"- ]- },- "taxUsefulLifeMonths": {- "type": [- "number",- "null"- ]- },- "taxResidualValuePercent": {- "type": [- "number",- "null"- ]- },- "macrsPropertyClass": {- "type": [- "string",- "null"- ]- },- "macrsConvention": {- "type": [- "string",- "null"- ]- },- "bonusDepreciationPercent": {- "type": [- "number",- "null"- ]- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_upsertFixedAsset",- "module": "accounting",- "classification": "WRITE",- "description": "upsert fixed asset",- "paramCount": 1,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "data": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "data",- "_operation"- ]- }- },- {- "name": "accounting_deleteFixedAsset",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete fixed asset",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_insertDepreciationRun",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "insert depreciation run",- "paramCount": 3,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "depreciationRunId": {- "type": "string"- },- "periodEnd": {- "type": "string"- },- "lines: Array<{\n fixedAssetId: string;\n amount: number;\n taxAmount": {}- },- "required": [- "periodEnd"- ]- }- },- {- "name": "accounting_deleteDepreciationRun",- "module": "accounting",- "classification": "DESTRUCTIVE",- "description": "delete depreciation run",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_getDepreciationRuns",- "module": "accounting",- "classification": "READ",- "description": "get depreciation runs",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "accounting_getDepreciationRun",- "module": "accounting",- "classification": "READ",- "description": "get depreciation run",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "accounting_getDepreciationRunLines",- "module": "accounting",- "classification": "READ",- "description": "get depreciation run lines",- "paramCount": 1,- "serviceParams": [- "client",- "depreciationRunId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "depreciationRunId": {- "type": "string"- }- },- "required": [- "depreciationRunId"- ]- }- },- {- "name": "accounting_getAssetDepreciationHistory",- "module": "accounting",- "classification": "READ",- "description": "get asset depreciation history",- "paramCount": 1,- "serviceParams": [- "client",- "fixedAssetId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "fixedAssetId": {- "type": "string"- }- },- "required": [- "fixedAssetId"- ]- }- },- {- "name": "accounting_getFixedAssetDisposal",- "module": "accounting",- "classification": "READ",- "description": "get fixed asset disposal",- "paramCount": 1,- "serviceParams": [- "client",- "fixedAssetId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "fixedAssetId": {- "type": "string"- }- },- "required": [- "fixedAssetId"- ]- }- },- {- "name": "accounting_getFixedAssetUsageLogs",- "module": "accounting",- "classification": "READ",- "description": "get fixed asset usage logs",- "paramCount": 1,- "serviceParams": [- "client",- "fixedAssetId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "fixedAssetId": {- "type": "string"- }- },- "required": [- "fixedAssetId"- ]- }- },- {- "name": "accounting_upsertFixedAssetUsageLog",- "module": "accounting",- "classification": "WRITE",- "description": "upsert fixed asset usage log",- "paramCount": 1,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy"- ],- "schema": {- "type": "object",- "properties": {- "data": {}- },- "required": [- "data"- ]- }- },- {- "name": "accounting_getJournalSyncCompleteness",- "module": "accounting",- "classification": "READ",- "description": "get journal sync completeness",- "paramCount": 3,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "/** companyIntegration id, e.g. \"xero\" | \"quickbooks\" | \"rillet\". */\n integrationId": {- "type": "string"- },- "journals dated before this are out of scope. */\n syncFromDate": {- "type": "string"- },- "/** Restrict to one accounting period (the close auto-check). */\n accountingPeriodId": {- "type": "string"- }- },- "required": [- "/** companyIntegration id, e.g. \"xero\" | \"quickbooks\" | \"rillet\". */\n integrationId",- "journals dated before this are out of scope. */\n syncFromDate"- ]- }- },- {- "name": "accounting_getAccountingSyncTieOut",- "module": "accounting",- "classification": "READ",- "description": "get accounting sync tie out",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "integration": {- "type": [- "array",- "null"- ],- "items": {}- },- "accountingPeriodId": {- "type": [- "string",- "null"- ]- },- "accountId": {- "type": [- "array",- "null"- ],- "items": {}- }- }- }- },- {- "name": "accounting_getAccountingSyncTieOutCell",- "module": "accounting",- "classification": "READ",- "description": "get accounting sync tie out cell",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "cellId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "cellId": {- "type": "string"- }- },- "required": [- "cellId"- ]- }- },- {- "name": "documents_deleteDocument",- "module": "documents",- "classification": "DESTRUCTIVE",- "description": "delete document",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "documents_deleteDocumentFavorite",- "module": "documents",- "classification": "DESTRUCTIVE",- "description": "delete document favorite",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "documents_deleteDocumentLabel",- "module": "documents",- "classification": "DESTRUCTIVE",- "description": "delete document label",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "label"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "label": {- "type": "string"- }- },- "required": [- "id",- "label"- ]- }- },- {- "name": "documents_getDocument",- "module": "documents",- "classification": "READ",- "description": "get document",- "paramCount": 1,- "serviceParams": [- "client",- "documentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "documentId": {- "type": "string"- }- },- "required": [- "documentId"- ]- }- },- {- "name": "documents_getDocuments",- "module": "documents",- "classification": "READ",- "description": "get documents",- "paramCount": 6,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "favorite": {- "type": "boolean"- },- "recent": {- "type": "boolean"- },- "active": {- "type": "boolean"- }- }- }- }- }- },- {- "name": "documents_getDocumentExtensions",- "module": "documents",- "classification": "READ",- "description": "get document extensions",- "paramCount": 0,- "serviceParams": [- "client"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "documents_getDocumentLabels",- "module": "documents",- "classification": "READ",- "description": "get document labels",- "paramCount": 0,- "serviceParams": [- "client",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "documents_insertDocumentFavorite",- "module": "documents",- "classification": "WRITE",- "description": "insert document favorite",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "userId"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "documents_insertDocumentLabel",- "module": "documents",- "classification": "WRITE",- "description": "insert document label",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "label",- "companyId",- "userId"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "label": {- "type": "string"- }- },- "required": [- "id",- "label"- ]- }- },- {- "name": "documents_moveDocumentToTrash",- "module": "documents",- "classification": "WRITE",- "description": "move document to trash",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "userId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "documents_restoreDocument",- "module": "documents",- "classification": "WRITE",- "description": "restore document",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "documents_upsertDocument",- "module": "documents",- "classification": "WRITE",- "description": "upsert document",- "paramCount": 7,- "serviceParams": [- "client",- "document"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "extension": {- "type": "string"- },- "description": {- "type": "string"- },- "labels": {- "type": "array",- "items": {- "type": "string"- }- },- "readGroups": {- "type": "string"- },- "writeGroups": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "name",- "readGroups",- "writeGroups",- "_operation"- ]- }- },- {- "name": "documents_updateDocumentFavorite",- "module": "documents",- "classification": "DESTRUCTIVE",- "description": "update document favorite",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "favorite": {- "type": "boolean"- }- },- "required": [- "id",- "favorite"- ]- }- },- {- "name": "documents_updateDocumentLabels",- "module": "documents",- "classification": "DESTRUCTIVE",- "description": "update document labels",- "paramCount": 2,- "serviceParams": [- "client",- "document"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "documentId": {- "type": "string"- },- "labels": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "documentId"- ]- }- },- {- "name": "documents_insertDocumentExtraction",- "module": "documents",- "classification": "WRITE",- "description": "insert document extraction",- "paramCount": 4,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "storagePath": {- "type": "string"- },- "documentType": {- "type": "string",- "enum": [- "purchaseInvoice",- "salesRfq"- ]- },- "sourceDocument": {- "type": "string"- },- "sourceDocumentId": {- "type": "string"- }- },- "required": [- "storagePath",- "documentType",- "sourceDocument"- ]- }- },- {- "name": "inventory_deleteBatchProperty",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete batch property",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "inventory_deleteKanban",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete kanban",- "paramCount": 1,- "serviceParams": [- "client",- "kanbanId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "kanbanId": {- "type": "string"- }- },- "required": [- "kanbanId"- ]- }- },- {- "name": "inventory_deleteReceipt",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete receipt",- "paramCount": 1,- "serviceParams": [- "client",- "receiptId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "receiptId": {- "type": "string"- }- },- "required": [- "receiptId"- ]- }- },- {- "name": "inventory_deleteReceiptLine",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete receipt line",- "paramCount": 1,- "serviceParams": [- "client",- "receiptLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "receiptLineId": {- "type": "string"- }- },- "required": [- "receiptLineId"- ]- }- },- {- "name": "inventory_deleteStorageUnit",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete storage unit",- "paramCount": 1,- "serviceParams": [- "client",- "storageUnitId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "storageUnitId": {- "type": "string"- }- },- "required": [- "storageUnitId"- ]- }- },- {- "name": "inventory_deleteStorageUnitCascade",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete storage unit cascade",- "paramCount": 1,- "serviceParams": [- "client",- "storageUnitId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "storageUnitId": {- "type": "string"- }- },- "required": [- "storageUnitId"- ]- }- },- {- "name": "inventory_deleteShipment",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete shipment",- "paramCount": 1,- "serviceParams": [- "client",- "shipmentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shipmentId": {- "type": "string"- }- },- "required": [- "shipmentId"- ]- }- },- {- "name": "inventory_deleteShipmentLine",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete shipment line",- "paramCount": 1,- "serviceParams": [- "client",- "shipmentLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shipmentLineId": {- "type": "string"- }- },- "required": [- "shipmentLineId"- ]- }- },- {- "name": "inventory_deleteShippingMethod",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete shipping method",- "paramCount": 1,- "serviceParams": [- "client",- "shippingMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shippingMethodId": {- "type": "string"- }- },- "required": [- "shippingMethodId"- ]- }- },- {- "name": "inventory_deleteStockTransfer",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete stock transfer",- "paramCount": 1,- "serviceParams": [- "client",- "stockTransferId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "stockTransferId": {- "type": "string"- }- },- "required": [- "stockTransferId"- ]- }- },- {- "name": "inventory_deleteStockTransferLine",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete stock transfer line",- "paramCount": 1,- "serviceParams": [- "client",- "stockTransferLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "stockTransferLineId": {- "type": "string"- }- },- "required": [- "stockTransferLineId"- ]- }- },- {- "name": "inventory_deleteWarehouseTransfer",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete warehouse transfer",- "paramCount": 1,- "serviceParams": [- "client",- "transferId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "transferId": {- "type": "string"- }- },- "required": [- "transferId"- ]- }- },- {- "name": "inventory_deleteWarehouseTransferLine",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete warehouse transfer line",- "paramCount": 1,- "serviceParams": [- "client",- "transferLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "transferLineId": {- "type": "string"- }- },- "required": [- "transferLineId"- ]- }- },- {- "name": "inventory_getItemLedgerPage",- "module": "inventory",- "classification": "READ",- "description": "get item ledger page",- "paramCount": 4,- "serviceParams": [- "client",- "itemId",- "companyId",- "locationId",- "sortDescending",- "page"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "sortDescending": {},- "page": {}- },- "required": [- "itemId",- "locationId",- "sortDescending",- "page"- ]- }- },- {- "name": "inventory_getItemLedgerActivity",- "module": "inventory",- "classification": "READ",- "description": "get item ledger activity",- "paramCount": 5,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "omit to start from the newest entry. */\n entryNumber": {- "type": "number"- },- "direction": {- "type": "string",- "enum": [- "older",- "newer"- ]- },- "/** include the cursor row itself (used for the anchored first load). */\n inclusive": {- "type": "boolean"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "inventory_getBatchProperties",- "module": "inventory",- "classification": "READ",- "description": "get batch properties",- "paramCount": 1,- "serviceParams": [- "client",- "itemIds",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemIds"- ]- }- },- {- "name": "inventory_getInventoryItems",- "module": "inventory",- "classification": "READ",- "description": "get inventory items",- "paramCount": 2,- "serviceParams": [- "client",- "locationId",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- },- "required": [- "locationId",- "args"- ]- }- },- {- "name": "inventory_getInventoryItemsCount",- "module": "inventory",- "classification": "READ",- "description": "get inventory items count",- "paramCount": 2,- "serviceParams": [- "client",- "locationId",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- },- "required": [- "locationId",- "args"- ]- }- },- {- "name": "inventory_getInventoryValuation",- "module": "inventory",- "classification": "READ",- "description": "get inventory valuation",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "asOfDate": {- "type": [- "string",- "null"- ]- },- "locationId": {- "type": [- "string",- "null"- ]- }- }- }- },- {- "name": "inventory_getInventoryValuationTieOut",- "module": "inventory",- "classification": "READ",- "description": "get inventory valuation tie out",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "asOfDate"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "asOfDate": {- "type": [- "string",- "null"- ]- }- }- }- },- {- "name": "inventory_createInventoryReconciliationJournal",- "module": "inventory",- "classification": "WRITE",- "description": "create inventory reconciliation journal",- "paramCount": 1,- "serviceParams": [- "client",- "db",- "companyId",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "asOfDate": {- "type": "string"- }- },- "required": [- "asOfDate"- ]- }- },- {- "name": "inventory_getKanbans",- "module": "inventory",- "classification": "READ",- "description": "get kanbans",- "paramCount": 2,- "serviceParams": [- "client",- "locationId",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- },- "required": [- "locationId",- "args"- ]- }- },- {- "name": "inventory_getKanban",- "module": "inventory",- "classification": "READ",- "description": "get kanban",- "paramCount": 1,- "serviceParams": [- "client",- "kanbanId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "kanbanId": {- "type": "string"- }- },- "required": [- "kanbanId"- ]- }- },- {- "name": "inventory_getStockTransfer",- "module": "inventory",- "classification": "READ",- "description": "get stock transfer",- "paramCount": 1,- "serviceParams": [- "client",- "stockTransferId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "stockTransferId": {- "type": "string"- }- },- "required": [- "stockTransferId"- ]- }- },- {- "name": "inventory_getStockTransferLine",- "module": "inventory",- "classification": "READ",- "description": "get stock transfer line",- "paramCount": 1,- "serviceParams": [- "client",- "stockTransferLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "stockTransferLineId": {- "type": "string"- }- },- "required": [- "stockTransferLineId"- ]- }- },- {- "name": "inventory_getStockTransferLines",- "module": "inventory",- "classification": "READ",- "description": "get stock transfer lines",- "paramCount": 1,- "serviceParams": [- "client",- "stockTransferId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "stockTransferId": {- "type": "string"- }- },- "required": [- "stockTransferId"- ]- }- },- {- "name": "inventory_getStockTransferTracking",- "module": "inventory",- "classification": "READ",- "description": "get stock transfer tracking",- "paramCount": 1,- "serviceParams": [- "client",- "stockTransferId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "stockTransferId": {- "type": "string"- }- },- "required": [- "stockTransferId"- ]- }- },- {- "name": "inventory_getStockTransfers",- "module": "inventory",- "classification": "READ",- "description": "get stock transfers",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "locationId": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "inventory_getDefaultStorageUnitOrStorageUnitWithHighestQuantity",- "module": "inventory",- "classification": "READ",- "description": "get default storage unit or storage unit with highest quantity",- "paramCount": 2,- "serviceParams": [- "client",- "itemId",- "locationId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "inventory_getReceipts",- "module": "inventory",- "classification": "READ",- "description": "get receipts",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "inventory_getReceipt",- "module": "inventory",- "classification": "READ",- "description": "get receipt",- "paramCount": 1,- "serviceParams": [- "client",- "receiptId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "receiptId": {- "type": "string"- }- },- "required": [- "receiptId"- ]- }- },- {- "name": "inventory_getReceiptLines",- "module": "inventory",- "classification": "READ",- "description": "get receipt lines",- "paramCount": 1,- "serviceParams": [- "client",- "receiptId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "receiptId": {- "type": "string"- }- },- "required": [- "receiptId"- ]- }- },- {- "name": "inventory_getReceiptTracking",- "module": "inventory",- "classification": "READ",- "description": "get receipt tracking",- "paramCount": 1,- "serviceParams": [- "client",- "receiptId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "receiptId": {- "type": "string"- }- },- "required": [- "receiptId"- ]- }- },- {- "name": "inventory_getReceiptLineTracking",- "module": "inventory",- "classification": "READ",- "description": "get receipt line tracking",- "paramCount": 1,- "serviceParams": [- "client",- "receiptLineId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "receiptLineId": {- "type": "string"- }- },- "required": [- "receiptLineId"- ]- }- },- {- "name": "inventory_reconcileReceiptSerialEntities",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "reconcile receipt serial entities",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "receiptId": {- "type": "string"- },- "lines: {\n id: string;\n receivedQuantity: number | null;\n requiresSerialTracking": {- "type": "array",- "items": {}- }- },- "required": [- "receiptId"- ]- }- },- {- "name": "inventory_getReceiptFiles",- "module": "inventory",- "classification": "READ",- "description": "get receipt files",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "lineIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "lineIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "lineIds"- ]- }- },- {- "name": "inventory_getSerialNumbersForItem",- "module": "inventory",- "classification": "READ",- "description": "get serial numbers for item",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "inventory_getAvailableTrackedEntities",- "module": "inventory",- "classification": "READ",- "description": "get available tracked entities",- "paramCount": 5,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "excludeLineside": {- "type": "boolean"- },- "excludeAllocated": {- "type": "boolean"- },- "excludeLineId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "inventory_getPickOrder",- "module": "inventory",- "classification": "READ",- "description": "get pick order",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "inventory_getBatchNumbersForItem",- "module": "inventory",- "classification": "READ",- "description": "get batch numbers for item",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "isReadOnly": {- "type": "boolean"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "inventory_getStorageUnitsList",- "module": "inventory",- "classification": "READ",- "description": "get storage units list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "inventory_getStorageUnitsListForLocation",- "module": "inventory",- "classification": "READ",- "description": "get storage units list for location",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- },- "required": [- "locationId"- ]- }- },- {- "name": "inventory_getStorageUnitsTreeForLocation",- "module": "inventory",- "classification": "READ",- "description": "get storage units tree for location",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- },- "required": [- "locationId"- ]- }- },- {- "name": "inventory_getStorageUnits",- "module": "inventory",- "classification": "READ",- "description": "get storage units",- "paramCount": 2,- "serviceParams": [- "client",- "locationId",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- },- "required": [- "locationId",- "args"- ]- }- },- {- "name": "inventory_getStorageUnit",- "module": "inventory",- "classification": "READ",- "description": "get storage unit",- "paramCount": 1,- "serviceParams": [- "client",- "storageUnitId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "storageUnitId": {- "type": "string"- }- },- "required": [- "storageUnitId"- ]- }- },- {- "name": "inventory_getEffectiveWorkCenterId",- "module": "inventory",- "classification": "READ",- "description": "get effective work center id",- "paramCount": 1,- "serviceParams": [- "client",- "storageUnitId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "storageUnitId": {- "type": "string"- }- },- "required": [- "storageUnitId"- ]- }- },- {- "name": "inventory_getStorageUnitRoots",- "module": "inventory",- "classification": "READ",- "description": "get storage unit roots",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "locationId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- },- "required": [- "locationId",- "args"- ]- }- },- {- "name": "inventory_getStorageUnitChildren",- "module": "inventory",- "classification": "READ",- "description": "get storage unit children",- "paramCount": 1,- "serviceParams": [- "client",- "parentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "parentId": {- "type": "string"- }- },- "required": [- "parentId"- ]- }- },- {- "name": "inventory_getStorageUnitSubtrees",- "module": "inventory",- "classification": "READ",- "description": "get storage unit subtrees",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "locationId",- "rootIds",- "maxDepth"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "rootIds": {- "type": "array",- "items": {- "type": "string"- }- },- "maxDepth": {- "type": "number"- }- },- "required": [- "locationId",- "rootIds",- "maxDepth"- ]- }- },- {- "name": "inventory_getStorageUnitParentIdsWithChildren",- "module": "inventory",- "classification": "READ",- "description": "get storage unit parent ids with children",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- },- "required": [- "locationId"- ]- }- },- {- "name": "inventory_searchStorageUnitsWithAncestors",- "module": "inventory",- "classification": "READ",- "description": "search storage units with ancestors",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "locationId",- "search"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "search": {- "type": "string"- }- },- "required": [- "locationId",- "search"- ]- }- },- {- "name": "inventory_getStockMovements",- "module": "inventory",- "classification": "READ",- "description": "get stock movements",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "inventory_getShipments",- "module": "inventory",- "classification": "READ",- "description": "get shipments",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "inventory_getShipment",- "module": "inventory",- "classification": "READ",- "description": "get shipment",- "paramCount": 1,- "serviceParams": [- "client",- "shipmentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shipmentId": {- "type": "string"- }- },- "required": [- "shipmentId"- ]- }- },- {- "name": "inventory_getShipmentLines",- "module": "inventory",- "classification": "READ",- "description": "get shipment lines",- "paramCount": 1,- "serviceParams": [- "client",- "shipmentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shipmentId": {- "type": "string"- }- },- "required": [- "shipmentId"- ]- }- },- {- "name": "inventory_getShipmentLinesWithDetails",- "module": "inventory",- "classification": "READ",- "description": "get shipment lines with details",- "paramCount": 1,- "serviceParams": [- "client",- "shipmentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shipmentId": {- "type": "string"- }- },- "required": [- "shipmentId"- ]- }- },- {- "name": "inventory_getShipmentFiles",- "module": "inventory",- "classification": "READ",- "description": "get shipment files",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "lineIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "lineIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "lineIds"- ]- }- },- {- "name": "inventory_getShipmentRelatedItems",- "module": "inventory",- "classification": "READ",- "description": "get shipment related items",- "paramCount": 2,- "serviceParams": [- "client",- "shipmentId",- "sourceDocumentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shipmentId": {- "type": "string"- },- "sourceDocumentId": {- "type": "string"- }- },- "required": [- "shipmentId",- "sourceDocumentId"- ]- }- },- {- "name": "inventory_getShipmentTracking",- "module": "inventory",- "classification": "READ",- "description": "get shipment tracking",- "paramCount": 1,- "serviceParams": [- "client",- "shipmentId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shipmentId": {- "type": "string"- }- },- "required": [- "shipmentId"- ]- }- },- {- "name": "inventory_getShipmentLineTracking",- "module": "inventory",- "classification": "READ",- "description": "get shipment line tracking",- "paramCount": 1,- "serviceParams": [- "client",- "shipmentLineId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shipmentLineId": {- "type": "string"- }- },- "required": [- "shipmentLineId"- ]- }- },- {- "name": "inventory_getShippingMethod",- "module": "inventory",- "classification": "READ",- "description": "get shipping method",- "paramCount": 1,- "serviceParams": [- "client",- "shippingMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shippingMethodId": {- "type": "string"- }- },- "required": [- "shippingMethodId"- ]- }- },- {- "name": "inventory_getShippingMethods",- "module": "inventory",- "classification": "READ",- "description": "get shipping methods",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "inventory_getShippingMethodsList",- "module": "inventory",- "classification": "READ",- "description": "get shipping methods list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "inventory_getShippingTermsList",- "module": "inventory",- "classification": "READ",- "description": "get shipping terms list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "inventory_getTrackedEntities",- "module": "inventory",- "classification": "READ",- "description": "get tracked entities",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "inventory_getTrackedEntitiesByMakeMethodId",- "module": "inventory",- "classification": "READ",- "description": "get tracked entities by make method id",- "paramCount": 1,- "serviceParams": [- "client",- "jobMakeMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobMakeMethodId": {- "type": "string"- }- },- "required": [- "jobMakeMethodId"- ]- }- },- {- "name": "inventory_getTrackedEntity",- "module": "inventory",- "classification": "READ",- "description": "get tracked entity",- "paramCount": 1,- "serviceParams": [- "client",- "trackedEntityId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "trackedEntityId": {- "type": "string"- }- },- "required": [- "trackedEntityId"- ]- }- },- {- "name": "inventory_updateTrackedEntityExpiry",- "module": "inventory",- "classification": "WRITE",- "description": "update tracked entity expiry",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "trackedEntityId": {- "type": "string"- },- "expirationDate": {- "type": [- "string",- "null"- ]- },- "reason": {- "type": "string"- },- "source": {- "type": "string"- }- },- "required": [- "trackedEntityId",- "expirationDate",- "reason"- ]- }- },- {- "name": "inventory_getTrackedEntitiesByOperationId",- "module": "inventory",- "classification": "READ",- "description": "get tracked entities by operation id",- "paramCount": 1,- "serviceParams": [- "client",- "operationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "operationId": {- "type": "string"- }- },- "required": [- "operationId"- ]- }- },- {- "name": "inventory_getWarehouseTransfers",- "module": "inventory",- "classification": "READ",- "description": "get warehouse transfers",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "inventory_getWarehouseTransfer",- "module": "inventory",- "classification": "READ",- "description": "get warehouse transfer",- "paramCount": 1,- "serviceParams": [- "client",- "transferId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "transferId": {- "type": "string"- }- },- "required": [- "transferId"- ]- }- },- {- "name": "inventory_getWarehouseTransferLine",- "module": "inventory",- "classification": "READ",- "description": "get warehouse transfer line",- "paramCount": 2,- "serviceParams": [- "client",- "transferId",- "lineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "transferId": {- "type": "string"- },- "lineId": {- "type": "string"- }- },- "required": [- "transferId",- "lineId"- ]- }- },- {- "name": "inventory_getWarehouseTransferLines",- "module": "inventory",- "classification": "READ",- "description": "get warehouse transfer lines",- "paramCount": 1,- "serviceParams": [- "client",- "transferId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "transferId": {- "type": "string"- }- },- "required": [- "transferId"- ]- }- },- {- "name": "inventory_insertManualInventoryAdjustment",- "module": "inventory",- "classification": "WRITE",- "description": "insert manual inventory adjustment",- "paramCount": 30,- "serviceParams": [- "client",- "// `requiresSerialTracking` is a form-only flag for the validator's serial\n // quantity guard — the route strips it before calling this.\n inventoryAdjustment"- ],- "injectAuth": [- "companyId",- "createdBy"- ],- "schema": {- "type": "object",- "properties": {- "correctedQuantity": {- "type": "number"- },- "comment": {- "type": "string"- },- "postingDate": {- "type": "string"- },- "entryType": {- "type": "string"- },- "documentType": {- "type": "string"- },- "documentId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "storageUnitId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "id": {- "type": "string"- },- "receiptId": {- "type": "string"- },- "sourceDocument": {- "type": "string"- },- "sourceDocumentId": {- "type": "string"- },- "externalDocumentId": {- "type": "string"- },- "sourceDocumentReadableId": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "name": {- "type": "string"- },- "warehouseId": {- "type": "string"- },- "parentId": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "storageTypeIds": {- "type": "string"- },- "shipmentId": {- "type": "string"- },- "trackingNumber": {- "type": "string"- },- "shippingMethodId": {- "type": "string"- },- "customerId": {- "type": "string"- },- "carrier": {- "type": "string"- },- "carrierAccountId": {- "type": "string"- },- "trackingUrl": {- "type": "string"- },- "documentLineId": {- "type": "string"- }- },- "required": [- "entryType",- "documentType",- "itemId",- "quantity",- "id",- "receiptId",- "name",- "locationId",- "shipmentId",- "carrier",- "documentId",- "documentLineId"- ]- }- },- {- "name": "inventory_getStockMovementEffectiveQuantity",- "module": "inventory",- "classification": "READ",- "description": "get stock movement effective quantity",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "itemLedgerId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemLedgerId": {- "type": "string"- }- },- "required": [- "itemLedgerId"- ]- }- },- {- "name": "inventory_correctStockMovement",- "module": "inventory",- "classification": "WRITE",- "description": "correct stock movement",- "paramCount": 2,- "serviceParams": [- "client",- "correction"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "correctedQuantity": {- "type": "number"- },- "comment": {- "type": "string"- }- }- }- },- {- "name": "inventory_getInventoryCounts",- "module": "inventory",- "classification": "READ",- "description": "get inventory counts",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "inventory_getInventoryCount",- "module": "inventory",- "classification": "READ",- "description": "get inventory count",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "inventory_getInventoryCountLines",- "module": "inventory",- "classification": "READ",- "description": "get inventory count lines",- "paramCount": 2,- "serviceParams": [- "client",- "inventoryCountId",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "inventoryCountId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- },- "required": [- "inventoryCountId",- "args"- ]- }- },- {- "name": "inventory_getInventoryCountLineSummary",- "module": "inventory",- "classification": "READ",- "description": "get inventory count line summary",- "paramCount": 1,- "serviceParams": [- "client",- "inventoryCountId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "inventoryCountId": {- "type": "string"- }- },- "required": [- "inventoryCountId"- ]- }- },- {- "name": "inventory_getInventoryCountMovements",- "module": "inventory",- "classification": "READ",- "description": "get inventory count movements",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "inventoryCountId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "inventoryCountId": {- "type": "string"- }- },- "required": [- "inventoryCountId"- ]- }- },- {- "name": "inventory_insertInventoryCount",- "module": "inventory",- "classification": "WRITE",- "description": "insert inventory count",- "paramCount": 6,- "serviceParams": [- "client",- "inventoryCount"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "inventoryCountId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "isBlind": {- "type": "boolean"- },- "notes": {- "type": [- "string",- "null"- ]- },- "scope": {},- "customFields": {}- },- "required": [- "inventoryCountId",- "locationId",- "isBlind"- ]- }- },- {- "name": "inventory_deleteInventoryCount",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete inventory count",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "inventory_generateInventoryCountLines",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "generate inventory count lines",- "paramCount": 4,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "inventoryCountId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "storageUnitIds": {- "type": "array",- "items": {- "type": "string"- }- },- "itemType": {- "type": "string"- }- },- "required": [- "inventoryCountId",- "locationId"- ]- }- },- {- "name": "inventory_updateInventoryCountLine",- "module": "inventory",- "classification": "WRITE",- "description": "update inventory count line",- "paramCount": 2,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "countedQuantity": {- "type": "number"- }- },- "required": [- "id"- ]- }- },- {- "name": "inventory_updateInventoryCountStatus",- "module": "inventory",- "classification": "WRITE",- "description": "update inventory count status",- "paramCount": 3,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {},- "expectedStatus": {}- },- "required": [- "id",- "status"- ]- }- },- {- "name": "inventory_updateBatchPropertyOrder",- "module": "inventory",- "classification": "WRITE",- "description": "update batch property order",- "paramCount": 2,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id"- ]- }- },- {- "name": "inventory_updateStockTransferStatus",- "module": "inventory",- "classification": "WRITE",- "description": "update stock transfer status",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {},- "assignee": {- "type": [- "string",- "null"- ]- },- "completedAt": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id",- "status",- "completedAt"- ]- }- },- {- "name": "inventory_upsertBatchProperty",- "module": "inventory",- "classification": "WRITE",- "description": "upsert batch property",- "paramCount": 1,- "serviceParams": [- "client",- "batchProperty"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "batchProperty": {}- },- "required": [- "batchProperty"- ]- }- },- {- "name": "inventory_upsertKanban",- "module": "inventory",- "classification": "WRITE",- "description": "upsert kanban",- "paramCount": 1,- "serviceParams": [- "client",- "kanban"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "kanban": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "kanban",- "_operation"- ]- }- },- {- "name": "inventory_upsertReceipt",- "module": "inventory",- "classification": "WRITE",- "description": "upsert receipt",- "paramCount": 8,- "serviceParams": [- "client",- "receipt"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "receiptId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "sourceDocument": {- "type": "string"- },- "sourceDocumentId": {- "type": "string"- },- "externalDocumentId": {- "type": "string"- },- "sourceDocumentReadableId": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "receiptId",- "_operation"- ]- }- },- {- "name": "inventory_upsertStorageUnit",- "module": "inventory",- "classification": "WRITE",- "description": "upsert storage unit",- "paramCount": 7,- "serviceParams": [- "client",- "storageUnit"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "locationId": {- "type": "string"- },- "warehouseId": {- "type": "string"- },- "parentId": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "storageTypeIds": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "locationId",- "_operation"- ]- }- },- {- "name": "inventory_upsertShippingMethod",- "module": "inventory",- "classification": "WRITE",- "description": "upsert shipping method",- "paramCount": 5,- "serviceParams": [- "client",- "shippingMethod"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "carrier": {- "type": "string"- },- "carrierAccountId": {- "type": "string"- },- "trackingUrl": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "carrier",- "_operation"- ]- }- },- {- "name": "inventory_upsertShipment",- "module": "inventory",- "classification": "WRITE",- "description": "upsert shipment",- "paramCount": 9,- "serviceParams": [- "client",- "shipment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "shipmentId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "sourceDocument": {- "type": "string"- },- "sourceDocumentId": {- "type": "string"- },- "trackingNumber": {- "type": "string"- },- "shippingMethodId": {- "type": "string"- },- "sourceDocumentReadableId": {- "type": "string"- },- "customerId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "shipmentId",- "_operation"- ]- }- },- {- "name": "inventory_upsertStockTransfer",- "module": "inventory",- "classification": "WRITE",- "description": "upsert stock transfer",- "paramCount": 1,- "serviceParams": [- "client",- "stockTransfer"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "stockTransfer": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "stockTransfer",- "_operation"- ]- }- },- {- "name": "inventory_upsertStockTransferLine",- "module": "inventory",- "classification": "WRITE",- "description": "upsert stock transfer line",- "paramCount": 5,- "serviceParams": [- "client",- "stockTransferLine"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "stockTransferId": {- "type": "string"- },- "trackedEntityId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "itemId",- "locationId",- "stockTransferId",- "trackedEntityId",- "_operation"- ]- }- },- {- "name": "inventory_upsertStockTransferLines",- "module": "inventory",- "classification": "WRITE",- "description": "upsert stock transfer lines",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "lines": {},- "stockTransferId": {- "type": "string"- }- },- "required": [- "lines",- "stockTransferId"- ]- }- },- {- "name": "inventory_upsertWarehouseTransfer",- "module": "inventory",- "classification": "WRITE",- "description": "upsert warehouse transfer",- "paramCount": 1,- "serviceParams": [- "client",- "transfer"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "transfer": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "transfer",- "_operation"- ]- }- },- {- "name": "inventory_updateWarehouseTransferStatus",- "module": "inventory",- "classification": "WRITE",- "description": "update warehouse transfer status",- "paramCount": 2,- "serviceParams": [- "client",- "transferId",- "status",- "updatedBy"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "transferId": {- "type": "string"- },- "status": {}- },- "required": [- "transferId",- "status"- ]- }- },- {- "name": "inventory_upsertWarehouseTransferLine",- "module": "inventory",- "classification": "WRITE",- "description": "upsert warehouse transfer line",- "paramCount": 1,- "serviceParams": [- "client",- "line"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "line": {}- },- "required": [- "line"- ]- }- },- {- "name": "inventory_getDefaultStorageUnitForJob",- "module": "inventory",- "classification": "READ",- "description": "get default storage unit for job",- "paramCount": 2,- "serviceParams": [- "client",- "itemId",- "locationId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "inventory_getStorageUnitTree",- "module": "inventory",- "classification": "READ",- "description": "get storage unit tree",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- },- "required": [- "locationId"- ]- }- },- {- "name": "inventory_getStorageUnitDescendants",- "module": "inventory",- "classification": "READ",- "description": "get storage unit descendants",- "paramCount": 1,- "serviceParams": [- "client",- "storageUnitId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "storageUnitId": {- "type": "string"- }- },- "required": [- "storageUnitId"- ]- }- },- {- "name": "inventory_expandStorageUnitIdsWithDescendants",- "module": "inventory",- "classification": "WRITE",- "description": "expand storage unit ids with descendants",- "paramCount": 1,- "serviceParams": [- "client",- "storageUnitIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "storageUnitIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "storageUnitIds"- ]- }- },- {- "name": "inventory_getStorageTypeUsage",- "module": "inventory",- "classification": "READ",- "description": "get storage type usage",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "inventory_deleteStorageTypeWithCascade",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete storage type with cascade",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "inventory_getStorageTypes",- "module": "inventory",- "classification": "READ",- "description": "get storage types",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "inventory_getStorageType",- "module": "inventory",- "classification": "READ",- "description": "get storage type",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "inventory_getStorageTypesList",- "module": "inventory",- "classification": "READ",- "description": "get storage types list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "inventory_upsertStorageType",- "module": "inventory",- "classification": "WRITE",- "description": "upsert storage type",- "paramCount": 2,- "serviceParams": [- "client",- "storageType"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "inventory_getShelfLifeForItems",- "module": "inventory",- "classification": "READ",- "description": "get shelf life for items",- "paramCount": 1,- "serviceParams": [- "client",- "itemIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemIds"- ]- }- },- {- "name": "inventory_getTrackedEntityExpirations",- "module": "inventory",- "classification": "READ",- "description": "get tracked entity expirations",- "paramCount": 1,- "serviceParams": [- "client",- "trackedEntityIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "trackedEntityIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "trackedEntityIds"- ]- }- },- {- "name": "inventory_getPickingLists",- "module": "inventory",- "classification": "READ",- "description": "get picking lists",- "paramCount": 6,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "status": {- "type": [- "string",- "null"- ]- },- "assignee": {- "type": [- "string",- "null"- ]- },- "locationId": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "inventory_getPickingList",- "module": "inventory",- "classification": "READ",- "description": "get picking list",- "paramCount": 1,- "serviceParams": [- "client",- "pickingListId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "pickingListId": {- "type": "string"- }- },- "required": [- "pickingListId"- ]- }- },- {- "name": "inventory_getPickingListLines",- "module": "inventory",- "classification": "READ",- "description": "get picking list lines",- "paramCount": 1,- "serviceParams": [- "client",- "pickingListId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "pickingListId": {- "type": "string"- }- },- "required": [- "pickingListId"- ]- }- },- {- "name": "inventory_getPickingListAvailability",- "module": "inventory",- "classification": "READ",- "description": "get picking list availability",- "paramCount": 1,- "serviceParams": [- "client",- "pickingListId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "pickingListId": {- "type": "string"- }- },- "required": [- "pickingListId"- ]- }- },- {- "name": "inventory_getPickingListRecommendations",- "module": "inventory",- "classification": "READ",- "description": "get picking list recommendations",- "paramCount": 1,- "serviceParams": [- "client",- "pickingListId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "pickingListId": {- "type": "string"- }- },- "required": [- "pickingListId"- ]- }- },- {- "name": "inventory_getPickingListLine",- "module": "inventory",- "classification": "READ",- "description": "get picking list line",- "paramCount": 1,- "serviceParams": [- "client",- "lineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "lineId": {- "type": "string"- }- },- "required": [- "lineId"- ]- }- },- {- "name": "inventory_getPickingListLineTrackedEntities",- "module": "inventory",- "classification": "READ",- "description": "get picking list line tracked entities",- "paramCount": 1,- "serviceParams": [- "client",- "lineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "lineId": {- "type": "string"- }- },- "required": [- "lineId"- ]- }- },- {- "name": "inventory_setPickingListLineTrackedEntity",- "module": "inventory",- "classification": "WRITE",- "description": "set picking list line tracked entity",- "paramCount": 5,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "pickingListLineId": {- "type": "string"- },- "trackedEntityId": {- "type": "string"- },- "fromStorageUnitId": {- "type": [- "string",- "null"- ]- },- "quantity": {- "type": "number"- },- "unpick": {- "type": "boolean"- }- },- "required": [- "pickingListLineId",- "trackedEntityId"- ]- }- },- {- "name": "inventory_upsertPickingList",- "module": "inventory",- "classification": "WRITE",- "description": "upsert picking list",- "paramCount": 6,- "serviceParams": [- "client",- "pickingList"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "pickingListId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "assignee": {- "type": "string"- },- "dueDate": {- "type": "string"- },- "notes": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "locationId",- "_operation"- ]- }- },- {- "name": "inventory_getUnresolvedPickingListLines",- "module": "inventory",- "classification": "READ",- "description": "get unresolved picking list lines",- "paramCount": 1,- "serviceParams": [- "client",- "pickingListId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "pickingListId": {- "type": "string"- }- },- "required": [- "pickingListId"- ]- }- },- {- "name": "inventory_updatePickingListStatus",- "module": "inventory",- "classification": "WRITE",- "description": "update picking list status",- "paramCount": 2,- "serviceParams": [- "client",- "pickingListId",- "status",- "updatedBy"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "pickingListId": {- "type": "string"- },- "status": {}- },- "required": [- "pickingListId",- "status"- ]- }- },- {- "name": "inventory_upsertPickingListLine",- "module": "inventory",- "classification": "WRITE",- "description": "upsert picking list line",- "paramCount": 8,- "serviceParams": [- "client",- "line"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "pickingListId": {- "type": "string"- },- "jobId": {- "type": "string"- },- "jobMaterialId": {- "type": "string"- },- "jobOperationId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantityToPick": {- "type": "number"- },- "storageUnitId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "pickingListId",- "jobId",- "jobMaterialId",- "itemId",- "_operation"- ]- }- },- {- "name": "inventory_deletePickingList",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete picking list",- "paramCount": 1,- "serviceParams": [- "client",- "pickingListId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "pickingListId": {- "type": "string"- }- },- "required": [- "pickingListId"- ]- }- },- {- "name": "inventory_deletePickingListLine",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "delete picking list line",- "paramCount": 1,- "serviceParams": [- "client",- "lineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "lineId": {- "type": "string"- }- },- "required": [- "lineId"- ]- }- },- {- "name": "inventory_getPickingSchedule",- "module": "inventory",- "classification": "READ",- "description": "get picking schedule",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "search": {- "type": [- "string",- "null"- ]- }- },- "required": [- "locationId"- ]- }- },- {- "name": "inventory_generatePickingList",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "generate picking list",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationIds": {- "type": "array",- "items": {- "type": "string"- }- },- "locationId": {- "type": "string"- },- "assignee": {- "type": [- "string",- "null"- ]- },- "dueDate": {- "type": [- "string",- "null"- ]- }- },- "required": [- "jobOperationIds",- "locationId"- ]- }- },- {- "name": "inventory_pickPickingListLine",- "module": "inventory",- "classification": "WRITE",- "description": "pick picking list line",- "paramCount": 3,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "pickingListLineId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "markShort": {- "type": "boolean"- }- },- "required": [- "pickingListLineId",- "quantity"- ]- }- },- {- "name": "inventory_insertStockTransfer",- "module": "inventory",- "classification": "DESTRUCTIVE",- "description": "Create a stock transfer with lines. Generates sequence ID automatically.",- "paramCount": 4,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "lines: Array<{\n itemId: string;\n fromStorageUnitId": {},- "stockTransferId": {- "type": "string"- },- "customFields": {}- },- "required": [- "locationId"- ]- }- },- {- "name": "inventory_insertWarehouseTransfer",- "module": "inventory",- "classification": "WRITE",- "description": "Create a warehouse transfer between locations. Generates sequence ID automatically.",- "paramCount": 9,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "fromLocationId": {- "type": "string"- },- "toLocationId": {- "type": "string"- },- "transferId": {- "type": "string"- },- "status": {},- "transferDate": {- "type": "string"- },- "expectedReceiptDate": {- "type": "string"- },- "notes": {- "type": "string"- },- "reference": {- "type": "string"- },- "customFields": {}- },- "required": [- "fromLocationId",- "toLocationId"- ]- }- },- {- "name": "inventory_updateStockTransfer",- "module": "inventory",- "classification": "WRITE",- "description": "Update an existing stock transfer",- "paramCount": 4,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "locationId": {- "type": "string"- },- "stockTransferId": {- "type": "string"- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "inventory_updateWarehouseTransfer",- "module": "inventory",- "classification": "WRITE",- "description": "Update an existing warehouse transfer",- "paramCount": 10,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "fromLocationId": {- "type": "string"- },- "toLocationId": {- "type": "string"- },- "transferId": {- "type": "string"- },- "status": {},- "transferDate": {- "type": "string"- },- "expectedReceiptDate": {- "type": "string"- },- "notes": {- "type": "string"- },- "reference": {- "type": "string"- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "invoicing_computeInvoiceDateDue",- "module": "invoicing",- "classification": "READ",- "description": "compute invoice date due",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dateIssued": {},- "paymentTermId": {}- },- "required": [- "dateIssued",- "paymentTermId"- ]- }- },- {- "name": "invoicing_createPurchaseInvoiceFromPurchaseOrder",- "module": "invoicing",- "classification": "WRITE",- "description": "create purchase invoice from purchase order",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderId",- "companyId",- "userId"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderId": {- "type": "string"- }- },- "required": [- "purchaseOrderId"- ]- }- },- {- "name": "invoicing_createSalesInvoiceFromSalesOrder",- "module": "invoicing",- "classification": "WRITE",- "description": "create sales invoice from sales order",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderId",- "companyId",- "userId"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderId": {- "type": "string"- }- },- "required": [- "salesOrderId"- ]- }- },- {- "name": "invoicing_createSalesInvoiceFromShipment",- "module": "invoicing",- "classification": "WRITE",- "description": "create sales invoice from shipment",- "paramCount": 1,- "serviceParams": [- "client",- "shipmentId",- "companyId",- "userId"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "shipmentId": {- "type": "string"- }- },- "required": [- "shipmentId"- ]- }- },- {- "name": "invoicing_deletePurchaseInvoice",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "delete purchase invoice",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseInvoiceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseInvoiceId": {- "type": "string"- }- },- "required": [- "purchaseInvoiceId"- ]- }- },- {- "name": "invoicing_deletePurchaseInvoiceLine",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "delete purchase invoice line",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseInvoiceLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseInvoiceLineId": {- "type": "string"- }- },- "required": [- "purchaseInvoiceLineId"- ]- }- },- {- "name": "invoicing_deleteSalesInvoice",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "delete sales invoice",- "paramCount": 1,- "serviceParams": [- "client",- "salesInvoiceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesInvoiceId": {- "type": "string"- }- },- "required": [- "salesInvoiceId"- ]- }- },- {- "name": "invoicing_deleteSalesInvoiceLine",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "delete sales invoice line",- "paramCount": 1,- "serviceParams": [- "client",- "salesInvoiceLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesInvoiceLineId": {- "type": "string"- }- },- "required": [- "salesInvoiceLineId"- ]- }- },- {- "name": "invoicing_getPurchaseInvoice",- "module": "invoicing",- "classification": "READ",- "description": "get purchase invoice",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseInvoiceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseInvoiceId": {- "type": "string"- }- },- "required": [- "purchaseInvoiceId"- ]- }- },- {- "name": "invoicing_getPurchaseInvoices",- "module": "invoicing",- "classification": "READ",- "description": "get purchase invoices",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "supplierId": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "invoicing_getPurchaseInvoiceDelivery",- "module": "invoicing",- "classification": "READ",- "description": "get purchase invoice delivery",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseInvoiceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseInvoiceId": {- "type": "string"- }- },- "required": [- "purchaseInvoiceId"- ]- }- },- {- "name": "invoicing_getPurchaseInvoiceLines",- "module": "invoicing",- "classification": "READ",- "description": "get purchase invoice lines",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseInvoiceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseInvoiceId": {- "type": "string"- }- },- "required": [- "purchaseInvoiceId"- ]- }- },- {- "name": "invoicing_getPurchaseInvoiceLine",- "module": "invoicing",- "classification": "READ",- "description": "get purchase invoice line",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseInvoiceLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseInvoiceLineId": {- "type": "string"- }- },- "required": [- "purchaseInvoiceLineId"- ]- }- },- {- "name": "invoicing_getSalesInvoice",- "module": "invoicing",- "classification": "READ",- "description": "get sales invoice",- "paramCount": 1,- "serviceParams": [- "client",- "salesInvoiceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesInvoiceId": {- "type": "string"- }- },- "required": [- "salesInvoiceId"- ]- }- },- {- "name": "invoicing_getSalesInvoiceCustomerDetails",- "module": "invoicing",- "classification": "READ",- "description": "get sales invoice customer details",- "paramCount": 1,- "serviceParams": [- "client",- "salesInvoiceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesInvoiceId": {- "type": "string"- }- },- "required": [- "salesInvoiceId"- ]- }- },- {- "name": "invoicing_getSalesInvoices",- "module": "invoicing",- "classification": "READ",- "description": "get sales invoices",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "customerId": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "invoicing_getSalesInvoiceShipment",- "module": "invoicing",- "classification": "READ",- "description": "get sales invoice shipment",- "paramCount": 1,- "serviceParams": [- "client",- "salesInvoiceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesInvoiceId": {- "type": "string"- }- },- "required": [- "salesInvoiceId"- ]- }- },- {- "name": "invoicing_getSalesInvoiceLines",- "module": "invoicing",- "classification": "READ",- "description": "get sales invoice lines",- "paramCount": 1,- "serviceParams": [- "client",- "salesInvoiceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesInvoiceId": {- "type": "string"- }- },- "required": [- "salesInvoiceId"- ]- }- },- {- "name": "invoicing_getSalesInvoiceLine",- "module": "invoicing",- "classification": "READ",- "description": "get sales invoice line",- "paramCount": 1,- "serviceParams": [- "client",- "salesInvoiceLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesInvoiceLineId": {- "type": "string"- }- },- "required": [- "salesInvoiceLineId"- ]- }- },- {- "name": "invoicing_updatePurchaseInvoiceExchangeRate",- "module": "invoicing",- "classification": "WRITE",- "description": "update purchase invoice exchange rate",- "paramCount": 2,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "exchangeRate": {- "type": "number"- }- },- "required": [- "id",- "exchangeRate"- ]- }- },- {- "name": "invoicing_updatePurchaseInvoiceStatus",- "module": "invoicing",- "classification": "WRITE",- "description": "update purchase invoice status",- "paramCount": 4,- "serviceParams": [- "client",- "update"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "assignee": {},- "datePaid": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id",- "status",- "assignee"- ]- }- },- {- "name": "invoicing_updateSalesInvoiceExchangeRate",- "module": "invoicing",- "classification": "WRITE",- "description": "update sales invoice exchange rate",- "paramCount": 2,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "exchangeRate": {- "type": "number"- }- },- "required": [- "id",- "exchangeRate"- ]- }- },- {- "name": "invoicing_updateSalesInvoiceStatus",- "module": "invoicing",- "classification": "WRITE",- "description": "update sales invoice status",- "paramCount": 4,- "serviceParams": [- "client",- "update"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "assignee": {},- "datePaid": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id",- "status",- "assignee"- ]- }- },- {- "name": "invoicing_insertPurchaseInvoice",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "insert purchase invoice",- "paramCount": 15,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- },- "invoiceId": {- "type": "string"- },- "supplierReference": {- "type": "string"- },- "paymentTermId": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "locationId": {- "type": "string"- },- "invoiceSupplierId": {- "type": "string"- },- "invoiceSupplierContactId": {- "type": "string"- },- "invoiceSupplierLocationId": {- "type": "string"- },- "dateIssued": {- "type": "string"- },- "dateDue": {- "type": "string"- },- "exchangeRate": {- "type": "number"- },- "exchangeRateUpdatedAt": {- "type": "string"- },- "supplierShippingCost": {- "type": "number"- },- "customFields": {}- },- "required": [- "supplierId"- ]- }- },- {- "name": "invoicing_updatePurchaseInvoice",- "module": "invoicing",- "classification": "WRITE",- "description": "update purchase invoice",- "paramCount": 15,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "invoiceId": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "supplierReference": {- "type": [- "string",- "null"- ]- },- "paymentTermId": {- "type": [- "string",- "null"- ]- },- "currencyCode": {- "type": "string"- },- "locationId": {- "type": "string"- },- "invoiceSupplierId": {- "type": [- "string",- "null"- ]- },- "invoiceSupplierContactId": {- "type": [- "string",- "null"- ]- },- "invoiceSupplierLocationId": {- "type": [- "string",- "null"- ]- },- "dateIssued": {- "type": [- "string",- "null"- ]- },- "dateDue": {- "type": [- "string",- "null"- ]- },- "exchangeRate": {- "type": "number"- },- "exchangeRateUpdatedAt": {- "type": "string"- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "invoicing_upsertPurchaseInvoice",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "upsert purchase invoice",- "paramCount": 15,- "serviceParams": [- "client",- "purchaseInvoice"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "invoiceId": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "supplierReference": {- "type": "string"- },- "paymentTermId": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "locationId": {- "type": "string"- },- "invoiceSupplierId": {- "type": "string"- },- "invoiceSupplierContactId": {- "type": "string"- },- "invoiceSupplierLocationId": {- "type": "string"- },- "dateIssued": {- "type": "string"- },- "dateDue": {- "type": "string"- },- "supplierShippingCost": {- "type": "number"- },- "exchangeRate": {- "type": "number"- },- "exchangeRateUpdatedAt": {- "type": "string"- }- },- "required": [- "supplierId",- "locationId"- ]- }- },- {- "name": "invoicing_upsertPurchaseInvoiceDelivery",- "module": "invoicing",- "classification": "WRITE",- "description": "upsert purchase invoice delivery",- "paramCount": 8,- "serviceParams": [- "client",- "purchaseInvoiceDelivery"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "locationId": {- "type": "string"- },- "shippingMethodId": {- "type": "string"- },- "shippingTermId": {- "type": "string"- },- "supplierShippingCost": {- "type": "number"- },- "incoterm": {- "type": "string"- },- "incotermLocation": {- "type": "string"- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "invoicing_upsertPurchaseInvoiceLine",- "module": "invoicing",- "classification": "WRITE",- "description": "upsert purchase invoice line",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseInvoiceLine"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "purchaseInvoiceLine": {}- },- "required": [- "purchaseInvoiceLine"- ]- }- },- {- "name": "invoicing_updatePurchaseInvoiceLineOrder",- "module": "invoicing",- "classification": "WRITE",- "description": "update purchase invoice line order",- "paramCount": 1,- "serviceParams": [- "db",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "invoicing_insertSalesInvoice",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "insert sales invoice",- "paramCount": 14,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "invoiceId": {- "type": "string"- },- "customerReference": {- "type": "string"- },- "paymentTermId": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "locationId": {- "type": "string"- },- "invoiceCustomerId": {- "type": "string"- },- "invoiceCustomerContactId": {- "type": "string"- },- "invoiceCustomerLocationId": {- "type": "string"- },- "dateIssued": {- "type": "string"- },- "dateDue": {- "type": "string"- },- "exchangeRate": {- "type": "number"- },- "exchangeRateUpdatedAt": {- "type": "string"- },- "customFields": {}- },- "required": [- "customerId"- ]- }- },- {- "name": "invoicing_updateSalesInvoice",- "module": "invoicing",- "classification": "WRITE",- "description": "update sales invoice",- "paramCount": 15,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "invoiceId": {- "type": "string"- },- "customerId": {- "type": "string"- },- "customerReference": {- "type": [- "string",- "null"- ]- },- "paymentTermId": {- "type": [- "string",- "null"- ]- },- "currencyCode": {- "type": "string"- },- "locationId": {- "type": "string"- },- "invoiceCustomerId": {- "type": [- "string",- "null"- ]- },- "invoiceCustomerContactId": {- "type": [- "string",- "null"- ]- },- "invoiceCustomerLocationId": {- "type": [- "string",- "null"- ]- },- "dateIssued": {- "type": [- "string",- "null"- ]- },- "dateDue": {- "type": [- "string",- "null"- ]- },- "exchangeRate": {- "type": "number"- },- "exchangeRateUpdatedAt": {- "type": "string"- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "invoicing_upsertSalesInvoice",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "upsert sales invoice",- "paramCount": 15,- "serviceParams": [- "client",- "salesInvoice"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "invoiceId": {- "type": "string"- },- "customerId": {- "type": "string"- },- "customerReference": {- "type": "string"- },- "paymentTermId": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "locationId": {- "type": "string"- },- "invoiceCustomerId": {- "type": "string"- },- "invoiceCustomerContactId": {- "type": "string"- },- "invoiceCustomerLocationId": {- "type": "string"- },- "dateIssued": {- "type": "string"- },- "dateDue": {- "type": "string"- },- "supplierShippingCost": {- "type": "number"- },- "exchangeRate": {- "type": "number"- },- "exchangeRateUpdatedAt": {- "type": "string"- }- },- "required": [- "customerId",- "locationId"- ]- }- },- {- "name": "invoicing_upsertSalesInvoiceShipment",- "module": "invoicing",- "classification": "WRITE",- "description": "upsert sales invoice shipment",- "paramCount": 8,- "serviceParams": [- "client",- "salesInvoiceShipment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "locationId": {- "type": "string"- },- "shippingMethodId": {- "type": "string"- },- "shippingTermId": {- "type": "string"- },- "shippingCost": {- "type": "number"- },- "incoterm": {- "type": "string"- },- "incotermLocation": {- "type": "string"- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "invoicing_upsertSalesInvoiceLine",- "module": "invoicing",- "classification": "WRITE",- "description": "upsert sales invoice line",- "paramCount": 1,- "serviceParams": [- "client",- "salesInvoiceLine"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "salesInvoiceLine": {}- },- "required": [- "salesInvoiceLine"- ]- }- },- {- "name": "invoicing_updateSalesInvoiceLineOrder",- "module": "invoicing",- "classification": "WRITE",- "description": "update sales invoice line order",- "paramCount": 1,- "serviceParams": [- "db",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "invoicing_getPayment",- "module": "invoicing",- "classification": "READ",- "description": "get payment",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "invoicing_getPayments",- "module": "invoicing",- "classification": "READ",- "description": "get payments",- "paramCount": 8,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "paymentType": {- "type": [- "string",- "null"- ],- "enum": [- "Receipt",- "Disbursement"- ]- },- "status": {},- "customerId": {- "type": [- "string",- "null"- ]- },- "supplierId": {- "type": [- "string",- "null"- ]- },- "counterpartyIds": {- "type": [- "array",- "null"- ],- "items": {- "type": "string"- }- }- }- }- }- }- },- {- "name": "invoicing_getInvoiceSettlements",- "module": "invoicing",- "classification": "READ",- "description": "get invoice settlements",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "paymentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "paymentId": {- "type": "string"- }- },- "required": [- "paymentId"- ]- }- },- {- "name": "invoicing_getInvoiceSettlementsForInvoice",- "module": "invoicing",- "classification": "READ",- "description": "get invoice settlements for invoice",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "side",- "invoiceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "side": {- "type": "string",- "enum": [- "sales",- "purchase"- ]- },- "invoiceId": {- "type": "string"- }- },- "required": [- "side",- "invoiceId"- ]- }- },- {- "name": "invoicing_getMemoApplications",- "module": "invoicing",- "classification": "READ",- "description": "get memo applications",- "paramCount": 1,- "serviceParams": [- "client",- "memoId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "memoId": {- "type": "string"- }- },- "required": [- "memoId"- ]- }- },- {- "name": "invoicing_getOpenSalesInvoicesForCustomer",- "module": "invoicing",- "classification": "READ",- "description": "get open sales invoices for customer",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "customerId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- }- },- "required": [- "customerId"- ]- }- },- {- "name": "invoicing_getOpenPurchaseInvoicesForSupplier",- "module": "invoicing",- "classification": "READ",- "description": "get open purchase invoices for supplier",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "supplierId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "invoicing_getAvailableOnAccountCredit",- "module": "invoicing",- "classification": "READ",- "description": "get available on account credit",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "party"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "party": {}- },- "required": [- "party"- ]- }- },- {- "name": "invoicing_upsertPayment",- "module": "invoicing",- "classification": "WRITE",- "description": "upsert payment",- "paramCount": 1,- "serviceParams": [- "client",- "payment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "payment": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "payment",- "_operation"- ]- }- },- {- "name": "invoicing_deletePayment",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "delete payment",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "invoicing_upsertInvoiceSettlement",- "module": "invoicing",- "classification": "WRITE",- "description": "upsert invoice settlement",- "paramCount": 1,- "serviceParams": [- "client",- "app"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "app": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "app",- "_operation"- ]- }- },- {- "name": "invoicing_deleteInvoiceSettlement",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "delete invoice settlement",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "invoicing_replaceInvoiceSettlements",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "replace invoice settlements",- "paramCount": 2,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "paymentId": {- "type": "string"- },- "applications": {- "type": "array",- "items": {}- }- },- "required": [- "paymentId",- "applications"- ]- }- },- {- "name": "invoicing_getMemo",- "module": "invoicing",- "classification": "READ",- "description": "get memo",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "invoicing_getMemos",- "module": "invoicing",- "classification": "READ",- "description": "get memos",- "paramCount": 6,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "direction": {- "type": [- "string",- "null"- ],- "enum": [- "Credit",- "Debit"- ]- },- "status": {- "type": [- "string",- "null"- ],- "enum": [- "Draft",- "Posted",- "Voided"- ]- },- "counterpartyIds": {- "type": [- "array",- "null"- ],- "items": {- "type": "string"- }- }- }- }- }- }- },- {- "name": "invoicing_upsertMemo",- "module": "invoicing",- "classification": "WRITE",- "description": "upsert memo",- "paramCount": 1,- "serviceParams": [- "client",- "memo"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "memo": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "memo",- "_operation"- ]- }- },- {- "name": "invoicing_deleteMemo",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "delete memo",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "invoicing_getAvailableCreditsForParty",- "module": "invoicing",- "classification": "READ",- "description": "get available credits for party",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "party",- "// When editing a Draft payment's composer",- "that payment's own staged credits\n // should NOT count as used — they show as staged",- "not consumed.\n excludePaymentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "party": {},- "// When editing a Draft payment's composer": {},- "that payment's own staged credits\n // should NOT count as used — they show as staged": {},- "not consumed.\n excludePaymentId": {- "type": "string"- }- },- "required": [- "party",- "// When editing a Draft payment's composer",- "that payment's own staged credits\n // should NOT count as used — they show as staged"- ]- }- },- {- "name": "invoicing_getCompanyHasOpenCredits",- "module": "invoicing",- "classification": "READ",- "description": "get company has open credits",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "side"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "side": {- "type": "string",- "enum": [- "sales",- "purchase"- ]- }- },- "required": [- "side"- ]- }- },- {- "name": "invoicing_getStagedCreditsForPayment",- "module": "invoicing",- "classification": "READ",- "description": "get staged credits for payment",- "paramCount": 2,- "serviceParams": [- "client",- "paymentId",- "side"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "paymentId": {- "type": "string"- },- "side": {- "type": "string",- "enum": [- "sales",- "purchase"- ]- }- },- "required": [- "paymentId",- "side"- ]- }- },- {- "name": "invoicing_applyCreditsToInvoices",- "module": "invoicing",- "classification": "DESTRUCTIVE",- "description": "apply credits to invoices",- "paramCount": 4,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "paymentId": {- "type": "string"- },- "appliedDate": {- "type": "string"- },- "side": {- "type": "string",- "enum": [- "sales",- "purchase"- ]- },- "applications": {- "type": "array",- "items": {- "type": "object",- "properties": {- "memoId": {- "type": "string"- },- "invoiceId": {- "type": "string"- },- "amount": {- "type": "number"- }- },- "required": [- "memoId",- "invoiceId",- "amount"- ]- }- }- },- "required": [- "paymentId",- "appliedDate",- "side",- "applications"- ]- }- },- {- "name": "invoicing_getArTieOut",- "module": "invoicing",- "classification": "READ",- "description": "get ar tie out",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "asOfDate"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "asOfDate": {- "type": "string"- }- },- "required": [- "asOfDate"- ]- }- },- {- "name": "invoicing_getApTieOut",- "module": "invoicing",- "classification": "READ",- "description": "get ap tie out",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "asOfDate"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "asOfDate": {- "type": "string"- }- },- "required": [- "asOfDate"- ]- }- },- {- "name": "invoicing_getArOpenByCustomer",- "module": "invoicing",- "classification": "READ",- "description": "get ar open by customer",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "asOfDate"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "asOfDate": {- "type": "string"- }- },- "required": [- "asOfDate"- ]- }- },- {- "name": "invoicing_getApOpenBySupplier",- "module": "invoicing",- "classification": "READ",- "description": "get ap open by supplier",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "asOfDate"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "asOfDate": {- "type": "string"- }- },- "required": [- "asOfDate"- ]- }- },- {- "name": "invoicing_getArAging",- "module": "invoicing",- "classification": "READ",- "description": "get ar aging",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "asOfDate",- "options"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "asOfDate": {- "type": "string"- },- "options": {}- },- "required": [- "asOfDate",- "options"- ]- }- },- {- "name": "invoicing_getApAging",- "module": "invoicing",- "classification": "READ",- "description": "get ap aging",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "asOfDate",- "options"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "asOfDate": {- "type": "string"- },- "options": {}- },- "required": [- "asOfDate",- "options"- ]- }- },- {- "name": "items_activateMethodVersion",- "module": "items",- "classification": "WRITE",- "description": "activate method version",- "paramCount": 1,- "serviceParams": [- "client",- "payload"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_copyItem",- "module": "items",- "classification": "WRITE",- "description": "copy item",- "paramCount": 8,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "targetId": {- "type": "string"- },- "sourceId": {- "type": "string"- },- "billOfMaterial": {- "type": "string"- },- "billOfProcess": {- "type": "string"- },- "parameters": {- "type": "string"- },- "tools": {- "type": "string"- },- "steps": {- "type": "string"- },- "workInstructions": {- "type": "string"- }- },- "required": [- "targetId",- "sourceId",- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- {- "name": "items_copyMakeMethod",- "module": "items",- "classification": "WRITE",- "description": "copy make method",- "paramCount": 8,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "targetId": {- "type": "string"- },- "sourceId": {- "type": "string"- },- "billOfMaterial": {- "type": "string"- },- "billOfProcess": {- "type": "string"- },- "parameters": {- "type": "string"- },- "tools": {- "type": "string"- },- "steps": {- "type": "string"- },- "workInstructions": {- "type": "string"- }- },- "required": [- "targetId",- "sourceId",- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- {- "name": "items_copyItemPostingGroup",- "module": "items",- "classification": "WRITE",- "description": "copy item posting group",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "sourceItemId": {- "type": "string"- },- "targetItemId": {- "type": "string"- }- },- "required": [- "sourceItemId",- "targetItemId"- ]- }- },- {- "name": "items_createRevision",- "module": "items",- "classification": "WRITE",- "description": "create revision",- "paramCount": 3,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "item": {},- "revision": {- "type": "string"- },- "active": {- "type": "boolean"- }- },- "required": [- "item",- "revision"- ]- }- },- {- "name": "items_getNextRevision",- "module": "items",- "classification": "READ",- "description": "get next revision",- "paramCount": 1,- "serviceParams": [- "maxRevision"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "maxRevision": {- "type": "string"- }- },- "required": [- "maxRevision"- ]- }- },- {- "name": "items_deleteConfigurationParameter",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete configuration parameter",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteConfigurationRule",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete configuration rule",- "paramCount": 2,- "serviceParams": [- "client",- "field",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "field": {- "type": "string"- },- "itemId": {- "type": "string"- }- },- "required": [- "field",- "itemId"- ]- }- },- {- "name": "items_deleteItemCustomerPart",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete item customer part",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteSupplierPart",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete supplier part",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteConfigurationParameterGroup",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete configuration parameter group",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteItem",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete item",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteItemPostingGroup",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete item posting group",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteMaterialDimension",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete material dimension",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteMaterialFinish",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete material finish",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteMaterialForm",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete material form",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteMaterialGrade",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete material grade",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteMaterialSubstance",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete material substance",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteMethodMaterial",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete method material",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_assertMethodOperationIsDraft",- "module": "items",- "classification": "WRITE",- "description": "assert method operation is draft",- "paramCount": 1,- "serviceParams": [- "client",- "operationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "operationId": {- "type": "string"- }- },- "required": [- "operationId"- ]- }- },- {- "name": "items_deleteMethodOperation",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete method operation",- "paramCount": 1,- "serviceParams": [- "client",- "methodOperationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "methodOperationId": {- "type": "string"- }- },- "required": [- "methodOperationId"- ]- }- },- {- "name": "items_deleteMethodOperationStep",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete method operation step",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteMethodOperationStepSlide",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete method operation step slide",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteMethodOperationParameter",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete method operation parameter",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteMethodOperationTool",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete method operation tool",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteUnitOfMeasure",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete unit of measure",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getConfigurationParameters",- "module": "items",- "classification": "READ",- "description": "get configuration parameters",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getConfigurationRules",- "module": "items",- "classification": "READ",- "description": "get configuration rules",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getConsumable",- "module": "items",- "classification": "READ",- "description": "get consumable",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getConsumables",- "module": "items",- "classification": "READ",- "description": "get consumables",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "supplierId": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getConsumablesList",- "module": "items",- "classification": "READ",- "description": "get consumables list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_getItem",- "module": "items",- "classification": "READ",- "description": "get item",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getItemCost",- "module": "items",- "classification": "READ",- "description": "get item cost",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getItemCostHistory",- "module": "items",- "classification": "READ",- "description": "get item cost history",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getItemCustomerPart",- "module": "items",- "classification": "READ",- "description": "get item customer part",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getItemCustomerParts",- "module": "items",- "classification": "READ",- "description": "get item customer parts",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getItemDemand",- "module": "items",- "classification": "READ",- "description": "get item demand",- "paramCount": 3,- "serviceParams": [- "client",- "{\n itemId,\n locationId,\n periods,\n companyId\n }"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "periods": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemId",- "locationId",- "periods"- ]- }- },- {- "name": "items_getDemandForecastSources",- "module": "items",- "classification": "READ",- "description": "get demand forecast sources",- "paramCount": 3,- "serviceParams": [- "client",- "{\n itemId,\n locationId,\n periods,\n companyId\n }"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "periods": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemId",- "locationId",- "periods"- ]- }- },- {- "name": "items_getItemFiles",- "module": "items",- "classification": "READ",- "description": "get item files",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getItemPostingGroup",- "module": "items",- "classification": "READ",- "description": "get item posting group",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getItemPostingGroups",- "module": "items",- "classification": "READ",- "description": "get item posting groups",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getItemPostingGroupsList",- "module": "items",- "classification": "READ",- "description": "get item posting groups list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_getItemManufacturing",- "module": "items",- "classification": "READ",- "description": "get item manufacturing",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getItemPlanning",- "module": "items",- "classification": "READ",- "description": "get item planning",- "paramCount": 2,- "serviceParams": [- "client",- "itemId",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "items_getItemQuantities",- "module": "items",- "classification": "READ",- "description": "get item quantities",- "paramCount": 2,- "serviceParams": [- "client",- "itemId",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "items_getItemReplenishment",- "module": "items",- "classification": "READ",- "description": "get item replenishment",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getItemSupersession",- "module": "items",- "classification": "READ",- "description": "get item supersession",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getItemSupersededBy",- "module": "items",- "classification": "READ",- "description": "get item superseded by",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getSupersessionChain",- "module": "items",- "classification": "READ",- "description": "get supersession chain",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getItemStorageUnitQuantities",- "module": "items",- "classification": "READ",- "description": "get item storage unit quantities",- "paramCount": 2,- "serviceParams": [- "client",- "itemId",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "items_getItemSupply",- "module": "items",- "classification": "READ",- "description": "get item supply",- "paramCount": 3,- "serviceParams": [- "client",- "{\n itemId,\n locationId,\n periods,\n companyId\n }"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "periods": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemId",- "locationId",- "periods"- ]- }- },- {- "name": "items_getItemUnitSalePrice",- "module": "items",- "classification": "READ",- "description": "get item unit sale price",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getJobMaterialUsageForItem",- "module": "items",- "classification": "READ",- "description": "get job material usage for item",- "paramCount": 1,- "serviceParams": [- "client",- "{ itemId, companyId }"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getMaterialUsedIn",- "module": "items",- "classification": "READ",- "description": "get material used in",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getMakeMethods",- "module": "items",- "classification": "READ",- "description": "get make methods",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getMakeMethodById",- "module": "items",- "classification": "READ",- "description": "get make method by id",- "paramCount": 1,- "serviceParams": [- "client",- "makeMethodId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "makeMethodId": {- "type": "string"- }- },- "required": [- "makeMethodId"- ]- }- },- {- "name": "items_getMaterial",- "module": "items",- "classification": "READ",- "description": "get material",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getMaterials",- "module": "items",- "classification": "READ",- "description": "get materials",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "supplierId": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getMaterialsList",- "module": "items",- "classification": "READ",- "description": "get materials list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_getMaterialDimension",- "module": "items",- "classification": "READ",- "description": "get material dimension",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getMaterialDimensions",- "module": "items",- "classification": "READ",- "description": "get material dimensions",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "isMetric": {- "type": "boolean"- }- }- }- }- }- },- {- "name": "items_getMaterialDimensionList",- "module": "items",- "classification": "READ",- "description": "get material dimension list",- "paramCount": 2,- "serviceParams": [- "client",- "materialFormId",- "isMetric",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "materialFormId": {- "type": "string"- },- "isMetric": {- "type": "boolean"- }- },- "required": [- "materialFormId",- "isMetric"- ]- }- },- {- "name": "items_getMaterialFinish",- "module": "items",- "classification": "READ",- "description": "get material finish",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getMaterialFinishes",- "module": "items",- "classification": "READ",- "description": "get material finishes",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getMaterialFinishList",- "module": "items",- "classification": "READ",- "description": "get material finish list",- "paramCount": 1,- "serviceParams": [- "client",- "materialSubstanceId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "materialSubstanceId": {- "type": "string"- }- },- "required": [- "materialSubstanceId"- ]- }- },- {- "name": "items_getMaterialForm",- "module": "items",- "classification": "READ",- "description": "get material form",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getMaterialForms",- "module": "items",- "classification": "READ",- "description": "get material forms",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getMaterialFormsList",- "module": "items",- "classification": "READ",- "description": "get material forms list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_getMaterialGrades",- "module": "items",- "classification": "READ",- "description": "get material grades",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getMaterialGrade",- "module": "items",- "classification": "READ",- "description": "get material grade",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getMaterialGradeList",- "module": "items",- "classification": "READ",- "description": "get material grade list",- "paramCount": 1,- "serviceParams": [- "client",- "materialSubstanceId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "materialSubstanceId": {- "type": "string"- }- },- "required": [- "materialSubstanceId"- ]- }- },- {- "name": "items_getMaterialSubstance",- "module": "items",- "classification": "READ",- "description": "get material substance",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getMaterialSubstances",- "module": "items",- "classification": "READ",- "description": "get material substances",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getMaterialSubstancesList",- "module": "items",- "classification": "READ",- "description": "get material substances list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_getMethodMaterial",- "module": "items",- "classification": "READ",- "description": "get method material",- "paramCount": 1,- "serviceParams": [- "client",- "materialId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "materialId": {- "type": "string"- }- },- "required": [- "materialId"- ]- }- },- {- "name": "items_getMethodMaterials",- "module": "items",- "classification": "READ",- "description": "get method materials",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getMethodMaterialsByMakeMethod",- "module": "items",- "classification": "READ",- "description": "get method materials by make method",- "paramCount": 1,- "serviceParams": [- "client",- "makeMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "makeMethodId": {- "type": "string"- }- },- "required": [- "makeMethodId"- ]- }- },- {- "name": "items_getMethodOperations",- "module": "items",- "classification": "READ",- "description": "get method operations",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getMethodOperationsByMakeMethodId",- "module": "items",- "classification": "READ",- "description": "get method operations by make method id",- "paramCount": 1,- "serviceParams": [- "client",- "makeMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "makeMethodId": {- "type": "string"- }- },- "required": [- "makeMethodId"- ]- }- },- {- "name": "items_getMethodTree",- "module": "items",- "classification": "READ",- "description": "get method tree",- "paramCount": 1,- "serviceParams": [- "client",- "makeMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "makeMethodId": {- "type": "string"- }- },- "required": [- "makeMethodId"- ]- }- },- {- "name": "items_getMethodTreeArray",- "module": "items",- "classification": "READ",- "description": "get method tree array",- "paramCount": 1,- "serviceParams": [- "client",- "makeMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "makeMethodId": {- "type": "string"- }- },- "required": [- "makeMethodId"- ]- }- },- {- "name": "items_getBomItemAttributes",- "module": "items",- "classification": "READ",- "description": "get bom item attributes",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "itemIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemIds"- ]- }- },- {- "name": "items_getOpenJobMaterials",- "module": "items",- "classification": "READ",- "description": "get open job materials",- "paramCount": 2,- "serviceParams": [- "client",- "{\n itemId,\n companyId,\n locationId\n }"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "items_getOpenProductionOrders",- "module": "items",- "classification": "READ",- "description": "get open production orders",- "paramCount": 2,- "serviceParams": [- "client",- "{\n itemId,\n companyId,\n locationId\n }"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "items_getOpenPurchaseOrderLines",- "module": "items",- "classification": "READ",- "description": "get open purchase order lines",- "paramCount": 2,- "serviceParams": [- "client",- "{\n itemId,\n companyId,\n locationId\n }"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "items_getOpenSalesOrderLines",- "module": "items",- "classification": "READ",- "description": "get open sales order lines",- "paramCount": 2,- "serviceParams": [- "client",- "{\n itemId,\n companyId,\n locationId\n }"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "items_getPart",- "module": "items",- "classification": "READ",- "description": "get part",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getParts",- "module": "items",- "classification": "READ",- "description": "get parts",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "supplierId": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getItemMpnsList",- "module": "items",- "classification": "READ",- "description": "get item mpns list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_getPartsList",- "module": "items",- "classification": "READ",- "description": "get parts list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_getPartUsedIn",- "module": "items",- "classification": "READ",- "description": "get part used in",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getPickMethod",- "module": "items",- "classification": "READ",- "description": "get pick method",- "paramCount": 2,- "serviceParams": [- "client",- "itemId",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "items_getPickMethods",- "module": "items",- "classification": "READ",- "description": "get pick methods",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getServices",- "module": "items",- "classification": "READ",- "description": "get services",- "paramCount": 5,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "group": {- "type": [- "string",- "null"- ]- },- "supplierId": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getService",- "module": "items",- "classification": "READ",- "description": "get service",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getServicesList",- "module": "items",- "classification": "READ",- "description": "get services list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_getSupplierParts",- "module": "items",- "classification": "READ",- "description": "get supplier parts",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getTool",- "module": "items",- "classification": "READ",- "description": "get tool",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getTools",- "module": "items",- "classification": "READ",- "description": "get tools",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "supplierId": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getToolsList",- "module": "items",- "classification": "READ",- "description": "get tools list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_getUnitOfMeasure",- "module": "items",- "classification": "READ",- "description": "get unit of measure",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getUnitOfMeasures",- "module": "items",- "classification": "READ",- "description": "get unit of measures",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getUnitOfMeasuresList",- "module": "items",- "classification": "READ",- "description": "get unit of measures list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_updateConfigurationParameterGroupOrder",- "module": "items",- "classification": "WRITE",- "description": "update configuration parameter group order",- "paramCount": 2,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_updateDefaultRevision",- "module": "items",- "classification": "WRITE",- "description": "update default revision",- "paramCount": 1,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_updateConfigurationParameterOrder",- "module": "items",- "classification": "WRITE",- "description": "update configuration parameter order",- "paramCount": 3,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- },- "configurationParameterGroupId": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_updateItemCost",- "module": "items",- "classification": "WRITE",- "description": "update item cost",- "paramCount": 2,- "serviceParams": [- "client",- "itemId",- "cost"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "cost": {- "type": "object",- "properties": {- "unitCost": {- "type": "number"- }- },- "required": [- "unitCost"- ]- }- },- "required": [- "itemId",- "cost"- ]- }- },- {- "name": "items_updateMaterialOrder",- "module": "items",- "classification": "WRITE",- "description": "update material order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "order": {- "type": "number"- }- },- "required": [- "id",- "order"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "items_updateOperationOrder",- "module": "items",- "classification": "WRITE",- "description": "update operation order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "order": {- "type": "number"- }- },- "required": [- "id",- "order"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "items_updateRevision",- "module": "items",- "classification": "WRITE",- "description": "update revision",- "paramCount": 2,- "serviceParams": [- "client",- "revision"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "revision": {- "type": "string"- }- },- "required": [- "id",- "revision"- ]- }- },- {- "name": "items_upsertConfigurationParameter",- "module": "items",- "classification": "WRITE",- "description": "upsert configuration parameter",- "paramCount": 1,- "serviceParams": [- "client",- "configurationParameter"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "configurationParameter": {}- },- "required": [- "configurationParameter"- ]- }- },- {- "name": "items_upsertConfigurationParameterGroup",- "module": "items",- "classification": "WRITE",- "description": "upsert configuration parameter group",- "paramCount": 1,- "serviceParams": [- "client",- "configurationParameterGroup"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "configurationParameterGroup": {}- },- "required": [- "configurationParameterGroup"- ]- }- },- {- "name": "items_upsertConfigurationRule",- "module": "items",- "classification": "WRITE",- "description": "upsert configuration rule",- "paramCount": 2,- "serviceParams": [- "client",- "configurationRule"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "field": {- "type": "string"- },- "code": {- "type": "string"- }- },- "required": [- "field",- "code"- ]- }- },- {- "name": "items_upsertItemDefaultPickMethod",- "module": "items",- "classification": "WRITE",- "description": "upsert item default pick method",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "storageUnitId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getRecipeProcessIdsForItem",- "module": "items",- "classification": "READ",- "description": "get recipe process ids for item",- "paramCount": 1,- "serviceParams": [- "client",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getItemShelfLife",- "module": "items",- "classification": "READ",- "description": "get item shelf life",- "paramCount": 1,- "serviceParams": [- "client",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getBomHasShelfLifeManagedInput",- "module": "items",- "classification": "READ",- "description": "get bom has shelf life managed input",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_upsertItemShelfLife",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "upsert item shelf life",- "paramCount": 6,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "mode": {- "type": "string"- },- "days": {- "type": "number"- },- "triggerProcessId": {- "type": "string"- },- "triggerTiming": {- "type": "string"- },- "calculateFromBom": {- "type": "boolean"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_upsertPickMethodWithShelfLife",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "upsert pick method with shelf life",- "paramCount": 6,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "defaultStorageUnitId": {- "type": [- "string",- "null"- ]- },- "sortMethod": {- "type": "string"- },- "customFields": {},- "shelfLife: {\n mode": {}- },- "required": [- "itemId",- "locationId"- ]- }- },- {- "name": "items_cascadeItemTrackingType",- "module": "items",- "classification": "WRITE",- "description": "cascade item tracking type",- "paramCount": 2,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemIds": {- "type": "array",- "items": {- "type": "string"- }- },- "newType": {}- },- "required": [- "itemIds",- "newType"- ]- }- },- {- "name": "items_updateItemMethodAndSourcing",- "module": "items",- "classification": "WRITE",- "description": "update item method and sourcing",- "paramCount": 3,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemIds": {- "type": "array",- "items": {- "type": "string"- }- },- "itemUpdate: {\n replenishmentSystem": {},- "cascade: {\n sourcingType": {}- },- "required": [- "itemIds"- ]- }- },- {- "name": "items_upsertConsumable",- "module": "items",- "classification": "WRITE",- "description": "upsert consumable",- "paramCount": 12,- "serviceParams": [- "client",- "consumable"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "readableId": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "replenishmentSystem": {- "type": "string"- },- "defaultMethodType": {- "type": "string"- },- "itemTrackingType": {- "type": "string"- },- "postingGroupId": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "shelfLifeDays": {- "type": "number"- },- "shelfLifeTriggerProcessId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "name",- "replenishmentSystem",- "defaultMethodType",- "itemTrackingType",- "unitOfMeasureCode",- "_operation"- ]- }- },- {- "name": "items_matchItemIdByText",- "module": "items",- "classification": "WRITE",- "description": "match item id by text",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "candidates"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "candidates": {}- },- "required": [- "candidates"- ]- }- },- {- "name": "items_resolveItemIdFromExtractedText",- "module": "items",- "classification": "WRITE",- "description": "resolve item id from extracted text",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "party",- "candidates"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "party": {},- "candidates": {}- },- "required": [- "party",- "candidates"- ]- }- },- {- "name": "items_upsertPart",- "module": "items",- "classification": "WRITE",- "description": "upsert part",- "paramCount": 15,- "serviceParams": [- "client",- "part"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "readableId": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "replenishmentSystem": {- "type": "string"- },- "defaultMethodType": {- "type": "string"- },- "itemTrackingType": {- "type": "string"- },- "postingGroupId": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "shelfLifeDays": {- "type": "number"- },- "shelfLifeTriggerProcessId": {- "type": "string"- },- "revision": {- "type": "string"- },- "modelUploadId": {- "type": "string"- },- "lotSize": {- "type": "number"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "name",- "replenishmentSystem",- "defaultMethodType",- "itemTrackingType",- "unitOfMeasureCode",- "revision",- "_operation"- ]- }- },- {- "name": "items_updateItem",- "module": "items",- "classification": "WRITE",- "description": "update item",- "paramCount": 12,- "serviceParams": [- "client",- "item"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "readableId": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "replenishmentSystem": {- "type": "string"- },- "defaultMethodType": {- "type": "string"- },- "itemTrackingType": {- "type": "string"- },- "postingGroupId": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "shelfLifeDays": {- "type": "number"- },- "shelfLifeTriggerProcessId": {- "type": "string"- }- },- "required": [- "id",- "name",- "replenishmentSystem",- "defaultMethodType",- "itemTrackingType",- "unitOfMeasureCode"- ]- }- },- {- "name": "items_upsertItemCost",- "module": "items",- "classification": "WRITE",- "description": "upsert item cost",- "paramCount": 4,- "serviceParams": [- "client",- "itemCost"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "itemPostingGroupId": {- "type": "string"- },- "costingMethod": {- "type": "string"- },- "unitCost": {- "type": "number"- }- },- "required": [- "itemId",- "costingMethod"- ]- }- },- {- "name": "items_upsertPickMethod",- "module": "items",- "classification": "WRITE",- "description": "upsert pick method",- "paramCount": 4,- "serviceParams": [- "client",- "pickMethod"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "defaultStorageUnitId": {- "type": "string"- },- "sortMethod": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "itemId",- "locationId",- "_operation"- ]- }- },- {- "name": "items_upsertItemManufacturing",- "module": "items",- "classification": "WRITE",- "description": "upsert item manufacturing",- "paramCount": 5,- "serviceParams": [- "client",- "partManufacturing"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "requiresConfiguration": {- "type": "string"- },- "lotSize": {- "type": "number"- },- "scrapPercentage": {- "type": "number"- },- "leadTime": {- "type": "number"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_upsertItemPlanning",- "module": "items",- "classification": "WRITE",- "description": "upsert item planning",- "paramCount": 1,- "serviceParams": [- "client",- "partPlanning"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "partPlanning": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "partPlanning",- "_operation"- ]- }- },- {- "name": "items_upsertItemPurchasing",- "module": "items",- "classification": "WRITE",- "description": "upsert item purchasing",- "paramCount": 5,- "serviceParams": [- "client",- "itemPurchasing"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "preferredSupplierId": {- "type": "string"- },- "conversionFactor": {- "type": "number"- },- "leadTime": {- "type": "number"- },- "purchasingUnitOfMeasureCode": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_upsertItemSupersession",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "upsert item supersession",- "paramCount": 36,- "serviceParams": [- "client",- "itemSupersession"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "preferredSupplierId": {- "type": "string"- },- "conversionFactor": {- "type": "number"- },- "leadTime": {- "type": "number"- },- "purchasingUnitOfMeasureCode": {- "type": "string"- },- "unitSalePrice": {- "type": "number"- },- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "materialFormId": {- "type": "string"- },- "materialSubstanceId": {- "type": "string"- },- "code": {- "type": "string"- },- "readableId": {- "type": "string"- },- "description": {- "type": "string"- },- "replenishmentSystem": {- "type": "string"- },- "defaultMethodType": {- "type": "string"- },- "itemTrackingType": {- "type": "string"- },- "postingGroupId": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "shelfLifeDays": {- "type": "number"- },- "shelfLifeTriggerProcessId": {- "type": "string"- },- "revision": {- "type": "string"- },- "modelUploadId": {- "type": "string"- },- "lotSize": {- "type": "number"- },- "locationId": {- "type": "string"- },- "defaultStorageUnitId": {- "type": "string"- },- "sortMethod": {- "type": "string"- },- "shelfLifeMode": {- "type": "string"- },- "shelfLifeTriggerTiming": {- "type": "string"- },- "shelfLifeCalculateFromBom": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "supplierPartId": {- "type": "string"- },- "supplierUnitOfMeasureCode": {- "type": "string"- },- "minimumOrderQuantity": {- "type": "number"- },- "orderMultiple": {- "type": "number"- },- "unitPrice": {- "type": "number"- }- },- "required": [- "itemId",- "name",- "materialFormId",- "materialSubstanceId",- "code",- "id",- "replenishmentSystem",- "defaultMethodType",- "itemTrackingType",- "unitOfMeasureCode",- "revision",- "locationId",- "shelfLifeCalculateFromBom",- "supplierId"- ]- }- },- {- "name": "items_upsertItemPostingGroup",- "module": "items",- "classification": "WRITE",- "description": "upsert item posting group",- "paramCount": 3,- "serviceParams": [- "client",- "itemPostingGroup"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "items_upsertSupplierPart",- "module": "items",- "classification": "WRITE",- "description": "upsert supplier part",- "paramCount": 9,- "serviceParams": [- "client",- "supplierPart"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "itemId": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "supplierPartId": {- "type": "string"- },- "supplierUnitOfMeasureCode": {- "type": "string"- },- "minimumOrderQuantity": {- "type": "number"- },- "orderMultiple": {- "type": "number"- },- "conversionFactor": {- "type": "number"- },- "unitPrice": {- "type": "number"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "itemId",- "supplierId",- "_operation"- ]- }- },- {- "name": "items_upsertItemCustomerPart",- "module": "items",- "classification": "WRITE",- "description": "upsert item customer part",- "paramCount": 5,- "serviceParams": [- "client",- "customerPart"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "itemId": {- "type": "string"- },- "customerId": {- "type": "string"- },- "customerPartId": {- "type": "string"- },- "customerPartRevision": {- "type": "string"- }- },- "required": [- "itemId",- "customerId",- "customerPartId"- ]- }- },- {- "name": "items_upsertItemUnitSalePrice",- "module": "items",- "classification": "WRITE",- "description": "upsert item unit sale price",- "paramCount": 2,- "serviceParams": [- "client",- "itemUnitSalePrice"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "unitSalePrice": {- "type": "number"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_upsertMakeMethodVersion",- "module": "items",- "classification": "WRITE",- "description": "upsert make method version",- "paramCount": 3,- "serviceParams": [- "client",- "makeMethodVersion"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "copyFromId": {- "type": "string"- },- "activeVersionId": {- "type": "string"- },- "version": {- "type": "number"- }- },- "required": [- "copyFromId"- ]- }- },- {- "name": "items_upsertMethodMaterial",- "module": "items",- "classification": "WRITE",- "description": "upsert method material",- "paramCount": 12,- "serviceParams": [- "client",- "methodMaterial"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "makeMethodId": {- "type": "string"- },- "order": {- "type": "number"- },- "itemType": {- "type": "string"- },- "kit": {- "type": "string"- },- "methodType": {- "type": "string"- },- "sourcingType": {- "type": "string"- },- "itemId": {- "type": "string"- },- "methodOperationId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "unitOfMeasureCode": {- "type": "string"- },- "storageUnitIds": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "makeMethodId",- "itemType",- "methodType",- "sourcingType",- "unitOfMeasureCode",- "storageUnitIds",- "_operation"- ]- }- },- {- "name": "items_upsertMethodOperation",- "module": "items",- "classification": "WRITE",- "description": "upsert method operation",- "paramCount": 1,- "serviceParams": [- "client",- "methodOperation"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "methodOperation": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "methodOperation",- "_operation"- ]- }- },- {- "name": "items_upsertMethodOperationStep",- "module": "items",- "classification": "WRITE",- "description": "upsert method operation step",- "paramCount": 1,- "serviceParams": [- "client",- "methodOperationStep"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "methodOperationStep": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "methodOperationStep",- "_operation"- ]- }- },- {- "name": "items_duplicateMethodOperationStep",- "module": "items",- "classification": "WRITE",- "description": "duplicate method operation step",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_upsertMethodOperationStepSlide",- "module": "items",- "classification": "WRITE",- "description": "upsert method operation step slide",- "paramCount": 1,- "serviceParams": [- "client",- "slide"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "slide": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "slide",- "_operation"- ]- }- },- {- "name": "items_upsertMethodOperationParameter",- "module": "items",- "classification": "WRITE",- "description": "upsert method operation parameter",- "paramCount": 1,- "serviceParams": [- "client",- "methodOperationParameter"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "methodOperationParameter": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "methodOperationParameter",- "_operation"- ]- }- },- {- "name": "items_upsertMethodOperationTool",- "module": "items",- "classification": "WRITE",- "description": "upsert method operation tool",- "paramCount": 1,- "serviceParams": [- "client",- "methodOperationTool"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "methodOperationTool": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "methodOperationTool",- "_operation"- ]- }- },- {- "name": "items_replaceMethodMaterialSteps",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "replace method material steps",- "paramCount": 2,- "serviceParams": [- "client",- "methodMaterialId",- "methodOperationStepIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "methodMaterialId": {- "type": "string"- },- "methodOperationStepIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "methodMaterialId",- "methodOperationStepIds"- ]- }- },- {- "name": "items_setMethodMaterialStepLink",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "set method material step link",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "methodMaterialId": {- "type": "string"- },- "methodOperationStepId": {- "type": "string"- },- "linked": {- "type": "boolean"- },- "quantity": {- "type": [- "number",- "null"- ]- }- },- "required": [- "methodMaterialId",- "methodOperationStepId",- "linked"- ]- }- },- {- "name": "items_setMethodOperationToolStepLink",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "set method operation tool step link",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "operationId": {- "type": "string"- },- "toolId": {- "type": "string"- },- "methodOperationStepId": {- "type": "string"- },- "linked": {- "type": "boolean"- }- },- "required": [- "operationId",- "toolId",- "methodOperationStepId",- "linked"- ]- }- },- {- "name": "items_upsertMaterial",- "module": "items",- "classification": "WRITE",- "description": "upsert material",- "paramCount": 19,- "serviceParams": [- "client",- "material"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "readableId": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "replenishmentSystem": {- "type": "string"- },- "defaultMethodType": {- "type": "string"- },- "itemTrackingType": {- "type": "string"- },- "postingGroupId": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "shelfLifeDays": {- "type": "number"- },- "shelfLifeTriggerProcessId": {- "type": "string"- },- "materialSubstanceId": {- "type": "string"- },- "materialFormId": {- "type": "string"- },- "materialTypeId": {- "type": "string"- },- "finishId": {- "type": "string"- },- "gradeId": {- "type": "string"- },- "dimensionId": {- "type": "string"- },- "sizes": {- "type": "array",- "items": {- "type": "string"- }- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "name",- "replenishmentSystem",- "defaultMethodType",- "itemTrackingType",- "unitOfMeasureCode",- "_operation"- ]- }- },- {- "name": "items_upsertMaterialDimension",- "module": "items",- "classification": "WRITE",- "description": "upsert material dimension",- "paramCount": 3,- "serviceParams": [- "client",- "materialDimension"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "materialFormId": {- "type": "string"- }- },- "required": [- "name",- "materialFormId"- ]- }- },- {- "name": "items_upsertMaterialFinish",- "module": "items",- "classification": "WRITE",- "description": "upsert material finish",- "paramCount": 3,- "serviceParams": [- "client",- "materialFinish"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "materialSubstanceId": {- "type": "string"- },- "name": {- "type": "string"- }- },- "required": [- "materialSubstanceId",- "name"- ]- }- },- {- "name": "items_upsertMaterialForm",- "module": "items",- "classification": "WRITE",- "description": "upsert material form",- "paramCount": 3,- "serviceParams": [- "client",- "materialForm"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "code": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "code",- "_operation"- ]- }- },- {- "name": "items_upsertMaterialGrade",- "module": "items",- "classification": "WRITE",- "description": "upsert material grade",- "paramCount": 3,- "serviceParams": [- "client",- "materialGrade"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "materialSubstanceId": {- "type": "string"- },- "name": {- "type": "string"- }- },- "required": [- "materialSubstanceId",- "name"- ]- }- },- {- "name": "items_deleteMaterialType",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete material type",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getMaterialTypes",- "module": "items",- "classification": "READ",- "description": "get material types",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getMaterialType",- "module": "items",- "classification": "READ",- "description": "get material type",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getMaterialTypeList",- "module": "items",- "classification": "READ",- "description": "get material type list",- "paramCount": 2,- "serviceParams": [- "client",- "materialSubstanceId",- "materialFormId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "materialSubstanceId": {- "type": "string"- },- "materialFormId": {- "type": "string"- }- },- "required": [- "materialSubstanceId",- "materialFormId"- ]- }- },- {- "name": "items_upsertMaterialType",- "module": "items",- "classification": "WRITE",- "description": "upsert material type",- "paramCount": 5,- "serviceParams": [- "client",- "materialType"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "materialSubstanceId": {- "type": "string"- },- "materialFormId": {- "type": "string"- },- "name": {- "type": "string"- },- "code": {- "type": "string"- }- },- "required": [- "materialSubstanceId",- "materialFormId",- "name",- "code"- ]- }- },- {- "name": "items_upsertMaterialSubstance",- "module": "items",- "classification": "WRITE",- "description": "upsert material substance",- "paramCount": 3,- "serviceParams": [- "client",- "materialSubstance"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "code": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "code",- "_operation"- ]- }- },- {- "name": "items_upsertService",- "module": "items",- "classification": "WRITE",- "description": "upsert service",- "paramCount": 13,- "serviceParams": [- "client",- "service"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "readableId": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "replenishmentSystem": {- "type": "string"- },- "defaultMethodType": {- "type": "string"- },- "itemTrackingType": {- "type": "string"- },- "postingGroupId": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "shelfLifeDays": {- "type": "number"- },- "shelfLifeTriggerProcessId": {- "type": "string"- },- "revision": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "name",- "replenishmentSystem",- "defaultMethodType",- "itemTrackingType",- "unitOfMeasureCode",- "revision",- "_operation"- ]- }- },- {- "name": "items_upsertUnitOfMeasure",- "module": "items",- "classification": "WRITE",- "description": "upsert unit of measure",- "paramCount": 3,- "serviceParams": [- "client",- "unitOfMeasure"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "code": {- "type": "string"- },- "name": {- "type": "string"- }- },- "required": [- "code",- "name"- ]- }- },- {- "name": "items_upsertTool",- "module": "items",- "classification": "WRITE",- "description": "upsert tool",- "paramCount": 15,- "serviceParams": [- "client",- "tool"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "readableId": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "replenishmentSystem": {- "type": "string"- },- "defaultMethodType": {- "type": "string"- },- "itemTrackingType": {- "type": "string"- },- "postingGroupId": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "shelfLifeDays": {- "type": "number"- },- "shelfLifeTriggerProcessId": {- "type": "string"- },- "revision": {- "type": "string"- },- "modelUploadId": {- "type": "string"- },- "lotSize": {- "type": "number"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "name",- "replenishmentSystem",- "defaultMethodType",- "itemTrackingType",- "unitOfMeasureCode",- "revision",- "_operation"- ]- }- },- {- "name": "items_getSupplierPriceBreaksForItems",- "module": "items",- "classification": "READ",- "description": "get supplier price breaks for items",- "paramCount": 1,- "serviceParams": [- "client",- "itemIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemIds"- ]- }- },- {- "name": "items_lookupBuyPrice",- "module": "items",- "classification": "WRITE",- "description": "lookup buy price",- "paramCount": 3,- "serviceParams": [- "client",- "itemId",- "qty",- "fallbackCost"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "qty": {- "type": "number"- },- "fallbackCost": {- "type": "number"- }- },- "required": [- "itemId",- "qty",- "fallbackCost"- ]- }- },- {- "name": "items_getSupplierPartPriceBreaks",- "module": "items",- "classification": "READ",- "description": "get supplier part price breaks",- "paramCount": 1,- "serviceParams": [- "client",- "supplierPartId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierPartId": {- "type": "string"- }- },- "required": [- "supplierPartId"- ]- }- },- {- "name": "items_getChangeNotice",- "module": "items",- "classification": "READ",- "description": "get change notice",- "paramCount": 1,- "serviceParams": [- "client",- "changeNoticeId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeId": {- "type": "string"- }- },- "required": [- "changeNoticeId"- ]- }- },- {- "name": "items_getChangeNotices",- "module": "items",- "classification": "READ",- "description": "get change notices",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_insertChangeNotice",- "module": "items",- "classification": "WRITE",- "description": "insert change notice",- "paramCount": 12,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeId": {- "type": "string"- },- "name": {- "type": "string"- },- "type": {- "type": "string"- },- "priority": {- "type": "string"- },- "changeNoticeTypeId": {- "type": "string"- },- "nonConformanceId": {- "type": "string"- },- "openDate": {- "type": "string"- },- "reasonForChange": {},- "description": {},- "dueDate": {- "type": "string"- },- "assignee": {- "type": "string"- },- "customFields": {}- },- "required": [- "name",- "openDate"- ]- }- },- {- "name": "items_updateChangeNotice",- "module": "items",- "classification": "WRITE",- "description": "update change notice",- "paramCount": 13,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "changeOrderId": {- "type": "string"- },- "name": {- "type": "string"- },- "type": {- "type": "string"- },- "priority": {- "type": [- "string",- "null"- ]- },- "changeOrderTypeId": {- "type": [- "string",- "null"- ]- },- "nonConformanceId": {- "type": [- "string",- "null"- ]- },- "openDate": {- "type": "string"- },- "reasonForChange": {},- "description": {},- "dueDate": {- "type": [- "string",- "null"- ]- },- "assignee": {- "type": [- "string",- "null"- ]- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "items_deleteChangeNotice",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete change notice",- "paramCount": 1,- "serviceParams": [- "client",- "changeNoticeId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeId": {- "type": "string"- }- },- "required": [- "changeNoticeId"- ]- }- },- {- "name": "items_updateChangeNoticeStatus",- "module": "items",- "classification": "WRITE",- "description": "update change notice status",- "paramCount": 4,- "serviceParams": [- "client",- "update"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "fromStatus": {- "type": "string"- },- "toStatus": {- "type": "string"- },- "assignee": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id",- "fromStatus",- "toStatus"- ]- }- },- {- "name": "items_getChangeNoticeTypes",- "module": "items",- "classification": "READ",- "description": "get change notice types",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getChangeNoticeTypesList",- "module": "items",- "classification": "READ",- "description": "get change notice types list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_getChangeNoticeType",- "module": "items",- "classification": "READ",- "description": "get change notice type",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_upsertChangeNoticeType",- "module": "items",- "classification": "WRITE",- "description": "upsert change notice type",- "paramCount": 1,- "serviceParams": [- "client",- "changeNoticeType"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeType": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "changeNoticeType",- "_operation"- ]- }- },- {- "name": "items_deleteChangeNoticeType",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete change notice type",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_getTopLevelProductsForItems",- "module": "items",- "classification": "READ",- "description": "get top level products for items",- "paramCount": 1,- "serviceParams": [- "client",- "itemIds",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemIds"- ]- }- },- {- "name": "items_mintPlaceholderPart",- "module": "items",- "classification": "WRITE",- "description": "mint placeholder part",- "paramCount": 3,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "readableId": {- "type": "string"- },- "name": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- }- },- "required": [- "readableId",- "name"- ]- }- },- {- "name": "items_createChangeNoticeDraftMethod",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "create change notice draft method",- "paramCount": 4,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "changeType": {},- "revision": {- "type": "string"- }- },- "required": [- "changeNoticeId",- "itemId",- "changeType"- ]- }- },- {- "name": "items_addChangeNoticeAffectedItem",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "add change notice affected item",- "paramCount": 5,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "changeType": {},- "revision": {- "type": "string"- },- "newPart": {- "type": "object",- "properties": {- "readableId": {- "type": "string"- },- "name": {- "type": "string"- },- "itemType": {- "type": "string",- "enum": [- "Part",- "Tool"- ]- },- "replenishmentSystem": {- "type": "string",- "enum": [- "Buy",- "Make",- "Buy and Make"- ]- },- "itemTrackingType": {- "type": "string"- }- },- "required": [- "readableId",- "name",- "itemType",- "replenishmentSystem"- ]- }- },- "required": [- "changeNoticeId",- "changeType"- ]- }- },- {- "name": "items_updateChangeNoticeAffectedItemChangeType",- "module": "items",- "classification": "WRITE",- "description": "update change notice affected item change type",- "paramCount": 2,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "changeType": {}- },- "required": [- "id",- "changeType"- ]- }- },- {- "name": "items_updateChangeNoticeAffectedItemCutover",- "module": "items",- "classification": "WRITE",- "description": "update change notice affected item cutover",- "paramCount": 4,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "supersessionMode": {},- "discontinuationDate": {- "type": "string"- },- "successorEffectivityDate": {- "type": "string"- }- },- "required": [- "id",- "supersessionMode"- ]- }- },- {- "name": "items_getChangeNoticeAffectedItems",- "module": "items",- "classification": "READ",- "description": "get change notice affected items",- "paramCount": 1,- "serviceParams": [- "client",- "changeNoticeId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeId": {- "type": "string"- }- },- "required": [- "changeNoticeId"- ]- }- },- {- "name": "items_removeChangeNoticeAffectedItem",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "remove change notice affected item",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_findChangeNoticesForItem",- "module": "items",- "classification": "READ",- "description": "find change notices for item",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "statuses": {- "type": "array",- "items": {}- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getChangeNoticesForNonConformance",- "module": "items",- "classification": "READ",- "description": "get change notices for non conformance",- "paramCount": 1,- "serviceParams": [- "client",- "nonConformanceId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "nonConformanceId": {- "type": "string"- }- },- "required": [- "nonConformanceId"- ]- }- },- {- "name": "items_findOtherOpenChangeNoticesForItem",- "module": "items",- "classification": "READ",- "description": "find other open change notices for item",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "excludeChangeNoticeId": {- "type": "string"- }- },- "required": [- "itemId",- "excludeChangeNoticeId"- ]- }- },- {- "name": "items_getItemChangeNoticeData",- "module": "items",- "classification": "READ",- "description": "get item change notice data",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "items_getChangeNoticeActions",- "module": "items",- "classification": "READ",- "description": "get change notice actions",- "paramCount": 1,- "serviceParams": [- "client",- "changeNoticeId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeId": {- "type": "string"- }- },- "required": [- "changeNoticeId"- ]- }- },- {- "name": "items_updateChangeNoticeActionStatus",- "module": "items",- "classification": "WRITE",- "description": "update change notice action status",- "paramCount": 2,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- }- },- "required": [- "id",- "status"- ]- }- },- {- "name": "items_deleteChangeNoticeAction",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete change notice action",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_updateChangeNoticeActionOrder",- "module": "items",- "classification": "WRITE",- "description": "update change notice action order",- "paramCount": 2,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeId": {- "type": "string"- },- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "changeNoticeId",- "updates"- ]- }- },- {- "name": "items_getChangeNoticeRequiredActions",- "module": "items",- "classification": "READ",- "description": "get change notice required actions",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "items_getChangeNoticeRequiredActionsList",- "module": "items",- "classification": "READ",- "description": "get change notice required actions list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "items_getChangeNoticeRequiredAction",- "module": "items",- "classification": "READ",- "description": "get change notice required action",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_upsertChangeNoticeRequiredAction",- "module": "items",- "classification": "WRITE",- "description": "upsert change notice required action",- "paramCount": 3,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "active": {- "type": "boolean"- }- },- "required": [- "name",- "active"- ]- }- },- {- "name": "items_deleteChangeNoticeRequiredAction",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "delete change notice required action",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "items_setChangeNoticeActionTasks",- "module": "items",- "classification": "DESTRUCTIVE",- "description": "set change notice action tasks",- "paramCount": 2,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeId": {- "type": "string"- },- "requiredActionIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "changeNoticeId",- "requiredActionIds"- ]- }- },- {- "name": "items_seedDefaultChangeNoticeActions",- "module": "items",- "classification": "WRITE",- "description": "seed default change notice actions",- "paramCount": 1,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeId": {- "type": "string"- }- },- "required": [- "changeNoticeId"- ]- }- },- {- "name": "items_diffMethod",- "module": "items",- "classification": "WRITE",- "description": "diff method",- "paramCount": 1,- "serviceParams": [- "input"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "input": {}- },- "required": [- "input"- ]- }- },- {- "name": "items_getChangeNoticeDiff",- "module": "items",- "classification": "READ",- "description": "get change notice diff",- "paramCount": 1,- "serviceParams": [- "client",- "changeNoticeId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "changeNoticeId": {- "type": "string"- }- },- "required": [- "changeNoticeId"- ]- }- },- {- "name": "people_deleteAttribute",- "module": "people",- "classification": "DESTRUCTIVE",- "description": "delete attribute",- "paramCount": 1,- "serviceParams": [- "client",- "attributeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "attributeId": {- "type": "string"- }- },- "required": [- "attributeId"- ]- }- },- {- "name": "people_deleteAttributeCategory",- "module": "people",- "classification": "DESTRUCTIVE",- "description": "delete attribute category",- "paramCount": 1,- "serviceParams": [- "client",- "attributeCategoryId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "attributeCategoryId": {- "type": "string"- }- },- "required": [- "attributeCategoryId"- ]- }- },- {- "name": "people_deleteDepartment",- "module": "people",- "classification": "DESTRUCTIVE",- "description": "delete department",- "paramCount": 1,- "serviceParams": [- "client",- "departmentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "departmentId": {- "type": "string"- }- },- "required": [- "departmentId"- ]- }- },- {- "name": "people_deleteHoliday",- "module": "people",- "classification": "DESTRUCTIVE",- "description": "delete holiday",- "paramCount": 1,- "serviceParams": [- "client",- "holidayId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "holidayId": {- "type": "string"- }- },- "required": [- "holidayId"- ]- }- },- {- "name": "people_deleteShift",- "module": "people",- "classification": "DESTRUCTIVE",- "description": "delete shift",- "paramCount": 1,- "serviceParams": [- "client",- "shiftId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shiftId": {- "type": "string"- }- },- "required": [- "shiftId"- ]- }- },- {- "name": "people_getAttribute",- "module": "people",- "classification": "READ",- "description": "get attribute",- "paramCount": 1,- "serviceParams": [- "client",- "attributeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "attributeId": {- "type": "string"- }- },- "required": [- "attributeId"- ]- }- },- {- "name": "people_getAttributeCategories",- "module": "people",- "classification": "READ",- "description": "get attribute categories",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "search": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- },- "required": [- "search"- ]- }- },- {- "name": "people_getAttributeCategory",- "module": "people",- "classification": "READ",- "description": "get attribute category",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "people_getAttributeDataTypes",- "module": "people",- "classification": "READ",- "description": "get attribute data types",- "paramCount": 0,- "serviceParams": [- "client"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "people_getDepartment",- "module": "people",- "classification": "READ",- "description": "get department",- "paramCount": 1,- "serviceParams": [- "client",- "departmentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "departmentId": {- "type": "string"- }- },- "required": [- "departmentId"- ]- }- },- {- "name": "people_getDepartments",- "module": "people",- "classification": "READ",- "description": "get departments",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "people_getDepartmentsList",- "module": "people",- "classification": "READ",- "description": "get departments list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "people_getDepartmentsTree",- "module": "people",- "classification": "READ",- "description": "get departments tree",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "people_getEmployeeJob",- "module": "people",- "classification": "READ",- "description": "get employee job",- "paramCount": 1,- "serviceParams": [- "client",- "employeeId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- }- },- "required": [- "employeeId"- ]- }- },- {- "name": "people_getEmployeeSummary",- "module": "people",- "classification": "READ",- "description": "get employee summary",- "paramCount": 1,- "serviceParams": [- "client",- "employeeId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- }- },- "required": [- "employeeId"- ]- }- },- {- "name": "people_getHoliday",- "module": "people",- "classification": "READ",- "description": "get holiday",- "paramCount": 1,- "serviceParams": [- "client",- "holidayId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "holidayId": {- "type": "string"- }- },- "required": [- "holidayId"- ]- }- },- {- "name": "people_getHolidays",- "module": "people",- "classification": "READ",- "description": "get holidays",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "people_getHolidayYears",- "module": "people",- "classification": "READ",- "description": "get holiday years",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "people_getPeople",- "module": "people",- "classification": "READ",- "description": "get people",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "people_getContacts",- "module": "people",- "classification": "READ",- "description": "get contacts",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "people_getShift",- "module": "people",- "classification": "READ",- "description": "get shift",- "paramCount": 1,- "serviceParams": [- "client",- "shiftId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shiftId": {- "type": "string"- }- },- "required": [- "shiftId"- ]- }- },- {- "name": "people_getShifts",- "module": "people",- "classification": "READ",- "description": "get shifts",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "people_getShiftsList",- "module": "people",- "classification": "READ",- "description": "get shifts list",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "locationId"- ]- }- },- {- "name": "people_getEmployeeShifts",- "module": "people",- "classification": "READ",- "description": "get employee shifts",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "people_getEmployeeDepartments",- "module": "people",- "classification": "READ",- "description": "get employee departments",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "people_getShiftsWithTimes",- "module": "people",- "classification": "READ",- "description": "get shifts with times",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- },- "required": [- "locationId"- ]- }- },- {- "name": "people_insertAttribute",- "module": "people",- "classification": "WRITE",- "description": "insert attribute",- "paramCount": 5,- "serviceParams": [- "client",- "attribute"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "attributeDataTypeId": {- "type": "number"- },- "userAttributeCategoryId": {- "type": "string"- },- "listOptions": {- "type": "array",- "items": {- "type": "string"- }- },- "canSelfManage": {- "type": "boolean"- }- },- "required": [- "name",- "attributeDataTypeId",- "userAttributeCategoryId",- "canSelfManage"- ]- }- },- {- "name": "people_insertAttributeCategory",- "module": "people",- "classification": "WRITE",- "description": "insert attribute category",- "paramCount": 3,- "serviceParams": [- "client",- "attributeCategory"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "emoji": {- "type": "string"- },- "public": {- "type": "boolean"- }- },- "required": [- "name",- "public"- ]- }- },- {- "name": "people_insertEmployeeJob",- "module": "people",- "classification": "WRITE",- "description": "insert employee job",- "paramCount": 2,- "serviceParams": [- "client",- "job"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "people_updateAttribute",- "module": "people",- "classification": "WRITE",- "description": "update attribute",- "paramCount": 4,- "serviceParams": [- "client",- "attribute"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "listOptions": {- "type": "array",- "items": {- "type": "string"- }- },- "canSelfManage": {- "type": "boolean"- }- },- "required": [- "name",- "canSelfManage"- ]- }- },- {- "name": "people_updateAttributeCategory",- "module": "people",- "classification": "WRITE",- "description": "update attribute category",- "paramCount": 4,- "serviceParams": [- "client",- "attributeCategory"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "emoji": {- "type": "string"- },- "public": {- "type": "boolean"- }- },- "required": [- "id",- "name",- "public"- ]- }- },- {- "name": "people_updateAttributeSortOrder",- "module": "people",- "classification": "WRITE",- "description": "update attribute sort order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "people_updateEmployeeJob",- "module": "people",- "classification": "DESTRUCTIVE",- "description": "update employee job",- "paramCount": 2,- "serviceParams": [- "db",- "employeeId",- "employeeJob"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- },- "employeeJob": {}- },- "required": [- "employeeId",- "employeeJob"- ]- }- },- {- "name": "people_upsertDepartment",- "module": "people",- "classification": "WRITE",- "description": "upsert department",- "paramCount": 3,- "serviceParams": [- "client",- "department"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "parentDepartmentId": {- "type": "string"- }- },- "required": [- "name"- ]- }- },- {- "name": "people_upsertHoliday",- "module": "people",- "classification": "WRITE",- "description": "upsert holiday",- "paramCount": 3,- "serviceParams": [- "client",- "holiday"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "date": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "date",- "_operation"- ]- }- },- {- "name": "people_upsertShift",- "module": "people",- "classification": "WRITE",- "description": "upsert shift",- "paramCount": 12,- "serviceParams": [- "client",- "shift"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "startTime": {- "type": "string"- },- "endTime": {- "type": "string"- },- "locationId": {- "type": "string"- },- "monday": {- "type": "string"- },- "tuesday": {- "type": "string"- },- "wednesday": {- "type": "string"- },- "thursday": {- "type": "string"- },- "friday": {- "type": "string"- },- "saturday": {- "type": "string"- },- "sunday": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "startTime",- "endTime",- "locationId",- "monday",- "tuesday",- "wednesday",- "thursday",- "friday",- "saturday",- "sunday",- "_operation"- ]- }- },- {- "name": "people_clockIn",- "module": "people",- "classification": "WRITE",- "description": "clock in",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- }- },- "required": [- "employeeId"- ]- }- },- {- "name": "people_clockOut",- "module": "people",- "classification": "WRITE",- "description": "clock out",- "paramCount": 3,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- },- "clockOut": {- "type": "string"- },- "note": {- "type": "string"- }- },- "required": [- "employeeId"- ]- }- },- {- "name": "people_createTimeCardEntry",- "module": "people",- "classification": "WRITE",- "description": "create time card entry",- "paramCount": 4,- "serviceParams": [- "client",- "entry"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- },- "clockIn": {- "type": "string"- },- "clockOut": {- "type": [- "string",- "null"- ]- },- "note": {- "type": [- "string",- "null"- ]- }- },- "required": [- "employeeId",- "clockIn"- ]- }- },- {- "name": "people_deleteTimeCardEntry",- "module": "people",- "classification": "DESTRUCTIVE",- "description": "delete time card entry",- "paramCount": 1,- "serviceParams": [- "client",- "entryId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "entryId": {- "type": "string"- }- },- "required": [- "entryId"- ]- }- },- {- "name": "people_getClockedInEmployees",- "module": "people",- "classification": "READ",- "description": "get clocked in employees",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "people_getOpenClockEntry",- "module": "people",- "classification": "READ",- "description": "get open clock entry",- "paramCount": 1,- "serviceParams": [- "client",- "employeeId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- }- },- "required": [- "employeeId"- ]- }- },- {- "name": "people_getRecentTimecards",- "module": "people",- "classification": "READ",- "description": "get recent timecards",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "people_getScheduledEmployeesToday",- "module": "people",- "classification": "READ",- "description": "get scheduled employees today",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "people_getTimeCardEntry",- "module": "people",- "classification": "READ",- "description": "get time card entry",- "paramCount": 1,- "serviceParams": [- "client",- "entryId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "entryId": {- "type": "string"- }- },- "required": [- "entryId"- ]- }- },- {- "name": "people_getTimeCardEntries",- "module": "people",- "classification": "READ",- "description": "get time card entries",- "paramCount": 3,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- },- "from": {- "type": "string"- },- "to": {- "type": "string"- }- },- "required": [- "employeeId"- ]- }- },- {- "name": "people_getTimecardEntries",- "module": "people",- "classification": "READ",- "description": "get timecard entries",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "people_getWeeklyHoursForEmployees",- "module": "people",- "classification": "READ",- "description": "get weekly hours for employees",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "employeeIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "employeeIds"- ]- }- },- {- "name": "people_updateTimeCardEntry",- "module": "people",- "classification": "WRITE",- "description": "update time card entry",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "entryId": {- "type": "string"- },- "clockIn": {- "type": "string"- },- "clockOut": {- "type": [- "string",- "null"- ]- },- "note": {- "type": [- "string",- "null"- ]- }- },- "required": [- "entryId"- ]- }- },- {- "name": "production_convertSalesOrderLinesToJobs",- "module": "production",- "classification": "WRITE",- "description": "convert sales order lines to jobs",- "paramCount": 1,- "serviceParams": [- "client",- "{\n orderId,\n companyId,\n userId\n }"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "orderId": {- "type": "string"- }- },- "required": [- "orderId"- ]- }- },- {- "name": "production_calculateJobPriority",- "module": "production",- "classification": "WRITE",- "description": "calculate job priority",- "paramCount": 4,- "serviceParams": [- "client",- "params"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- },- "dueDate": {- "type": [- "string",- "null"- ]- },- "deadlineType": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "dueDate",- "deadlineType",- "locationId"- ]- }- },- {- "name": "production_deleteDemandForecasts",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete demand forecasts",- "paramCount": 3,- "serviceParams": [- "client",- "params"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "futurePeriodIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemId",- "locationId",- "futurePeriodIds"- ]- }- },- {- "name": "production_deleteDemandProjections",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete demand projections",- "paramCount": 3,- "serviceParams": [- "client",- "params"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "futurePeriodIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemId",- "locationId",- "futurePeriodIds"- ]- }- },- {- "name": "production_deleteJob",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete job",- "paramCount": 1,- "serviceParams": [- "client",- "jobId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_deleteJobMaterial",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete job material",- "paramCount": 1,- "serviceParams": [- "client",- "jobMaterialId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobMaterialId": {- "type": "string"- }- },- "required": [- "jobMaterialId"- ]- }- },- {- "name": "production_deleteJobOperation",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete job operation",- "paramCount": 1,- "serviceParams": [- "client",- "jobOperationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationId": {- "type": "string"- }- },- "required": [- "jobOperationId"- ]- }- },- {- "name": "production_deleteJobOperationStep",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete job operation step",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_deleteJobOperationStepSlide",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete job operation step slide",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_deleteJobOperationParameter",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete job operation parameter",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_deleteJobOperationTool",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete job operation tool",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_deleteProcedure",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete procedure",- "paramCount": 1,- "serviceParams": [- "client",- "procedureId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "procedureId": {- "type": "string"- }- },- "required": [- "procedureId"- ]- }- },- {- "name": "production_deleteProcedureStep",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete procedure step",- "paramCount": 1,- "serviceParams": [- "client",- "procedureStepId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "procedureStepId": {- "type": "string"- }- },- "required": [- "procedureStepId"- ]- }- },- {- "name": "production_deleteProcedureParameter",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete procedure parameter",- "paramCount": 1,- "serviceParams": [- "client",- "procedureParameterId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "procedureParameterId": {- "type": "string"- }- },- "required": [- "procedureParameterId"- ]- }- },- {- "name": "production_deleteProductionEvent",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete production event",- "paramCount": 1,- "serviceParams": [- "client",- "productionEventId",- "companyId",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "productionEventId": {- "type": "string"- }- },- "required": [- "productionEventId"- ]- }- },- {- "name": "production_deleteProductionQuantity",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete production quantity",- "paramCount": 1,- "serviceParams": [- "client",- "productionQuantityId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "productionQuantityId": {- "type": "string"- }- },- "required": [- "productionQuantityId"- ]- }- },- {- "name": "production_getActiveJobOperationByJobId",- "module": "production",- "classification": "READ",- "description": "get active job operation by job id",- "paramCount": 1,- "serviceParams": [- "client",- "jobId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getActiveJobOperationsByLocation",- "module": "production",- "classification": "READ",- "description": "get active job operations by location",- "paramCount": 2,- "serviceParams": [- "client",- "locationId",- "workCenterIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "workCenterIds": {- "type": "array",- "items": {}- }- },- "required": [- "locationId",- "workCenterIds"- ]- }- },- {- "name": "production_getJobsByDateRange",- "module": "production",- "classification": "READ",- "description": "get jobs by date range",- "paramCount": 3,- "serviceParams": [- "client",- "locationId",- "startDate",- "endDate"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "startDate": {- "type": "string"- },- "endDate": {- "type": "string"- }- },- "required": [- "locationId",- "startDate",- "endDate"- ]- }- },- {- "name": "production_getUnscheduledJobs",- "module": "production",- "classification": "READ",- "description": "get unscheduled jobs",- "paramCount": 1,- "serviceParams": [- "client",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- },- "required": [- "locationId"- ]- }- },- {- "name": "production_getActiveProductionEvents",- "module": "production",- "classification": "READ",- "description": "get active production events",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "production_deleteScrapReason",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete scrap reason",- "paramCount": 1,- "serviceParams": [- "client",- "scrapReasonId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "scrapReasonId": {- "type": "string"- }- },- "required": [- "scrapReasonId"- ]- }- },- {- "name": "production_deleteFailureMode",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete failure mode",- "paramCount": 1,- "serviceParams": [- "client",- "failureModeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "failureModeId": {- "type": "string"- }- },- "required": [- "failureModeId"- ]- }- },- {- "name": "production_deleteMaintenanceDispatch",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete maintenance dispatch",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "production_deleteMaintenanceDispatchComment",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete maintenance dispatch comment",- "paramCount": 1,- "serviceParams": [- "client",- "commentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "commentId": {- "type": "string"- }- },- "required": [- "commentId"- ]- }- },- {- "name": "production_deleteMaintenanceDispatchEvent",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete maintenance dispatch event",- "paramCount": 1,- "serviceParams": [- "client",- "eventId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "eventId": {- "type": "string"- }- },- "required": [- "eventId"- ]- }- },- {- "name": "production_deleteMaintenanceDispatchItem",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete maintenance dispatch item",- "paramCount": 1,- "serviceParams": [- "client",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "production_deleteMaintenanceDispatchWorkCenter",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete maintenance dispatch work center",- "paramCount": 1,- "serviceParams": [- "client",- "workCenterId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "workCenterId": {- "type": "string"- }- },- "required": [- "workCenterId"- ]- }- },- {- "name": "production_deleteMaintenanceSchedule",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete maintenance schedule",- "paramCount": 1,- "serviceParams": [- "client",- "scheduleId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "scheduleId": {- "type": "string"- }- },- "required": [- "scheduleId"- ]- }- },- {- "name": "production_deleteMaintenanceScheduleItem",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete maintenance schedule item",- "paramCount": 1,- "serviceParams": [- "client",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "production_getDemandForecasts",- "module": "production",- "classification": "READ",- "description": "get demand forecasts",- "paramCount": 3,- "serviceParams": [- "client",- "params"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "periodIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemId",- "locationId",- "periodIds"- ]- }- },- {- "name": "production_getDemandProjections",- "module": "production",- "classification": "READ",- "description": "get demand projections",- "paramCount": 3,- "serviceParams": [- "client",- "params"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "periodIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemId",- "locationId",- "periodIds"- ]- }- },- {- "name": "production_getJobDocuments",- "module": "production",- "classification": "READ",- "description": "get job documents",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "job"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": [- "string",- "null"- ]- },- "salesOrderLineId": {- "type": [- "string",- "null"- ]- },- "quoteLineId": {- "type": [- "string",- "null"- ]- },- "itemId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getJobDocumentsWithItemId",- "module": "production",- "classification": "READ",- "description": "get job documents with item id",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "job",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "job": {},- "itemId": {- "type": "string"- }- },- "required": [- "job",- "itemId"- ]- }- },- {- "name": "production_getJob",- "module": "production",- "classification": "READ",- "description": "get job",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getJobExpediteForecast",- "module": "production",- "classification": "READ",- "description": "get job expedite forecast",- "paramCount": 1,- "serviceParams": [- "client",- "db",- "jobId",- "companyId",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getJobByOperationId",- "module": "production",- "classification": "READ",- "description": "get job by operation id",- "paramCount": 1,- "serviceParams": [- "client",- "operationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "operationId": {- "type": "string"- }- },- "required": [- "operationId"- ]- }- },- {- "name": "production_getJobPurchaseOrderLines",- "module": "production",- "classification": "READ",- "description": "get job purchase order lines",- "paramCount": 1,- "serviceParams": [- "client",- "jobId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getJobOperationsForTimeline",- "module": "production",- "classification": "READ",- "description": "get job operations for timeline",- "paramCount": 1,- "serviceParams": [- "client",- "jobId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getCapacityReservationsByJob",- "module": "production",- "classification": "READ",- "description": "get capacity reservations by job",- "paramCount": 1,- "serviceParams": [- "client",- "jobId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getCapacityReservationsForResources",- "module": "production",- "classification": "READ",- "description": "get capacity reservations for resources",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "locationId",- "/**\n * Explicit [from, to"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "/**\n * Explicit [from, to": {}- },- "required": [- "/**\n * Explicit [from, to"- ]- }- },- {- "name": "production_getMaintenanceDowntimeForResources",- "module": "production",- "classification": "READ",- "description": "get maintenance downtime for resources",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- }- }- },- {- "name": "production_getProductionEventsByJob",- "module": "production",- "classification": "READ",- "description": "get production events by job",- "paramCount": 1,- "serviceParams": [- "client",- "jobId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getJobs",- "module": "production",- "classification": "READ",- "description": "get jobs",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "search": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- },- "required": [- "search"- ]- }- },- {- "name": "production_getJobsBySalesOrderLine",- "module": "production",- "classification": "READ",- "description": "get jobs by sales order line",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderLineId": {- "type": "string"- }- },- "required": [- "salesOrderLineId"- ]- }- },- {- "name": "production_getJobsList",- "module": "production",- "classification": "READ",- "description": "get jobs list",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "statuses"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "statuses": {- "type": "array",- "items": {}- }- }- }- },- {- "name": "production_getJobMakeMethodById",- "module": "production",- "classification": "READ",- "description": "get job make method by id",- "paramCount": 1,- "serviceParams": [- "client",- "jobMakeMethodId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobMakeMethodId": {- "type": "string"- }- },- "required": [- "jobMakeMethodId"- ]- }- },- {- "name": "production_getRootMakeMethod",- "module": "production",- "classification": "READ",- "description": "get root make method",- "paramCount": 1,- "serviceParams": [- "client",- "jobId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getJobMaterialsWithQuantityOnHand",- "module": "production",- "classification": "READ",- "description": "get job materials with quantity on hand",- "paramCount": 3,- "serviceParams": [- "client",- "jobId",- "companyId",- "locationId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "search": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- },- "required": [- "search"- ]- }- },- "required": [- "jobId",- "locationId"- ]- }- },- {- "name": "production_getJobMaterialItemIds",- "module": "production",- "classification": "READ",- "description": "get job material item ids",- "paramCount": 1,- "serviceParams": [- "client",- "jobId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getJobMaterialShortfallByItem",- "module": "production",- "classification": "READ",- "description": "get job material shortfall by item",- "paramCount": 3,- "serviceParams": [- "client",- "jobId",- "companyId",- "locationId",- "materials"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "materials": {- "type": "array",- "items": {}- }- },- "required": [- "jobId",- "locationId",- "materials"- ]- }- },- {- "name": "production_getJobOrderStatusMap",- "module": "production",- "classification": "READ",- "description": "get job order status map",- "paramCount": 4,- "serviceParams": [- "client",- "jobId",- "companyId",- "locationId",- "jobStatus",- "materials"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "jobStatus": {},- "materials": {}- },- "required": [- "jobId",- "locationId",- "jobStatus",- "materials"- ]- }- },- {- "name": "production_getJobMethodTree",- "module": "production",- "classification": "READ",- "description": "get job method tree",- "paramCount": 1,- "serviceParams": [- "client",- "jobId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getJobMethodTreeArray",- "module": "production",- "classification": "READ",- "description": "get job method tree array",- "paramCount": 1,- "serviceParams": [- "client",- "jobId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getJobMaterial",- "module": "production",- "classification": "READ",- "description": "get job material",- "paramCount": 1,- "serviceParams": [- "client",- "materialId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "materialId": {- "type": "string"- }- },- "required": [- "materialId"- ]- }- },- {- "name": "production_getJobMaterialsByMethodId",- "module": "production",- "classification": "READ",- "description": "get job materials by method id",- "paramCount": 1,- "serviceParams": [- "client",- "jobMakeMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobMakeMethodId": {- "type": "string"- }- },- "required": [- "jobMakeMethodId"- ]- }- },- {- "name": "production_getJobOperation",- "module": "production",- "classification": "READ",- "description": "get job operation",- "paramCount": 1,- "serviceParams": [- "client",- "jobOperationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationId": {- "type": "string"- }- },- "required": [- "jobOperationId"- ]- }- },- {- "name": "production_getJobOperations",- "module": "production",- "classification": "READ",- "description": "get job operations",- "paramCount": 2,- "serviceParams": [- "client",- "jobId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "search": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- },- "required": [- "search"- ]- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getJobOperationDependencies",- "module": "production",- "classification": "READ",- "description": "get job operation dependencies",- "paramCount": 1,- "serviceParams": [- "client",- "jobId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getJobOperationsAssignedToEmployee",- "module": "production",- "classification": "READ",- "description": "get job operations assigned to employee",- "paramCount": 1,- "serviceParams": [- "client",- "employeeId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- }- },- "required": [- "employeeId"- ]- }- },- {- "name": "production_getJobOperationAttachments",- "module": "production",- "classification": "READ",- "description": "get job operation attachments",- "paramCount": 1,- "serviceParams": [- "client",- "jobOperationIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "jobOperationIds"- ]- }- },- {- "name": "production_getJobOperationsList",- "module": "production",- "classification": "READ",- "description": "get job operations list",- "paramCount": 1,- "serviceParams": [- "client",- "jobId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getJobOperationsByMethodId",- "module": "production",- "classification": "READ",- "description": "get job operations by method id",- "paramCount": 1,- "serviceParams": [- "client",- "jobMakeMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobMakeMethodId": {- "type": "string"- }- },- "required": [- "jobMakeMethodId"- ]- }- },- {- "name": "production_getJobOperationStepRecords",- "module": "production",- "classification": "READ",- "description": "get job operation step records",- "paramCount": 2,- "serviceParams": [- "client",- "jobId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- },- "required": [- "jobId",- "args"- ]- }- },- {- "name": "production_getOutsideOperationsByJobId",- "module": "production",- "classification": "READ",- "description": "get outside operations by job id",- "paramCount": 1,- "serviceParams": [- "client",- "jobId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getProcedure",- "module": "production",- "classification": "READ",- "description": "get procedure",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getProcedureSteps",- "module": "production",- "classification": "READ",- "description": "get procedure steps",- "paramCount": 1,- "serviceParams": [- "client",- "procedureId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "procedureId": {- "type": "string"- }- },- "required": [- "procedureId"- ]- }- },- {- "name": "production_getProcedureParameters",- "module": "production",- "classification": "READ",- "description": "get procedure parameters",- "paramCount": 1,- "serviceParams": [- "client",- "procedureId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "procedureId": {- "type": "string"- }- },- "required": [- "procedureId"- ]- }- },- {- "name": "production_getProcedureVersions",- "module": "production",- "classification": "READ",- "description": "get procedure versions",- "paramCount": 2,- "serviceParams": [- "client",- "procedure",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "version": {- "type": "number"- }- },- "required": [- "name",- "version"- ]- }- },- {- "name": "production_getProcedures",- "module": "production",- "classification": "READ",- "description": "get procedures",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "search": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- },- "required": [- "search"- ]- }- },- {- "name": "production_getProceduresList",- "module": "production",- "classification": "READ",- "description": "get procedures list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "production_getProductionEvent",- "module": "production",- "classification": "READ",- "description": "get production event",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getProductionEvents",- "module": "production",- "classification": "READ",- "description": "get production events",- "paramCount": 2,- "serviceParams": [- "client",- "jobOperationIds",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationIds": {- "type": "array",- "items": {- "type": "string"- }- },- "args": {- "type": "object",- "properties": {- "search": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- },- "required": [- "search"- ]- }- },- "required": [- "jobOperationIds"- ]- }- },- {- "name": "production_getProductionEventsPage",- "module": "production",- "classification": "READ",- "description": "get production events page",- "paramCount": 3,- "serviceParams": [- "client",- "jobOperationId",- "companyId",- "sortDescending",- "page"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationId": {- "type": "string"- },- "sortDescending": {},- "page": {}- },- "required": [- "jobOperationId",- "sortDescending",- "page"- ]- }- },- {- "name": "production_getProductionEventsByOperations",- "module": "production",- "classification": "READ",- "description": "get production events by operations",- "paramCount": 1,- "serviceParams": [- "client",- "jobOperationIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "jobOperationIds"- ]- }- },- {- "name": "production_getProductionPlanning",- "module": "production",- "classification": "READ",- "description": "get production planning",- "paramCount": 3,- "serviceParams": [- "client",- "locationId",- "companyId",- "periods",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "periods": {- "type": "array",- "items": {- "type": "string"- }- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- },- "required": [- "locationId",- "periods",- "args"- ]- }- },- {- "name": "production_getProductionProjections",- "module": "production",- "classification": "READ",- "description": "get production projections",- "paramCount": 3,- "serviceParams": [- "client",- "locationId",- "periods",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "periods": {- "type": "array",- "items": {- "type": "string"- }- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- },- "required": [- "locationId",- "periods",- "args"- ]- }- },- {- "name": "production_getProductionQuantity",- "module": "production",- "classification": "READ",- "description": "get production quantity",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getProductionQuantities",- "module": "production",- "classification": "READ",- "description": "get production quantities",- "paramCount": 2,- "serviceParams": [- "client",- "jobOperationIds",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationIds": {- "type": "array",- "items": {- "type": "string"- }- },- "args": {- "type": "object",- "properties": {- "search": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- },- "required": [- "search"- ]- }- },- "required": [- "jobOperationIds"- ]- }- },- {- "name": "production_getProductionDataByOperations",- "module": "production",- "classification": "READ",- "description": "get production data by operations",- "paramCount": 1,- "serviceParams": [- "client",- "jobOperationIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "jobOperationIds"- ]- }- },- {- "name": "production_getScrapReasonsList",- "module": "production",- "classification": "READ",- "description": "get scrap reasons list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "production_getScrapReason",- "module": "production",- "classification": "READ",- "description": "get scrap reason",- "paramCount": 1,- "serviceParams": [- "client",- "scrapReasonId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "scrapReasonId": {- "type": "string"- }- },- "required": [- "scrapReasonId"- ]- }- },- {- "name": "production_getScrapReasons",- "module": "production",- "classification": "READ",- "description": "get scrap reasons",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "production_getFailureMode",- "module": "production",- "classification": "READ",- "description": "get failure mode",- "paramCount": 1,- "serviceParams": [- "client",- "failureModeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "failureModeId": {- "type": "string"- }- },- "required": [- "failureModeId"- ]- }- },- {- "name": "production_getFailureModes",- "module": "production",- "classification": "READ",- "description": "get failure modes",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "production_getFailureModesList",- "module": "production",- "classification": "READ",- "description": "get failure modes list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "production_getMaintenanceDispatch",- "module": "production",- "classification": "READ",- "description": "get maintenance dispatch",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "production_getMaintenanceDispatches",- "module": "production",- "classification": "READ",- "description": "get maintenance dispatches",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "status": {- "type": "string"- }- }- }- }- }- },- {- "name": "production_getMaintenanceDispatchComments",- "module": "production",- "classification": "READ",- "description": "get maintenance dispatch comments",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "production_getMaintenanceDispatchEvents",- "module": "production",- "classification": "READ",- "description": "get maintenance dispatch events",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "production_getMaintenanceDispatchItems",- "module": "production",- "classification": "READ",- "description": "get maintenance dispatch items",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "production_getMaintenanceDispatchWorkCenters",- "module": "production",- "classification": "READ",- "description": "get maintenance dispatch work centers",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "production_getMaintenanceSchedule",- "module": "production",- "classification": "READ",- "description": "get maintenance schedule",- "paramCount": 1,- "serviceParams": [- "client",- "scheduleId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "scheduleId": {- "type": "string"- }- },- "required": [- "scheduleId"- ]- }- },- {- "name": "production_getMaintenanceSchedules",- "module": "production",- "classification": "READ",- "description": "get maintenance schedules",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "active": {- "type": "boolean"- }- }- }- }- }- },- {- "name": "production_getMaintenanceScheduleItems",- "module": "production",- "classification": "READ",- "description": "get maintenance schedule items",- "paramCount": 1,- "serviceParams": [- "client",- "scheduleId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "scheduleId": {- "type": "string"- }- },- "required": [- "scheduleId"- ]- }- },- {- "name": "production_getTrackedEntityByJobId",- "module": "production",- "classification": "READ",- "description": "get tracked entity by job id",- "paramCount": 1,- "serviceParams": [- "client",- "jobId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_getTrackedEntitiesByJobId",- "module": "production",- "classification": "READ",- "description": "get tracked entities by job id",- "paramCount": 1,- "serviceParams": [- "client",- "jobId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_recalculateJobOperationDependencies",- "module": "production",- "classification": "WRITE",- "description": "recalculate job operation dependencies",- "paramCount": 1,- "serviceParams": [- "client",- "db",- "params"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_recalculateJobRequirements",- "module": "production",- "classification": "WRITE",- "description": "recalculate job requirements",- "paramCount": 1,- "serviceParams": [- "client",- "params"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_recalculateJobMakeMethodRequirements",- "module": "production",- "classification": "WRITE",- "description": "recalculate job make method requirements",- "paramCount": 1,- "serviceParams": [- "client",- "params"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_runMRP",- "module": "production",- "classification": "WRITE",- "description": "run m r p",- "paramCount": 2,- "serviceParams": [- "client",- "db",- "params"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "type": {},- "id": {- "type": "string"- }- },- "required": [- "type",- "id"- ]- }- },- {- "name": "production_updateJobBatchNumber",- "module": "production",- "classification": "WRITE",- "description": "update job batch number",- "paramCount": 2,- "serviceParams": [- "client",- "trackedEntityId",- "value"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "trackedEntityId": {- "type": "string"- },- "value": {- "type": [- "string",- "null"- ]- }- },- "required": [- "trackedEntityId",- "value"- ]- }- },- {- "name": "production_updateJobStatus",- "module": "production",- "classification": "WRITE",- "description": "update job status",- "paramCount": 3,- "serviceParams": [- "client",- "params"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "assignee": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id",- "status"- ]- }- },- {- "name": "production_updateJobMaterialOrder",- "module": "production",- "classification": "WRITE",- "description": "update job material order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "order": {- "type": "number"- }- },- "required": [- "id",- "order"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "production_updateJobOperationOrder",- "module": "production",- "classification": "WRITE",- "description": "update job operation order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "order": {- "type": "number"- }- },- "required": [- "id",- "order"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "production_updateJobOperationStepOrder",- "module": "production",- "classification": "WRITE",- "description": "update job operation step order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "production_updateKanbanJob",- "module": "production",- "classification": "WRITE",- "description": "update kanban job",- "paramCount": 2,- "serviceParams": [- "client",- "params"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "jobId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id",- "jobId"- ]- }- },- {- "name": "production_updateQuoteOperationStepOrder",- "module": "production",- "classification": "WRITE",- "description": "update quote operation step order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "production_updateMethodOperationStepOrder",- "module": "production",- "classification": "WRITE",- "description": "update method operation step order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "production_updateJobOperationStatus",- "module": "production",- "classification": "WRITE",- "description": "update job operation status",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "status",- "updatedBy"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- }- },- "required": [- "id",- "status"- ]- }- },- {- "name": "production_updateJobOperationDueDate",- "module": "production",- "classification": "WRITE",- "description": "update job operation due date",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "dueDate",- "updatedBy"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "dueDate": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id",- "dueDate"- ]- }- },- {- "name": "production_updateProcedureStepOrder",- "module": "production",- "classification": "WRITE",- "description": "update procedure step order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "production_upsertProductionEvent",- "module": "production",- "classification": "WRITE",- "description": "upsert production event",- "paramCount": 55,- "serviceParams": [- "client",- "productionEvent"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "startDate": {- "type": "string"- },- "dueDate": {- "type": "string"- },- "periodId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "existingId": {- "type": "string"- },- "existingQuantity": {- "type": "number"- },- "existingReadableId": {- "type": "string"- },- "existingStatus": {- "type": "string"- },- "isASAP": {- "type": "boolean"- },- "id": {- "type": "string"- },- "columnId": {- "type": "string"- },- "priority": {- "type": "string"- },- "locationId": {- "type": "string"- },- "name": {- "type": "string"- },- "status": {- "type": "string"- },- "severity": {- "type": "string"- },- "source": {- "type": "string"- },- "oeeImpact": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "suspectedFailureModeId": {- "type": "string"- },- "plannedStartTime": {- "type": "string"- },- "plannedEndTime": {- "type": "string"- },- "assignee": {- "type": "string"- },- "content": {- "type": "string"- },- "maintenanceDispatchId": {- "type": "string"- },- "comment": {- "type": "string"- },- "itemId": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "description": {- "type": "string"- },- "frequency": {- "type": "string"- },- "estimatedDuration": {- "type": "number"- },- "active": {- "type": "string"- },- "maintenanceScheduleId": {- "type": "string"- },- "periods": {- "type": "array",- "items": {- "type": "string"- }- },- "modelUploadId": {- "type": "string"- },- "operationId": {- "type": "string"- },- "copyFromId": {- "type": "string"- },- "motion": {- "type": "string"- },- "camera": {- "type": "string"- },- "componentNodeIds": {- "type": "string"- },- "updates": {- "type": "number"- },- "stepId": {- "type": "string"- },- "sortOrder": {- "type": "number"- },- "employeeId": {- "type": "string"- },- "date": {- "type": "string"- },- "note": {- "type": "string"- },- "shiftId": {- "type": "string"- },- "fromDate": {- "type": "string"- },- "toDate": {- "type": "string"- },- "weekStart": {- "type": "string"- },- "fromWorkCenterId": {- "type": "string"- },- "fromWeekStart": {- "type": "string"- },- "rows": {- "type": "number"- },- "hours": {- "type": "number"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "periodId",- "id",- "columnId",- "priority",- "locationId",- "name",- "status",- "maintenanceDispatchId",- "comment",- "itemId",- "unitOfMeasureCode",- "workCenterId",- "frequency",- "active",- "maintenanceScheduleId",- "modelUploadId",- "operationId",- "copyFromId",- "componentNodeIds",- "updates",- "stepId",- "employeeId",- "date",- "fromDate",- "toDate",- "weekStart",- "fromWorkCenterId",- "fromWeekStart",- "_operation"- ]- }- },- {- "name": "production_updateProductionQuantity",- "module": "production",- "classification": "WRITE",- "description": "update production quantity",- "paramCount": 1,- "serviceParams": [- "client",- "productionQuantity"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "productionQuantity": {}- },- "required": [- "productionQuantity"- ]- }- },- {- "name": "production_upsertProductionQuantity",- "module": "production",- "classification": "WRITE",- "description": "upsert production quantity",- "paramCount": 1,- "serviceParams": [- "client",- "productionQuantity"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "productionQuantity": {}- },- "required": [- "productionQuantity"- ]- }- },- {- "name": "production_insertJob",- "module": "production",- "classification": "WRITE",- "description": "Create a new job with all business logic - generates sequence, resolves location, copies method from item, recalculates requirements. LLM can create a job with just itemId and quantity.",- "paramCount": 2,- "serviceParams": [- "client",- "input",- "options"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "input": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "jobId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "dueDate": {- "type": "string"- },- "startDate": {- "type": "string"- },- "priority": {- "type": "number"- },- "status": {- "type": "string"- },- "deadlineType": {- "type": "string"- },- "storageUnitId": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "customerId": {- "type": "string"- },- "salesOrderId": {- "type": "string"- },- "salesOrderLineId": {- "type": "string"- },- "quoteId": {- "type": "string"- },- "quoteLineId": {- "type": "string"- },- "parentJobId": {- "type": "string"- },- "modelUploadId": {- "type": "string"- },- "notes": {- "type": "string"- },- "customFields": {},- "configuration": {}- },- "required": [- "itemId",- "quantity"- ]- },- "options": {- "type": "object",- "properties": {- "skipMethod": {- "type": "boolean"- },- "skipRecalculate": {- "type": "boolean"- },- "methodSource": {- "type": "string",- "enum": [- "item",- "quoteLine"- ]- },- "source": {}- }- }- },- "required": [- "input"- ]- }- },- {- "name": "production_updateJob",- "module": "production",- "classification": "WRITE",- "description": "Update an existing job - handles priority recalculation when deadline changes",- "paramCount": 21,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "quantity": {- "type": "number"- },- "dueDate": {- "type": [- "string",- "null"- ]- },- "startDate": {- "type": [- "string",- "null"- ]- },- "status": {- "type": "string"- },- "priority": {- "type": "number"- },- "deadlineType": {- "type": "string"- },- "locationId": {- "type": "string"- },- "storageUnitId": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "customerId": {- "type": [- "string",- "null"- ]- },- "salesOrderId": {- "type": [- "string",- "null"- ]- },- "salesOrderLineId": {- "type": [- "string",- "null"- ]- },- "quoteId": {- "type": [- "string",- "null"- ]- },- "quoteLineId": {- "type": [- "string",- "null"- ]- },- "parentJobId": {- "type": [- "string",- "null"- ]- },- "modelUploadId": {- "type": [- "string",- "null"- ]- },- "notes": {- "type": [- "string",- "null"- ]- },- "customFields": {},- "scrapQuantity": {- "type": "number"- },- "itemId": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_upsertJob",- "module": "production",- "classification": "WRITE",- "description": "upsert job",- "paramCount": 2,- "serviceParams": [- "client",- "job",- "status"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "job": {},- "status": {- "type": "string"- }- },- "required": [- "job"- ]- }- },- {- "name": "production_upsertJobMaterial",- "module": "production",- "classification": "WRITE",- "description": "upsert job material",- "paramCount": 1,- "serviceParams": [- "client",- "jobMaterial"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "jobMaterial": {}- },- "required": [- "jobMaterial"- ]- }- },- {- "name": "production_upsertJobOperation",- "module": "production",- "classification": "WRITE",- "description": "upsert job operation",- "paramCount": 24,- "serviceParams": [- "client",- "jobOperation"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "jobMakeMethodId": {- "type": "string"- },- "order": {- "type": "number"- },- "operationOrder": {- "type": "string"- },- "operationType": {- "type": "string"- },- "processId": {- "type": "string"- },- "procedureId": {- "type": "string"- },- "assemblyInstructionId": {- "type": "string"- },- "inspectionDocumentId": {- "type": "string"- },- "description": {- "type": "string"- },- "setupUnit": {- "type": "string"- },- "setupTime": {- "type": "number"- },- "laborUnit": {- "type": "string"- },- "laborTime": {- "type": "number"- },- "machineUnit": {- "type": "string"- },- "machineTime": {- "type": "number"- },- "machineRate": {- "type": "number"- },- "overheadRate": {- "type": "number"- },- "laborRate": {- "type": "number"- },- "operationSupplierProcessId": {- "type": "string"- },- "operationMinimumCost": {- "type": "number"- },- "operationUnitCost": {- "type": "number"- },- "operationLeadTime": {- "type": "number"- },- "workCenterId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "jobMakeMethodId",- "operationOrder",- "operationType",- "processId",- "_operation"- ]- }- },- {- "name": "production_upsertJobOperationStep",- "module": "production",- "classification": "WRITE",- "description": "upsert job operation step",- "paramCount": 1,- "serviceParams": [- "client",- "jobOperationStep"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationStep": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "jobOperationStep",- "_operation"- ]- }- },- {- "name": "production_duplicateJobOperationStep",- "module": "production",- "classification": "WRITE",- "description": "duplicate job operation step",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_upsertJobOperationStepSlide",- "module": "production",- "classification": "WRITE",- "description": "upsert job operation step slide",- "paramCount": 1,- "serviceParams": [- "client",- "slide"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "slide": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "slide",- "_operation"- ]- }- },- {- "name": "production_upsertJobOperationParameter",- "module": "production",- "classification": "WRITE",- "description": "upsert job operation parameter",- "paramCount": 1,- "serviceParams": [- "client",- "jobOperationParameter"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationParameter": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "jobOperationParameter",- "_operation"- ]- }- },- {- "name": "production_getJobPromiseDate",- "module": "production",- "classification": "READ",- "description": "get job promise date",- "paramCount": 1,- "serviceParams": [- "client",- "jobId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "production_upsertJobOperationTool",- "module": "production",- "classification": "WRITE",- "description": "upsert job operation tool",- "paramCount": 1,- "serviceParams": [- "client",- "jobOperationTool"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "jobOperationTool": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "jobOperationTool",- "_operation"- ]- }- },- {- "name": "production_replaceJobMaterialSteps",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "replace job material steps",- "paramCount": 2,- "serviceParams": [- "client",- "jobMaterialId",- "jobOperationStepIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobMaterialId": {- "type": "string"- },- "jobOperationStepIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "jobMaterialId",- "jobOperationStepIds"- ]- }- },- {- "name": "production_setJobMaterialStepLink",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "set job material step link",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "jobMaterialId": {- "type": "string"- },- "jobOperationStepId": {- "type": "string"- },- "linked": {- "type": "boolean"- },- "quantity": {- "type": [- "number",- "null"- ]- }- },- "required": [- "jobMaterialId",- "jobOperationStepId",- "linked"- ]- }- },- {- "name": "production_setJobOperationToolStepLink",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "set job operation tool step link",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "operationId": {- "type": "string"- },- "toolId": {- "type": "string"- },- "jobOperationStepId": {- "type": "string"- },- "linked": {- "type": "boolean"- }- },- "required": [- "operationId",- "toolId",- "jobOperationStepId",- "linked"- ]- }- },- {- "name": "production_upsertJobMethod",- "module": "production",- "classification": "WRITE",- "description": "upsert job method",- "paramCount": 2,- "serviceParams": [- "client",- "type",- "jobMethod"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "type": {- "type": "string",- "enum": [- "itemToJob",- "quoteLineToJob",- "jobToJob"- ]- },- "jobMethod": {- "type": "object",- "properties": {- "sourceId": {- "type": "string"- },- "targetId": {- "type": "string"- },- "configuration": {},- "versionId": {- "type": "string"- },- "parts": {- "type": "object",- "properties": {- "billOfMaterial": {- "type": "boolean"- },- "billOfProcess": {- "type": "boolean"- },- "parameters": {- "type": "boolean"- },- "tools": {- "type": "boolean"- },- "steps": {- "type": "boolean"- },- "workInstructions": {- "type": "boolean"- }- },- "required": [- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- "required": [- "sourceId",- "targetId"- ]- }- },- "required": [- "type",- "jobMethod"- ]- }- },- {- "name": "production_upsertJobMaterialMakeMethod",- "module": "production",- "classification": "WRITE",- "description": "upsert job material make method",- "paramCount": 5,- "serviceParams": [- "client",- "jobMaterial"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "sourceId": {- "type": "string"- },- "targetId": {- "type": "string"- },- "configuration": {},- "versionId": {- "type": "string"- },- "parts": {- "type": "object",- "properties": {- "billOfMaterial": {- "type": "boolean"- },- "billOfProcess": {- "type": "boolean"- },- "parameters": {- "type": "boolean"- },- "tools": {- "type": "boolean"- },- "steps": {- "type": "boolean"- },- "workInstructions": {- "type": "boolean"- }- },- "required": [- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- "required": [- "sourceId",- "targetId"- ]- }- },- {- "name": "production_pullJobMaterialMakeMethod",- "module": "production",- "classification": "WRITE",- "description": "pull job material make method",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobMaterialId": {- "type": "string"- },- "itemId": {- "type": "string"- }- },- "required": [- "jobMaterialId",- "itemId"- ]- }- },- {- "name": "production_upsertMakeMethodFromJob",- "module": "production",- "classification": "WRITE",- "description": "upsert make method from job",- "paramCount": 3,- "serviceParams": [- "client",- "jobMethod"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "sourceId": {- "type": "string"- },- "targetId": {- "type": "string"- },- "parts": {- "type": "object",- "properties": {- "billOfMaterial": {- "type": "boolean"- },- "billOfProcess": {- "type": "boolean"- },- "parameters": {- "type": "boolean"- },- "tools": {- "type": "boolean"- },- "steps": {- "type": "boolean"- },- "workInstructions": {- "type": "boolean"- }- },- "required": [- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- "required": [- "sourceId",- "targetId"- ]- }- },- {- "name": "production_upsertMakeMethodFromJobMethod",- "module": "production",- "classification": "WRITE",- "description": "upsert make method from job method",- "paramCount": 3,- "serviceParams": [- "client",- "jobMethod"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "sourceId": {- "type": "string"- },- "targetId": {- "type": "string"- },- "parts": {- "type": "object",- "properties": {- "billOfMaterial": {- "type": "boolean"- },- "billOfProcess": {- "type": "boolean"- },- "parameters": {- "type": "boolean"- },- "tools": {- "type": "boolean"- },- "steps": {- "type": "boolean"- },- "workInstructions": {- "type": "boolean"- }- },- "required": [- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- "required": [- "sourceId",- "targetId"- ]- }- },- {- "name": "production_upsertProcedure",- "module": "production",- "classification": "WRITE",- "description": "upsert procedure",- "paramCount": 6,- "serviceParams": [- "client",- "procedure"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "version": {- "type": "number"- },- "processId": {- "type": "string"- },- "content": {- "type": "string"- },- "copyFromId": {- "type": "string"- }- },- "required": [- "name"- ]- }- },- {- "name": "production_upsertProcedureStep",- "module": "production",- "classification": "WRITE",- "description": "upsert procedure step",- "paramCount": 1,- "serviceParams": [- "client",- "procedureStep"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "procedureStep": {}- },- "required": [- "procedureStep"- ]- }- },- {- "name": "production_upsertProcedureParameter",- "module": "production",- "classification": "WRITE",- "description": "upsert procedure parameter",- "paramCount": 4,- "serviceParams": [- "client",- "procedureParameter"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "procedureId": {- "type": "string"- },- "key": {- "type": "string"- },- "value": {- "type": "string"- }- },- "required": [- "procedureId",- "key",- "value"- ]- }- },- {- "name": "production_upsertScrapReason",- "module": "production",- "classification": "WRITE",- "description": "upsert scrap reason",- "paramCount": 2,- "serviceParams": [- "client",- "scrapReason"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "production_upsertFailureMode",- "module": "production",- "classification": "WRITE",- "description": "upsert failure mode",- "paramCount": 2,- "serviceParams": [- "client",- "failureMode"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "production_upsertMaintenanceDispatch",- "module": "production",- "classification": "WRITE",- "description": "upsert maintenance dispatch",- "paramCount": 12,- "serviceParams": [- "client",- "dispatch"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "priority": {- "type": "string"- },- "severity": {- "type": "string"- },- "source": {- "type": "string"- },- "oeeImpact": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "suspectedFailureModeId": {- "type": "string"- },- "plannedStartTime": {- "type": "string"- },- "plannedEndTime": {- "type": "string"- },- "assignee": {- "type": "string"- },- "content": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "status",- "priority",- "_operation"- ]- }- },- {- "name": "production_upsertMaintenanceDispatchComment",- "module": "production",- "classification": "WRITE",- "description": "upsert maintenance dispatch comment",- "paramCount": 3,- "serviceParams": [- "client",- "comment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "maintenanceDispatchId": {- "type": "string"- },- "comment": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "maintenanceDispatchId",- "comment",- "_operation"- ]- }- },- {- "name": "production_upsertMaintenanceDispatchEvent",- "module": "production",- "classification": "WRITE",- "description": "upsert maintenance dispatch event",- "paramCount": 18,- "serviceParams": [- "client",- "event"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "maintenanceDispatchId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "workCenterId": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "frequency": {- "type": "string"- },- "priority": {- "type": "string"- },- "estimatedDuration": {- "type": "number"- },- "active": {- "type": "string"- },- "maintenanceScheduleId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "periods": {- "type": "array",- "items": {- "type": "string"- }- },- "modelUploadId": {- "type": "string"- },- "operationId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "maintenanceDispatchId",- "itemId",- "unitOfMeasureCode",- "workCenterId",- "name",- "frequency",- "priority",- "active",- "maintenanceScheduleId",- "locationId",- "modelUploadId",- "operationId",- "_operation"- ]- }- },- {- "name": "production_upsertMaintenanceDispatchItem",- "module": "production",- "classification": "WRITE",- "description": "upsert maintenance dispatch item",- "paramCount": 6,- "serviceParams": [- "client",- "item"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "maintenanceDispatchId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "maintenanceDispatchId",- "itemId",- "unitOfMeasureCode",- "_operation"- ]- }- },- {- "name": "production_upsertMaintenanceDispatchWorkCenter",- "module": "production",- "classification": "WRITE",- "description": "upsert maintenance dispatch work center",- "paramCount": 3,- "serviceParams": [- "client",- "workCenter"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "maintenanceDispatchId": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "maintenanceDispatchId",- "workCenterId",- "_operation"- ]- }- },- {- "name": "production_upsertMaintenanceSchedule",- "module": "production",- "classification": "WRITE",- "description": "upsert maintenance schedule",- "paramCount": 8,- "serviceParams": [- "client",- "schedule"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "frequency": {- "type": "string"- },- "priority": {- "type": "string"- },- "estimatedDuration": {- "type": "number"- },- "active": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "workCenterId",- "frequency",- "priority",- "active",- "_operation"- ]- }- },- {- "name": "production_upsertMaintenanceScheduleItem",- "module": "production",- "classification": "WRITE",- "description": "upsert maintenance schedule item",- "paramCount": 5,- "serviceParams": [- "client",- "item"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "maintenanceScheduleId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "unitOfMeasureCode": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "maintenanceScheduleId",- "itemId",- "unitOfMeasureCode",- "_operation"- ]- }- },- {- "name": "production_upsertDemandForecasts",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "upsert demand forecasts",- "paramCount": 1,- "serviceParams": [- "client",- "forecasts"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "forecasts": {}- },- "required": [- "forecasts"- ]- }- },- {- "name": "production_upsertDemandProjections",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "upsert demand projections",- "paramCount": 1,- "serviceParams": [- "client",- "forecasts"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "forecasts": {}- },- "required": [- "forecasts"- ]- }- },- {- "name": "production_getPeopleAssignments",- "module": "production",- "classification": "READ",- "description": "get people assignments",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "date": {- "type": "string"- }- },- "required": [- "locationId",- "date"- ]- }- },- {- "name": "production_getPeopleAbsences",- "module": "production",- "classification": "READ",- "description": "get people absences",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "date"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "date": {- "type": "string"- }- },- "required": [- "date"- ]- }- },- {- "name": "production_getPeopleAssignmentsRange",- "module": "production",- "classification": "READ",- "description": "get people assignments range",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "startDate": {- "type": "string"- },- "endDate": {- "type": "string"- }- },- "required": [- "locationId",- "startDate",- "endDate"- ]- }- },- {- "name": "production_getPeopleAbsencesRange",- "module": "production",- "classification": "READ",- "description": "get people absences range",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "startDate": {- "type": "string"- },- "endDate": {- "type": "string"- }- },- "required": [- "startDate",- "endDate"- ]- }- },- {- "name": "production_getPeopleCapacityOperations",- "module": "production",- "classification": "READ",- "description": "get people capacity operations",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "startDate": {- "type": [- "string",- "null"- ]- },- "endDate": {- "type": "string"- }- },- "required": [- "locationId",- "startDate",- "endDate"- ]- }- },- {- "name": "production_getWorkCenterShifts",- "module": "production",- "classification": "READ",- "description": "get work center shifts",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "workCenterIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "workCenterIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "workCenterIds"- ]- }- },- {- "name": "production_getWorkCenterReservationsRange",- "module": "production",- "classification": "READ",- "description": "get work center reservations range",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "startAt": {- "type": "string"- },- "endAt": {- "type": "string"- }- },- "required": [- "startAt",- "endAt"- ]- }- },- {- "name": "production_getLocationEmployees",- "module": "production",- "classification": "READ",- "description": "get location employees",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- },- "required": [- "locationId"- ]- }- },- {- "name": "production_getWorkCenterRequiredAbilities",- "module": "production",- "classification": "READ",- "description": "get work center required abilities",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- },- "required": [- "locationId"- ]- }- },- {- "name": "production_getActiveEmployeeAbilities",- "module": "production",- "classification": "READ",- "description": "get active employee abilities",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "production_upsertPeopleAssignment",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "upsert people assignment",- "paramCount": 7,- "serviceParams": [- "db",- "assignment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "employeeId": {- "type": "string"- },- "date": {- "type": "string"- },- "shiftId": {- "type": [- "string",- "null"- ]- },- "note": {- "type": "string"- },- "undefined = whole shift (replaces other rows) */\n hours": {- "type": "number"- }- },- "required": [- "locationId",- "workCenterId",- "employeeId",- "date",- "shiftId"- ]- }- },- {- "name": "production_deletePeopleAssignment",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete people assignment",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_setPeopleAbsence",- "module": "production",- "classification": "WRITE",- "description": "set people absence",- "paramCount": 4,- "serviceParams": [- "client",- "absence"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- },- "date": {- "type": "string"- },- "shiftId": {- "type": [- "string",- "null"- ]- },- "note": {- "type": "string"- }- },- "required": [- "employeeId",- "date",- "shiftId"- ]- }- },- {- "name": "production_clearPeopleAbsence",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "clear people absence",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_movePeopleAssignment",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "move people assignment",- "paramCount": 2,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "workCenterId": {- "type": "string"- }- },- "required": [- "id",- "workCenterId"- ]- }- },- {- "name": "production_setPeopleDay",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "set people day",- "paramCount": 7,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "employeeId": {- "type": "string"- },- "date": {- "type": "string"- },- "shiftId": {- "type": [- "string",- "null"- ]- },- "/** day-scoped note, written to every surviving row of the day */\n note": {- "type": [- "string",- "null"- ]- },- "/**\n * Day-scoped overtime, written to every surviving row of the day. The\n * scheduler reads the MAX across a day's rows (never the sum), so 2h of\n * overtime stays 2h however many stations the person splits across.\n */\n overtimeHours": {- "type": "number"- },- "rows": {- "type": "array",- "items": {- "type": "object",- "properties": {- "workCenterId": {- "type": "string"- },- "hours": {- "type": [- "number",- "null"- ]- }- },- "required": [- "workCenterId",- "hours"- ]- }- }- },- "required": [- "locationId",- "employeeId",- "date",- "shiftId",- "/** day-scoped note, written to every surviving row of the day */\n note",- "/**\n * Day-scoped overtime, written to every surviving row of the day. The\n * scheduler reads the MAX across a day's rows (never the sum), so 2h of\n * overtime stays 2h however many stations the person splits across.\n */\n overtimeHours",- "rows"- ]- }- },- {- "name": "production_setPeopleAssignmentHours",- "module": "production",- "classification": "WRITE",- "description": "set people assignment hours",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "hours": {- "type": [- "number",- "null"- ]- }- },- "required": [- "id",- "hours"- ]- }- },- {- "name": "production_setPeopleOvertimeBulk",- "module": "production",- "classification": "WRITE",- "description": "set people overtime bulk",- "paramCount": 6,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "date": {- "type": "string"- },- "omitted = the single `date` only */\n toDate": {- "type": [- "string",- "null"- ]- },- "hours": {- "type": "number"- },- "shiftId": {- "type": [- "string",- "null"- ]- },- "departmentId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "locationId",- "date",- "hours"- ]- }- },- {- "name": "production_copyPeopleBoard",- "module": "production",- "classification": "WRITE",- "description": "copy people board",- "paramCount": 4,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "fromDate": {- "type": "string"- },- "toDate": {- "type": "string"- },- "shiftId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "locationId",- "fromDate",- "toDate",- "shiftId"- ]- }- },- {- "name": "production_assignPeopleWeek",- "module": "production",- "classification": "WRITE",- "description": "assign people week",- "paramCount": 5,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "employeeId": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "weekStart": {- "type": "string"- },- "shiftId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "locationId",- "employeeId",- "workCenterId",- "weekStart",- "shiftId"- ]- }- },- {- "name": "production_unassignPeopleWeek",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "unassign people week",- "paramCount": 4,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "weekStart": {- "type": "string"- },- "shiftId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "employeeId",- "workCenterId",- "weekStart",- "shiftId"- ]- }- },- {- "name": "production_movePeopleWeek",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "move people week",- "paramCount": 5,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- },- "fromWorkCenterId": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "weekStart": {- "type": "string"- },- "shiftId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "employeeId",- "fromWorkCenterId",- "workCenterId",- "weekStart",- "shiftId"- ]- }- },- {- "name": "production_copyPeopleWeek",- "module": "production",- "classification": "WRITE",- "description": "copy people week",- "paramCount": 4,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "fromWeekStart": {- "type": "string"- },- "toWeekStart": {- "type": "string"- },- "shiftId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "locationId",- "fromWeekStart",- "toWeekStart",- "shiftId"- ]- }- },- {- "name": "production_setPeopleAbsenceRange",- "module": "production",- "classification": "WRITE",- "description": "set people absence range",- "paramCount": 5,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- },- "fromDate": {- "type": "string"- },- "toDate": {- "type": "string"- },- "shiftId": {- "type": [- "string",- "null"- ]- },- "note": {- "type": "string"- }- },- "required": [- "employeeId",- "fromDate",- "toDate",- "shiftId"- ]- }- },- {- "name": "production_notifyScheduleInputsChanged",- "module": "production",- "classification": "WRITE",- "description": "notify schedule inputs changed",- "paramCount": 3,- "serviceParams": [- "companyId",- "kind",- "reason",- "entityId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "kind": {},- "reason": {- "type": "string"- },- "entityId": {- "type": "string"- }- },- "required": [- "kind",- "reason"- ]- }- },- {- "name": "production_getAssemblyInstruction",- "module": "production",- "classification": "READ",- "description": "get assembly instruction",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getAssemblyInstructions",- "module": "production",- "classification": "READ",- "description": "get assembly instructions",- "paramCount": 5,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "search": {- "type": "string"- },- "status": {- "type": "string"- },- "itemId": {- "type": "string"- },- "limit": {- "type": "number"- },- "offset": {- "type": "number"- }- }- }- },- {- "name": "production_getAssemblyInstructionsForItem",- "module": "production",- "classification": "READ",- "description": "get assembly instructions for item",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "production_getModelForItem",- "module": "production",- "classification": "READ",- "description": "get model for item",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "production_getAssemblyInstructionSteps",- "module": "production",- "classification": "READ",- "description": "get assembly instruction steps",- "paramCount": 1,- "serviceParams": [- "client",- "assemblyInstructionId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "assemblyInstructionId": {- "type": "string"- }- },- "required": [- "assemblyInstructionId"- ]- }- },- {- "name": "production_upsertAssemblyInstruction",- "module": "production",- "classification": "WRITE",- "description": "upsert assembly instruction",- "paramCount": 4,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "modelUploadId": {- "type": "string"- },- "itemId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "name",- "modelUploadId"- ]- }- },- {- "name": "production_updateAssemblyInstructionStatus",- "module": "production",- "classification": "WRITE",- "description": "update assembly instruction status",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "data": {- "type": "object",- "properties": {- "status": {- "type": "string"- }- },- "required": [- "status"- ]- }- },- "required": [- "id",- "data"- ]- }- },- {- "name": "production_getAssemblyInstructionVersions",- "module": "production",- "classification": "READ",- "description": "get assembly instruction versions",- "paramCount": 2,- "serviceParams": [- "client",- "instruction"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "rootInstructionId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id"- ]- }- },- {- "name": "production_copyAssemblyInstructionAsVersion",- "module": "production",- "classification": "WRITE",- "description": "copy assembly instruction as version",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "copyFromId": {- "type": "string"- }- },- "required": [- "copyFromId"- ]- }- },- {- "name": "production_activateAssemblyInstructionVersion",- "module": "production",- "classification": "WRITE",- "description": "activate assembly instruction version",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_deleteAssemblyInstruction",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete assembly instruction",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_invalidateAssemblyModelCache",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "invalidate assembly model cache",- "paramCount": 1,- "serviceParams": [- "client",- "modelUploadId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "modelUploadId": {- "type": "string"- }- },- "required": [- "modelUploadId"- ]- }- },- {- "name": "production_upsertAssemblyInstructionStep",- "module": "production",- "classification": "WRITE",- "description": "upsert assembly instruction step",- "paramCount": 16,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "assemblyInstructionId": {- "type": "string"- },- "title": {- "type": [- "string",- "null"- ]- },- "type": {},- "description": {},- "required": {- "type": "boolean"- },- "unitOfMeasureCode": {- "type": [- "string",- "null"- ]- },- "minValue": {- "type": [- "number",- "null"- ]- },- "maxValue": {- "type": [- "number",- "null"- ]- },- "listValues": {- "type": [- "array",- "null"- ],- "items": {- "type": "string"- }- },- "componentNodeIds": {- "type": "array",- "items": {- "type": "string"- }- },- "motion": {},- "camera": {},- "fastener": {},- "durationSeconds": {- "type": [- "number",- "null"- ]- },- "sortOrder": {- "type": "number"- }- },- "required": [- "assemblyInstructionId"- ]- }- },- {- "name": "production_updateAssemblyStepMotion",- "module": "production",- "classification": "WRITE",- "description": "update assembly step motion",- "paramCount": 3,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "motion": {},- "camera": {}- },- "required": [- "id"- ]- }- },- {- "name": "production_updateAssemblyStepComponents",- "module": "production",- "classification": "WRITE",- "description": "update assembly step components",- "paramCount": 2,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "componentNodeIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "id",- "componentNodeIds"- ]- }- },- {- "name": "production_reassignAssemblyStepComponents",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "reassign assembly step components",- "paramCount": 4,- "serviceParams": [- "db",- "data"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "assemblyInstructionId": {- "type": "string"- },- "targetStepId": {- "type": "string"- },- "componentNodeIds": {- "type": "array",- "items": {- "type": "string"- }- },- "mode": {- "type": "string",- "enum": [- "move",- "duplicate",- "remove"- ]- }- },- "required": [- "assemblyInstructionId",- "componentNodeIds",- "mode"- ]- }- },- {- "name": "production_updateAssemblyInstructionStepStatus",- "module": "production",- "classification": "WRITE",- "description": "update assembly instruction step status",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "data": {- "type": "object",- "properties": {- "status": {- "type": "string"- }- },- "required": [- "status"- ]- }- },- "required": [- "id",- "data"- ]- }- },- {- "name": "production_updateAssemblyInstructionStepOrder",- "module": "production",- "classification": "WRITE",- "description": "update assembly instruction step order",- "paramCount": 1,- "serviceParams": [- "db",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "production_deleteAssemblyInstructionStep",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete assembly instruction step",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getAssemblyInstructionStepSlides",- "module": "production",- "classification": "READ",- "description": "get assembly instruction step slides",- "paramCount": 1,- "serviceParams": [- "client",- "stepIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "stepIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "stepIds"- ]- }- },- {- "name": "production_upsertAssemblyInstructionStepSlide",- "module": "production",- "classification": "WRITE",- "description": "upsert assembly instruction step slide",- "paramCount": 1,- "serviceParams": [- "client",- "slide"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "slide": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "slide",- "_operation"- ]- }- },- {- "name": "production_deleteAssemblyInstructionStepSlide",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete assembly instruction step slide",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getAssemblyInstructionStepTools",- "module": "production",- "classification": "READ",- "description": "get assembly instruction step tools",- "paramCount": 1,- "serviceParams": [- "client",- "stepIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "stepIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "stepIds"- ]- }- },- {- "name": "production_upsertAssemblyInstructionStepTool",- "module": "production",- "classification": "WRITE",- "description": "upsert assembly instruction step tool",- "paramCount": 5,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "stepId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "stepId",- "itemId"- ]- }- },- {- "name": "production_deleteAssemblyInstructionStepTool",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete assembly instruction step tool",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getAssemblyInstructionStepMaterials",- "module": "production",- "classification": "READ",- "description": "get assembly instruction step materials",- "paramCount": 1,- "serviceParams": [- "client",- "stepIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "stepIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "stepIds"- ]- }- },- {- "name": "production_upsertAssemblyInstructionStepMaterial",- "module": "production",- "classification": "WRITE",- "description": "upsert assembly instruction step material",- "paramCount": 5,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "stepId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantity": {- "type": [- "number",- "null"- ]- },- "sortOrder": {- "type": "number"- }- },- "required": [- "stepId",- "itemId"- ]- }- },- {- "name": "production_updateAssemblyInstructionStepMaterialOrder",- "module": "production",- "classification": "WRITE",- "description": "update assembly instruction step material order",- "paramCount": 1,- "serviceParams": [- "db",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "production_deleteAssemblyInstructionStepMaterial",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete assembly instruction step material",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_syncAssemblyStepMaterialsFromMappings",- "module": "production",- "classification": "WRITE",- "description": "sync assembly step materials from mappings",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "assemblyInstructionId": {- "type": "string"- },- "/** Limit to these steps (default: every step of the instruction) */\n stepIds": {- "type": "array",- "items": {- "type": "string"- }- },- "/** Limit to these mappings (e.g. one just created) */\n geometryHashes": {- "type": "array",- "items": {- "type": "string"- }- },- "/** Limit to component groups containing one of these instances */\n onlyComponentNodeIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "assemblyInstructionId"- ]- }- },- {- "name": "production_getAssemblyUnits",- "module": "production",- "classification": "READ",- "description": "get assembly units",- "paramCount": 1,- "serviceParams": [- "client",- "modelUploadId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "modelUploadId": {- "type": "string"- }- },- "required": [- "modelUploadId"- ]- }- },- {- "name": "production_upsertAssemblyUnit",- "module": "production",- "classification": "WRITE",- "description": "upsert assembly unit",- "paramCount": 5,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "modelUploadId": {- "type": "string"- },- "name": {- "type": "string"- },- "componentNodeIds": {- "type": "array",- "items": {- "type": "string"- }- },- "itemId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "modelUploadId",- "name",- "componentNodeIds"- ]- }- },- {- "name": "production_deleteAssemblyUnit",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete assembly unit",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getLatestAssemblyPlan",- "module": "production",- "classification": "READ",- "description": "get latest assembly plan",- "paramCount": 1,- "serviceParams": [- "client",- "modelUploadId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "modelUploadId": {- "type": "string"- }- },- "required": [- "modelUploadId"- ]- }- },- {- "name": "production_getLatestAssemblyPlanJob",- "module": "production",- "classification": "READ",- "description": "get latest assembly plan job",- "paramCount": 1,- "serviceParams": [- "client",- "modelUploadId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "modelUploadId": {- "type": "string"- }- },- "required": [- "modelUploadId"- ]- }- },- {- "name": "production_createAssemblyPlanJob",- "module": "production",- "classification": "WRITE",- "description": "create assembly plan job",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "modelUploadId": {- "type": "string"- }- },- "required": [- "modelUploadId"- ]- }- },- {- "name": "production_getAssemblyPlanJson",- "module": "production",- "classification": "READ",- "description": "get assembly plan json",- "paramCount": 1,- "serviceParams": [- "client",- "modelUploadId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "modelUploadId": {- "type": "string"- }- },- "required": [- "modelUploadId"- ]- }- },- {- "name": "production_getAssemblyComponentMappings",- "module": "production",- "classification": "READ",- "description": "get assembly component mappings",- "paramCount": 1,- "serviceParams": [- "client",- "modelUploadId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "modelUploadId": {- "type": "string"- }- },- "required": [- "modelUploadId"- ]- }- },- {- "name": "production_upsertAssemblyComponentMapping",- "module": "production",- "classification": "WRITE",- "description": "upsert assembly component mapping",- "paramCount": 4,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "modelUploadId": {- "type": "string"- },- "geometryHash": {- "type": "string"- },- "itemId": {- "type": "string"- },- "confidence": {- "type": "string",- "enum": [- "high",- "low"- ]- }- },- "required": [- "modelUploadId",- "geometryHash",- "itemId"- ]- }- },- {- "name": "production_deleteAssemblyComponentMapping",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete assembly component mapping",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getFlattenedBomMaterials",- "module": "production",- "classification": "READ",- "description": "get flattened bom materials",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "production_autoMatchAssemblyComponents",- "module": "production",- "classification": "WRITE",- "description": "auto match assembly components",- "paramCount": 1,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "assemblyInstructionId": {- "type": "string"- }- },- "required": [- "assemblyInstructionId"- ]- }- },- {- "name": "production_planAssemblyStepMarkerSync",- "module": "production",- "classification": "WRITE",- "description": "plan assembly step marker sync",- "paramCount": 2,- "serviceParams": [- "sourceStepIds",- "existingSynced"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "sourceStepIds": {- "type": "array",- "items": {- "type": "string"- }- },- "existingSynced": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "assemblyInstructionStepId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id",- "assemblyInstructionStepId"- ]- }- }- },- "required": [- "sourceStepIds",- "existingSynced"- ]- }- },- {- "name": "production_maxToolQuantityByItem",- "module": "production",- "classification": "WRITE",- "description": "max tool quantity by item",- "paramCount": 1,- "serviceParams": [- "sourceTools"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "sourceTools": {- "type": "array",- "items": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "quantity": {- "type": [- "number",- "null"- ]- }- },- "required": [- "itemId",- "quantity"- ]- }- }- },- "required": [- "sourceTools"- ]- }- },- {- "name": "production_buildAssemblyToolStepLinks",- "module": "production",- "classification": "WRITE",- "description": "build assembly tool step links",- "paramCount": 4,- "serviceParams": [- "sourceSteps",- "toolsByStep",- "toolRowIdByItemId",- "targetIdBySource"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "sourceSteps": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- "toolsByStep": {},- "toolRowIdByItemId": {},- "targetIdBySource": {}- },- "required": [- "sourceSteps",- "toolsByStep",- "toolRowIdByItemId",- "targetIdBySource"- ]- }- },- {- "name": "production_syncAssemblyInstructionToOperation",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "sync assembly instruction to operation",- "paramCount": 2,- "serviceParams": [- "db",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "assemblyInstructionId": {- "type": "string"- },- "operationId": {- "type": "string"- }- },- "required": [- "assemblyInstructionId",- "operationId"- ]- }- },- {- "name": "production_generateAssemblyStepsFromPlan",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "generate assembly steps from plan",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "assemblyInstructionId": {- "type": "string"- },- "/**\n * \"regenerate\" replaces the existing steps with fresh drafts from the\n * latest plan — refused while any step is manually authored\n * (planConfidence \"manual\") or already Done.\n */\n mode": {- "type": "string",- "enum": [- "generate",- "regenerate"- ]- }- },- "required": [- "assemblyInstructionId"- ]- }- },- {- "name": "production_toViewerStep",- "module": "production",- "classification": "WRITE",- "description": "to viewer step",- "paramCount": 1,- "serviceParams": [- "step"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "step": {}- },- "required": [- "step"- ]- }- },- {- "name": "production_getJobMaterialPurchaseOrderLines",- "module": "production",- "classification": "READ",- "description": "get job material purchase order lines",- "paramCount": 2,- "serviceParams": [- "client",- "materials",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "materials": {},- "locationId": {- "type": "string"- }- },- "required": [- "materials",- "locationId"- ]- }- },- {- "name": "production_getJobMaterialSupplyJobLines",- "module": "production",- "classification": "READ",- "description": "get job material supply job lines",- "paramCount": 2,- "serviceParams": [- "client",- "materials",- "companyId",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "materials": {},- "locationId": {- "type": "string"- }- },- "required": [- "materials",- "locationId"- ]- }- },- {- "name": "production_getInspectionDocuments",- "module": "production",- "classification": "READ",- "description": "get inspection documents",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "search": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- },- "required": [- "search"- ]- }- },- {- "name": "production_getInspectionDocumentsForItem",- "module": "production",- "classification": "READ",- "description": "get inspection documents for item",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "production_getInspectionDocument",- "module": "production",- "classification": "READ",- "description": "get inspection document",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_upsertInspectionDocument",- "module": "production",- "classification": "WRITE",- "description": "upsert inspection document",- "paramCount": 7,- "serviceParams": [- "client",- "diagram"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "partId": {- "type": "string"- },- "drawingNumber": {- "type": "string"- },- "pdfUrl": {- "type": "string"- },- "annotations": {- "type": "string"- },- "features": {- "type": "string"- }- },- "required": [- "partId"- ]- }- },- {- "name": "production_deleteInspectionDocument",- "module": "production",- "classification": "DESTRUCTIVE",- "description": "delete inspection document",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "production_getInspectionFeatures",- "module": "production",- "classification": "READ",- "description": "get inspection features",- "paramCount": 1,- "serviceParams": [- "client",- "inspectionDocumentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "inspectionDocumentId": {- "type": "string"- }- },- "required": [- "inspectionDocumentId"- ]- }- },- {- "name": "production_getBalloons",- "module": "production",- "classification": "READ",- "description": "get balloons",- "paramCount": 1,- "serviceParams": [- "client",- "inspectionDocumentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "inspectionDocumentId": {- "type": "string"- }- },- "required": [- "inspectionDocumentId"- ]- }- },- {- "name": "production_getInspectionPlan",- "module": "production",- "classification": "READ",- "description": "get inspection plan",- "paramCount": 1,- "serviceParams": [- "client",- "inspectionDocumentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "inspectionDocumentId": {- "type": "string"- }- },- "required": [- "inspectionDocumentId"- ]- }- },- {- "name": "production_updateInspectionDocumentSampling",- "module": "production",- "classification": "WRITE",- "description": "update inspection document sampling",- "paramCount": 6,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "samplingPlanType": {- "type": "string"- },- "samplingSampleSize": {- "type": "number"- },- "samplingPercentage": {- "type": "number"- },- "samplingAql": {- "type": "number"- },- "samplingInspectionLevel": {- "type": "string"- },- "samplingSeverity": {- "type": "string"- }- }- }- },- {- "name": "production_saveInspectionDocumentAtomic",- "module": "production",- "classification": "WRITE",- "description": "save inspection document atomic",- "paramCount": 7,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "inspectionDocumentId": {- "type": "string"- },- "pdfUrl": {- "type": [- "string",- "null"- ]- },- "pageCount": {- "type": "number"- },- "defaultPageWidth": {- "type": "number"- },- "defaultPageHeight": {- "type": "number"- },- "features": {},- "balloons": {}- },- "required": [- "inspectionDocumentId",- "features",- "balloons"- ]- }- },- {- "name": "production_completeOperation",- "module": "production",- "classification": "WRITE",- "description": "complete operation",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "userId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "operationId": {- "type": "string"- },- "quantity": {- "type": "number"- }- },- "required": [- "operationId",- "quantity"- ]- }- },- {- "name": "production_issueMaterial",- "module": "production",- "classification": "WRITE",- "description": "issue material",- "paramCount": 7,- "serviceParams": [- "client",- "companyId",- "userId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "operationId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "materialId": {- "type": "string"- },- "jobOperationStepId": {- "type": "string"- },- "adjustmentType": {- "type": "string"- },- "acknowledged": {- "type": "boolean"- }- },- "required": [- "operationId",- "itemId",- "quantity"- ]- }- },- {- "name": "production_completeJob",- "module": "production",- "classification": "WRITE",- "description": "complete job",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "userId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "storageUnitId": {- "type": "string"- },- "locationId": {- "type": "string"- }- },- "required": [- "jobId",- "quantity"- ]- }- },- {- "name": "production_scheduleJob",- "module": "production",- "classification": "WRITE",- "description": "schedule job",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "userId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "jobId": {- "type": "string"- }- },- "required": [- "jobId"- ]- }- },- {- "name": "purchasing_closePurchaseOrder",- "module": "purchasing",- "classification": "WRITE",- "description": "close purchase order",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderId",- "userId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderId": {- "type": "string"- }- },- "required": [- "purchaseOrderId"- ]- }- },- {- "name": "purchasing_convertSupplierQuoteToOrder",- "module": "purchasing",- "classification": "WRITE",- "description": "convert supplier quote to order",- "paramCount": 2,- "serviceParams": [- "client",- "payload"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "selectedLines": {}- },- "required": [- "id",- "selectedLines"- ]- }- },- {- "name": "purchasing_deletePurchaseOrder",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "delete purchase order",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderId": {- "type": "string"- }- },- "required": [- "purchaseOrderId"- ]- }- },- {- "name": "purchasing_deletePurchaseOrderLine",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "delete purchase order line",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderLineId": {- "type": "string"- }- },- "required": [- "purchaseOrderLineId"- ]- }- },- {- "name": "purchasing_duplicatePurchaseOrder",- "module": "purchasing",- "classification": "WRITE",- "description": "duplicate purchase order",- "paramCount": 1,- "serviceParams": [- "client",- "{\n sourcePurchaseOrderId,\n companyId,\n companyGroupId,\n userId\n }"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "sourcePurchaseOrderId": {- "type": "string"- }- },- "required": [- "sourcePurchaseOrderId"- ]- }- },- {- "name": "purchasing_deleteSupplier",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "delete supplier",- "paramCount": 1,- "serviceParams": [- "client",- "supplierId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_deleteSupplierContact",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "delete supplier contact",- "paramCount": 2,- "serviceParams": [- "client",- "supplierId",- "supplierContactId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- },- "supplierContactId": {- "type": "string"- }- },- "required": [- "supplierId",- "supplierContactId"- ]- }- },- {- "name": "purchasing_deleteSupplierLocation",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "delete supplier location",- "paramCount": 2,- "serviceParams": [- "client",- "supplierId",- "supplierLocationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- },- "supplierLocationId": {- "type": "string"- }- },- "required": [- "supplierId",- "supplierLocationId"- ]- }- },- {- "name": "purchasing_deleteSupplierProcess",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "delete supplier process",- "paramCount": 1,- "serviceParams": [- "client",- "supplierProcessId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierProcessId": {- "type": "string"- }- },- "required": [- "supplierProcessId"- ]- }- },- {- "name": "purchasing_deleteSupplierQuote",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "delete supplier quote",- "paramCount": 1,- "serviceParams": [- "client",- "supplierQuoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteId": {- "type": "string"- }- },- "required": [- "supplierQuoteId"- ]- }- },- {- "name": "purchasing_deleteSupplierQuoteLine",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "delete supplier quote line",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "purchasing_deleteSupplierType",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "delete supplier type",- "paramCount": 1,- "serviceParams": [- "client",- "supplierTypeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierTypeId": {- "type": "string"- }- },- "required": [- "supplierTypeId"- ]- }- },- {- "name": "purchasing_getPurchaseOrder",- "module": "purchasing",- "classification": "READ",- "description": "get purchase order",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderId": {- "type": "string"- }- },- "required": [- "purchaseOrderId"- ]- }- },- {- "name": "purchasing_finalizeSupplierQuote",- "module": "purchasing",- "classification": "WRITE",- "description": "finalize supplier quote",- "paramCount": 1,- "serviceParams": [- "client",- "supplierQuoteId",- "userId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteId": {- "type": "string"- }- },- "required": [- "supplierQuoteId"- ]- }- },- {- "name": "purchasing_getPurchaseOrders",- "module": "purchasing",- "classification": "READ",- "description": "get purchase orders",- "paramCount": 5,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "status": {- "type": [- "string",- "null"- ]- },- "supplierId": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "purchasing_getPurchaseOrderDelivery",- "module": "purchasing",- "classification": "READ",- "description": "get purchase order delivery",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderId": {- "type": "string"- }- },- "required": [- "purchaseOrderId"- ]- }- },- {- "name": "purchasing_getPurchaseOrderLocations",- "module": "purchasing",- "classification": "READ",- "description": "get purchase order locations",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderId": {- "type": "string"- }- },- "required": [- "purchaseOrderId"- ]- }- },- {- "name": "purchasing_getPurchaseOrderPayment",- "module": "purchasing",- "classification": "READ",- "description": "get purchase order payment",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderId": {- "type": "string"- }- },- "required": [- "purchaseOrderId"- ]- }- },- {- "name": "purchasing_getPurchaseOrderLines",- "module": "purchasing",- "classification": "READ",- "description": "get purchase order lines",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderId": {- "type": "string"- }- },- "required": [- "purchaseOrderId"- ]- }- },- {- "name": "purchasing_getPurchaseOrderLine",- "module": "purchasing",- "classification": "READ",- "description": "get purchase order line",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderLineId": {- "type": "string"- }- },- "required": [- "purchaseOrderLineId"- ]- }- },- {- "name": "purchasing_getPurchaseOrderSuppliers",- "module": "purchasing",- "classification": "READ",- "description": "get purchase order suppliers",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "purchasing_getPurchasingDocumentsAssignedToMe",- "module": "purchasing",- "classification": "READ",- "description": "get purchasing documents assigned to me",- "paramCount": 0,- "serviceParams": [- "client",- "userId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "purchasing_getPurchasingPlanning",- "module": "purchasing",- "classification": "READ",- "description": "get purchasing planning",- "paramCount": 3,- "serviceParams": [- "client",- "locationId",- "companyId",- "periods",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "periods": {- "type": "array",- "items": {- "type": "string"- }- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- },- "required": [- "locationId",- "periods",- "args"- ]- }- },- {- "name": "purchasing_getPurchasingTerms",- "module": "purchasing",- "classification": "READ",- "description": "get purchasing terms",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "purchasing_getSupplier",- "module": "purchasing",- "classification": "READ",- "description": "get supplier",- "paramCount": 1,- "serviceParams": [- "client",- "supplierId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_getSupplierApprovalContext",- "module": "purchasing",- "classification": "READ",- "description": "get supplier approval context",- "paramCount": 3,- "serviceParams": [- "serviceRole",- "supplierId",- "status",- "companyId",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "serviceRole": {},- "supplierId": {- "type": "string"- },- "status": {- "type": [- "string",- "null"- ]- }- },- "required": [- "serviceRole",- "supplierId",- "status"- ]- }- },- {- "name": "purchasing_getSupplierContact",- "module": "purchasing",- "classification": "READ",- "description": "get supplier contact",- "paramCount": 1,- "serviceParams": [- "client",- "supplierContactId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierContactId": {- "type": "string"- }- },- "required": [- "supplierContactId"- ]- }- },- {- "name": "purchasing_getSupplierContacts",- "module": "purchasing",- "classification": "READ",- "description": "get supplier contacts",- "paramCount": 1,- "serviceParams": [- "client",- "supplierId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_getSupplierInteraction",- "module": "purchasing",- "classification": "READ",- "description": "get supplier interaction",- "paramCount": 1,- "serviceParams": [- "client",- "opportunityId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "opportunityId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "opportunityId"- ]- }- },- {- "name": "purchasing_getSupplierInteractionDocuments",- "module": "purchasing",- "classification": "READ",- "description": "get supplier interaction documents",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "interactionId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "interactionId": {- "type": "string"- }- },- "required": [- "interactionId"- ]- }- },- {- "name": "purchasing_getSupplierInteractionLineDocuments",- "module": "purchasing",- "classification": "READ",- "description": "get supplier interaction line documents",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "lineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "lineId": {- "type": "string"- }- },- "required": [- "lineId"- ]- }- },- {- "name": "purchasing_getSupplierLocations",- "module": "purchasing",- "classification": "READ",- "description": "get supplier locations",- "paramCount": 1,- "serviceParams": [- "client",- "supplierId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_getSupplierLocation",- "module": "purchasing",- "classification": "READ",- "description": "get supplier location",- "paramCount": 1,- "serviceParams": [- "client",- "supplierContactId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierContactId": {- "type": "string"- }- },- "required": [- "supplierContactId"- ]- }- },- {- "name": "purchasing_getSupplierPayment",- "module": "purchasing",- "classification": "READ",- "description": "get supplier payment",- "paramCount": 1,- "serviceParams": [- "client",- "supplierId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_getSupplierProcessById",- "module": "purchasing",- "classification": "READ",- "description": "get supplier process by id",- "paramCount": 1,- "serviceParams": [- "client",- "supplierProcessId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierProcessId": {- "type": "string"- }- },- "required": [- "supplierProcessId"- ]- }- },- {- "name": "purchasing_getSupplierProcessesByProcess",- "module": "purchasing",- "classification": "READ",- "description": "get supplier processes by process",- "paramCount": 1,- "serviceParams": [- "client",- "processId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "processId": {- "type": "string"- }- },- "required": [- "processId"- ]- }- },- {- "name": "purchasing_getSupplierProcessesBySupplier",- "module": "purchasing",- "classification": "READ",- "description": "get supplier processes by supplier",- "paramCount": 1,- "serviceParams": [- "client",- "supplierId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_getSupplierQuote",- "module": "purchasing",- "classification": "READ",- "description": "get supplier quote",- "paramCount": 1,- "serviceParams": [- "client",- "supplierQuoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteId": {- "type": "string"- }- },- "required": [- "supplierQuoteId"- ]- }- },- {- "name": "purchasing_getSupplierQuoteByInteractionId",- "module": "purchasing",- "classification": "READ",- "description": "get supplier quote by interaction id",- "paramCount": 1,- "serviceParams": [- "client",- "interactionId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "interactionId": {- "type": "string"- }- },- "required": [- "interactionId"- ]- }- },- {- "name": "purchasing_getSupplierQuoteByExternalLinkId",- "module": "purchasing",- "classification": "READ",- "description": "get supplier quote by external link id",- "paramCount": 1,- "serviceParams": [- "client",- "externalLinkId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "externalLinkId": {- "type": "string"- }- },- "required": [- "externalLinkId"- ]- }- },- {- "name": "purchasing_getSupplierQuotes",- "module": "purchasing",- "classification": "READ",- "description": "get supplier quotes",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "purchasing_getSupplierQuoteLine",- "module": "purchasing",- "classification": "READ",- "description": "get supplier quote line",- "paramCount": 1,- "serviceParams": [- "client",- "supplierQuoteLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteLineId": {- "type": "string"- }- },- "required": [- "supplierQuoteLineId"- ]- }- },- {- "name": "purchasing_getSupplierQuoteLines",- "module": "purchasing",- "classification": "READ",- "description": "get supplier quote lines",- "paramCount": 1,- "serviceParams": [- "client",- "supplierQuoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteId": {- "type": "string"- }- },- "required": [- "supplierQuoteId"- ]- }- },- {- "name": "purchasing_getSupplierQuoteLinePrices",- "module": "purchasing",- "classification": "READ",- "description": "get supplier quote line prices",- "paramCount": 1,- "serviceParams": [- "client",- "supplierQuoteLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteLineId": {- "type": "string"- }- },- "required": [- "supplierQuoteLineId"- ]- }- },- {- "name": "purchasing_getSupplierQuoteLinePricesByQuoteId",- "module": "purchasing",- "classification": "READ",- "description": "get supplier quote line prices by quote id",- "paramCount": 1,- "serviceParams": [- "client",- "supplierQuoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteId": {- "type": "string"- }- },- "required": [- "supplierQuoteId"- ]- }- },- {- "name": "purchasing_getSupplierQuotesList",- "module": "purchasing",- "classification": "READ",- "description": "get supplier quotes list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "purchasing_getSupplierShipping",- "module": "purchasing",- "classification": "READ",- "description": "get supplier shipping",- "paramCount": 1,- "serviceParams": [- "client",- "supplierId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_getSuppliers",- "module": "purchasing",- "classification": "READ",- "description": "get suppliers",- "paramCount": 5,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "type": {- "type": [- "string",- "null"- ]- },- "status": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "purchasing_getSuppliersList",- "module": "purchasing",- "classification": "READ",- "description": "get suppliers list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "purchasing_getSupplierType",- "module": "purchasing",- "classification": "READ",- "description": "get supplier type",- "paramCount": 1,- "serviceParams": [- "client",- "supplierTypeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierTypeId": {- "type": "string"- }- },- "required": [- "supplierTypeId"- ]- }- },- {- "name": "purchasing_getSupplierTypes",- "module": "purchasing",- "classification": "READ",- "description": "get supplier types",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "purchasing_getSupplierTypesList",- "module": "purchasing",- "classification": "READ",- "description": "get supplier types list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "purchasing_insertSupplier",- "module": "purchasing",- "classification": "WRITE",- "description": "insert supplier",- "paramCount": 9,- "serviceParams": [- "client",- "supplier"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "readableId": {- "type": "string"- },- "name": {- "type": "string"- },- "supplierStatus": {- "type": "string"- },- "supplierTypeId": {- "type": "string"- },- "accountManagerId": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "purchasingContactId": {- "type": "string"- },- "website": {- "type": "string"- }- },- "required": [- "name"- ]- }- },- {- "name": "purchasing_insertSupplierContact",- "module": "purchasing",- "classification": "WRITE",- "description": "insert supplier contact",- "paramCount": 4,- "serviceParams": [- "client",- "supplierContact"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- },- "contact": {},- "supplierLocationId": {- "type": "string"- },- "customFields": {}- },- "required": [- "supplierId",- "contact"- ]- }- },- {- "name": "purchasing_insertSupplierInteraction",- "module": "purchasing",- "classification": "WRITE",- "description": "insert supplier interaction",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "supplierId"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_insertSupplierLocation",- "module": "purchasing",- "classification": "WRITE",- "description": "insert supplier location",- "paramCount": 4,- "serviceParams": [- "client",- "supplierLocation"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- },- "name": {- "type": "string"- },- "address: {\n addressLine1": {},- "customFields": {}- },- "required": [- "supplierId",- "name"- ]- }- },- {- "name": "purchasing_finalizePurchaseOrder",- "module": "purchasing",- "classification": "WRITE",- "description": "finalize purchase order",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderId",- "userId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderId": {- "type": "string"- }- },- "required": [- "purchaseOrderId"- ]- }- },- {- "name": "purchasing_sendSupplierQuote",- "module": "purchasing",- "classification": "WRITE",- "description": "send supplier quote",- "paramCount": 1,- "serviceParams": [- "client",- "supplierQuoteId",- "userId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteId": {- "type": "string"- }- },- "required": [- "supplierQuoteId"- ]- }- },- {- "name": "purchasing_updatePurchaseOrderStatusLegacy",- "module": "purchasing",- "classification": "WRITE",- "description": "update purchase order status legacy",- "paramCount": 2,- "serviceParams": [- "client",- "purchaseOrder"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- }- },- "required": [- "id",- "status"- ]- }- },- {- "name": "purchasing_updatePurchaseOrderExchangeRate",- "module": "purchasing",- "classification": "WRITE",- "description": "update purchase order exchange rate",- "paramCount": 2,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "exchangeRate": {- "type": "number"- }- },- "required": [- "id",- "exchangeRate"- ]- }- },- {- "name": "purchasing_updatePurchaseOrderFavorite",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "update purchase order favorite",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "favorite": {- "type": "boolean"- }- },- "required": [- "id",- "favorite"- ]- }- },- {- "name": "purchasing_updatePurchaseOrderStatus",- "module": "purchasing",- "classification": "WRITE",- "description": "update purchase order status",- "paramCount": 3,- "serviceParams": [- "client",- "update"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "assignee": {}- },- "required": [- "id",- "status",- "assignee"- ]- }- },- {- "name": "purchasing_reopenPurchaseOrderAsRevision",- "module": "purchasing",- "classification": "WRITE",- "description": "reopen purchase order as revision",- "paramCount": 1,- "serviceParams": [- "db",- "{\n id,\n companyId,\n updatedBy\n }"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "purchasing_updateSupplierAccounting",- "module": "purchasing",- "classification": "WRITE",- "description": "update supplier accounting",- "paramCount": 2,- "serviceParams": [- "client",- "supplierAccounting"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "supplierTypeId": {- "type": "string"- }- }- }- },- {- "name": "purchasing_updateSupplierContact",- "module": "purchasing",- "classification": "WRITE",- "description": "update supplier contact",- "paramCount": 4,- "serviceParams": [- "client",- "supplierContact"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "contactId": {- "type": "string"- },- "contact": {},- "supplierLocationId": {- "type": "string"- },- "customFields": {}- },- "required": [- "contactId",- "contact"- ]- }- },- {- "name": "purchasing_updateSupplierLocation",- "module": "purchasing",- "classification": "WRITE",- "description": "update supplier location",- "paramCount": 4,- "serviceParams": [- "client",- "supplierLocation"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "addressId": {- "type": "string"- },- "name": {- "type": "string"- },- "address: {\n addressLine1": {},- "customFields": {}- },- "required": [- "addressId",- "name"- ]- }- },- {- "name": "purchasing_updateSupplierPayment",- "module": "purchasing",- "classification": "WRITE",- "description": "update supplier payment",- "paramCount": 5,- "serviceParams": [- "client",- "supplierPayment"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- },- "invoiceSupplierId": {- "type": "string"- },- "invoiceSupplierLocationId": {- "type": "string"- },- "invoiceSupplierContactId": {- "type": "string"- },- "paymentTermId": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_updateSupplierQuoteExchangeRate",- "module": "purchasing",- "classification": "WRITE",- "description": "update supplier quote exchange rate",- "paramCount": 2,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "exchangeRate": {- "type": "number"- }- },- "required": [- "id",- "exchangeRate"- ]- }- },- {- "name": "purchasing_updateSupplierQuoteFavorite",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "update supplier quote favorite",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "favorite": {- "type": "boolean"- }- },- "required": [- "id",- "favorite"- ]- }- },- {- "name": "purchasing_updateSupplierQuoteStatus",- "module": "purchasing",- "classification": "WRITE",- "description": "update supplier quote status",- "paramCount": 3,- "serviceParams": [- "client",- "update"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "assignee": {}- },- "required": [- "id",- "status",- "assignee"- ]- }- },- {- "name": "purchasing_updateSupplierShipping",- "module": "purchasing",- "classification": "WRITE",- "description": "update supplier shipping",- "paramCount": 7,- "serviceParams": [- "client",- "supplierShipping"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- },- "shippingSupplierId": {- "type": "string"- },- "shippingSupplierLocationId": {- "type": "string"- },- "shippingSupplierContactId": {- "type": "string"- },- "shippingMethodId": {- "type": "string"- },- "incoterm": {- "type": "string"- },- "incotermLocation": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_getSupplierTax",- "module": "purchasing",- "classification": "READ",- "description": "get supplier tax",- "paramCount": 1,- "serviceParams": [- "client",- "supplierId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_updateSupplierTax",- "module": "purchasing",- "classification": "WRITE",- "description": "update supplier tax",- "paramCount": 1,- "serviceParams": [- "client",- "supplierTax"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierTax": {}- },- "required": [- "supplierTax"- ]- }- },- {- "name": "purchasing_insertPurchaseOrder",- "module": "purchasing",- "classification": "WRITE",- "description": "Create a new purchase order with all business logic - generates sequence, creates supplier interaction, resolves payment/shipping defaults from supplier. LLM can create a PO with just supplierId.",- "paramCount": 15,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- },- "purchaseOrderId": {- "type": "string"- },- "purchaseOrderType": {- "type": "string",- "enum": [- "Purchase",- "Return",- "Outside Processing"- ]- },- "locationId": {- "type": "string"- },- "status": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "orderDate": {- "type": "string"- },- "supplierContactId": {- "type": "string"- },- "supplierLocationId": {- "type": "string"- },- "supplierQuoteId": {- "type": "string"- },- "receiptRequestedDate": {- "type": "string"- },- "supplierReference": {- "type": "string"- },- "notes": {},- "externalNotes": {},- "customFields": {}- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_updatePurchaseOrder",- "module": "purchasing",- "classification": "WRITE",- "description": "Update an existing purchase order - handles exchange rate updates when currency changes",- "paramCount": 11,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "orderDate": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "supplierContactId": {- "type": [- "string",- "null"- ]- },- "supplierLocationId": {- "type": [- "string",- "null"- ]- },- "supplierReference": {- "type": "string"- },- "purchaseOrderType": {- "type": "string"- },- "notes": {- "type": [- "string",- "null"- ]- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "purchasing_upsertPurchaseOrder",- "module": "purchasing",- "classification": "WRITE",- "description": "upsert purchase order",- "paramCount": 2,- "serviceParams": [- "client",- "purchaseOrder",- "receiptRequestedDate"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrder": {},- "receiptRequestedDate": {- "type": "string"- }- },- "required": [- "purchaseOrder"- ]- }- },- {- "name": "purchasing_upsertPurchaseOrderDelivery",- "module": "purchasing",- "classification": "WRITE",- "description": "upsert purchase order delivery",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderDelivery"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderDelivery": {}- },- "required": [- "purchaseOrderDelivery"- ]- }- },- {- "name": "purchasing_upsertPurchaseOrderLine",- "module": "purchasing",- "classification": "WRITE",- "description": "upsert purchase order line",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderLine"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderLine": {}- },- "required": [- "purchaseOrderLine"- ]- }- },- {- "name": "purchasing_updatePurchaseOrderLineOrder",- "module": "purchasing",- "classification": "WRITE",- "description": "update purchase order line order",- "paramCount": 1,- "serviceParams": [- "db",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "purchasing_shortClosePurchaseOrderLine",- "module": "purchasing",- "classification": "WRITE",- "description": "short close purchase order line",- "paramCount": 3,- "serviceParams": [- "db",- "{\n lineId,\n purchaseOrderId,\n companyId,\n userId,\n intent\n }"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "lineId": {- "type": "string"- },- "purchaseOrderId": {- "type": "string"- },- "intent": {- "type": "string",- "enum": [- "close",- "reopen"- ]- }- },- "required": [- "lineId",- "purchaseOrderId",- "intent"- ]- }- },- {- "name": "purchasing_upsertPurchaseOrderPayment",- "module": "purchasing",- "classification": "WRITE",- "description": "upsert purchase order payment",- "paramCount": 5,- "serviceParams": [- "client",- "purchaseOrderPayment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "invoiceSupplierId": {- "type": "string"- },- "invoiceSupplierLocationId": {- "type": "string"- },- "invoiceSupplierContactId": {- "type": "string"- },- "paymentTermId": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "purchasing_upsertSupplier",- "module": "purchasing",- "classification": "WRITE",- "description": "upsert supplier",- "paramCount": 9,- "serviceParams": [- "client",- "supplier"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "readableId": {- "type": "string"- },- "name": {- "type": "string"- },- "supplierStatus": {- "type": "string"- },- "supplierTypeId": {- "type": "string"- },- "accountManagerId": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "purchasingContactId": {- "type": "string"- },- "website": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "purchasing_upsertSupplierProcess",- "module": "purchasing",- "classification": "WRITE",- "description": "upsert supplier process",- "paramCount": 5,- "serviceParams": [- "client",- "supplierProcess"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "processId": {- "type": "string"- },- "minimumCost": {- "type": "number"- },- "leadTime": {- "type": "number"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "supplierId",- "processId",- "_operation"- ]- }- },- {- "name": "purchasing_insertSupplierQuote",- "module": "purchasing",- "classification": "WRITE",- "description": "Create a new supplier quote with all business logic - generates sequence, creates supplier interaction, sets up external link. LLM can create a quote with just supplierId.",- "paramCount": 13,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": "string"- },- "supplierQuoteId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "status": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "expirationDate": {- "type": "string"- },- "supplierContactId": {- "type": "string"- },- "supplierLocationId": {- "type": "string"- },- "notes": {- "type": "string"- },- "customFields": {},- "quotedDate": {- "type": "string"- },- "supplierReference": {- "type": "string"- },- "supplierQuoteType": {- "type": "string"- }- },- "required": [- "supplierId"- ]- }- },- {- "name": "purchasing_updateSupplierQuote",- "module": "purchasing",- "classification": "WRITE",- "description": "Update an existing supplier quote - handles exchange rate updates when currency changes",- "paramCount": 8,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "expirationDate": {- "type": [- "string",- "null"- ]- },- "supplierContactId": {- "type": [- "string",- "null"- ]- },- "supplierLocationId": {- "type": [- "string",- "null"- ]- },- "notes": {- "type": [- "string",- "null"- ]- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "purchasing_upsertSupplierQuote",- "module": "purchasing",- "classification": "WRITE",- "description": "upsert supplier quote",- "paramCount": 17,- "serviceParams": [- "client",- "supplierQuote"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "rfqId": {- "type": "string"- },- "rfqDate": {- "type": "string"- },- "expirationDate": {- "type": "string"- },- "locationId": {- "type": "string"- },- "employeeId": {- "type": "string"- },- "status": {- "type": "string"- },- "supplierIds": {- "type": "string"- },- "purchasingRfqId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "description": {- "type": "string"- },- "quantity": {- "type": "array",- "items": {- "type": "number"- }- },- "purchaseUnitOfMeasureCode": {- "type": "string"- },- "inventoryUnitOfMeasureCode": {- "type": "string"- },- "conversionFactor": {- "type": "number"- },- "order": {- "type": "number"- },- "suppliers": {- "type": "array",- "items": {- "type": "string"- }- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "rfqDate",- "supplierIds",- "purchasingRfqId",- "itemId",- "quantity",- "_operation"- ]- }- },- {- "name": "purchasing_upsertSupplierQuoteLine",- "module": "purchasing",- "classification": "WRITE",- "description": "upsert supplier quote line",- "paramCount": 1,- "serviceParams": [- "client",- "supplierQuoteLine"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteLine": {}- },- "required": [- "supplierQuoteLine"- ]- }- },- {- "name": "purchasing_updateSupplierQuoteLineOrder",- "module": "purchasing",- "classification": "WRITE",- "description": "update supplier quote line order",- "paramCount": 1,- "serviceParams": [- "db",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "purchasing_upsertSupplierType",- "module": "purchasing",- "classification": "WRITE",- "description": "upsert supplier type",- "paramCount": 2,- "serviceParams": [- "client",- "supplierType"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "purchasing_deletePurchasingRFQ",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "delete purchasing r f q",- "paramCount": 1,- "serviceParams": [- "client",- "purchasingRfqId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchasingRfqId": {- "type": "string"- }- },- "required": [- "purchasingRfqId"- ]- }- },- {- "name": "purchasing_deletePurchasingRFQLine",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "delete purchasing r f q line",- "paramCount": 1,- "serviceParams": [- "client",- "purchasingRfqLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchasingRfqLineId": {- "type": "string"- }- },- "required": [- "purchasingRfqLineId"- ]- }- },- {- "name": "purchasing_getPurchasingRFQ",- "module": "purchasing",- "classification": "READ",- "description": "get purchasing r f q",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "purchasing_getPurchasingRFQs",- "module": "purchasing",- "classification": "READ",- "description": "get purchasing r f qs",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "purchasing_getPurchasingRFQLine",- "module": "purchasing",- "classification": "READ",- "description": "get purchasing r f q line",- "paramCount": 1,- "serviceParams": [- "client",- "lineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "lineId": {- "type": "string"- }- },- "required": [- "lineId"- ]- }- },- {- "name": "purchasing_getPurchasingRFQLines",- "module": "purchasing",- "classification": "READ",- "description": "get purchasing r f q lines",- "paramCount": 1,- "serviceParams": [- "client",- "purchasingRfqId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchasingRfqId": {- "type": "string"- }- },- "required": [- "purchasingRfqId"- ]- }- },- {- "name": "purchasing_getPurchasingRFQSuppliers",- "module": "purchasing",- "classification": "READ",- "description": "get purchasing r f q suppliers",- "paramCount": 1,- "serviceParams": [- "client",- "purchasingRfqId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchasingRfqId": {- "type": "string"- }- },- "required": [- "purchasingRfqId"- ]- }- },- {- "name": "purchasing_insertPurchasingRFQ",- "module": "purchasing",- "classification": "WRITE",- "description": "insert purchasing r f q",- "paramCount": 8,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "rfqId": {- "type": "string"- },- "rfqDate": {- "type": "string"- },- "expirationDate": {- "type": "string"- },- "locationId": {- "type": "string"- },- "employeeId": {- "type": "string"- },- "status": {- "type": "string"- },- "notes": {- "type": "string"- },- "customFields": {}- }- }- },- {- "name": "purchasing_updatePurchasingRFQ",- "module": "purchasing",- "classification": "WRITE",- "description": "update purchasing r f q",- "paramCount": 8,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "rfqDate": {- "type": "string"- },- "expirationDate": {- "type": [- "string",- "null"- ]- },- "locationId": {- "type": "string"- },- "employeeId": {- "type": [- "string",- "null"- ]- },- "status": {- "type": "string"- },- "notes": {- "type": [- "string",- "null"- ]- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "purchasing_upsertPurchasingRFQ",- "module": "purchasing",- "classification": "WRITE",- "description": "upsert purchasing r f q",- "paramCount": 8,- "serviceParams": [- "client",- "purchasingRfq"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "rfqId": {- "type": "string"- },- "rfqDate": {- "type": "string"- },- "expirationDate": {- "type": "string"- },- "locationId": {- "type": "string"- },- "employeeId": {- "type": "string"- },- "status": {- "type": "string"- },- "customFields": {}- },- "required": [- "rfqId",- "rfqDate"- ]- }- },- {- "name": "purchasing_upsertPurchasingRFQLine",- "module": "purchasing",- "classification": "WRITE",- "description": "upsert purchasing r f q line",- "paramCount": 1,- "serviceParams": [- "client",- "purchasingRfqLine"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "purchasingRfqLine": {}- },- "required": [- "purchasingRfqLine"- ]- }- },- {- "name": "purchasing_updatePurchasingRFQLineOrder",- "module": "purchasing",- "classification": "WRITE",- "description": "update purchasing r f q line order",- "paramCount": 1,- "serviceParams": [- "db",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "purchasing_upsertPurchasingRFQSuppliers",- "module": "purchasing",- "classification": "DESTRUCTIVE",- "description": "upsert purchasing r f q suppliers",- "paramCount": 2,- "serviceParams": [- "client",- "purchasingRfqId",- "supplierIds",- "companyId",- "createdBy"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "purchasingRfqId": {- "type": "string"- },- "supplierIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "purchasingRfqId",- "supplierIds"- ]- }- },- {- "name": "purchasing_updatePurchasingRFQStatus",- "module": "purchasing",- "classification": "WRITE",- "description": "update purchasing r f q status",- "paramCount": 3,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "assignee": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id",- "status"- ]- }- },- {- "name": "purchasing_getLinkedSupplierQuotes",- "module": "purchasing",- "classification": "READ",- "description": "get linked supplier quotes",- "paramCount": 1,- "serviceParams": [- "client",- "purchasingRfqId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchasingRfqId": {- "type": "string"- }- },- "required": [- "purchasingRfqId"- ]- }- },- {- "name": "purchasing_getLinkedPurchasingRfqs",- "module": "purchasing",- "classification": "READ",- "description": "get linked purchasing rfqs",- "paramCount": 1,- "serviceParams": [- "client",- "supplierQuoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteId": {- "type": "string"- }- },- "required": [- "supplierQuoteId"- ]- }- },- {- "name": "purchasing_getLinkedPurchasingRfqsForInteraction",- "module": "purchasing",- "classification": "READ",- "description": "get linked purchasing rfqs for interaction",- "paramCount": 1,- "serviceParams": [- "client",- "supplierInteractionId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierInteractionId": {- "type": "string"- }- },- "required": [- "supplierInteractionId"- ]- }- },- {- "name": "purchasing_getSiblingQuotesForQuote",- "module": "purchasing",- "classification": "READ",- "description": "get sibling quotes for quote",- "paramCount": 1,- "serviceParams": [- "client",- "supplierQuoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteId": {- "type": "string"- }- },- "required": [- "supplierQuoteId"- ]- }- },- {- "name": "purchasing_getLinkedPurchasingRfqsForOrder",- "module": "purchasing",- "classification": "READ",- "description": "get linked purchasing rfqs for order",- "paramCount": 1,- "serviceParams": [- "client",- "purchaseOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchaseOrderId": {- "type": "string"- }- },- "required": [- "purchaseOrderId"- ]- }- },- {- "name": "purchasing_getSupplierQuotesForComparison",- "module": "purchasing",- "classification": "READ",- "description": "get supplier quotes for comparison",- "paramCount": 1,- "serviceParams": [- "client",- "purchasingRfqId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchasingRfqId": {- "type": "string"- }- },- "required": [- "purchasingRfqId"- ]- }- },- {- "name": "purchasing_getPurchasingRFQSuppliersWithLinks",- "module": "purchasing",- "classification": "READ",- "description": "get purchasing r f q suppliers with links",- "paramCount": 1,- "serviceParams": [- "client",- "purchasingRfqId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "purchasingRfqId": {- "type": "string"- }- },- "required": [- "purchasingRfqId"- ]- }- },- {- "name": "purchasing_getDefaultAttachmentsForPO",- "module": "purchasing",- "classification": "READ",- "description": "get default attachments for p o",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "supplierId": {- "type": [- "string",- "null"- ]- },- "itemIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "supplierId",- "itemIds"- ]- }- },- {- "name": "quality_activateGauge",- "module": "quality",- "classification": "WRITE",- "description": "activate gauge",- "paramCount": 1,- "serviceParams": [- "client",- "gaugeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "gaugeId": {- "type": "string"- }- },- "required": [- "gaugeId"- ]- }- },- {- "name": "quality_deactivateGauge",- "module": "quality",- "classification": "WRITE",- "description": "deactivate gauge",- "paramCount": 1,- "serviceParams": [- "client",- "gaugeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "gaugeId": {- "type": "string"- }- },- "required": [- "gaugeId"- ]- }- },- {- "name": "quality_deleteGauge",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "delete gauge",- "paramCount": 1,- "serviceParams": [- "client",- "gaugeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "gaugeId": {- "type": "string"- }- },- "required": [- "gaugeId"- ]- }- },- {- "name": "quality_deleteGaugeCalibrationRecord",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "delete gauge calibration record",- "paramCount": 1,- "serviceParams": [- "client",- "gaugeCalibrationRecordId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "gaugeCalibrationRecordId": {- "type": "string"- }- },- "required": [- "gaugeCalibrationRecordId"- ]- }- },- {- "name": "quality_deleteGaugeType",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "delete gauge type",- "paramCount": 1,- "serviceParams": [- "client",- "gaugeTypeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "gaugeTypeId": {- "type": "string"- }- },- "required": [- "gaugeTypeId"- ]- }- },- {- "name": "quality_deleteIssue",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "delete issue",- "paramCount": 1,- "serviceParams": [- "client",- "nonConformanceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "nonConformanceId": {- "type": "string"- }- },- "required": [- "nonConformanceId"- ]- }- },- {- "name": "quality_deleteIssueAssociation",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "delete issue association",- "paramCount": 2,- "serviceParams": [- "client",- "type",- "associationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "type": {- "type": "string"- },- "associationId": {- "type": "string"- }- },- "required": [- "type",- "associationId"- ]- }- },- {- "name": "quality_deleteIssueType",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "delete issue type",- "paramCount": 1,- "serviceParams": [- "client",- "nonConformanceTypeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "nonConformanceTypeId": {- "type": "string"- }- },- "required": [- "nonConformanceTypeId"- ]- }- },- {- "name": "quality_deleteIssueWorkflow",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "delete issue workflow",- "paramCount": 1,- "serviceParams": [- "client",- "nonConformanceWorkflowId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "nonConformanceWorkflowId": {- "type": "string"- }- },- "required": [- "nonConformanceWorkflowId"- ]- }- },- {- "name": "quality_deleteRequiredAction",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "delete required action",- "paramCount": 1,- "serviceParams": [- "client",- "requiredActionId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "requiredActionId": {- "type": "string"- }- },- "required": [- "requiredActionId"- ]- }- },- {- "name": "quality_deleteQualityDocument",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "delete quality document",- "paramCount": 1,- "serviceParams": [- "client",- "qualityDocumentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "qualityDocumentId": {- "type": "string"- }- },- "required": [- "qualityDocumentId"- ]- }- },- {- "name": "quality_deleteQualityDocumentStep",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "delete quality document step",- "paramCount": 1,- "serviceParams": [- "client",- "qualityDocumentStepId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "qualityDocumentStepId": {- "type": "string"- }- },- "required": [- "qualityDocumentStepId"- ]- }- },- {- "name": "quality_deleteRisk",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "delete risk",- "paramCount": 1,- "serviceParams": [- "client",- "riskId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "riskId": {- "type": "string"- }- },- "required": [- "riskId"- ]- }- },- {- "name": "quality_getIssueFromExternalLink",- "module": "quality",- "classification": "READ",- "description": "get issue from external link",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "quality_getGauge",- "module": "quality",- "classification": "READ",- "description": "get gauge",- "paramCount": 1,- "serviceParams": [- "client",- "gaugeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "gaugeId": {- "type": "string"- }- },- "required": [- "gaugeId"- ]- }- },- {- "name": "quality_getGauges",- "module": "quality",- "classification": "READ",- "description": "get gauges",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "quality_getGaugesList",- "module": "quality",- "classification": "READ",- "description": "get gauges list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "quality_getGaugeCalibrationRecord",- "module": "quality",- "classification": "READ",- "description": "get gauge calibration record",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "quality_getGaugeCalibrationRecords",- "module": "quality",- "classification": "READ",- "description": "get gauge calibration records",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "quality_getGaugeCalibrationRecordsByGaugeId",- "module": "quality",- "classification": "READ",- "description": "get gauge calibration records by gauge id",- "paramCount": 1,- "serviceParams": [- "client",- "gaugeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "gaugeId": {- "type": "string"- }- },- "required": [- "gaugeId"- ]- }- },- {- "name": "quality_getGaugeTypesList",- "module": "quality",- "classification": "READ",- "description": "get gauge types list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "quality_getGaugeType",- "module": "quality",- "classification": "READ",- "description": "get gauge type",- "paramCount": 1,- "serviceParams": [- "client",- "gaugeTypeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "gaugeTypeId": {- "type": "string"- }- },- "required": [- "gaugeTypeId"- ]- }- },- {- "name": "quality_getGaugeTypes",- "module": "quality",- "classification": "READ",- "description": "get gauge types",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "quality_getIssue",- "module": "quality",- "classification": "READ",- "description": "get issue",- "paramCount": 1,- "serviceParams": [- "client",- "nonConformanceId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "nonConformanceId": {- "type": "string"- }- },- "required": [- "nonConformanceId"- ]- }- },- {- "name": "quality_getIssues",- "module": "quality",- "classification": "READ",- "description": "get issues",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "quality_getIssueWorkflow",- "module": "quality",- "classification": "READ",- "description": "get issue workflow",- "paramCount": 1,- "serviceParams": [- "client",- "nonConformanceWorkflowId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "nonConformanceWorkflowId": {- "type": "string"- }- },- "required": [- "nonConformanceWorkflowId"- ]- }- },- {- "name": "quality_getIssueActionTasks",- "module": "quality",- "classification": "READ",- "description": "get issue action tasks",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "companyId",- "supplierId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "supplierId": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "quality_getIssueApprovalTasks",- "module": "quality",- "classification": "READ",- "description": "get issue approval tasks",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "quality_getIssueItems",- "module": "quality",- "classification": "READ",- "description": "get issue items",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "quality_getIssueAssociations",- "module": "quality",- "classification": "READ",- "description": "get issue associations",- "paramCount": 1,- "serviceParams": [- "client",- "nonConformanceId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "nonConformanceId": {- "type": "string"- }- },- "required": [- "nonConformanceId"- ]- }- },- {- "name": "quality_getIssueReviewers",- "module": "quality",- "classification": "READ",- "description": "get issue reviewers",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "quality_getIssueSuppliers",- "module": "quality",- "classification": "READ",- "description": "get issue suppliers",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "quality_getIssueTasks",- "module": "quality",- "classification": "READ",- "description": "get issue tasks",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "quality_getIssueType",- "module": "quality",- "classification": "READ",- "description": "get issue type",- "paramCount": 1,- "serviceParams": [- "client",- "nonConformanceTypeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "nonConformanceTypeId": {- "type": "string"- }- },- "required": [- "nonConformanceTypeId"- ]- }- },- {- "name": "quality_getIssueTypeByName",- "module": "quality",- "classification": "READ",- "description": "get issue type by name",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "name",- "excludeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "excludeId": {- "type": "string"- }- },- "required": [- "name"- ]- }- },- {- "name": "quality_getIssueTypes",- "module": "quality",- "classification": "READ",- "description": "get issue types",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "quality_getIssueWorkflows",- "module": "quality",- "classification": "READ",- "description": "get issue workflows",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "quality_getIssueWorkflowsList",- "module": "quality",- "classification": "READ",- "description": "get issue workflows list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "quality_getIssueTypesList",- "module": "quality",- "classification": "READ",- "description": "get issue types list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "quality_getQualityActions",- "module": "quality",- "classification": "READ",- "description": "get quality actions",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "quality_getQualityDocument",- "module": "quality",- "classification": "READ",- "description": "get quality document",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "quality_getQualityDocumentSteps",- "module": "quality",- "classification": "READ",- "description": "get quality document steps",- "paramCount": 1,- "serviceParams": [- "client",- "qualityDocumentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "qualityDocumentId": {- "type": "string"- }- },- "required": [- "qualityDocumentId"- ]- }- },- {- "name": "quality_getQualityDocumentVersions",- "module": "quality",- "classification": "READ",- "description": "get quality document versions",- "paramCount": 2,- "serviceParams": [- "client",- "qualityDocument",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "version": {- "type": "number"- }- },- "required": [- "name",- "version"- ]- }- },- {- "name": "quality_getQualityDocuments",- "module": "quality",- "classification": "READ",- "description": "get quality documents",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "search": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- },- "required": [- "search"- ]- }- },- {- "name": "quality_getQualityDocumentsList",- "module": "quality",- "classification": "READ",- "description": "get quality documents list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "quality_getQualityFiles",- "module": "quality",- "classification": "READ",- "description": "get quality files",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "quality_getRequiredActionsList",- "module": "quality",- "classification": "READ",- "description": "get required actions list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "quality_getRequiredActions",- "module": "quality",- "classification": "READ",- "description": "get required actions",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "quality_getRequiredAction",- "module": "quality",- "classification": "READ",- "description": "get required action",- "paramCount": 1,- "serviceParams": [- "client",- "requiredActionId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "requiredActionId": {- "type": "string"- }- },- "required": [- "requiredActionId"- ]- }- },- {- "name": "quality_getRisk",- "module": "quality",- "classification": "READ",- "description": "get risk",- "paramCount": 1,- "serviceParams": [- "client",- "riskId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "riskId": {- "type": "string"- }- },- "required": [- "riskId"- ]- }- },- {- "name": "quality_getRisks",- "module": "quality",- "classification": "READ",- "description": "get risks",- "paramCount": 6,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "status": {},- "source": {},- "assignee": {- "type": "array",- "items": {- "type": "string"- }- }- }- }- }- }- },- {- "name": "quality_insertIssueReviewer",- "module": "quality",- "classification": "WRITE",- "description": "insert issue reviewer",- "paramCount": 1,- "serviceParams": [- "client",- "reviewer"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "title": {- "type": "string"- }- },- "required": [- "title"- ]- }- },- {- "name": "quality_updateIssueActionProcesses",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "update issue action processes",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "actionTaskId": {- "type": "string"- },- "processIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "actionTaskId",- "processIds"- ]- }- },- {- "name": "quality_updateIssueStatus",- "module": "quality",- "classification": "WRITE",- "description": "update issue status",- "paramCount": 4,- "serviceParams": [- "client",- "update"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "assignee": {},- "closeDate": {}- },- "required": [- "id",- "status",- "assignee",- "closeDate"- ]- }- },- {- "name": "quality_updateIssueTaskStatus",- "module": "quality",- "classification": "WRITE",- "description": "update issue task status",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string",- "enum": [- "Pending",- "Completed",- "Skipped",- "In Progress"- ]- },- "type": {- "type": "string",- "enum": [- "investigation",- "action",- "approval",- "review"- ]- },- "assignee": {- "type": [- "string",- "null"- ]- }- },- "required": [- "id",- "status",- "type"- ]- }- },- {- "name": "quality_updateIssueTaskContent",- "module": "quality",- "classification": "WRITE",- "description": "update issue task content",- "paramCount": 3,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "type": {- "type": "string",- "enum": [- "action",- "approval",- "review"- ]- },- "content": {}- },- "required": [- "id",- "type",- "content"- ]- }- },- {- "name": "quality_updateQualityDocumentStepOrder",- "module": "quality",- "classification": "WRITE",- "description": "update quality document step order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "quality_updateRiskStatus",- "module": "quality",- "classification": "WRITE",- "description": "update risk status",- "paramCount": 2,- "serviceParams": [- "client",- "riskId",- "status"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "riskId": {- "type": "string"- },- "status": {- "type": "string"- }- },- "required": [- "riskId",- "status"- ]- }- },- {- "name": "quality_insertGauge",- "module": "quality",- "classification": "WRITE",- "description": "insert gauge",- "paramCount": 15,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "gaugeId": {- "type": "string"- },- "gaugeTypeId": {- "type": "string"- },- "gaugeRole": {- "type": "string"- },- "gaugeCalibrationStatus": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "modelNumber": {- "type": "string"- },- "serialNumber": {- "type": "string"- },- "description": {- "type": "string"- },- "dateAcquired": {- "type": "string"- },- "lastCalibrationDate": {- "type": "string"- },- "nextCalibrationDate": {- "type": "string"- },- "locationId": {- "type": "string"- },- "storageUnitId": {- "type": "string"- },- "calibrationIntervalInMonths": {- "type": "number"- },- "customFields": {}- },- "required": [- "gaugeTypeId",- "gaugeRole",- "gaugeCalibrationStatus"- ]- }- },- {- "name": "quality_updateGauge",- "module": "quality",- "classification": "WRITE",- "description": "update gauge",- "paramCount": 16,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "gaugeId": {- "type": "string"- },- "gaugeTypeId": {- "type": "string"- },- "gaugeRole": {- "type": "string"- },- "gaugeCalibrationStatus": {- "type": "string"- },- "supplierId": {- "type": [- "string",- "null"- ]- },- "modelNumber": {- "type": [- "string",- "null"- ]- },- "serialNumber": {- "type": [- "string",- "null"- ]- },- "description": {- "type": [- "string",- "null"- ]- },- "dateAcquired": {- "type": [- "string",- "null"- ]- },- "lastCalibrationDate": {- "type": [- "string",- "null"- ]- },- "nextCalibrationDate": {- "type": [- "string",- "null"- ]- },- "locationId": {- "type": [- "string",- "null"- ]- },- "storageUnitId": {- "type": [- "string",- "null"- ]- },- "calibrationIntervalInMonths": {- "type": "number"- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "quality_upsertGauge",- "module": "quality",- "classification": "WRITE",- "description": "upsert gauge",- "paramCount": 14,- "serviceParams": [- "client",- "gauge"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "gaugeId": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "modelNumber": {- "type": "string"- },- "serialNumber": {- "type": "string"- },- "description": {- "type": "string"- },- "dateAcquired": {- "type": "string"- },- "gaugeTypeId": {- "type": "string"- },- "gaugeRole": {- "type": "string"- },- "lastCalibrationDate": {- "type": "string"- },- "nextCalibrationDate": {- "type": "string"- },- "locationId": {- "type": "string"- },- "storageUnitId": {- "type": "string"- },- "calibrationIntervalInMonths": {- "type": "number"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "gaugeTypeId",- "gaugeRole",- "_operation"- ]- }- },- {- "name": "quality_upsertGaugeCalibrationRecord",- "module": "quality",- "classification": "WRITE",- "description": "upsert gauge calibration record",- "paramCount": 13,- "serviceParams": [- "client",- "gaugeCalibrationRecord"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "gaugeId": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "dateCalibrated": {- "type": "string"- },- "requiresAction": {- "type": "string"- },- "requiresAdjustment": {- "type": "string"- },- "requiresRepair": {- "type": "string"- },- "temperature": {- "type": "number"- },- "humidity": {- "type": "number"- },- "approvedBy": {- "type": "string"- },- "measurementStandard": {- "type": "string"- },- "calibrationAttempts": {- "type": "string"- },- "notes": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "gaugeId",- "dateCalibrated",- "requiresAction",- "requiresAdjustment",- "requiresRepair",- "calibrationAttempts",- "_operation"- ]- }- },- {- "name": "quality_upsertGaugeType",- "module": "quality",- "classification": "WRITE",- "description": "upsert gauge type",- "paramCount": 2,- "serviceParams": [- "client",- "gaugeType"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "quality_insertIssue",- "module": "quality",- "classification": "WRITE",- "description": "insert issue",- "paramCount": 20,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "nonConformanceId": {- "type": "string"- },- "name": {- "type": "string"- },- "priority": {- "type": "string",- "enum": [- "Low",- "Medium",- "High",- "Critical"- ]- },- "source": {- "type": "string",- "enum": [- "Internal",- "External"- ]- },- "locationId": {- "type": "string"- },- "nonConformanceTypeId": {- "type": "string"- },- "openDate": {- "type": "string"- },- "description": {- "type": "string"- },- "nonConformanceWorkflowId": {- "type": "string"- },- "dueDate": {- "type": "string"- },- "closeDate": {- "type": "string"- },- "quantity": {- "type": "number"- },- "requiredActionIds": {- "type": "array",- "items": {- "type": "string"- }- },- "approvalRequirements": {- "type": "array",- "items": {- "type": "string"- }- },- "items": {- "type": "array",- "items": {- "type": "string"- }- },- "jobOperationId": {- "type": "string"- },- "customerId": {- "type": "string"- },- "salesOrderLineId": {- "type": "string"- },- "operationSupplierProcessId": {- "type": "string"- },- "customFields": {}- },- "required": [- "name",- "priority",- "source",- "locationId",- "nonConformanceTypeId"- ]- }- },- {- "name": "quality_updateIssue",- "module": "quality",- "classification": "WRITE",- "description": "update issue",- "paramCount": 16,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "nonConformanceId": {- "type": "string"- },- "name": {- "type": "string"- },- "priority": {- "type": "string",- "enum": [- "Low",- "Medium",- "High",- "Critical"- ]- },- "source": {- "type": "string",- "enum": [- "Internal",- "External"- ]- },- "locationId": {- "type": "string"- },- "nonConformanceTypeId": {- "type": "string"- },- "nonConformanceWorkflowId": {- "type": [- "string",- "null"- ]- },- "openDate": {- "type": "string"- },- "dueDate": {- "type": [- "string",- "null"- ]- },- "closeDate": {- "type": [- "string",- "null"- ]- },- "description": {- "type": [- "string",- "null"- ]- },- "quantity": {- "type": "number"- },- "requiredActionIds": {- "type": "array",- "items": {- "type": "string"- }- },- "approvalRequirements": {- "type": "array",- "items": {- "type": "string"- }- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "quality_upsertIssue",- "module": "quality",- "classification": "WRITE",- "description": "upsert issue",- "paramCount": 20,- "serviceParams": [- "client",- "nonConformance"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "nonConformanceId": {- "type": "string"- },- "priority": {- "type": "string"- },- "source": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "requiredActionIds": {- "type": "array",- "items": {- "type": "string"- }- },- "approvalRequirements": {- "type": "string"- },- "locationId": {- "type": "string"- },- "nonConformanceWorkflowId": {- "type": "string"- },- "nonConformanceTypeId": {- "type": "string"- },- "openDate": {- "type": "string"- },- "dueDate": {- "type": "string"- },- "closeDate": {- "type": "string"- },- "quantity": {- "type": "number"- },- "items": {- "type": "array",- "items": {- "type": "string"- }- },- "jobOperationId": {- "type": "string"- },- "customerId": {- "type": "string"- },- "salesOrderLineId": {- "type": "string"- },- "operationSupplierProcessId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "priority",- "source",- "name",- "locationId",- "nonConformanceTypeId",- "openDate",- "_operation"- ]- }- },- {- "name": "quality_upsertIssueWorkflow",- "module": "quality",- "classification": "WRITE",- "description": "upsert issue workflow",- "paramCount": 7,- "serviceParams": [- "client",- "nonConformanceWorkflow"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "content": {- "type": "string"- },- "priority": {- "type": "string"- },- "source": {- "type": "string"- },- "requiredActionIds": {- "type": "string"- },- "approvalRequirements": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "content",- "priority",- "source",- "_operation"- ]- }- },- {- "name": "quality_upsertIssueType",- "module": "quality",- "classification": "WRITE",- "description": "upsert issue type",- "paramCount": 2,- "serviceParams": [- "client",- "nonConformanceType"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "quality_upsertRequiredAction",- "module": "quality",- "classification": "WRITE",- "description": "upsert required action",- "paramCount": 2,- "serviceParams": [- "client",- "requiredAction"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "quality_upsertQualityDocument",- "module": "quality",- "classification": "WRITE",- "description": "upsert quality document",- "paramCount": 5,- "serviceParams": [- "client",- "qualityDocument"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "version": {- "type": "number"- },- "content": {- "type": "string"- },- "copyFromId": {- "type": "string"- }- },- "required": [- "name"- ]- }- },- {- "name": "quality_upsertQualityDocumentStep",- "module": "quality",- "classification": "WRITE",- "description": "upsert quality document step",- "paramCount": 1,- "serviceParams": [- "client",- "qualityDocumentStep"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "qualityDocumentStep": {}- },- "required": [- "qualityDocumentStep"- ]- }- },- {- "name": "quality_upsertRisk",- "module": "quality",- "classification": "WRITE",- "description": "upsert risk",- "paramCount": 12,- "serviceParams": [- "client",- "risk"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "assignee": {- "type": "string"- },- "description": {- "type": "string"- },- "itemId": {- "type": "string"- },- "likelihood": {- "type": "string"- },- "notes": {- "type": "string"- },- "severity": {- "type": "string"- },- "source": {- "type": "string"- },- "sourceId": {- "type": "string"- },- "status": {- "type": "string"- },- "title": {- "type": "string"- },- "type": {- "type": "string"- }- },- "required": [- "likelihood",- "severity",- "source",- "status",- "title",- "type"- ]- }- },- {- "name": "quality_getInspections",- "module": "quality",- "classification": "READ",- "description": "get inspections",- "paramCount": 5,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "status": {- "type": [- "string",- "null"- ]- },- "source": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "quality_getInspection",- "module": "quality",- "classification": "READ",- "description": "get inspection",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "quality_getReceiptInspections",- "module": "quality",- "classification": "READ",- "description": "get receipt inspections",- "paramCount": 1,- "serviceParams": [- "client",- "receiptId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "receiptId": {- "type": "string"- }- },- "required": [- "receiptId"- ]- }- },- {- "name": "quality_getInspectionTrackedEntities",- "module": "quality",- "classification": "READ",- "description": "get inspection tracked entities",- "paramCount": 1,- "serviceParams": [- "client",- "receiptLineId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "receiptLineId": {- "type": "string"- }- },- "required": [- "receiptLineId"- ]- }- },- {- "name": "quality_getInspectionSamplingPlans",- "module": "quality",- "classification": "READ",- "description": "get inspection sampling plans",- "paramCount": 1,- "serviceParams": [- "client",- "inspectionId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "inspectionId": {- "type": "string"- }- },- "required": [- "inspectionId"- ]- }- },- {- "name": "quality_getInspectionMeasurements",- "module": "quality",- "classification": "READ",- "description": "get inspection measurements",- "paramCount": 1,- "serviceParams": [- "client",- "inspectionId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "inspectionId": {- "type": "string"- }- },- "required": [- "inspectionId"- ]- }- },- {- "name": "quality_getItemInspectionDocumentAssignments",- "module": "quality",- "classification": "READ",- "description": "get item inspection document assignments",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "quality_upsertItemInspectionDocumentAssignment",- "module": "quality",- "classification": "DESTRUCTIVE",- "description": "upsert item inspection document assignment",- "paramCount": 2,- "serviceParams": [- "client",- "assignment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "usage": {- "type": "string"- }- },- "required": [- "itemId",- "usage"- ]- }- },- {- "name": "resources_activateWorkCenter",- "module": "resources",- "classification": "WRITE",- "description": "activate work center",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "resources_deleteAbility",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete ability",- "paramCount": 2,- "serviceParams": [- "client",- "abilityId",- "hardDelete = true"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "abilityId": {- "type": "string"- },- "hardDelete = true": {}- },- "required": [- "abilityId",- "hardDelete = true"- ]- }- },- {- "name": "resources_deleteContractor",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete contractor",- "paramCount": 1,- "serviceParams": [- "client",- "contractorId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "contractorId": {- "type": "string"- }- },- "required": [- "contractorId"- ]- }- },- {- "name": "resources_deleteEmployeeAbility",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete employee ability",- "paramCount": 1,- "serviceParams": [- "client",- "employeeAbilityId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeAbilityId": {- "type": "string"- }- },- "required": [- "employeeAbilityId"- ]- }- },- {- "name": "resources_deleteFailureMode",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete failure mode",- "paramCount": 1,- "serviceParams": [- "client",- "failureModeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "failureModeId": {- "type": "string"- }- },- "required": [- "failureModeId"- ]- }- },- {- "name": "resources_deleteLocation",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete location",- "paramCount": 1,- "serviceParams": [- "client",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- },- "required": [- "locationId"- ]- }- },- {- "name": "resources_deleteMaintenanceDispatch",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete maintenance dispatch",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "resources_deleteMaintenanceDispatchComment",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete maintenance dispatch comment",- "paramCount": 1,- "serviceParams": [- "client",- "commentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "commentId": {- "type": "string"- }- },- "required": [- "commentId"- ]- }- },- {- "name": "resources_deleteMaintenanceDispatchEvent",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete maintenance dispatch event",- "paramCount": 1,- "serviceParams": [- "client",- "eventId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "eventId": {- "type": "string"- }- },- "required": [- "eventId"- ]- }- },- {- "name": "resources_deleteMaintenanceDispatchItem",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete maintenance dispatch item",- "paramCount": 1,- "serviceParams": [- "client",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "resources_deleteMaintenanceDispatchWorkCenter",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete maintenance dispatch work center",- "paramCount": 1,- "serviceParams": [- "client",- "workCenterId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "workCenterId": {- "type": "string"- }- },- "required": [- "workCenterId"- ]- }- },- {- "name": "resources_deleteMaintenanceSchedule",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete maintenance schedule",- "paramCount": 1,- "serviceParams": [- "client",- "scheduleId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "scheduleId": {- "type": "string"- }- },- "required": [- "scheduleId"- ]- }- },- {- "name": "resources_deleteMaintenanceScheduleItem",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete maintenance schedule item",- "paramCount": 1,- "serviceParams": [- "client",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "resources_deletePartner",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete partner",- "paramCount": 1,- "serviceParams": [- "client",- "partnerId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "partnerId": {- "type": "string"- }- },- "required": [- "partnerId"- ]- }- },- {- "name": "resources_activateProcess",- "module": "resources",- "classification": "WRITE",- "description": "activate process",- "paramCount": 1,- "serviceParams": [- "client",- "processId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "processId": {- "type": "string"- }- },- "required": [- "processId"- ]- }- },- {- "name": "resources_processDeactivate",- "module": "resources",- "classification": "WRITE",- "description": "process deactivate",- "paramCount": 1,- "serviceParams": [- "client",- "processId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "processId": {- "type": "string"- }- },- "required": [- "processId"- ]- }- },- {- "name": "resources_deleteProcess",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete process",- "paramCount": 1,- "serviceParams": [- "client",- "processId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "processId": {- "type": "string"- }- },- "required": [- "processId"- ]- }- },- {- "name": "resources_deleteShift",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete shift",- "paramCount": 1,- "serviceParams": [- "client",- "shiftId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "shiftId": {- "type": "string"- }- },- "required": [- "shiftId"- ]- }- },- {- "name": "resources_deleteSuggestion",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete suggestion",- "paramCount": 1,- "serviceParams": [- "client",- "suggestionId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "suggestionId": {- "type": "string"- }- },- "required": [- "suggestionId"- ]- }- },- {- "name": "resources_deleteTraining",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete training",- "paramCount": 1,- "serviceParams": [- "client",- "trainingId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "trainingId": {- "type": "string"- }- },- "required": [- "trainingId"- ]- }- },- {- "name": "resources_deleteTrainingAssignment",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete training assignment",- "paramCount": 1,- "serviceParams": [- "client",- "assignmentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "assignmentId": {- "type": "string"- }- },- "required": [- "assignmentId"- ]- }- },- {- "name": "resources_deleteTrainingQuestion",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete training question",- "paramCount": 1,- "serviceParams": [- "client",- "trainingQuestionId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "trainingQuestionId": {- "type": "string"- }- },- "required": [- "trainingQuestionId"- ]- }- },- {- "name": "resources_deleteWorkCenter",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "delete work center",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "resources_getAbilities",- "module": "resources",- "classification": "READ",- "description": "get abilities",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "resources_getAbilitiesList",- "module": "resources",- "classification": "READ",- "description": "get abilities list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "resources_getAbility",- "module": "resources",- "classification": "READ",- "description": "get ability",- "paramCount": 1,- "serviceParams": [- "client",- "abilityId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "abilityId": {- "type": "string"- }- },- "required": [- "abilityId"- ]- }- },- {- "name": "resources_getContractor",- "module": "resources",- "classification": "READ",- "description": "get contractor",- "paramCount": 1,- "serviceParams": [- "client",- "contractorId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "contractorId": {- "type": "string"- }- },- "required": [- "contractorId"- ]- }- },- {- "name": "resources_getContractors",- "module": "resources",- "classification": "READ",- "description": "get contractors",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "resources_getEmployeeAbilities",- "module": "resources",- "classification": "READ",- "description": "get employee abilities",- "paramCount": 1,- "serviceParams": [- "client",- "employeeId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- }- },- "required": [- "employeeId"- ]- }- },- {- "name": "resources_getEmployeeAbility",- "module": "resources",- "classification": "READ",- "description": "get employee ability",- "paramCount": 1,- "serviceParams": [- "client",- "employeeAbilityId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeAbilityId": {- "type": "string"- }- },- "required": [- "employeeAbilityId"- ]- }- },- {- "name": "resources_getFailureMode",- "module": "resources",- "classification": "READ",- "description": "get failure mode",- "paramCount": 1,- "serviceParams": [- "client",- "failureModeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "failureModeId": {- "type": "string"- }- },- "required": [- "failureModeId"- ]- }- },- {- "name": "resources_getFailureModes",- "module": "resources",- "classification": "READ",- "description": "get failure modes",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "resources_getFailureModesList",- "module": "resources",- "classification": "READ",- "description": "get failure modes list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "resources_getLocation",- "module": "resources",- "classification": "READ",- "description": "get location",- "paramCount": 1,- "serviceParams": [- "client",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- },- "required": [- "locationId"- ]- }- },- {- "name": "resources_getLocations",- "module": "resources",- "classification": "READ",- "description": "get locations",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "resources_getLocationsList",- "module": "resources",- "classification": "READ",- "description": "get locations list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "resources_getMaintenanceDispatch",- "module": "resources",- "classification": "READ",- "description": "get maintenance dispatch",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "resources_getMaintenanceDispatchComments",- "module": "resources",- "classification": "READ",- "description": "get maintenance dispatch comments",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "resources_getMaintenanceDispatchEvents",- "module": "resources",- "classification": "READ",- "description": "get maintenance dispatch events",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "resources_getMaintenanceDispatchItems",- "module": "resources",- "classification": "READ",- "description": "get maintenance dispatch items",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "resources_getMaintenanceDispatchItemTrackedEntities",- "module": "resources",- "classification": "READ",- "description": "get maintenance dispatch item tracked entities",- "paramCount": 1,- "serviceParams": [- "client",- "maintenanceDispatchItemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "maintenanceDispatchItemId": {- "type": "string"- }- },- "required": [- "maintenanceDispatchItemId"- ]- }- },- {- "name": "resources_getMaintenanceDispatches",- "module": "resources",- "classification": "READ",- "description": "get maintenance dispatches",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "status": {- "type": "string"- }- }- }- }- }- },- {- "name": "resources_getMaintenanceDispatchesByLocation",- "module": "resources",- "classification": "READ",- "description": "get maintenance dispatches by location",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "locationId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "status": {- "type": "string"- }- }- }- },- "required": [- "locationId"- ]- }- },- {- "name": "resources_getMaintenanceDispatchWorkCenters",- "module": "resources",- "classification": "READ",- "description": "get maintenance dispatch work centers",- "paramCount": 1,- "serviceParams": [- "client",- "dispatchId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "dispatchId": {- "type": "string"- }- },- "required": [- "dispatchId"- ]- }- },- {- "name": "resources_getMaintenanceSchedule",- "module": "resources",- "classification": "READ",- "description": "get maintenance schedule",- "paramCount": 1,- "serviceParams": [- "client",- "scheduleId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "scheduleId": {- "type": "string"- }- },- "required": [- "scheduleId"- ]- }- },- {- "name": "resources_getMaintenanceScheduleItems",- "module": "resources",- "classification": "READ",- "description": "get maintenance schedule items",- "paramCount": 1,- "serviceParams": [- "client",- "scheduleId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "scheduleId": {- "type": "string"- }- },- "required": [- "scheduleId"- ]- }- },- {- "name": "resources_getMaintenanceSchedules",- "module": "resources",- "classification": "READ",- "description": "get maintenance schedules",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "active": {- "type": "boolean"- }- }- }- }- }- },- {- "name": "resources_getMaintenanceSchedulesByLocation",- "module": "resources",- "classification": "READ",- "description": "get maintenance schedules by location",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "locationId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "active": {- "type": "boolean"- }- }- }- },- "required": [- "locationId"- ]- }- },- {- "name": "resources_getOutstandingTrainingsForUser",- "module": "resources",- "classification": "READ",- "description": "get outstanding trainings for user",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "employeeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- }- },- "required": [- "employeeId"- ]- }- },- {- "name": "resources_getTrainingAssignmentStatusForEmployee",- "module": "resources",- "classification": "READ",- "description": "get training assignment status for employee",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "employeeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- }- },- "required": [- "employeeId"- ]- }- },- {- "name": "resources_getPartner",- "module": "resources",- "classification": "READ",- "description": "get partner",- "paramCount": 2,- "serviceParams": [- "client",- "partnerId",- "abilityId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "partnerId": {- "type": "string"- },- "abilityId": {- "type": "string"- }- },- "required": [- "partnerId",- "abilityId"- ]- }- },- {- "name": "resources_getPartnerBySupplierId",- "module": "resources",- "classification": "READ",- "description": "get partner by supplier id",- "paramCount": 1,- "serviceParams": [- "client",- "partnerId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "partnerId": {- "type": "string"- }- },- "required": [- "partnerId"- ]- }- },- {- "name": "resources_getPartners",- "module": "resources",- "classification": "READ",- "description": "get partners",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "resources_getProcess",- "module": "resources",- "classification": "READ",- "description": "get process",- "paramCount": 1,- "serviceParams": [- "client",- "processId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "processId": {- "type": "string"- }- },- "required": [- "processId"- ]- }- },- {- "name": "resources_getProcesses",- "module": "resources",- "classification": "READ",- "description": "get processes",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "resources_getProcessesList",- "module": "resources",- "classification": "READ",- "description": "get processes list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "resources_getSuggestion",- "module": "resources",- "classification": "READ",- "description": "get suggestion",- "paramCount": 1,- "serviceParams": [- "client",- "suggestionId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "suggestionId": {- "type": "string"- }- },- "required": [- "suggestionId"- ]- }- },- {- "name": "resources_getSuggestions",- "module": "resources",- "classification": "READ",- "description": "get suggestions",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "resources_getTraining",- "module": "resources",- "classification": "READ",- "description": "get training",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "resources_getTrainingAssignment",- "module": "resources",- "classification": "READ",- "description": "get training assignment",- "paramCount": 1,- "serviceParams": [- "client",- "assignmentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "assignmentId": {- "type": "string"- }- },- "required": [- "assignmentId"- ]- }- },- {- "name": "resources_getTrainingAssignmentForCompletion",- "module": "resources",- "classification": "READ",- "description": "get training assignment for completion",- "paramCount": 1,- "serviceParams": [- "client",- "assignmentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "assignmentId": {- "type": "string"- }- },- "required": [- "assignmentId"- ]- }- },- {- "name": "resources_getTrainingAssignments",- "module": "resources",- "classification": "READ",- "description": "get training assignments",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "trainingId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "trainingId": {- "type": "string"- }- }- }- },- {- "name": "resources_getTrainingAssignmentStatus",- "module": "resources",- "classification": "READ",- "description": "get training assignment status",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "trainingId": {- "type": "string"- },- "status": {- "type": "string",- "enum": [- "Completed",- "Pending",- "Overdue",- "Not Required"- ]- },- "search": {- "type": "string"- }- }- }- },- {- "name": "resources_getTrainingAssignmentSummary",- "module": "resources",- "classification": "READ",- "description": "get training assignment summary",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "resources_getTrainingQuestions",- "module": "resources",- "classification": "READ",- "description": "get training questions",- "paramCount": 1,- "serviceParams": [- "client",- "trainingId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "trainingId": {- "type": "string"- }- },- "required": [- "trainingId"- ]- }- },- {- "name": "resources_getTrainings",- "module": "resources",- "classification": "READ",- "description": "get trainings",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "search": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- },- "required": [- "search"- ]- }- },- {- "name": "resources_getTrainingsList",- "module": "resources",- "classification": "READ",- "description": "get trainings list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "resources_getWorkCenter",- "module": "resources",- "classification": "READ",- "description": "get work center",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "resources_getWorkCenters",- "module": "resources",- "classification": "READ",- "description": "get work centers",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "search": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- },- "required": [- "search"- ]- }- },- {- "name": "resources_getWorkCentersByLocation",- "module": "resources",- "classification": "READ",- "description": "get work centers by location",- "paramCount": 1,- "serviceParams": [- "client",- "locationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "locationId": {- "type": "string"- }- },- "required": [- "locationId"- ]- }- },- {- "name": "resources_getWorkCentersList",- "module": "resources",- "classification": "READ",- "description": "get work centers list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "resources_getWorkCentersListWithBlockingStatus",- "module": "resources",- "classification": "READ",- "description": "get work centers list with blocking status",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "resources_insertAbility",- "module": "resources",- "classification": "WRITE",- "description": "insert ability",- "paramCount": 2,- "serviceParams": [- "client",- "ability"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "recertifyEveryDays": {- "type": [- "number",- "null"- ]- }- },- "required": [- "name"- ]- }- },- {- "name": "resources_insertTrainingCompletion",- "module": "resources",- "classification": "WRITE",- "description": "insert training completion",- "paramCount": 4,- "serviceParams": [- "client",- "completion"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "trainingAssignmentId": {- "type": "string"- },- "employeeId": {- "type": "string"- },- "period": {- "type": [- "string",- "null"- ]- },- "completedBy": {- "type": "string"- }- },- "required": [- "trainingAssignmentId",- "employeeId",- "period",- "completedBy"- ]- }- },- {- "name": "resources_getTrainingGrantedAbilityId",- "module": "resources",- "classification": "READ",- "description": "get training granted ability id",- "paramCount": 1,- "serviceParams": [- "client",- "trainingAssignmentId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "trainingAssignmentId": {- "type": "string"- }- },- "required": [- "trainingAssignmentId"- ]- }- },- {- "name": "resources_updateAbility",- "module": "resources",- "classification": "WRITE",- "description": "update ability",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "ability"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "ability": {}- },- "required": [- "id",- "ability"- ]- }- },- {- "name": "resources_resolveEmployeeAbilityExpiresAt",- "module": "resources",- "classification": "WRITE",- "description": "resolve employee ability expires at",- "paramCount": 3,- "serviceParams": [- "client",- "abilityId",- "lastTrainingDate",- "expiresAt"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "abilityId": {- "type": "string"- },- "lastTrainingDate": {- "type": [- "string",- "null"- ]- },- "expiresAt": {- "type": [- "string",- "null"- ]- }- },- "required": [- "abilityId",- "lastTrainingDate",- "expiresAt"- ]- }- },- {- "name": "resources_upsertEmployeeAbilityCell",- "module": "resources",- "classification": "WRITE",- "description": "upsert employee ability cell",- "paramCount": 4,- "serviceParams": [- "client",- "cell"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "employeeId": {- "type": "string"- },- "abilityId": {- "type": "string"- },- "lastTrainingDate": {- "type": [- "string",- "null"- ]- },- "expiresAt": {- "type": [- "string",- "null"- ]- }- },- "required": [- "employeeId",- "abilityId",- "lastTrainingDate",- "expiresAt"- ]- }- },- {- "name": "resources_ensureProcessAbility",- "module": "resources",- "classification": "WRITE",- "description": "ensure process ability",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "processId": {- "type": "string"- },- "processName": {- "type": "string"- }- },- "required": [- "processId",- "processName"- ]- }- },- {- "name": "resources_updateSuggestionEmoji",- "module": "resources",- "classification": "WRITE",- "description": "update suggestion emoji",- "paramCount": 2,- "serviceParams": [- "client",- "suggestionId",- "emoji"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "suggestionId": {- "type": "string"- },- "emoji": {- "type": "string"- }- },- "required": [- "suggestionId",- "emoji"- ]- }- },- {- "name": "resources_updateSuggestionTags",- "module": "resources",- "classification": "WRITE",- "description": "update suggestion tags",- "paramCount": 2,- "serviceParams": [- "client",- "suggestionId",- "tags"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "suggestionId": {- "type": "string"- },- "tags": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "suggestionId",- "tags"- ]- }- },- {- "name": "resources_updateTrainingQuestionOrder",- "module": "resources",- "classification": "WRITE",- "description": "update training question order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "resources_upsertContractor",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "upsert contractor",- "paramCount": 1,- "serviceParams": [- "client",- "contractorWithAbilities"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "contractorWithAbilities": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "contractorWithAbilities",- "_operation"- ]- }- },- {- "name": "resources_upsertFailureMode",- "module": "resources",- "classification": "WRITE",- "description": "upsert failure mode",- "paramCount": 3,- "serviceParams": [- "client",- "failureMode"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "type": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "type",- "_operation"- ]- }- },- {- "name": "resources_upsertLocation",- "module": "resources",- "classification": "WRITE",- "description": "upsert location",- "paramCount": 1,- "serviceParams": [- "client",- "location"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "location": {}- },- "required": [- "location"- ]- }- },- {- "name": "resources_insertMaintenanceDispatch",- "module": "resources",- "classification": "WRITE",- "description": "insert maintenance dispatch",- "paramCount": 14,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "maintenanceDispatchId": {- "type": "string"- },- "status": {- "type": "string"- },- "priority": {- "type": "string"- },- "severity": {},- "source": {- "type": "string",- "enum": [- "Scheduled",- "Reactive",- "Non-Conformance"- ]- },- "oeeImpact": {- "type": "string",- "enum": [- "Down",- "Planned",- "Impact",- "No Impact"- ]- },- "workCenterId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "assignee": {- "type": "string"- },- "suspectedFailureModeId": {- "type": "string"- },- "plannedStartTime": {- "type": "string"- },- "plannedEndTime": {- "type": "string"- },- "takesWorkCenterOffline": {- "type": "boolean"- },- "content": {}- },- "required": [- "locationId"- ]- }- },- {- "name": "resources_updateMaintenanceDispatch",- "module": "resources",- "classification": "WRITE",- "description": "update maintenance dispatch",- "paramCount": 18,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "priority": {- "type": "string"- },- "severity": {},- "source": {- "type": "string",- "enum": [- "Scheduled",- "Reactive",- "Non-Conformance"- ]- },- "oeeImpact": {- "type": "string"- },- "workCenterId": {- "type": [- "string",- "null"- ]- },- "locationId": {- "type": "string"- },- "assignee": {- "type": [- "string",- "null"- ]- },- "suspectedFailureModeId": {- "type": [- "string",- "null"- ]- },- "actualFailureModeId": {- "type": [- "string",- "null"- ]- },- "procedureId": {- "type": [- "string",- "null"- ]- },- "plannedStartTime": {- "type": [- "string",- "null"- ]- },- "plannedEndTime": {- "type": [- "string",- "null"- ]- },- "actualStartTime": {- "type": [- "string",- "null"- ]- },- "actualEndTime": {- "type": [- "string",- "null"- ]- },- "takesWorkCenterOffline": {- "type": "boolean"- },- "content": {}- },- "required": [- "id"- ]- }- },- {- "name": "resources_upsertMaintenanceDispatch",- "module": "resources",- "classification": "WRITE",- "description": "upsert maintenance dispatch",- "paramCount": 14,- "serviceParams": [- "client",- "dispatch"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "priority": {- "type": "string"- },- "severity": {- "type": "string"- },- "source": {- "type": "string"- },- "oeeImpact": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "suspectedFailureModeId": {- "type": "string"- },- "plannedStartTime": {- "type": "string"- },- "plannedEndTime": {- "type": "string"- },- "takesWorkCenterOffline": {- "type": "string"- },- "assignee": {- "type": "string"- },- "content": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "status",- "priority",- "locationId",- "takesWorkCenterOffline",- "_operation"- ]- }- },- {- "name": "resources_upsertMaintenanceDispatchComment",- "module": "resources",- "classification": "WRITE",- "description": "upsert maintenance dispatch comment",- "paramCount": 3,- "serviceParams": [- "client",- "comment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "maintenanceDispatchId": {- "type": "string"- },- "comment": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "maintenanceDispatchId",- "comment",- "_operation"- ]- }- },- {- "name": "resources_upsertMaintenanceDispatchEvent",- "module": "resources",- "classification": "WRITE",- "description": "upsert maintenance dispatch event",- "paramCount": 41,- "serviceParams": [- "client",- "event"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "maintenanceDispatchId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "status": {- "type": "string"- },- "priority": {- "type": "string"- },- "severity": {- "type": "string"- },- "source": {- "type": "string"- },- "oeeImpact": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "suspectedFailureModeId": {- "type": "string"- },- "plannedStartTime": {- "type": "string"- },- "plannedEndTime": {- "type": "string"- },- "takesWorkCenterOffline": {- "type": "string"- },- "assignee": {- "type": "string"- },- "content": {- "type": "string"- },- "maintenanceDispatchItemId": {- "type": "string"- },- "adjustmentType": {- "type": "string",- "enum": [- "Positive Adjmt.",- "Negative Adjmt."- ]- },- "children": {- "type": "array",- "items": {- "type": "number"- }- },- "maintenanceScheduleId": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "hoursPerWeek": {- "type": "number"- },- "trainingId": {- "type": "string"- },- "groupIds": {- "type": "string"- },- "trainingAssignmentId": {- "type": "string"- },- "employeeId": {- "type": "string"- },- "period": {- "type": "string"- },- "name": {- "type": "string"- },- "grantsAbilityId": {- "type": "string"- },- "description": {- "type": "string"- },- "defaultStandardFactor": {- "type": "string"- },- "departmentId": {- "type": "string"- },- "laborRate": {- "type": "number"- },- "machineRate": {- "type": "number"- },- "overheadRate": {- "type": "number"- },- "processes": {- "type": "string"- },- "shifts": {- "type": "array",- "items": {- "type": "string"- }- },- "alwaysOn": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "maintenanceDispatchId",- "itemId",- "unitOfMeasureCode",- "status",- "priority",- "locationId",- "takesWorkCenterOffline",- "workCenterId",- "maintenanceDispatchItemId",- "adjustmentType",- "children",- "maintenanceScheduleId",- "id",- "trainingId",- "groupIds",- "trainingAssignmentId",- "employeeId",- "name",- "description",- "defaultStandardFactor",- "alwaysOn",- "_operation"- ]- }- },- {- "name": "resources_upsertMaintenanceDispatchItem",- "module": "resources",- "classification": "WRITE",- "description": "upsert maintenance dispatch item",- "paramCount": 6,- "serviceParams": [- "client",- "item"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "maintenanceDispatchId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "unitOfMeasureCode": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "maintenanceDispatchId",- "itemId",- "unitOfMeasureCode",- "_operation"- ]- }- },- {- "name": "resources_upsertMaintenanceDispatchWorkCenter",- "module": "resources",- "classification": "WRITE",- "description": "upsert maintenance dispatch work center",- "paramCount": 3,- "serviceParams": [- "client",- "workCenter"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "maintenanceDispatchId": {- "type": "string"- },- "workCenterId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "maintenanceDispatchId",- "workCenterId",- "_operation"- ]- }- },- {- "name": "resources_upsertMaintenanceSchedule",- "module": "resources",- "classification": "WRITE",- "description": "upsert maintenance schedule",- "paramCount": 8,- "serviceParams": [- "client",- "schedule"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "hoursPerWeek": {- "type": "number"- },- "trainingId": {- "type": "string"- },- "groupIds": {- "type": "string"- },- "trainingAssignmentId": {- "type": "string"- },- "employeeId": {- "type": "string"- },- "period": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "id",- "trainingId",- "groupIds",- "trainingAssignmentId",- "employeeId",- "_operation"- ]- }- },- {- "name": "resources_upsertMaintenanceScheduleItem",- "module": "resources",- "classification": "WRITE",- "description": "upsert maintenance schedule item",- "paramCount": 5,- "serviceParams": [- "client",- "item"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "maintenanceScheduleId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantity": {- "type": "number"- },- "unitOfMeasureCode": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "maintenanceScheduleId",- "itemId",- "unitOfMeasureCode",- "_operation"- ]- }- },- {- "name": "resources_upsertPartner",- "module": "resources",- "classification": "WRITE",- "description": "upsert partner",- "paramCount": 3,- "serviceParams": [- "client",- "partner"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "supplierId": {- "type": "string"- },- "hoursPerWeek": {- "type": "number"- }- },- "required": [- "id"- ]- }- },- {- "name": "resources_upsertProcess",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "upsert process",- "paramCount": 1,- "serviceParams": [- "client",- "process"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "process": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "process",- "_operation"- ]- }- },- {- "name": "resources_upsertTraining",- "module": "resources",- "classification": "WRITE",- "description": "upsert training",- "paramCount": 4,- "serviceParams": [- "client",- "training"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "content": {- "type": "string"- },- "grantsAbilityId": {- "type": "string"- }- },- "required": [- "name"- ]- }- },- {- "name": "resources_upsertTrainingAssignment",- "module": "resources",- "classification": "WRITE",- "description": "upsert training assignment",- "paramCount": 3,- "serviceParams": [- "client",- "assignment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "trainingId": {- "type": "string"- },- "groupIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "trainingId",- "groupIds"- ]- }- },- {- "name": "resources_upsertTrainingQuestion",- "module": "resources",- "classification": "WRITE",- "description": "upsert training question",- "paramCount": 1,- "serviceParams": [- "client",- "trainingQuestion"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "trainingQuestion": {}- },- "required": [- "trainingQuestion"- ]- }- },- {- "name": "resources_upsertWorkCenter",- "module": "resources",- "classification": "DESTRUCTIVE",- "description": "upsert work center",- "paramCount": 12,- "serviceParams": [- "client",- "workCenter"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "defaultStandardFactor": {- "type": "string"- },- "departmentId": {- "type": "string"- },- "laborRate": {- "type": "number"- },- "locationId": {- "type": "string"- },- "machineRate": {- "type": "number"- },- "overheadRate": {- "type": "number"- },- "processes": {- "type": "string"- },- "shifts": {- "type": "array",- "items": {- "type": "string"- }- },- "alwaysOn": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "description",- "defaultStandardFactor",- "locationId",- "alwaysOn",- "_operation"- ]- }- },- {- "name": "sales_applyPriceRules",- "module": "sales",- "classification": "WRITE",- "description": "apply price rules",- "paramCount": 2,- "serviceParams": [- "startingPrice",- "matchedRules"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "startingPrice": {- "type": "number"- },- "matchedRules": {- "type": "array",- "items": {}- }- },- "required": [- "startingPrice",- "matchedRules"- ]- }- },- {- "name": "sales_closeSalesOrder",- "module": "sales",- "classification": "WRITE",- "description": "close sales order",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderId",- "userId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderId": {- "type": "string"- }- },- "required": [- "salesOrderId"- ]- }- },- {- "name": "sales_convertSalesRfqToQuote",- "module": "sales",- "classification": "WRITE",- "description": "convert sales rfq to quote",- "paramCount": 1,- "serviceParams": [- "client",- "payload"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_convertQuoteToOrder",- "module": "sales",- "classification": "WRITE",- "description": "convert quote to order",- "paramCount": 5,- "serviceParams": [- "client",- "payload"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "selectedLines": {},- "purchaseOrderNumber": {- "type": "string"- },- "digitalQuoteAcceptedBy": {- "type": "string"- },- "digitalQuoteAcceptedByEmail": {- "type": "string"- }- },- "required": [- "id",- "selectedLines"- ]- }- },- {- "name": "sales_copyQuoteLine",- "module": "sales",- "classification": "WRITE",- "description": "copy quote line",- "paramCount": 9,- "serviceParams": [- "client",- "payload"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "type": {- "type": "string",- "enum": [- "item",- "quoteLine",- "method",- "quoteToQuote"- ]- },- "sourceId": {- "type": "string"- },- "targetId": {- "type": "string"- },- "billOfMaterial": {- "type": "string"- },- "billOfProcess": {- "type": "string"- },- "parameters": {- "type": "string"- },- "tools": {- "type": "string"- },- "steps": {- "type": "string"- },- "workInstructions": {- "type": "string"- }- },- "required": [- "type",- "sourceId",- "targetId",- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- {- "name": "sales_copyQuote",- "module": "sales",- "classification": "WRITE",- "description": "copy quote",- "paramCount": 9,- "serviceParams": [- "client",- "payload"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "type": {- "type": "string",- "enum": [- "item",- "quoteLine",- "method",- "quoteToQuote"- ]- },- "sourceId": {- "type": "string"- },- "targetId": {- "type": "string"- },- "billOfMaterial": {- "type": "string"- },- "billOfProcess": {- "type": "string"- },- "parameters": {- "type": "string"- },- "tools": {- "type": "string"- },- "steps": {- "type": "string"- },- "workInstructions": {- "type": "string"- }- },- "required": [- "type",- "sourceId",- "targetId",- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- {- "name": "sales_createPricingRule",- "module": "sales",- "classification": "WRITE",- "description": "create pricing rule",- "paramCount": 58,- "serviceParams": [- "client",- "companyId",- "userId",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "quoteId": {- "type": "string"- },- "name": {- "type": "string"- },- "salesPersonId": {- "type": "string"- },- "estimatorId": {- "type": "string"- },- "customerId": {- "type": "string"- },- "customerLocationId": {- "type": "string"- },- "customerContactId": {- "type": "string"- },- "customerEngineeringContactId": {- "type": "string"- },- "customerReference": {- "type": "string"- },- "locationId": {- "type": "string"- },- "status": {- "type": "string"- },- "notes": {},- "dueDate": {- "type": "string"- },- "expirationDate": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "exchangeRate": {- "type": "number"- },- "exchangeRateUpdatedAt": {- "type": "string"- },- "digitalQuoteAcceptedBy": {- "type": "string"- },- "digitalQuoteAcceptedByEmail": {- "type": "string"- },- "description": {- "type": "string"- },- "amounts": {- "type": "number"- },- "taxable": {- "type": "boolean"- },- "itemType": {- "type": "string"- },- "itemId": {- "type": "string"- },- "methodType": {- "type": "string"- },- "customerPartId": {- "type": "string"- },- "customerPartRevision": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "quantity": {- "type": "array",- "items": {- "type": "number"- }- },- "modelUploadId": {- "type": "string"- },- "noQuoteReason": {- "type": "string"- },- "taxPercent": {- "type": "number"- },- "configuration": {},- "invoiceCustomerId": {- "type": "string"- },- "invoiceCustomerLocationId": {- "type": "string"- },- "invoiceCustomerContactId": {- "type": "string"- },- "paymentTermId": {- "type": "string"- },- "shippingMethodId": {- "type": "string"- },- "receiptRequestedDate": {- "type": "string"- },- "shippingCost": {- "type": "number"- },- "incoterm": {- "type": "string"- },- "incotermLocation": {- "type": "string"- },- "salesOrderId": {- "type": "string"- },- "orderDate": {- "type": "string"- },- "requestedDate": {- "type": "string"- },- "promisedDate": {- "type": "string"- },- "paymentComplete": {- "type": "string"- },- "rfqId": {- "type": "string"- },- "externalNotes": {- "type": "string"- },- "internalNotes": {- "type": "string"- },- "rfqDate": {- "type": "string"- },- "is3DModel": {- "type": "boolean"- },- "size": {- "type": "number"- },- "lineId": {- "type": "string"- },- "path": {- "type": "string"- },- "salesRfqId": {- "type": "string"- },- "order": {- "type": "number"- }- },- "required": [- "customerId",- "locationId",- "description",- "amounts",- "quoteId",- "itemId",- "status",- "methodType",- "quantity",- "id",- "paymentComplete",- "rfqDate",- "customerPartId",- "path",- "salesRfqId",- "unitOfMeasureCode"- ]- }- },- {- "name": "sales_deleteCustomer",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete customer",- "paramCount": 1,- "serviceParams": [- "client",- "customerId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- }- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_deleteCustomerContact",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete customer contact",- "paramCount": 2,- "serviceParams": [- "client",- "customerId",- "customerContactId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "customerContactId": {- "type": "string"- }- },- "required": [- "customerId",- "customerContactId"- ]- }- },- {- "name": "sales_deleteCustomerLocation",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete customer location",- "paramCount": 2,- "serviceParams": [- "client",- "customerId",- "customerLocationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "customerLocationId": {- "type": "string"- }- },- "required": [- "customerId",- "customerLocationId"- ]- }- },- {- "name": "sales_deleteCustomerStatus",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete customer status",- "paramCount": 1,- "serviceParams": [- "client",- "customerStatusId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerStatusId": {- "type": "string"- }- },- "required": [- "customerStatusId"- ]- }- },- {- "name": "sales_deleteCustomerType",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete customer type",- "paramCount": 1,- "serviceParams": [- "client",- "customerTypeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerTypeId": {- "type": "string"- }- },- "required": [- "customerTypeId"- ]- }- },- {- "name": "sales_deleteNoQuoteReason",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete no quote reason",- "paramCount": 1,- "serviceParams": [- "client",- "noQuoteReasonId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "noQuoteReasonId": {- "type": "string"- }- },- "required": [- "noQuoteReasonId"- ]- }- },- {- "name": "sales_deletePricingRule",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete pricing rule",- "paramCount": 1,- "serviceParams": [- "client",- "pricingRuleId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "pricingRuleId": {- "type": "string"- }- },- "required": [- "pricingRuleId"- ]- }- },- {- "name": "sales_deleteQuote",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete quote",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_deleteQuoteMakeMethod",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete quote make method",- "paramCount": 1,- "serviceParams": [- "client",- "quoteMakeMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteMakeMethodId": {- "type": "string"- }- },- "required": [- "quoteMakeMethodId"- ]- }- },- {- "name": "sales_deleteQuoteLine",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete quote line",- "paramCount": 1,- "serviceParams": [- "client",- "quoteLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteLineId": {- "type": "string"- }- },- "required": [- "quoteLineId"- ]- }- },- {- "name": "sales_deleteQuoteMaterial",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete quote material",- "paramCount": 1,- "serviceParams": [- "client",- "quoteMaterialId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteMaterialId": {- "type": "string"- }- },- "required": [- "quoteMaterialId"- ]- }- },- {- "name": "sales_deleteQuoteOperation",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete quote operation",- "paramCount": 1,- "serviceParams": [- "client",- "quoteOperationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteOperationId": {- "type": "string"- }- },- "required": [- "quoteOperationId"- ]- }- },- {- "name": "sales_deleteQuoteOperationStep",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete quote operation step",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_deleteQuoteOperationParameter",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete quote operation parameter",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_deleteQuoteOperationTool",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete quote operation tool",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_deleteSalesOrder",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete sales order",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderId": {- "type": "string"- }- },- "required": [- "salesOrderId"- ]- }- },- {- "name": "sales_deleteSalesOrderLine",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete sales order line",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderLineId": {- "type": "string"- }- },- "required": [- "salesOrderLineId"- ]- }- },- {- "name": "sales_deleteSalesRFQ",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete sales r f q",- "paramCount": 1,- "serviceParams": [- "client",- "salesRfqId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesRfqId": {- "type": "string"- }- },- "required": [- "salesRfqId"- ]- }- },- {- "name": "sales_deleteSalesRFQLine",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete sales r f q line",- "paramCount": 1,- "serviceParams": [- "client",- "salesRFQLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesRFQLineId": {- "type": "string"- }- },- "required": [- "salesRFQLineId"- ]- }- },- {- "name": "sales_duplicatePricingRule",- "module": "sales",- "classification": "WRITE",- "description": "duplicate pricing rule",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId",- "userId"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_getConfigurationParametersByQuoteLineId",- "module": "sales",- "classification": "READ",- "description": "get configuration parameters by quote line id",- "paramCount": 1,- "serviceParams": [- "client",- "quoteLineId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteLineId": {- "type": "string"- }- },- "required": [- "quoteLineId"- ]- }- },- {- "name": "sales_getCustomer",- "module": "sales",- "classification": "READ",- "description": "get customer",- "paramCount": 1,- "serviceParams": [- "client",- "customerId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- }- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_getCustomerContact",- "module": "sales",- "classification": "READ",- "description": "get customer contact",- "paramCount": 1,- "serviceParams": [- "client",- "customerContactId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerContactId": {- "type": "string"- }- },- "required": [- "customerContactId"- ]- }- },- {- "name": "sales_getCustomerContacts",- "module": "sales",- "classification": "READ",- "description": "get customer contacts",- "paramCount": 1,- "serviceParams": [- "client",- "customerId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- }- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_getCustomerItemPriceOverride",- "module": "sales",- "classification": "READ",- "description": "get customer item price override",- "paramCount": 4,- "serviceParams": [- "client",- "customerId",- "itemId",- "companyId",- "quantity",- "date"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantity": {},- "date": {- "type": "string"- }- },- "required": [- "customerId",- "itemId",- "quantity"- ]- }- },- {- "name": "sales_getCustomerLocation",- "module": "sales",- "classification": "READ",- "description": "get customer location",- "paramCount": 1,- "serviceParams": [- "client",- "customerLocationId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerLocationId": {- "type": "string"- }- },- "required": [- "customerLocationId"- ]- }- },- {- "name": "sales_getCustomerLocations",- "module": "sales",- "classification": "READ",- "description": "get customer locations",- "paramCount": 1,- "serviceParams": [- "client",- "customerId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- }- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_getCustomerPayment",- "module": "sales",- "classification": "READ",- "description": "get customer payment",- "paramCount": 1,- "serviceParams": [- "client",- "customerId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- }- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_getCustomerShipping",- "module": "sales",- "classification": "READ",- "description": "get customer shipping",- "paramCount": 1,- "serviceParams": [- "client",- "customerId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- }- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_getCustomerTax",- "module": "sales",- "classification": "READ",- "description": "get customer tax",- "paramCount": 1,- "serviceParams": [- "client",- "customerId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- }- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_getCustomerTypeItemPriceOverride",- "module": "sales",- "classification": "READ",- "description": "get customer type item price override",- "paramCount": 4,- "serviceParams": [- "client",- "customerTypeId",- "itemId",- "companyId",- "quantity",- "date"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerTypeId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "quantity": {},- "date": {- "type": "string"- }- },- "required": [- "customerTypeId",- "itemId",- "quantity"- ]- }- },- {- "name": "sales_getAllCustomersItemPriceOverride",- "module": "sales",- "classification": "READ",- "description": "get all customers item price override",- "paramCount": 3,- "serviceParams": [- "client",- "itemId",- "companyId",- "quantity",- "date"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "quantity": {},- "date": {- "type": "string"- }- },- "required": [- "itemId",- "quantity"- ]- }- },- {- "name": "sales_getCustomers",- "module": "sales",- "classification": "READ",- "description": "get customers",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "sales_getCustomersList",- "module": "sales",- "classification": "READ",- "description": "get customers list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getCustomerStatus",- "module": "sales",- "classification": "READ",- "description": "get customer status",- "paramCount": 1,- "serviceParams": [- "client",- "customerStatusId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerStatusId": {- "type": "string"- }- },- "required": [- "customerStatusId"- ]- }- },- {- "name": "sales_getCustomerStatuses",- "module": "sales",- "classification": "READ",- "description": "get customer statuses",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "sales_getCustomerStatusesList",- "module": "sales",- "classification": "READ",- "description": "get customer statuses list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getCustomerType",- "module": "sales",- "classification": "READ",- "description": "get customer type",- "paramCount": 1,- "serviceParams": [- "client",- "customerTypeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerTypeId": {- "type": "string"- }- },- "required": [- "customerTypeId"- ]- }- },- {- "name": "sales_getCustomerTypes",- "module": "sales",- "classification": "READ",- "description": "get customer types",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "sales_getCustomerTypesList",- "module": "sales",- "classification": "READ",- "description": "get customer types list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getExternalSalesOrderLines",- "module": "sales",- "classification": "READ",- "description": "get external sales order lines",- "paramCount": 2,- "serviceParams": [- "client",- "customerId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- },- "required": [- "customerId",- "args"- ]- }- },- {- "name": "sales_getModelByQuoteLineId",- "module": "sales",- "classification": "READ",- "description": "get model by quote line id",- "paramCount": 1,- "serviceParams": [- "client",- "quoteLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteLineId": {- "type": "string"- }- },- "required": [- "quoteLineId"- ]- }- },- {- "name": "sales_getNoQuoteReasonsList",- "module": "sales",- "classification": "READ",- "description": "get no quote reasons list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getNoQuoteReason",- "module": "sales",- "classification": "READ",- "description": "get no quote reason",- "paramCount": 1,- "serviceParams": [- "client",- "noQuoteReasonId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "noQuoteReasonId": {- "type": "string"- }- },- "required": [- "noQuoteReasonId"- ]- }- },- {- "name": "sales_getNoQuoteReasons",- "module": "sales",- "classification": "READ",- "description": "get no quote reasons",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "sales_getOpportunity",- "module": "sales",- "classification": "READ",- "description": "get opportunity",- "paramCount": 1,- "serviceParams": [- "client",- "opportunityId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "opportunityId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "opportunityId"- ]- }- },- {- "name": "sales_getOpportunityDocuments",- "module": "sales",- "classification": "READ",- "description": "get opportunity documents",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "opportunityId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "opportunityId": {- "type": "string"- }- },- "required": [- "opportunityId"- ]- }- },- {- "name": "sales_getOpportunityLineDocuments",- "module": "sales",- "classification": "READ",- "description": "get opportunity line documents",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "lineId",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "lineId": {- "type": "string"- },- "itemId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "lineId"- ]- }- },- {- "name": "sales_getPricingRule",- "module": "sales",- "classification": "READ",- "description": "get pricing rule",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_getPricingRules",- "module": "sales",- "classification": "READ",- "description": "get pricing rules",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": "string"- }- }- }- }- }- },- {- "name": "sales_getQuote",- "module": "sales",- "classification": "READ",- "description": "get quote",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getQuoteFavorites",- "module": "sales",- "classification": "READ",- "description": "get quote favorites",- "paramCount": 0,- "serviceParams": [- "client",- "companyId",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getQuotes",- "module": "sales",- "classification": "READ",- "description": "get quotes",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "sales_getQuotesList",- "module": "sales",- "classification": "READ",- "description": "get quotes list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getQuoteAssembliesByLine",- "module": "sales",- "classification": "READ",- "description": "get quote assemblies by line",- "paramCount": 1,- "serviceParams": [- "client",- "quoteLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteLineId": {- "type": "string"- }- },- "required": [- "quoteLineId"- ]- }- },- {- "name": "sales_getQuoteAssemblies",- "module": "sales",- "classification": "READ",- "description": "get quote assemblies",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getQuoteCustomerDetails",- "module": "sales",- "classification": "READ",- "description": "get quote customer details",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getQuoteLine",- "module": "sales",- "classification": "READ",- "description": "get quote line",- "paramCount": 1,- "serviceParams": [- "client",- "quoteLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteLineId": {- "type": "string"- }- },- "required": [- "quoteLineId"- ]- }- },- {- "name": "sales_getQuoteLinesList",- "module": "sales",- "classification": "READ",- "description": "get quote lines list",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getQuoteMakeMethod",- "module": "sales",- "classification": "READ",- "description": "get quote make method",- "paramCount": 1,- "serviceParams": [- "client",- "quoteMakeMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteMakeMethodId": {- "type": "string"- }- },- "required": [- "quoteMakeMethodId"- ]- }- },- {- "name": "sales_getRootQuoteMakeMethod",- "module": "sales",- "classification": "READ",- "description": "get root quote make method",- "paramCount": 1,- "serviceParams": [- "client",- "quoteLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteLineId": {- "type": "string"- }- },- "required": [- "quoteLineId"- ]- }- },- {- "name": "sales_getQuoteMethodTrees",- "module": "sales",- "classification": "READ",- "description": "get quote method trees",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getQuoteMethodTreeArray",- "module": "sales",- "classification": "READ",- "description": "get quote method tree array",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getQuoteLines",- "module": "sales",- "classification": "READ",- "description": "get quote lines",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getQuoteByExternalId",- "module": "sales",- "classification": "READ",- "description": "get quote by external id",- "paramCount": 1,- "serviceParams": [- "client",- "externalId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "externalId": {- "type": "string"- }- },- "required": [- "externalId"- ]- }- },- {- "name": "sales_getQuoteLinePrices",- "module": "sales",- "classification": "READ",- "description": "get quote line prices",- "paramCount": 1,- "serviceParams": [- "client",- "quoteLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteLineId": {- "type": "string"- }- },- "required": [- "quoteLineId"- ]- }- },- {- "name": "sales_getQuoteLinePricesByQuoteId",- "module": "sales",- "classification": "READ",- "description": "get quote line prices by quote id",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getQuoteLinePricesByItemId",- "module": "sales",- "classification": "READ",- "description": "get quote line prices by item id",- "paramCount": 2,- "serviceParams": [- "client",- "itemId",- "currentQuoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "currentQuoteId": {- "type": "string"- }- },- "required": [- "itemId",- "currentQuoteId"- ]- }- },- {- "name": "sales_getQuoteLinePricesByItemIds",- "module": "sales",- "classification": "READ",- "description": "get quote line prices by item ids",- "paramCount": 2,- "serviceParams": [- "client",- "itemIds",- "currentQuoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemIds": {- "type": "array",- "items": {- "type": "string"- }- },- "currentQuoteId": {- "type": "string"- }- },- "required": [- "itemIds",- "currentQuoteId"- ]- }- },- {- "name": "sales_getQuoteMaterials",- "module": "sales",- "classification": "READ",- "description": "get quote materials",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getQuoteMaterial",- "module": "sales",- "classification": "READ",- "description": "get quote material",- "paramCount": 1,- "serviceParams": [- "client",- "materialId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "materialId": {- "type": "string"- }- },- "required": [- "materialId"- ]- }- },- {- "name": "sales_getQuoteMaterialsByLine",- "module": "sales",- "classification": "READ",- "description": "get quote materials by line",- "paramCount": 1,- "serviceParams": [- "client",- "quoteLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteLineId": {- "type": "string"- }- },- "required": [- "quoteLineId"- ]- }- },- {- "name": "sales_getQuoteMaterialsByMethodId",- "module": "sales",- "classification": "READ",- "description": "get quote materials by method id",- "paramCount": 1,- "serviceParams": [- "client",- "quoteMakeMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteMakeMethodId": {- "type": "string"- }- },- "required": [- "quoteMakeMethodId"- ]- }- },- {- "name": "sales_getQuoteMaterialsByOperation",- "module": "sales",- "classification": "READ",- "description": "get quote materials by operation",- "paramCount": 1,- "serviceParams": [- "client",- "quoteOperationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteOperationId": {- "type": "string"- }- },- "required": [- "quoteOperationId"- ]- }- },- {- "name": "sales_getQuoteOperation",- "module": "sales",- "classification": "READ",- "description": "get quote operation",- "paramCount": 1,- "serviceParams": [- "client",- "quoteOperationId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteOperationId": {- "type": "string"- }- },- "required": [- "quoteOperationId"- ]- }- },- {- "name": "sales_getQuoteOperationsByLine",- "module": "sales",- "classification": "READ",- "description": "get quote operations by line",- "paramCount": 1,- "serviceParams": [- "client",- "quoteLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteLineId": {- "type": "string"- }- },- "required": [- "quoteLineId"- ]- }- },- {- "name": "sales_getQuoteOperationsByMethodId",- "module": "sales",- "classification": "READ",- "description": "get quote operations by method id",- "paramCount": 1,- "serviceParams": [- "client",- "quoteMakeMethodId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteMakeMethodId": {- "type": "string"- }- },- "required": [- "quoteMakeMethodId"- ]- }- },- {- "name": "sales_getQuoteOperations",- "module": "sales",- "classification": "READ",- "description": "get quote operations",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getQuotePayment",- "module": "sales",- "classification": "READ",- "description": "get quote payment",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getQuoteShipment",- "module": "sales",- "classification": "READ",- "description": "get quote shipment",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_getRelatedPricesForQuoteLine",- "module": "sales",- "classification": "READ",- "description": "get related prices for quote line",- "paramCount": 2,- "serviceParams": [- "client",- "itemId",- "quoteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "quoteId": {- "type": "string"- }- },- "required": [- "itemId",- "quoteId"- ]- }- },- {- "name": "sales_getSalesDocumentsAssignedToMe",- "module": "sales",- "classification": "READ",- "description": "get sales documents assigned to me",- "paramCount": 0,- "serviceParams": [- "client",- "userId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getSalesOrder",- "module": "sales",- "classification": "READ",- "description": "get sales order",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderId": {- "type": "string"- }- },- "required": [- "salesOrderId"- ]- }- },- {- "name": "sales_getSalesOrderCustomerDetails",- "module": "sales",- "classification": "READ",- "description": "get sales order customer details",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderId": {- "type": "string"- }- },- "required": [- "salesOrderId"- ]- }- },- {- "name": "sales_getSalesOrderFavorites",- "module": "sales",- "classification": "READ",- "description": "get sales order favorites",- "paramCount": 0,- "serviceParams": [- "client",- "companyId",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getSalesOrderRelatedItems",- "module": "sales",- "classification": "READ",- "description": "get sales order related items",- "paramCount": 2,- "serviceParams": [- "client",- "salesOrderId",- "opportunityId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderId": {- "type": "string"- },- "opportunityId": {- "type": "string"- }- },- "required": [- "salesOrderId",- "opportunityId"- ]- }- },- {- "name": "sales_getSalesOrders",- "module": "sales",- "classification": "READ",- "description": "get sales orders",- "paramCount": 5,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "status": {- "type": [- "string",- "null"- ]- },- "customerId": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "sales_getSalesOrdersList",- "module": "sales",- "classification": "READ",- "description": "get sales orders list",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getSalesOrdersByIds",- "module": "sales",- "classification": "READ",- "description": "get sales orders by ids",- "paramCount": 1,- "serviceParams": [- "client",- "ids"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "ids": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "ids"- ]- }- },- {- "name": "sales_getSalesOrderPayment",- "module": "sales",- "classification": "READ",- "description": "get sales order payment",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderId": {- "type": "string"- }- },- "required": [- "salesOrderId"- ]- }- },- {- "name": "sales_getSalesTerms",- "module": "sales",- "classification": "READ",- "description": "get sales terms",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getSalesOrderShipment",- "module": "sales",- "classification": "READ",- "description": "get sales order shipment",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderId": {- "type": "string"- }- },- "required": [- "salesOrderId"- ]- }- },- {- "name": "sales_getSalesOrderCustomers",- "module": "sales",- "classification": "READ",- "description": "get sales order customers",- "paramCount": 0,- "serviceParams": [- "client"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getSalesOrderLines",- "module": "sales",- "classification": "READ",- "description": "get sales order lines",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderId": {- "type": "string"- }- },- "required": [- "salesOrderId"- ]- }- },- {- "name": "sales_getSalesOrderInvoiceLines",- "module": "sales",- "classification": "READ",- "description": "get sales order invoice lines",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderId": {- "type": "string"- }- },- "required": [- "salesOrderId"- ]- }- },- {- "name": "sales_getSalesOrderInvoicesByIds",- "module": "sales",- "classification": "READ",- "description": "get sales order invoices by ids",- "paramCount": 1,- "serviceParams": [- "client",- "invoiceIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "invoiceIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "invoiceIds"- ]- }- },- {- "name": "sales_getSalesOrderLinesByItemId",- "module": "sales",- "classification": "READ",- "description": "get sales order lines by item id",- "paramCount": 1,- "serviceParams": [- "client",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "sales_getOpenSalesOrderLinesForItem",- "module": "sales",- "classification": "READ",- "description": "get open sales order lines for item",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "sales_getSalesOrderLinesByItemIds",- "module": "sales",- "classification": "READ",- "description": "get sales order lines by item ids",- "paramCount": 1,- "serviceParams": [- "client",- "itemIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "itemIds"- ]- }- },- {- "name": "sales_getSalesOrderLine",- "module": "sales",- "classification": "READ",- "description": "get sales order line",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderLineId": {- "type": "string"- }- },- "required": [- "salesOrderLineId"- ]- }- },- {- "name": "sales_getSalesOrderLineShipments",- "module": "sales",- "classification": "READ",- "description": "get sales order line shipments",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderLineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderLineId": {- "type": "string"- }- },- "required": [- "salesOrderLineId"- ]- }- },- {- "name": "sales_getSalesRFQ",- "module": "sales",- "classification": "READ",- "description": "get sales r f q",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_getSalesRFQFavorites",- "module": "sales",- "classification": "READ",- "description": "get sales r f q favorites",- "paramCount": 0,- "serviceParams": [- "client",- "companyId",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "sales_getSalesRFQs",- "module": "sales",- "classification": "READ",- "description": "get sales r f qs",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "sales_getSalesRFQLine",- "module": "sales",- "classification": "READ",- "description": "get sales r f q line",- "paramCount": 1,- "serviceParams": [- "client",- "lineId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "lineId": {- "type": "string"- }- },- "required": [- "lineId"- ]- }- },- {- "name": "sales_getSalesRFQLines",- "module": "sales",- "classification": "READ",- "description": "get sales r f q lines",- "paramCount": 1,- "serviceParams": [- "client",- "salesRfqId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "salesRfqId": {- "type": "string"- }- },- "required": [- "salesRfqId"- ]- }- },- {- "name": "sales_insertCustomerContact",- "module": "sales",- "classification": "WRITE",- "description": "insert customer contact",- "paramCount": 4,- "serviceParams": [- "client",- "customerContact"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "contact": {},- "customerLocationId": {- "type": "string"- },- "customFields": {}- },- "required": [- "customerId",- "contact"- ]- }- },- {- "name": "sales_insertCustomerLocation",- "module": "sales",- "classification": "WRITE",- "description": "insert customer location",- "paramCount": 4,- "serviceParams": [- "client",- "customerLocation"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "name": {- "type": "string"- },- "address: {\n addressLine1": {},- "customFields": {}- },- "required": [- "customerId",- "name"- ]- }- },- {- "name": "sales_insertSalesOrderLines",- "module": "sales",- "classification": "WRITE",- "description": "insert sales order lines",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderLines"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderLines": {- "type": "array",- "items": {}- }- },- "required": [- "salesOrderLines"- ]- }- },- {- "name": "sales_finalizeQuote",- "module": "sales",- "classification": "WRITE",- "description": "finalize quote",- "paramCount": 1,- "serviceParams": [- "client",- "quoteId",- "userId",- "companyId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- }- },- "required": [- "quoteId"- ]- }- },- {- "name": "sales_releaseSalesOrder",- "module": "sales",- "classification": "WRITE",- "description": "release sales order",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderId",- "userId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderId": {- "type": "string"- }- },- "required": [- "salesOrderId"- ]- }- },- {- "name": "sales_resolvePrice",- "module": "sales",- "classification": "WRITE",- "description": "resolve price",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "input"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "input": {}- },- "required": [- "input"- ]- }- },- {- "name": "sales_resolvePriceList",- "module": "sales",- "classification": "WRITE",- "description": "resolve price list",- "paramCount": 6,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "customerId": {- "type": "string"- },- "customerTypeId": {- "type": "string"- },- "search": {- "type": "string"- },- "quantity": {- "type": "number"- }- }- }- }- }- },- {- "name": "sales_getBaseCatalog",- "module": "sales",- "classification": "READ",- "description": "get base catalog",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": "string"- }- }- }- }- }- },- {- "name": "sales_upsertCustomer",- "module": "sales",- "classification": "WRITE",- "description": "upsert customer",- "paramCount": 10,- "serviceParams": [- "client",- "customer"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "readableId": {- "type": "string"- },- "name": {- "type": "string"- },- "customerStatusId": {- "type": "string"- },- "customerTypeId": {- "type": "string"- },- "accountManagerId": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "taxPercent": {- "type": "number"- },- "salesContactId": {- "type": "string"- },- "website": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "sales_upsertCustomerItemPriceOverride",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "upsert customer item price override",- "paramCount": 10,- "serviceParams": [- "db",- "companyId",- "userId",- "data"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "customerId": {- "type": "string"- },- "customerTypeId": {- "type": "string"- },- "itemId": {- "type": "string"- },- "breaks": {- "type": "array",- "items": {}- },- "active": {- "type": "boolean"- },- "applyRulesOnTop": {- "type": "boolean"- },- "notes": {- "type": "string"- },- "validFrom": {- "type": "string"- },- "validTo": {- "type": "string"- }- },- "required": [- "itemId",- "breaks",- "active",- "applyRulesOnTop"- ]- }- },- {- "name": "sales_deleteCustomerItemPriceOverride",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "delete customer item price override",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_getCustomerItemPriceOverrideById",- "module": "sales",- "classification": "READ",- "description": "get customer item price override by id",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_getCustomerItemPriceOverridesList",- "module": "sales",- "classification": "READ",- "description": "get customer item price overrides list",- "paramCount": 6,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": "string"- },- "customerId": {- "type": "string"- },- "customerTypeId": {- "type": "string"- },- "itemId": {- "type": "string"- }- }- }- }- }- },- {- "name": "sales_updateCustomerAccounting",- "module": "sales",- "classification": "WRITE",- "description": "update customer accounting",- "paramCount": 2,- "serviceParams": [- "client",- "customerAccounting"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "customerTypeId": {- "type": "string"- }- }- }- },- {- "name": "sales_updateCustomerContact",- "module": "sales",- "classification": "WRITE",- "description": "update customer contact",- "paramCount": 4,- "serviceParams": [- "client",- "customerContact"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "contactId": {- "type": "string"- },- "contact": {},- "customerLocationId": {- "type": "string"- },- "customFields": {}- },- "required": [- "contactId",- "contact"- ]- }- },- {- "name": "sales_updateCustomerLocation",- "module": "sales",- "classification": "WRITE",- "description": "update customer location",- "paramCount": 4,- "serviceParams": [- "client",- "customerLocation"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "addressId": {- "type": "string"- },- "name": {- "type": "string"- },- "address: {\n addressLine1": {},- "customFields": {}- },- "required": [- "addressId",- "name"- ]- }- },- {- "name": "sales_updateCustomerPayment",- "module": "sales",- "classification": "WRITE",- "description": "update customer payment",- "paramCount": 5,- "serviceParams": [- "client",- "customerPayment"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "invoiceCustomerId": {- "type": "string"- },- "invoiceCustomerLocationId": {- "type": "string"- },- "invoiceCustomerContactId": {- "type": "string"- },- "paymentTermId": {- "type": "string"- }- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_updateCustomerShipping",- "module": "sales",- "classification": "WRITE",- "description": "update customer shipping",- "paramCount": 7,- "serviceParams": [- "client",- "customerShipping"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "shippingCustomerId": {- "type": "string"- },- "shippingCustomerLocationId": {- "type": "string"- },- "shippingCustomerContactId": {- "type": "string"- },- "shippingMethodId": {- "type": "string"- },- "incoterm": {- "type": "string"- },- "incotermLocation": {- "type": "string"- }- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_updateCustomerTax",- "module": "sales",- "classification": "WRITE",- "description": "update customer tax",- "paramCount": 1,- "serviceParams": [- "client",- "customerTax"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "customerTax": {}- },- "required": [- "customerTax"- ]- }- },- {- "name": "sales_updatePricingRule",- "module": "sales",- "classification": "WRITE",- "description": "update pricing rule",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "userId",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "data": {}- },- "required": [- "id",- "data"- ]- }- },- {- "name": "sales_upsertCustomerStatus",- "module": "sales",- "classification": "WRITE",- "description": "upsert customer status",- "paramCount": 2,- "serviceParams": [- "client",- "customerStatus"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "sales_upsertCustomerType",- "module": "sales",- "classification": "WRITE",- "description": "upsert customer type",- "paramCount": 2,- "serviceParams": [- "client",- "customerType"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "sales_upsertNoQuoteReason",- "module": "sales",- "classification": "WRITE",- "description": "upsert no quote reason",- "paramCount": 2,- "serviceParams": [- "client",- "noQuoteReason"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "_operation"- ]- }- },- {- "name": "sales_updateSalesRFQFavorite",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "update sales r f q favorite",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "favorite": {- "type": "boolean"- }- },- "required": [- "id",- "favorite"- ]- }- },- {- "name": "sales_updateQuoteExchangeRate",- "module": "sales",- "classification": "WRITE",- "description": "update quote exchange rate",- "paramCount": 2,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "exchangeRate": {- "type": "number"- }- },- "required": [- "id",- "exchangeRate"- ]- }- },- {- "name": "sales_updateQuoteLinePrecision",- "module": "sales",- "classification": "WRITE",- "description": "update quote line precision",- "paramCount": 3,- "serviceParams": [- "db",- "companyId",- "quoteId",- "lineId",- "precision"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- },- "lineId": {- "type": "string"- },- "precision": {- "type": "number"- }- },- "required": [- "quoteId",- "lineId",- "precision"- ]- }- },- {- "name": "sales_updateSalesOrderExchangeRate",- "module": "sales",- "classification": "WRITE",- "description": "update sales order exchange rate",- "paramCount": 2,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "exchangeRate": {- "type": "number"- }- },- "required": [- "id",- "exchangeRate"- ]- }- },- {- "name": "sales_updateQuoteFavorite",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "update quote favorite",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "favorite": {- "type": "boolean"- }- },- "required": [- "id",- "favorite"- ]- }- },- {- "name": "sales_updateSalesRFQStatus",- "module": "sales",- "classification": "WRITE",- "description": "update sales r f q status",- "paramCount": 4,- "serviceParams": [- "client",- "update"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "noQuoteReasonId": {- "type": [- "string",- "null"- ]- },- "assignee": {}- },- "required": [- "id",- "status",- "noQuoteReasonId",- "assignee"- ]- }- },- {- "name": "sales_updateQuoteMaterialOrder",- "module": "sales",- "classification": "WRITE",- "description": "update quote material order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "order": {- "type": "number"- }- },- "required": [- "id",- "order"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "sales_updateQuoteOperationOrder",- "module": "sales",- "classification": "WRITE",- "description": "update quote operation order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "order": {- "type": "number"- }- },- "required": [- "id",- "order"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "sales_updateQuoteStatus",- "module": "sales",- "classification": "WRITE",- "description": "update quote status",- "paramCount": 3,- "serviceParams": [- "client",- "update"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "assignee": {}- },- "required": [- "id",- "status",- "assignee"- ]- }- },- {- "name": "sales_upsertMakeMethodFromQuoteLine",- "module": "sales",- "classification": "WRITE",- "description": "upsert make method from quote line",- "paramCount": 4,- "serviceParams": [- "client",- "lineMethod"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "quoteId": {- "type": "string"- },- "quoteLineId": {- "type": "string"- },- "parts": {- "type": "object",- "properties": {- "billOfMaterial": {- "type": "boolean"- },- "billOfProcess": {- "type": "boolean"- },- "parameters": {- "type": "boolean"- },- "tools": {- "type": "boolean"- },- "steps": {- "type": "boolean"- },- "workInstructions": {- "type": "boolean"- }- },- "required": [- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- "required": [- "itemId",- "quoteId",- "quoteLineId"- ]- }- },- {- "name": "sales_upsertMakeMethodFromQuoteMethod",- "module": "sales",- "classification": "WRITE",- "description": "upsert make method from quote method",- "paramCount": 3,- "serviceParams": [- "client",- "quoteMethod"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "sourceId": {- "type": "string"- },- "targetId": {- "type": "string"- },- "parts": {- "type": "object",- "properties": {- "billOfMaterial": {- "type": "boolean"- },- "billOfProcess": {- "type": "boolean"- },- "parameters": {- "type": "boolean"- },- "tools": {- "type": "boolean"- },- "steps": {- "type": "boolean"- },- "workInstructions": {- "type": "boolean"- }- },- "required": [- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- "required": [- "sourceId",- "targetId"- ]- }- },- {- "name": "sales_insertQuote",- "module": "sales",- "classification": "WRITE",- "description": "Create a new quote with all business logic - generates sequence, creates opportunity, resolves payment/shipping defaults from customer. LLM can create a quote with just customerId.",- "paramCount": 16,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "quoteId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "status": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "expirationDate": {- "type": "string"- },- "customerContactId": {- "type": "string"- },- "customerLocationId": {- "type": "string"- },- "customerEngineeringContactId": {- "type": "string"- },- "customerReference": {- "type": "string"- },- "salesPersonId": {- "type": "string"- },- "estimatorId": {- "type": "string"- },- "dueDate": {- "type": "string"- },- "opportunityId": {- "type": "string"- },- "notes": {- "type": "string"- },- "customFields": {}- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_updateQuote",- "module": "sales",- "classification": "WRITE",- "description": "Update an existing quote - handles exchange rate updates when currency changes, syncs customer to opportunity",- "paramCount": 17,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "expirationDate": {- "type": [- "string",- "null"- ]- },- "customerContactId": {- "type": [- "string",- "null"- ]- },- "customerLocationId": {- "type": [- "string",- "null"- ]- },- "customerEngineeringContactId": {- "type": [- "string",- "null"- ]- },- "customerReference": {- "type": [- "string",- "null"- ]- },- "customerId": {- "type": "string"- },- "salesPersonId": {- "type": [- "string",- "null"- ]- },- "estimatorId": {- "type": [- "string",- "null"- ]- },- "locationId": {- "type": "string"- },- "dueDate": {- "type": [- "string",- "null"- ]- },- "digitalQuoteAcceptedBy": {- "type": [- "string",- "null"- ]- },- "digitalQuoteAcceptedByEmail": {- "type": [- "string",- "null"- ]- },- "notes": {- "type": [- "string",- "null"- ]- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "sales_upsertQuote",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote",- "paramCount": 20,- "serviceParams": [- "client",- "quote"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "quoteId": {- "type": "string"- },- "name": {- "type": "string"- },- "salesPersonId": {- "type": "string"- },- "estimatorId": {- "type": "string"- },- "customerId": {- "type": "string"- },- "customerLocationId": {- "type": "string"- },- "customerContactId": {- "type": "string"- },- "customerEngineeringContactId": {- "type": "string"- },- "customerReference": {- "type": "string"- },- "locationId": {- "type": "string"- },- "status": {- "type": "string"- },- "notes": {},- "dueDate": {- "type": "string"- },- "expirationDate": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "exchangeRate": {- "type": "number"- },- "exchangeRateUpdatedAt": {- "type": "string"- },- "digitalQuoteAcceptedBy": {- "type": "string"- },- "digitalQuoteAcceptedByEmail": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "customerId",- "locationId",- "_operation"- ]- }- },- {- "name": "sales_upsertQuoteLine",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote line",- "paramCount": 16,- "serviceParams": [- "client",- "quotationLine"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "quoteId": {- "type": "string"- },- "itemType": {- "type": "string"- },- "itemId": {- "type": "string"- },- "status": {- "type": "string"- },- "estimatorId": {- "type": "string"- },- "description": {- "type": "string"- },- "methodType": {- "type": "string"- },- "customerPartId": {- "type": "string"- },- "customerPartRevision": {- "type": "string"- },- "unitOfMeasureCode": {- "type": "string"- },- "quantity": {- "type": "array",- "items": {- "type": "number"- }- },- "modelUploadId": {- "type": "string"- },- "noQuoteReason": {- "type": "string"- },- "taxPercent": {- "type": "number"- },- "configuration": {}- },- "required": [- "quoteId",- "itemId",- "status",- "description",- "methodType",- "quantity"- ]- }- },- {- "name": "sales_updateQuoteLineOrder",- "module": "sales",- "classification": "WRITE",- "description": "update quote line order",- "paramCount": 1,- "serviceParams": [- "db",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "sales_upsertQuoteLineAdditionalCharges",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote line additional charges",- "paramCount": 2,- "serviceParams": [- "client",- "lineId",- "update"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "lineId": {- "type": "string"- },- "update": {- "type": "object",- "properties": {- "additionalCharges": {}- },- "required": [- "additionalCharges"- ]- }- },- "required": [- "lineId",- "update"- ]- }- },- {- "name": "sales_upsertQuoteLinePrices",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "upsert quote line prices",- "paramCount": 3,- "serviceParams": [- "db",- "companyId",- "quoteId",- "lineId",- "quoteLinePrices"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- },- "lineId": {- "type": "string"- },- "quoteLinePrices": {- "type": "array",- "items": {- "type": "object",- "properties": {- "quoteLineId": {- "type": "string"- },- "unitPrice": {- "type": "number"- },- "quantity": {- "type": "number"- },- "leadTime": {- "type": "number"- },- "discountPercent": {- "type": "number"- },- "shippingCost": {- "type": "number"- },- "categoryMarkups": {},- "priceSource": {- "type": "string",- "enum": [- "system",- "manual"- ]- }- },- "required": [- "quoteLineId",- "unitPrice",- "quantity"- ]- }- }- },- "required": [- "quoteId",- "lineId",- "quoteLinePrices"- ]- }- },- {- "name": "sales_buildMakeToOrderPriceRows",- "module": "sales",- "classification": "WRITE",- "description": "build make to order price rows",- "paramCount": 4,- "serviceParams": [- "client",- "quoteId",- "quoteLineId",- "quantities",- "userId",- "itemIdOverride"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- },- "quoteLineId": {- "type": "string"- },- "quantities": {- "type": "array",- "items": {- "type": "number"- }- },- "itemIdOverride": {- "type": [- "string",- "null"- ]- }- },- "required": [- "quoteId",- "quoteLineId",- "quantities"- ]- }- },- {- "name": "sales_calculatePricesForQuantities",- "module": "sales",- "classification": "WRITE",- "description": "calculate prices for quantities",- "paramCount": 3,- "serviceParams": [- "client",- "quoteId",- "quoteLineId",- "quantities",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- },- "quoteLineId": {- "type": "string"- },- "quantities": {- "type": "array",- "items": {- "type": "number"- }- }- },- "required": [- "quoteId",- "quoteLineId",- "quantities"- ]- }- },- {- "name": "sales_buildPullFromInventoryPriceRows",- "module": "sales",- "classification": "WRITE",- "description": "build pull from inventory price rows",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "quoteId",- "quoteLineId",- "quantities",- "userId",- "itemIdOverride"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- },- "quoteLineId": {- "type": "string"- },- "quantities": {- "type": "array",- "items": {- "type": "number"- }- },- "itemIdOverride": {- "type": [- "string",- "null"- ]- }- },- "required": [- "quoteId",- "quoteLineId",- "quantities"- ]- }- },- {- "name": "sales_resolveQuoteLinePrices",- "module": "sales",- "classification": "WRITE",- "description": "resolve quote line prices",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "quoteId",- "quoteLineId",- "quantities",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- },- "quoteLineId": {- "type": "string"- },- "quantities": {- "type": "array",- "items": {- "type": "number"- }- }- },- "required": [- "quoteId",- "quoteLineId",- "quantities"- ]- }- },- {- "name": "sales_buildPurchaseToOrderPriceRows",- "module": "sales",- "classification": "WRITE",- "description": "build purchase to order price rows",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "quoteId",- "quoteLineId",- "quantities",- "userId",- "itemIdOverride"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- },- "quoteLineId": {- "type": "string"- },- "quantities": {- "type": "array",- "items": {- "type": "number"- }- },- "itemIdOverride": {- "type": [- "string",- "null"- ]- }- },- "required": [- "quoteId",- "quoteLineId",- "quantities"- ]- }- },- {- "name": "sales_resolvePurchaseToOrderPrices",- "module": "sales",- "classification": "WRITE",- "description": "resolve purchase to order prices",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "quoteId",- "quoteLineId",- "quantities",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- },- "quoteLineId": {- "type": "string"- },- "quantities": {- "type": "array",- "items": {- "type": "number"- }- }- },- "required": [- "quoteId",- "quoteLineId",- "quantities"- ]- }- },- {- "name": "sales_recalculateQuoteLinePrices",- "module": "sales",- "classification": "WRITE",- "description": "recalculate quote line prices",- "paramCount": 2,- "serviceParams": [- "client",- "quoteId",- "quoteLineId",- "userId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "quoteId": {- "type": "string"- },- "quoteLineId": {- "type": "string"- }- },- "required": [- "quoteId",- "quoteLineId"- ]- }- },- {- "name": "sales_upsertQuoteLineMethod",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote line method",- "paramCount": 5,- "serviceParams": [- "client",- "lineMethod"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "quoteId": {- "type": "string"- },- "quoteLineId": {- "type": "string"- },- "configuration": {},- "parts": {- "type": "object",- "properties": {- "billOfMaterial": {- "type": "boolean"- },- "billOfProcess": {- "type": "boolean"- },- "parameters": {- "type": "boolean"- },- "tools": {- "type": "boolean"- },- "steps": {- "type": "boolean"- },- "workInstructions": {- "type": "boolean"- }- },- "required": [- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- "required": [- "itemId",- "quoteId",- "quoteLineId"- ]- }- },- {- "name": "sales_upsertQuoteMaterial",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote material",- "paramCount": 1,- "serviceParams": [- "client",- "quoteMaterial"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "quoteMaterial": {}- },- "required": [- "quoteMaterial"- ]- }- },- {- "name": "sales_upsertQuoteMaterialMakeMethod",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote material make method",- "paramCount": 4,- "serviceParams": [- "client",- "quoteMethod"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "sourceId": {- "type": "string"- },- "targetId": {- "type": "string"- },- "configuration": {},- "parts": {- "type": "object",- "properties": {- "billOfMaterial": {- "type": "boolean"- },- "billOfProcess": {- "type": "boolean"- },- "parameters": {- "type": "boolean"- },- "tools": {- "type": "boolean"- },- "steps": {- "type": "boolean"- },- "workInstructions": {- "type": "boolean"- }- },- "required": [- "billOfMaterial",- "billOfProcess",- "parameters",- "tools",- "steps",- "workInstructions"- ]- }- },- "required": [- "sourceId",- "targetId"- ]- }- },- {- "name": "sales_upsertQuoteOperation",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote operation",- "paramCount": 1,- "serviceParams": [- "client",- "operation"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "operation": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "operation",- "_operation"- ]- }- },- {- "name": "sales_upsertQuoteOperationStep",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote operation step",- "paramCount": 1,- "serviceParams": [- "client",- "quoteOperationStep"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "quoteOperationStep": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "quoteOperationStep",- "_operation"- ]- }- },- {- "name": "sales_upsertQuoteOperationParameter",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote operation parameter",- "paramCount": 1,- "serviceParams": [- "client",- "quoteOperationParameter"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "quoteOperationParameter": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "quoteOperationParameter",- "_operation"- ]- }- },- {- "name": "sales_upsertQuoteOperationTool",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote operation tool",- "paramCount": 1,- "serviceParams": [- "client",- "quoteOperationTool"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "quoteOperationTool": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "quoteOperationTool",- "_operation"- ]- }- },- {- "name": "sales_upsertQuotePayment",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote payment",- "paramCount": 5,- "serviceParams": [- "client",- "quotePayment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "invoiceCustomerId": {- "type": "string"- },- "invoiceCustomerLocationId": {- "type": "string"- },- "invoiceCustomerContactId": {- "type": "string"- },- "paymentTermId": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_upsertQuoteShipment",- "module": "sales",- "classification": "WRITE",- "description": "upsert quote shipment",- "paramCount": 7,- "serviceParams": [- "client",- "quoteShipment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "locationId": {- "type": "string"- },- "shippingMethodId": {- "type": "string"- },- "receiptRequestedDate": {- "type": "string"- },- "shippingCost": {- "type": "number"- },- "incoterm": {- "type": "string"- },- "incotermLocation": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_updateSalesOrderFavorite",- "module": "sales",- "classification": "DESTRUCTIVE",- "description": "update sales order favorite",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "favorite": {- "type": "boolean"- }- },- "required": [- "id",- "favorite"- ]- }- },- {- "name": "sales_updateSalesOrderStatus",- "module": "sales",- "classification": "WRITE",- "description": "update sales order status",- "paramCount": 3,- "serviceParams": [- "client",- "update"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "assignee": {}- },- "required": [- "id",- "status",- "assignee"- ]- }- },- {- "name": "sales_insertSalesOrder",- "module": "sales",- "classification": "WRITE",- "description": "Create a new sales order with all business logic - generates sequence, creates opportunity, resolves payment/shipping defaults from customer. LLM can create a sales order with just customerId.",- "paramCount": 17,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "salesOrderId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "status": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "orderDate": {- "type": "string"- },- "customerContactId": {- "type": "string"- },- "customerLocationId": {- "type": "string"- },- "quoteId": {- "type": "string"- },- "opportunityId": {- "type": "string"- },- "requestedDate": {- "type": "string"- },- "promisedDate": {- "type": "string"- },- "notes": {- "type": "string"- },- "customerReference": {- "type": "string"- },- "customerEngineeringContactId": {- "type": "string"- },- "salesPersonId": {- "type": "string"- },- "customFields": {}- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_updateSalesOrder",- "module": "sales",- "classification": "WRITE",- "description": "Update an existing sales order - handles exchange rate updates when currency changes, syncs customer to opportunity",- "paramCount": 9,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "status": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "orderDate": {- "type": "string"- },- "customerContactId": {- "type": [- "string",- "null"- ]- },- "customerLocationId": {- "type": [- "string",- "null"- ]- },- "customerId": {- "type": "string"- },- "notes": {- "type": [- "string",- "null"- ]- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "sales_cancelSalesOrder",- "module": "sales",- "classification": "WRITE",- "description": "cancel sales order",- "paramCount": 2,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "jobs": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "id"- ]- }- },- {- "name": "sales_upsertSalesOrder",- "module": "sales",- "classification": "WRITE",- "description": "upsert sales order",- "paramCount": 18,- "serviceParams": [- "client",- "salesOrder"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "salesOrderId": {- "type": "string"- },- "orderDate": {- "type": "string"- },- "requestedDate": {- "type": "string"- },- "promisedDate": {- "type": "string"- },- "status": {- "type": "string"- },- "notes": {- "type": "string"- },- "customerId": {- "type": "string"- },- "customerLocationId": {- "type": "string"- },- "customerContactId": {- "type": "string"- },- "customerEngineeringContactId": {- "type": "string"- },- "customerReference": {- "type": "string"- },- "quoteId": {- "type": "string"- },- "locationId": {- "type": "string"- },- "currencyCode": {- "type": "string"- },- "exchangeRate": {- "type": "number"- },- "exchangeRateUpdatedAt": {- "type": "string"- },- "salesPersonId": {- "type": "string"- }- },- "required": [- "customerId",- "locationId"- ]- }- },- {- "name": "sales_upsertSalesOrderShipment",- "module": "sales",- "classification": "WRITE",- "description": "upsert sales order shipment",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderShipment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderShipment": {}- },- "required": [- "salesOrderShipment"- ]- }- },- {- "name": "sales_upsertSalesOrderLine",- "module": "sales",- "classification": "WRITE",- "description": "upsert sales order line",- "paramCount": 1,- "serviceParams": [- "client",- "salesOrderLine"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "salesOrderLine": {}- },- "required": [- "salesOrderLine"- ]- }- },- {- "name": "sales_updateSalesOrderLineOrder",- "module": "sales",- "classification": "WRITE",- "description": "update sales order line order",- "paramCount": 1,- "serviceParams": [- "db",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "sales_upsertSalesOrderPayment",- "module": "sales",- "classification": "WRITE",- "description": "upsert sales order payment",- "paramCount": 7,- "serviceParams": [- "client",- "salesOrderPayment"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "invoiceCustomerId": {- "type": "string"- },- "invoiceCustomerLocationId": {- "type": "string"- },- "invoiceCustomerContactId": {- "type": "string"- },- "paymentTermId": {- "type": "string"- },- "paymentComplete": {- "type": "string"- },- "currencyCode": {- "type": "string"- }- },- "required": [- "id",- "paymentComplete"- ]- }- },- {- "name": "sales_insertSalesRFQ",- "module": "sales",- "classification": "WRITE",- "description": "insert sales r f q",- "paramCount": 13,- "serviceParams": [- "client",- "db",- "input"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "customerId": {- "type": "string"- },- "rfqId": {- "type": "string"- },- "rfqDate": {- "type": "string"- },- "expirationDate": {- "type": "string"- },- "locationId": {- "type": "string"- },- "salesPersonId": {- "type": "string"- },- "customerContactId": {- "type": "string"- },- "customerEngineeringContactId": {- "type": "string"- },- "customerLocationId": {- "type": "string"- },- "customerReference": {- "type": "string"- },- "status": {- "type": "string",- "enum": [- "Draft",- "Ready for Quote",- "Quoted",- "Closed"- ]- },- "notes": {- "type": "string"- },- "customFields": {}- },- "required": [- "customerId"- ]- }- },- {- "name": "sales_updateSalesRFQ",- "module": "sales",- "classification": "WRITE",- "description": "update sales r f q",- "paramCount": 13,- "serviceParams": [- "client",- "input"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "customerId": {- "type": "string"- },- "customerContactId": {- "type": [- "string",- "null"- ]- },- "customerEngineeringContactId": {- "type": [- "string",- "null"- ]- },- "customerLocationId": {- "type": [- "string",- "null"- ]- },- "customerReference": {- "type": [- "string",- "null"- ]- },- "rfqDate": {- "type": "string"- },- "expirationDate": {- "type": [- "string",- "null"- ]- },- "locationId": {- "type": "string"- },- "salesPersonId": {- "type": [- "string",- "null"- ]- },- "status": {- "type": "string",- "enum": [- "Draft",- "Ready for Quote",- "Quoted",- "Closed"- ]- },- "notes": {- "type": [- "string",- "null"- ]- },- "customFields": {}- },- "required": [- "id"- ]- }- },- {- "name": "sales_upsertSalesRFQ",- "module": "sales",- "classification": "WRITE",- "description": "upsert sales r f q",- "paramCount": 14,- "serviceParams": [- "client",- "rfq"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "rfqId": {- "type": "string"- },- "customerLocationId": {- "type": "string"- },- "customerContactId": {- "type": "string"- },- "customerEngineeringContactId": {- "type": "string"- },- "customerId": {- "type": "string"- },- "customerReference": {- "type": "string"- },- "expirationDate": {- "type": "string"- },- "externalNotes": {- "type": "string"- },- "internalNotes": {- "type": "string"- },- "locationId": {- "type": "string"- },- "rfqDate": {- "type": "string"- },- "status": {- "type": "string"- },- "salesPersonId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "customerId",- "rfqDate",- "_operation"- ]- }- },- {- "name": "sales_upsertSalesRFQLine",- "module": "sales",- "classification": "WRITE",- "description": "upsert sales r f q line",- "paramCount": 10,- "serviceParams": [- "client",- "salesRfqLine"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "salesRfqId": {- "type": "string"- },- "customerPartId": {- "type": "string"- },- "customerPartRevision": {- "type": "string"- },- "itemId": {- "type": "string"- },- "description": {- "type": "string"- },- "quantity": {- "type": "array",- "items": {- "type": "number"- }- },- "unitOfMeasureCode": {- "type": "string"- },- "order": {- "type": "number"- },- "modelUploadId": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "salesRfqId",- "customerPartId",- "quantity",- "unitOfMeasureCode",- "_operation"- ]- }- },- {- "name": "sales_updateSalesRFQLineOrder",- "module": "sales",- "classification": "WRITE",- "description": "update sales r f q line order",- "paramCount": 1,- "serviceParams": [- "db",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "settings_getAccountsPayableBillingAddress",- "module": "settings",- "classification": "READ",- "description": "get accounts payable billing address",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getAccountsReceivableBillingAddress",- "module": "settings",- "classification": "READ",- "description": "get accounts receivable billing address",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_updateAccountsPayableBillingAddress",- "module": "settings",- "classification": "WRITE",- "description": "update accounts payable billing address",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "data",- "updatedBy"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "data": {}- },- "required": [- "data"- ]- }- },- {- "name": "settings_updateAccountsReceivableBillingAddress",- "module": "settings",- "classification": "WRITE",- "description": "update accounts receivable billing address",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "data",- "updatedBy"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "data": {}- },- "required": [- "data"- ]- }- },- {- "name": "settings_deactivateWebhooks",- "module": "settings",- "classification": "WRITE",- "description": "deactivate webhooks",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_deleteApiKey",- "module": "settings",- "classification": "DESTRUCTIVE",- "description": "delete api key",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "settings_deleteSubsidiary",- "module": "settings",- "classification": "DESTRUCTIVE",- "description": "delete subsidiary",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_deleteWebhook",- "module": "settings",- "classification": "DESTRUCTIVE",- "description": "delete webhook",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "settings_getApiKeys",- "module": "settings",- "classification": "READ",- "description": "get api keys",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "settings_getCompanies",- "module": "settings",- "classification": "READ",- "description": "get companies",- "paramCount": 0,- "serviceParams": [- "client",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getEmployeeCompanies",- "module": "settings",- "classification": "READ",- "description": "get employee companies",- "paramCount": 0,- "serviceParams": [- "client",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getIndustries",- "module": "settings",- "classification": "READ",- "description": "get industries",- "paramCount": 0,- "serviceParams": [- "client"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getCompany",- "module": "settings",- "classification": "READ",- "description": "get company",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getCompanyIntegrations",- "module": "settings",- "classification": "READ",- "description": "get company integrations",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getCompanyPlan",- "module": "settings",- "classification": "READ",- "description": "get company plan",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getCompanySettings",- "module": "settings",- "classification": "READ",- "description": "get company settings",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getConfig",- "module": "settings",- "classification": "READ",- "description": "get config",- "paramCount": 0,- "serviceParams": [- "client"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getCurrentSequence",- "module": "settings",- "classification": "READ",- "description": "get current sequence",- "paramCount": 1,- "serviceParams": [- "client",- "table",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "table": {- "type": "string"- }- },- "required": [- "table"- ]- }- },- {- "name": "settings_getCustomField",- "module": "settings",- "classification": "READ",- "description": "get custom field",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "settings_getCustomFields",- "module": "settings",- "classification": "READ",- "description": "get custom fields",- "paramCount": 1,- "serviceParams": [- "client",- "table",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "table": {- "type": "string"- }- },- "required": [- "table"- ]- }- },- {- "name": "settings_getCustomFieldsTables",- "module": "settings",- "classification": "READ",- "description": "get custom fields tables",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "settings_getIntegration",- "module": "settings",- "classification": "READ",- "description": "get integration",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "settings_getIntegrations",- "module": "settings",- "classification": "READ",- "description": "get integrations",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getKanbanOutputSetting",- "module": "settings",- "classification": "READ",- "description": "get kanban output setting",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getNextSequence",- "module": "settings",- "classification": "READ",- "description": "get next sequence",- "paramCount": 1,- "serviceParams": [- "client",- "table",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "table": {- "type": "string"- }- },- "required": [- "table"- ]- }- },- {- "name": "settings_getPlanById",- "module": "settings",- "classification": "READ",- "description": "get plan by id",- "paramCount": 1,- "serviceParams": [- "client",- "planId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "planId": {- "type": "string"- }- },- "required": [- "planId"- ]- }- },- {- "name": "settings_getPlans",- "module": "settings",- "classification": "READ",- "description": "get plans",- "paramCount": 0,- "serviceParams": [- "client"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getSequence",- "module": "settings",- "classification": "READ",- "description": "get sequence",- "paramCount": 1,- "serviceParams": [- "client",- "table",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "table": {- "type": "string"- }- },- "required": [- "table"- ]- }- },- {- "name": "settings_getSequences",- "module": "settings",- "classification": "READ",- "description": "get sequences",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "settings_getSequencesList",- "module": "settings",- "classification": "READ",- "description": "get sequences list",- "paramCount": 1,- "serviceParams": [- "client",- "table",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "table": {- "type": "string"- }- },- "required": [- "table"- ]- }- },- {- "name": "settings_getItemSerialSequences",- "module": "settings",- "classification": "READ",- "description": "get item serial sequences",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "settings_getItemSerialSequence",- "module": "settings",- "classification": "READ",- "description": "get item serial sequence",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "settings_getItemSerialSequenceByItemId",- "module": "settings",- "classification": "READ",- "description": "get item serial sequence by item id",- "paramCount": 1,- "serviceParams": [- "client",- "itemId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "settings_upsertItemSerialSequence",- "module": "settings",- "classification": "WRITE",- "description": "upsert item serial sequence",- "paramCount": 7,- "serviceParams": [- "client",- "itemSerialSequence"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "itemId": {- "type": "string"- },- "prefix": {- "type": "string"- },- "suffix": {- "type": "string"- },- "next": {- "type": "number"- },- "step": {- "type": "number"- },- "size": {- "type": "number"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "itemId",- "_operation"- ]- }- },- {- "name": "settings_deleteItemSerialSequence",- "module": "settings",- "classification": "DESTRUCTIVE",- "description": "delete item serial sequence",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "settings_getSubsidiaries",- "module": "settings",- "classification": "READ",- "description": "get subsidiaries",- "paramCount": 0,- "serviceParams": [- "client",- "companyGroupId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getSubsidiary",- "module": "settings",- "classification": "READ",- "description": "get subsidiary",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getTerms",- "module": "settings",- "classification": "READ",- "description": "get terms",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getDocumentTemplate",- "module": "settings",- "classification": "READ",- "description": "get document template",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "documentType"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "documentType": {}- },- "required": [- "documentType"- ]- }- },- {- "name": "settings_getDocumentTemplateConfig",- "module": "settings",- "classification": "READ",- "description": "get document template config",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "documentType"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "documentType": {}- },- "required": [- "documentType"- ]- }- },- {- "name": "settings_upsertDocumentTemplate",- "module": "settings",- "classification": "WRITE",- "description": "upsert document template",- "paramCount": 6,- "serviceParams": [- "client",- "documentTemplate"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "documentType": {},- "blocks": {- "type": "array",- "items": {}- },- "theme": {},- "settings": {},- "headerSectionId": {- "type": [- "string",- "null"- ]- },- "footerSectionId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "documentType",- "blocks",- "theme",- "settings",- "headerSectionId",- "footerSectionId"- ]- }- },- {- "name": "settings_getDocumentSections",- "module": "settings",- "classification": "READ",- "description": "get document sections",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_getDocumentSection",- "module": "settings",- "classification": "READ",- "description": "get document section",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "settings_getDocumentSectionsByIds",- "module": "settings",- "classification": "READ",- "description": "get document sections by ids",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "ids"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "ids": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "ids"- ]- }- },- {- "name": "settings_upsertDocumentSection",- "module": "settings",- "classification": "WRITE",- "description": "upsert document section",- "paramCount": 6,- "serviceParams": [- "client",- "documentSection"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "placement": {},- "content": {},- "config": {},- "} & ({ createdBy": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "name",- "placement",- "content",- "} & ({ createdBy",- "_operation"- ]- }- },- {- "name": "settings_deleteDocumentSection",- "module": "settings",- "classification": "DESTRUCTIVE",- "description": "delete document section",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "settings_resolveSections",- "module": "settings",- "classification": "WRITE",- "description": "resolve sections",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "ids"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "ids": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "ids"- ]- }- },- {- "name": "settings_getWebhook",- "module": "settings",- "classification": "READ",- "description": "get webhook",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "settings_getWebhooks",- "module": "settings",- "classification": "READ",- "description": "get webhooks",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "settings_getWebhookTables",- "module": "settings",- "classification": "READ",- "description": "get webhook tables",- "paramCount": 0,- "serviceParams": [- "client"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "settings_insertSubsidiary",- "module": "settings",- "classification": "WRITE",- "description": "insert subsidiary",- "paramCount": 2,- "serviceParams": [- "client",- "subsidiary"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "parentCompanyId": {- "type": "string"- }- }- }- },- {- "name": "settings_updateSubsidiary",- "module": "settings",- "classification": "WRITE",- "description": "update subsidiary",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "subsidiary"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "subsidiary": {}- },- "required": [- "id",- "subsidiary"- ]- }- },- {- "name": "settings_updateCompanyPlan",- "module": "settings",- "classification": "WRITE",- "description": "update company plan",- "paramCount": 4,- "serviceParams": [- "client",- "data"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "stripeCustomerId": {- "type": "string"- },- "stripeSubscriptionId": {- "type": "string"- },- "stripeSubscriptionStatus": {- "type": "string"- },- "subscriptionStartDate": {- "type": "string"- }- },- "required": [- "stripeCustomerId",- "stripeSubscriptionId",- "stripeSubscriptionStatus",- "subscriptionStartDate"- ]- }- },- {- "name": "settings_updateDefaultCustomerCc",- "module": "settings",- "classification": "WRITE",- "description": "update default customer cc",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "defaultCustomerCc"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "defaultCustomerCc": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "defaultCustomerCc"- ]- }- },- {- "name": "settings_updateCompany",- "module": "settings",- "classification": "WRITE",- "description": "update company",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "company"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "company": {}- },- "required": [- "company"- ]- }- },- {- "name": "settings_updateCompanyWithBaseCurrencyChange",- "module": "settings",- "classification": "DESTRUCTIVE",- "description": "update company with base currency change",- "paramCount": 1,- "serviceParams": [- "db",- "companyId",- "company"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "company": {}- },- "required": [- "company"- ]- }- },- {- "name": "settings_updateShelfLifeSettings",- "module": "settings",- "classification": "WRITE",- "description": "update shelf life settings",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "settings"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "/** undefined disables expiry badges company-wide. */\n nearExpiryWarningDays": {},- "/** Seed for the \"Shelf-life (days)\" input on new items. */\n defaultShelfLifeDays": {- "type": "number"- },- "/** MIN expiry scope for Calculated-mode finished products. */\n calculatedInputScope": {- "type": "string",- "enum": [- "AllInputs",- "ManagedInputsOnly"- ]- },- "/** Policy enforced when an operator consumes an expired entity. */\n expiredEntityPolicy": {- "type": "string",- "enum": [- "Warn",- "Block",- "BlockWithOverride"- ]- }- },- "required": [- "/** undefined disables expiry badges company-wide. */\n nearExpiryWarningDays",- "/** Seed for the \"Shelf-life (days)\" input on new items. */\n defaultShelfLifeDays",- "/** MIN expiry scope for Calculated-mode finished products. */\n calculatedInputScope",- "/** Policy enforced when an operator consumes an expired entity. */\n expiredEntityPolicy"- ]- }- },- {- "name": "settings_updateDigitalQuoteSetting",- "module": "settings",- "classification": "WRITE",- "description": "update digital quote setting",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "digitalQuoteEnabled",- "digitalQuoteNotificationGroup",- "digitalQuoteIncludesPurchaseOrders"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "digitalQuoteEnabled": {- "type": "boolean"- },- "digitalQuoteNotificationGroup": {- "type": "array",- "items": {- "type": "string"- }- },- "digitalQuoteIncludesPurchaseOrders": {- "type": "boolean"- }- },- "required": [- "digitalQuoteEnabled",- "digitalQuoteNotificationGroup",- "digitalQuoteIncludesPurchaseOrders"- ]- }- },- {- "name": "settings_updateAccountingEnabledSetting",- "module": "settings",- "classification": "WRITE",- "description": "update accounting enabled setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "accountingEnabled"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "accountingEnabled": {- "type": "boolean"- }- },- "required": [- "accountingEnabled"- ]- }- },- {- "name": "settings_updateAssetTaxDepreciationSettings",- "module": "settings",- "classification": "WRITE",- "description": "update asset tax depreciation settings",- "paramCount": 2,- "serviceParams": [- "client",- "companyId",- "settings"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "assetTaxDepreciationEnabled": {- "type": "boolean"- },- "assetTaxRate": {- "type": [- "number",- "null"- ]- }- },- "required": [- "assetTaxDepreciationEnabled",- "assetTaxRate"- ]- }- },- {- "name": "settings_updateTimeCardSetting",- "module": "settings",- "classification": "WRITE",- "description": "update time card setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "timeCardEnabled"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "timeCardEnabled": {- "type": "boolean"- }- },- "required": [- "timeCardEnabled"- ]- }- },- {- "name": "settings_updateKanbanOutputSetting",- "module": "settings",- "classification": "WRITE",- "description": "update kanban output setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "kanbanOutput"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "kanbanOutput": {- "type": "string"- }- },- "required": [- "kanbanOutput"- ]- }- },- {- "name": "settings_updateLogoDark",- "module": "settings",- "classification": "WRITE",- "description": "update logo dark",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "logoDark"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "logoDark": {- "type": [- "string",- "null"- ]- }- },- "required": [- "logoDark"- ]- }- },- {- "name": "settings_updateLogoDarkIcon",- "module": "settings",- "classification": "WRITE",- "description": "update logo dark icon",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "logoDarkIcon"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "logoDarkIcon": {- "type": [- "string",- "null"- ]- }- },- "required": [- "logoDarkIcon"- ]- }- },- {- "name": "settings_updateLogoLight",- "module": "settings",- "classification": "WRITE",- "description": "update logo light",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "logoLight"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "logoLight": {- "type": [- "string",- "null"- ]- }- },- "required": [- "logoLight"- ]- }- },- {- "name": "settings_updateLogoLightIcon",- "module": "settings",- "classification": "WRITE",- "description": "update logo light icon",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "logoLightIcon"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "logoLightIcon": {- "type": [- "string",- "null"- ]- }- },- "required": [- "logoLightIcon"- ]- }- },- {- "name": "settings_updateLogoWatermark",- "module": "settings",- "classification": "WRITE",- "description": "update logo watermark",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "logoWatermark"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "logoWatermark": {- "type": [- "string",- "null"- ]- }- },- "required": [- "logoWatermark"- ]- }- },- {- "name": "settings_updateMaintenanceDispatchNotificationSettings",- "module": "settings",- "classification": "WRITE",- "description": "update maintenance dispatch notification settings",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "settings"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "maintenanceDispatchNotificationGroup": {- "type": "array",- "items": {- "type": "string"- }- },- "qualityDispatchNotificationGroup": {- "type": "array",- "items": {- "type": "string"- }- },- "operationsDispatchNotificationGroup": {- "type": "array",- "items": {- "type": "string"- }- },- "otherDispatchNotificationGroup": {- "type": "array",- "items": {- "type": "string"- }- }- }- }- },- {- "name": "settings_updateMaterialGeneratedIdsSetting",- "module": "settings",- "classification": "WRITE",- "description": "update material generated ids setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "materialGeneratedIds"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "materialGeneratedIds": {- "type": "boolean"- }- },- "required": [- "materialGeneratedIds"- ]- }- },- {- "name": "settings_updateMetricSettings",- "module": "settings",- "classification": "WRITE",- "description": "update metric settings",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "useMetric"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "useMetric": {- "type": "boolean"- }- },- "required": [- "useMetric"- ]- }- },- {- "name": "settings_updateAllowLowercaseItemIdsSetting",- "module": "settings",- "classification": "WRITE",- "description": "update allow lowercase item ids setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "allowLowercaseItemIds"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "allowLowercaseItemIds": {- "type": "boolean"- }- },- "required": [- "allowLowercaseItemIds"- ]- }- },- {- "name": "settings_updatePlmReleaseControlSetting",- "module": "settings",- "classification": "WRITE",- "description": "update plm release control setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "plmReleaseControl"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "plmReleaseControl": {- "type": "string"- }- },- "required": [- "plmReleaseControl"- ]- }- },- {- "name": "settings_updateProductLabelSize",- "module": "settings",- "classification": "WRITE",- "description": "update product label size",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "productLabelSize"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "productLabelSize": {- "type": "string"- }- },- "required": [- "productLabelSize"- ]- }- },- {- "name": "settings_updatePurchasePriceUpdateTimingSetting",- "module": "settings",- "classification": "WRITE",- "description": "update purchase price update timing setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "purchasePriceUpdateTiming"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "purchasePriceUpdateTiming": {- "type": "string"- }- },- "required": [- "purchasePriceUpdateTiming"- ]- }- },- {- "name": "settings_updateLeadTimesOnReceiptSetting",- "module": "settings",- "classification": "WRITE",- "description": "update lead times on receipt setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "updateLeadTimesOnReceipt"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updateLeadTimesOnReceipt": {- "type": "boolean"- }- },- "required": [- "updateLeadTimesOnReceipt"- ]- }- },- {- "name": "settings_updateIncludeMaterialsOnTravelerSetting",- "module": "settings",- "classification": "WRITE",- "description": "update include materials on traveler setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "includeMaterialsOnTraveler"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "includeMaterialsOnTraveler": {- "type": "boolean"- }- },- "required": [- "includeMaterialsOnTraveler"- ]- }- },- {- "name": "settings_updateAccountsPayableAddressSetting",- "module": "settings",- "classification": "WRITE",- "description": "update accounts payable address setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "accountsPayableAddress"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "accountsPayableAddress": {- "type": "boolean"- }- },- "required": [- "accountsPayableAddress"- ]- }- },- {- "name": "settings_updateAccountsReceivableAddressSetting",- "module": "settings",- "classification": "WRITE",- "description": "update accounts receivable address setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "accountsReceivableAddress"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "accountsReceivableAddress": {- "type": "boolean"- }- },- "required": [- "accountsReceivableAddress"- ]- }- },- {- "name": "settings_updateAccountsPayableEmail",- "module": "settings",- "classification": "WRITE",- "description": "update accounts payable email",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "accountsPayableEmail"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "accountsPayableEmail": {}- },- "required": [- "accountsPayableEmail"- ]- }- },- {- "name": "settings_updateAccountsReceivableEmail",- "module": "settings",- "classification": "WRITE",- "description": "update accounts receivable email",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "accountsReceivableEmail"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "accountsReceivableEmail": {}- },- "required": [- "accountsReceivableEmail"- ]- }- },- {- "name": "settings_updateQuoteLineCategoryMarkups",- "module": "settings",- "classification": "WRITE",- "description": "update quote line category markups",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "quoteLineCategoryMarkups"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "quoteLineCategoryMarkups": {}- },- "required": [- "quoteLineCategoryMarkups"- ]- }- },- {- "name": "settings_updateRfqReadySetting",- "module": "settings",- "classification": "WRITE",- "description": "update rfq ready setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "rfqReadyNotificationGroup"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "rfqReadyNotificationGroup": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "rfqReadyNotificationGroup"- ]- }- },- {- "name": "settings_updateSequence",- "module": "settings",- "classification": "WRITE",- "description": "update sequence",- "paramCount": 2,- "serviceParams": [- "client",- "table",- "companyId",- "sequence"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "table": {- "type": "string"- },- "sequence": {}- },- "required": [- "table",- "sequence"- ]- }- },- {- "name": "settings_updateSuggestionNotificationSetting",- "module": "settings",- "classification": "WRITE",- "description": "update suggestion notification setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "suggestionNotificationGroup"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "suggestionNotificationGroup": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "suggestionNotificationGroup"- ]- }- },- {- "name": "settings_updateSupplierQuoteNotificationSetting",- "module": "settings",- "classification": "WRITE",- "description": "update supplier quote notification setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "supplierQuoteNotificationGroup"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "supplierQuoteNotificationGroup": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "supplierQuoteNotificationGroup"- ]- }- },- {- "name": "settings_upsertApiKey",- "module": "settings",- "classification": "WRITE",- "description": "upsert api key",- "paramCount": 50,- "serviceParams": [- "client",- "apiKey"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "domain": {- "type": "string"- },- "next": {- "type": "string"- },- "industryId": {- "type": "string"- },- "customIndustryDescription": {- "type": "string"- },- "digitalQuoteEnabled": {- "type": "string"- },- "digitalQuoteNotificationGroup": {- "type": "string"- },- "digitalQuoteIncludesPurchaseOrders": {- "type": "string"- },- "inventoryJobCompletedNotificationGroup": {- "type": "array",- "items": {- "type": "string"- }- },- "salesJobCompletedNotificationGroup": {- "type": "array",- "items": {- "type": "string"- }- },- "kanbanOutput": {- "type": "string"- },- "plmReleaseControl": {- "type": "string"- },- "purchasePriceUpdateTiming": {- "type": "string"- },- "incompletePickingListPolicy": {- "type": "string"- },- "returnPickedMaterialTiming": {- "type": "string"- },- "updateLeadTimesOnReceipt": {- "type": "string"- },- "materialGeneratedIds": {- "type": "string"- },- "useMetric": {- "type": "string"- },- "productLabelSize": {- "type": "string"- },- "rfqReadyNotificationGroup": {- "type": "string"- },- "suggestionNotificationGroup": {- "type": "string"- },- "maintenanceDispatchNotificationGroup": {- "type": "string"- },- "qualityDispatchNotificationGroup": {- "type": "string"- },- "operationsDispatchNotificationGroup": {- "type": "string"- },- "otherDispatchNotificationGroup": {- "type": "string"- },- "supplierQuoteNotificationGroup": {- "type": "string"- },- "accountsPayableEmail": {- "type": "string"- },- "defaultSupplierCc": {- "type": "array",- "items": {- "type": "string"- }- },- "accountsReceivableEmail": {- "type": "string"- },- "defaultCustomerCc": {- "type": "array",- "items": {- "type": "string"- }- },- "id": {- "type": "string"- },- "parentCompanyId": {- "type": "string"- },- "table": {- "type": "string"- },- "prefix": {- "type": "string"- },- "suffix": {- "type": "string"- },- "step": {- "type": "number"- },- "size": {- "type": "number"- },- "itemId": {- "type": "string"- },- "theme": {- "type": "string"- },- "consoleEnabled": {- "type": "string"- },- "intent": {- "type": "string"- },- "ids": {- "type": "string"- },- "to": {- "type": "string",- "enum": [- "Pending",- "Skipped"- ]- },- "accountId": {- "type": "string"- },- "externalId": {- "type": "string"- },- "externalCode": {- "type": "string"- },- "externalName": {- "type": "string"- },- "mappings": {- "type": "string"- },- "name": {- "type": "string"- },- "scopes": {- "type": "string"- },- "expiresAt": {- "type": "string"- },- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "domain",- "next",- "digitalQuoteEnabled",- "digitalQuoteIncludesPurchaseOrders",- "kanbanOutput",- "plmReleaseControl",- "purchasePriceUpdateTiming",- "updateLeadTimesOnReceipt",- "materialGeneratedIds",- "useMetric",- "productLabelSize",- "table",- "itemId",- "theme",- "consoleEnabled",- "intent",- "ids",- "to",- "accountId",- "externalId",- "mappings",- "name",- "_operation"- ]- }- },- {- "name": "settings_updateConsoleSetting",- "module": "settings",- "classification": "WRITE",- "description": "update console setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "consoleEnabled",- "userId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "consoleEnabled": {- "type": "boolean"- }- },- "required": [- "consoleEnabled"- ]- }- },- {- "name": "settings_updateDefaultSupplierCc",- "module": "settings",- "classification": "WRITE",- "description": "update default supplier cc",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "defaultSupplierCc"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "defaultSupplierCc": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "defaultSupplierCc"- ]- }- },- {- "name": "settings_updateRequireMfaSetting",- "module": "settings",- "classification": "WRITE",- "description": "update require mfa setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "requireMfa"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "requireMfa": {- "type": "boolean"- }- },- "required": [- "requireMfa"- ]- }- },- {- "name": "settings_updateShowCurrencyTrailingZerosSetting",- "module": "settings",- "classification": "WRITE",- "description": "update show currency trailing zeros setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "showCurrencyTrailingZeros"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "showCurrencyTrailingZeros": {- "type": "boolean"- }- },- "required": [- "showCurrencyTrailingZeros"- ]- }- },- {- "name": "settings_updateShowSupplierReadableIdSetting",- "module": "settings",- "classification": "WRITE",- "description": "update show supplier readable id setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "showSupplierReadableId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "showSupplierReadableId": {- "type": "boolean"- }- },- "required": [- "showSupplierReadableId"- ]- }- },- {- "name": "settings_updateShowCustomerReadableIdSetting",- "module": "settings",- "classification": "WRITE",- "description": "update show customer readable id setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "showCustomerReadableId"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "showCustomerReadableId": {- "type": "boolean"- }- },- "required": [- "showCustomerReadableId"- ]- }- },- {- "name": "settings_updateAutoSelectMaterialWithoutPickingListSetting",- "module": "settings",- "classification": "WRITE",- "description": "update auto select material without picking list setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "autoSelectMaterialWithoutPickingList"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "autoSelectMaterialWithoutPickingList": {- "type": "boolean"- }- },- "required": [- "autoSelectMaterialWithoutPickingList"- ]- }- },- {- "name": "settings_updateIncompletePickingListPolicySetting",- "module": "settings",- "classification": "WRITE",- "description": "update incomplete picking list policy setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "incompletePickingListPolicy"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "incompletePickingListPolicy": {- "type": "string",- "enum": [- "warn",- "error"- ]- }- },- "required": [- "incompletePickingListPolicy"- ]- }- },- {- "name": "settings_updateReturnPickedMaterialTimingSetting",- "module": "settings",- "classification": "WRITE",- "description": "update return picked material timing setting",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "returnPickedMaterialTiming"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "returnPickedMaterialTiming": {- "type": "string",- "enum": [- "job",- "operation"- ]- }- },- "required": [- "returnPickedMaterialTiming"- ]- }- },- {- "name": "settings_upsertWebhook",- "module": "settings",- "classification": "WRITE",- "description": "upsert webhook",- "paramCount": 1,- "serviceParams": [- "client",- "webhook"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "webhook": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "webhook",- "_operation"- ]- }- },- {- "name": "shared_approveRequest",- "module": "shared",- "classification": "WRITE",- "description": "approve request",- "paramCount": 2,- "serviceParams": [- "db",- "id",- "userId",- "notes"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "notes": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "shared_canApproveRequest",- "module": "shared",- "classification": "WRITE",- "description": "can approve request",- "paramCount": 1,- "serviceParams": [- "client",- "approvalRequest",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "approvalRequest": {}- },- "required": [- "approvalRequest"- ]- }- },- {- "name": "shared_canApproveRequestInWindow",- "module": "shared",- "classification": "WRITE",- "description": "can approve request in window",- "paramCount": 1,- "serviceParams": [- "client",- "approvalRequest",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "approvalRequest": {}- },- "required": [- "approvalRequest"- ]- }- },- {- "name": "shared_canCancelRequest",- "module": "shared",- "classification": "WRITE",- "description": "can cancel request",- "paramCount": 1,- "serviceParams": [- "approvalRequest",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "approvalRequest": {}- },- "required": [- "approvalRequest"- ]- }- },- {- "name": "shared_cancelApprovalRequest",- "module": "shared",- "classification": "WRITE",- "description": "cancel approval request",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "shared_canViewApprovalRequest",- "module": "shared",- "classification": "WRITE",- "description": "can view approval request",- "paramCount": 1,- "serviceParams": [- "client",- "approvalRequest",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "approvalRequest": {}- },- "required": [- "approvalRequest"- ]- }- },- {- "name": "shared_createApprovalRequest",- "module": "shared",- "classification": "WRITE",- "description": "create approval request",- "paramCount": 1,- "serviceParams": [- "client",- "request"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "request": {}- },- "required": [- "request"- ]- }- },- {- "name": "shared_deleteApprovalRule",- "module": "shared",- "classification": "DESTRUCTIVE",- "description": "delete approval rule",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "shared_deleteNote",- "module": "shared",- "classification": "DESTRUCTIVE",- "description": "delete note",- "paramCount": 1,- "serviceParams": [- "client",- "noteId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "noteId": {- "type": "string"- }- },- "required": [- "noteId"- ]- }- },- {- "name": "shared_deleteSavedView",- "module": "shared",- "classification": "DESTRUCTIVE",- "description": "delete saved view",- "paramCount": 1,- "serviceParams": [- "client",- "viewId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "viewId": {- "type": "string"- }- },- "required": [- "viewId"- ]- }- },- {- "name": "shared_generateEmbedding",- "module": "shared",- "classification": "WRITE",- "description": "generate embedding",- "paramCount": 1,- "serviceParams": [- "client",- "text"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "text": {- "type": "string"- }- },- "required": [- "text"- ]- }- },- {- "name": "shared_getApprovalById",- "module": "shared",- "classification": "READ",- "description": "get approval by id",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "shared_getApprovalRequestsByDocument",- "module": "shared",- "classification": "READ",- "description": "get approval requests by document",- "paramCount": 2,- "serviceParams": [- "client",- "documentType",- "documentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "documentType": {- "type": "string"- },- "documentId": {- "type": "string"- }- },- "required": [- "documentType",- "documentId"- ]- }- },- {- "name": "shared_getApprovalRuleByAmount",- "module": "shared",- "classification": "READ",- "description": "get approval rule by amount",- "paramCount": 2,- "serviceParams": [- "client",- "documentType",- "companyId",- "amount"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "documentType": {- "type": "string"- },- "amount": {- "type": "number"- }- },- "required": [- "documentType"- ]- }- },- {- "name": "shared_getApproverUserIdsForRule",- "module": "shared",- "classification": "READ",- "description": "get approver user ids for rule",- "paramCount": 1,- "serviceParams": [- "client",- "rule"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "rule": {}- },- "required": [- "rule"- ]- }- },- {- "name": "shared_getLowerTierApproverUserIds",- "module": "shared",- "classification": "READ",- "description": "get lower tier approver user ids",- "paramCount": 2,- "serviceParams": [- "client",- "documentType",- "companyId",- "amount"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "documentType": {- "type": "string"- },- "amount": {}- },- "required": [- "documentType",- "amount"- ]- }- },- {- "name": "shared_getApprovalRuleById",- "module": "shared",- "classification": "READ",- "description": "get approval rule by id",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "shared_getApprovalRules",- "module": "shared",- "classification": "READ",- "description": "get approval rules",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "shared_getApprovalRulesForApprover",- "module": "shared",- "classification": "READ",- "description": "get approval rules for approver",- "paramCount": 1,- "serviceParams": [- "client",- "documentType",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "documentType": {- "type": "string"- }- },- "required": [- "documentType"- ]- }- },- {- "name": "shared_getApprovalsForUser",- "module": "shared",- "classification": "READ",- "description": "get approvals for user",- "paramCount": 2,- "serviceParams": [- "client",- "userId",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- }- }- }- }- }- },- {- "name": "shared_getBase64ImageFromSupabase",- "module": "shared",- "classification": "READ",- "description": "get base64 image from supabase",- "paramCount": 1,- "serviceParams": [- "client",- "path"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "path": {- "type": "string"- }- },- "required": [- "path"- ]- }- },- {- "name": "shared_getCountries",- "module": "shared",- "classification": "READ",- "description": "get countries",- "paramCount": 0,- "serviceParams": [- "client"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "shared_getTimezoneNames",- "module": "shared",- "classification": "READ",- "description": "get timezone names",- "paramCount": 0,- "serviceParams": [- "client"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "shared_getLatestApprovalRequestForDocument",- "module": "shared",- "classification": "READ",- "description": "get latest approval request for document",- "paramCount": 2,- "serviceParams": [- "client",- "documentType",- "documentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "documentType": {- "type": "string"- },- "documentId": {- "type": "string"- }- },- "required": [- "documentType",- "documentId"- ]- }- },- {- "name": "shared_getDocumentType",- "module": "shared",- "classification": "READ",- "description": "get document type",- "paramCount": 1,- "serviceParams": [- "fileName"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "fileName": {- "type": "string"- }- },- "required": [- "fileName"- ]- }- },- {- "name": "shared_getModelByItemId",- "module": "shared",- "classification": "READ",- "description": "get model by item id",- "paramCount": 1,- "serviceParams": [- "client",- "itemId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- }- },- "required": [- "itemId"- ]- }- },- {- "name": "shared_getNotes",- "module": "shared",- "classification": "READ",- "description": "get notes",- "paramCount": 1,- "serviceParams": [- "client",- "documentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "documentId": {- "type": "string"- }- },- "required": [- "documentId"- ]- }- },- {- "name": "shared_getPendingApprovalsForApprover",- "module": "shared",- "classification": "READ",- "description": "get pending approvals for approver",- "paramCount": 0,- "serviceParams": [- "client",- "userId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "shared_getPeriods",- "module": "shared",- "classification": "READ",- "description": "get periods",- "paramCount": 2,- "serviceParams": [- "client",- "{ startDate, endDate }"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "startDate": {- "type": "string"- },- "endDate": {- "type": "string"- }- },- "required": [- "startDate",- "endDate"- ]- }- },- {- "name": "shared_getSavedViews",- "module": "shared",- "classification": "READ",- "description": "get saved views",- "paramCount": 0,- "serviceParams": [- "client",- "userId",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "shared_getTagsList",- "module": "shared",- "classification": "READ",- "description": "get tags list",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "table"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "table": {- "type": [- "string",- "null"- ]- }- }- }- },- {- "name": "shared_hasPendingApproval",- "module": "shared",- "classification": "READ",- "description": "has pending approval",- "paramCount": 2,- "serviceParams": [- "client",- "documentType",- "documentId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "documentType": {- "type": "string"- },- "documentId": {- "type": "string"- }- },- "required": [- "documentType",- "documentId"- ]- }- },- {- "name": "shared_importCsv",- "module": "shared",- "classification": "WRITE",- "description": "import csv",- "paramCount": 4,- "serviceParams": [- "client",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "table": {- "type": "string"- },- "filePath": {- "type": "string"- },- "columnMappings": {},- "enumMappings": {}- },- "required": [- "table",- "filePath",- "columnMappings"- ]- }- },- {- "name": "shared_insertNote",- "module": "shared",- "classification": "WRITE",- "description": "insert note",- "paramCount": 2,- "serviceParams": [- "client",- "note"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "note": {- "type": "string"- },- "documentId": {- "type": "string"- }- },- "required": [- "note",- "documentId"- ]- }- },- {- "name": "shared_insertTag",- "module": "shared",- "classification": "WRITE",- "description": "insert tag",- "paramCount": 1,- "serviceParams": [- "client",- "tag"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "tag": {}- },- "required": [- "tag"- ]- }- },- {- "name": "shared_isApprovalRequired",- "module": "shared",- "classification": "READ",- "description": "is approval required",- "paramCount": 2,- "serviceParams": [- "client",- "documentType",- "companyId",- "amount"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "documentType": {- "type": "string"- },- "amount": {- "type": "number"- }- },- "required": [- "documentType"- ]- }- },- {- "name": "shared_getExternalLink",- "module": "shared",- "classification": "READ",- "description": "get external link",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "shared_upsertExternalLink",- "module": "shared",- "classification": "WRITE",- "description": "upsert external link",- "paramCount": 1,- "serviceParams": [- "client",- "externalLink"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "externalLink": {}- },- "required": [- "externalLink"- ]- }- },- {- "name": "shared_getCustomerPortals",- "module": "shared",- "classification": "READ",- "description": "get customer portals",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "shared_getCustomerPortal",- "module": "shared",- "classification": "READ",- "description": "get customer portal",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "shared_deleteCustomerPortal",- "module": "shared",- "classification": "DESTRUCTIVE",- "description": "delete customer portal",- "paramCount": 1,- "serviceParams": [- "client",- "id"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "shared_updateModelThumbnail",- "module": "shared",- "classification": "WRITE",- "description": "update model thumbnail",- "paramCount": 2,- "serviceParams": [- "client",- "modelId",- "thumbnailPath"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "modelId": {- "type": "string"- },- "thumbnailPath": {- "type": "string"- }- },- "required": [- "modelId",- "thumbnailPath"- ]- }- },- {- "name": "shared_upsertModelUpload",- "module": "shared",- "classification": "WRITE",- "description": "upsert model upload",- "paramCount": 1,- "serviceParams": [- "client",- "upload"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "upload": {},- "_operation": {- "type": "string",- "enum": [- "create",- "update"- ],- "description": "Required. 'create' inserts a new record, 'update' modifies the existing record with this id."- }- },- "required": [- "upload",- "_operation"- ]- }- },- {- "name": "shared_updateNote",- "module": "shared",- "classification": "WRITE",- "description": "update note",- "paramCount": 2,- "serviceParams": [- "client",- "id",- "note"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "note": {- "type": "string"- }- },- "required": [- "id",- "note"- ]- }- },- {- "name": "shared_rejectRequest",- "module": "shared",- "classification": "WRITE",- "description": "reject request",- "paramCount": 2,- "serviceParams": [- "db",- "id",- "userId",- "notes"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "notes": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "shared_upsertApprovalRule",- "module": "shared",- "classification": "WRITE",- "description": "upsert approval rule",- "paramCount": 1,- "serviceParams": [- "client",- "rule"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "rule": {}- },- "required": [- "rule"- ]- }- },- {- "name": "shared_upsertSavedView",- "module": "shared",- "classification": "WRITE",- "description": "upsert saved view",- "paramCount": 10,- "serviceParams": [- "client",- "view"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- },- "description": {- "type": "string"- },- "table": {- "type": "string"- },- "type": {- "type": "string",- "enum": [- "Public",- "Private"- ]- },- "filters": {- "type": "array",- "items": {- "type": "string"- }- },- "sorts": {- "type": "array",- "items": {- "type": "string"- }- },- "columnPinning": {},- "columnVisibility": {},- "columnOrder": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "name",- "table",- "type"- ]- }- },- {- "name": "shared_updateSavedViewOrder",- "module": "shared",- "classification": "WRITE",- "description": "update saved view order",- "paramCount": 1,- "serviceParams": [- "client",- "updates"- ],- "injectAuth": [- "companyId",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "updates": {- "type": "array",- "items": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "sortOrder": {- "type": "number"- }- },- "required": [- "id",- "sortOrder"- ]- }- }- },- "required": [- "updates"- ]- }- },- {- "name": "shared_lookupPriceFromBreaks",- "module": "shared",- "classification": "WRITE",- "description": "lookup price from breaks",- "paramCount": 3,- "serviceParams": [- "priceBreaks",- "requestedQty",- "fallbackPrice"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "priceBreaks": {- "type": "array",- "items": {}- },- "requestedQty": {- "type": "number"- },- "fallbackPrice": {- "type": "number"- }- },- "required": [- "priceBreaks",- "requestedQty",- "fallbackPrice"- ]- }- },- {- "name": "shared_lookupBuyPriceFromMap",- "module": "shared",- "classification": "WRITE",- "description": "lookup buy price from map",- "paramCount": 4,- "serviceParams": [- "itemId",- "requestedQty",- "priceMap",- "fallbackCost"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "requestedQty": {- "type": "number"- },- "priceMap": {},- "fallbackCost": {- "type": "number"- }- },- "required": [- "itemId",- "requestedQty",- "priceMap",- "fallbackCost"- ]- }- },- {- "name": "shared_resolveBuyUnitCost",- "module": "shared",- "classification": "WRITE",- "description": "resolve buy unit cost",- "paramCount": 3,- "serviceParams": [- "material",- "requestedQty",- "priceMap"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "material": {- "type": "object",- "properties": {- "itemId": {- "type": "string"- },- "unitCost": {- "type": "number"- },- "unitCostSource": {- "type": [- "string",- "null"- ]- }- },- "required": [- "itemId",- "unitCost"- ]- },- "requestedQty": {- "type": "number"- },- "priceMap": {}- },- "required": [- "material",- "requestedQty",- "priceMap"- ]- }- },- {- "name": "shared_resolveSupplierPrice",- "module": "shared",- "classification": "WRITE",- "description": "resolve supplier price",- "paramCount": 4,- "serviceParams": [- "priceBreaks",- "quantity",- "fallbackUnitPrice",- "exchangeRate"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "priceBreaks": {- "type": "array",- "items": {}- },- "quantity": {- "type": "number"- },- "fallbackUnitPrice": {- "type": "number"- },- "exchangeRate": {- "type": "number"- }- },- "required": [- "priceBreaks",- "quantity",- "fallbackUnitPrice",- "exchangeRate"- ]- }- },- {- "name": "users_getItarCertificationStatus",- "module": "users",- "classification": "READ",- "description": "get itar certification status",- "paramCount": 0,- "serviceParams": [- "client",- "companyId",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "users_getItarEntityCertification",- "module": "users",- "classification": "READ",- "description": "get itar entity certification",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "users_getItarCertificationReport",- "module": "users",- "classification": "READ",- "description": "get itar certification report",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "users_deleteEmployeeType",- "module": "users",- "classification": "DESTRUCTIVE",- "description": "delete employee type",- "paramCount": 1,- "serviceParams": [- "client",- "employeeTypeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeTypeId": {- "type": "string"- }- },- "required": [- "employeeTypeId"- ]- }- },- {- "name": "users_deleteGroup",- "module": "users",- "classification": "DESTRUCTIVE",- "description": "delete group",- "paramCount": 1,- "serviceParams": [- "client",- "groupId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "groupId": {- "type": "string"- }- },- "required": [- "groupId"- ]- }- },- {- "name": "users_getCompaniesForUser",- "module": "users",- "classification": "READ",- "description": "get companies for user",- "paramCount": 0,- "serviceParams": [- "client",- "userId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "users_getCustomers",- "module": "users",- "classification": "READ",- "description": "get customers",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "users_getEmployee",- "module": "users",- "classification": "READ",- "description": "get employee",- "paramCount": 1,- "serviceParams": [- "client",- "id",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- }- },- "required": [- "id"- ]- }- },- {- "name": "users_getUnrevokedInviteEmails",- "module": "users",- "classification": "READ",- "description": "get unrevoked invite emails",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "users_getUsersWithVerifiedMfa",- "module": "users",- "classification": "READ",- "description": "get users with verified mfa",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "users_getEmployees",- "module": "users",- "classification": "READ",- "description": "get employees",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "users_getConsoleOperators",- "module": "users",- "classification": "READ",- "description": "get console operators",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "users_getEmployeeType",- "module": "users",- "classification": "READ",- "description": "get employee type",- "paramCount": 1,- "serviceParams": [- "client",- "employeeTypeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeTypeId": {- "type": "string"- }- },- "required": [- "employeeTypeId"- ]- }- },- {- "name": "users_getEmployeeTypes",- "module": "users",- "classification": "READ",- "description": "get employee types",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "users_getInvitable",- "module": "users",- "classification": "READ",- "description": "get invitable",- "paramCount": 0,- "serviceParams": [- "client",- "companyId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "users_getModules",- "module": "users",- "classification": "READ",- "description": "get modules",- "paramCount": 0,- "serviceParams": [- "client"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "users_getGroup",- "module": "users",- "classification": "READ",- "description": "get group",- "paramCount": 1,- "serviceParams": [- "client",- "groupId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "groupId": {- "type": "string"- }- },- "required": [- "groupId"- ]- }- },- {- "name": "users_getGroupMembers",- "module": "users",- "classification": "READ",- "description": "get group members",- "paramCount": 1,- "serviceParams": [- "client",- "groupId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "groupId": {- "type": "string"- }- },- "required": [- "groupId"- ]- }- },- {- "name": "users_getGroups",- "module": "users",- "classification": "READ",- "description": "get groups",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- },- "uid": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "users_getGroupEmails",- "module": "users",- "classification": "READ",- "description": "get group emails",- "paramCount": 1,- "serviceParams": [- "client",- "groupIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "groupIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "groupIds"- ]- }- },- {- "name": "users_getUserSelectGroups",- "module": "users",- "classification": "READ",- "description": "get user select groups",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "type": {- "type": "string"- },- "search": {- "type": "string"- },- "limit": {- "type": "number"- },- "offset": {- "type": "number"- }- },- "required": [- "limit",- "offset"- ]- }- },- {- "name": "users_getUserSelectGroupMembers",- "module": "users",- "classification": "READ",- "description": "get user select group members",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "groupId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "groupId": {- "type": "string"- }- },- "required": [- "groupId"- ]- }- },- {- "name": "users_searchUsersForSelect",- "module": "users",- "classification": "READ",- "description": "search users for select",- "paramCount": 4,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "q": {- "type": "string"- },- "type": {- "type": "string"- },- "excludeSelf": {- "type": "boolean"- },- "allowedIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "q"- ]- }- },- {- "name": "users_resolveUserSelectIds",- "module": "users",- "classification": "WRITE",- "description": "resolve user select ids",- "paramCount": 1,- "serviceParams": [- "client",- "companyId",- "ids"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "ids": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "ids"- ]- }- },- {- "name": "users_getPermissionsByEmployeeType",- "module": "users",- "classification": "READ",- "description": "get permissions by employee type",- "paramCount": 1,- "serviceParams": [- "client",- "employeeTypeId"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "employeeTypeId": {- "type": "string"- }- },- "required": [- "employeeTypeId"- ]- }- },- {- "name": "users_getSuppliers",- "module": "users",- "classification": "READ",- "description": "get suppliers",- "paramCount": 3,- "serviceParams": [- "client",- "companyId",- "args"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "args": {- "type": "object",- "properties": {- "limit": {- "type": "integer",- "default": 100- },- "offset": {- "type": "integer",- "default": 0- },- "search": {- "type": [- "string",- "null"- ]- }- }- }- }- }- },- {- "name": "users_getUsers",- "module": "users",- "classification": "READ",- "description": "get users",- "paramCount": 0,- "serviceParams": [- "client"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {}- }- },- {- "name": "users_getUserEmails",- "module": "users",- "classification": "READ",- "description": "get user emails",- "paramCount": 1,- "serviceParams": [- "client",- "userIds"- ],- "injectAuth": [- "companyId"- ],- "schema": {- "type": "object",- "properties": {- "userIds": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "userIds"- ]- }- },- {- "name": "users_insertEmployeeType",- "module": "users",- "classification": "WRITE",- "description": "insert employee type",- "paramCount": 1,- "serviceParams": [- "client",- "employeeType"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- }- },- "required": [- "name"- ]- }- },- {- "name": "users_insertGroup",- "module": "users",- "classification": "WRITE",- "description": "insert group",- "paramCount": 1,- "serviceParams": [- "client",- "group"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "name": {- "type": "string"- }- },- "required": [- "name"- ]- }- },- {- "name": "users_upsertEmployeeType",- "module": "users",- "classification": "WRITE",- "description": "upsert employee type",- "paramCount": 1,- "serviceParams": [- "client",- "employeeType"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "employeeType": {}- },- "required": [- "employeeType"- ]- }- },- {- "name": "users_upsertEmployeeTypePermissions",- "module": "users",- "classification": "WRITE",- "description": "upsert employee type permissions",- "paramCount": 2,- "serviceParams": [- "client",- "employeeTypeId",- "companyId",- "permissions"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "employeeTypeId": {- "type": "string"- },- "permissions": {- "type": "array",- "items": {- "type": "object",- "properties": {- "name": {- "type": "string"- },- "permission": {}- },- "required": [- "name",- "permission"- ]- }- }- },- "required": [- "employeeTypeId",- "permissions"- ]- }- },- {- "name": "users_upsertGroup",- "module": "users",- "classification": "WRITE",- "description": "upsert group",- "paramCount": 2,- "serviceParams": [- "client",- "{\n id,\n name,\n companyId\n }"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "id": {- "type": "string"- },- "name": {- "type": "string"- }- },- "required": [- "id",- "name"- ]- }- },- {- "name": "users_upsertGroupMembers",- "module": "users",- "classification": "DESTRUCTIVE",- "description": "upsert group members",- "paramCount": 2,- "serviceParams": [- "client",- "groupId",- "selections"- ],- "injectAuth": [- "companyId",- "createdBy",- "updatedBy"- ],- "schema": {- "type": "object",- "properties": {- "groupId": {- "type": "string"- },- "selections": {- "type": "array",- "items": {- "type": "string"- }- }- },- "required": [- "groupId",- "selections"- ]- }- }- ]-}\ No newline at end of filediff --git a/apps/erp/app/routes/api+/mcp+/lib/types.ts b/apps/erp/app/routes/api+/mcp+/lib/types.tsindex 0beaaf21a1..9a06e4b483 100644--- a/apps/erp/app/routes/api+/mcp+/lib/types.ts+++ b/apps/erp/app/routes/api+/mcp+/lib/types.ts@@ -1,21 +1,11 @@-import type { Database } from "@carbon/database";import { getLogger } from "@carbon/logger";-import type { SupabaseClient } from "@supabase/supabase-js";+import type { AuthedContext } from "~/routes/api+/v1+/lib/base.server";const logger = getLogger("erp", "mcp");-export interface McpContext {- client: SupabaseClient<Database>;- companyId: string;- companyGroupId: string;- userId: string;-}--export type AuthField =- | "companyId"- | "companyGroupId"- | "createdBy"- | "updatedBy";+/** MCP runs as the same identity every Carbon API call runs as. Type-only alias —+ * erased at runtime, so no server module enters a client graph through here. */+export type McpContext = AuthedContext;export const READ_ONLY_ANNOTATIONS = {readOnlyHint: true,diff --git a/apps/erp/app/routes/api+/v1+/$.ts b/apps/erp/app/routes/api+/v1+/$.tsnew file mode 100644index 0000000000..6f81dbfa75--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/$.ts@@ -0,0 +1,36 @@+// Carbon API v1 — the HTTP transport for the service layer.+//+// POST /api/v1/{module}/{operation}+//+// Every operation is a POST. The splat forwards the request to the oRPC OpenAPIHandler+// after resolving the API key into context. No CORS: keys must not live in browsers.++import type { ActionFunctionArgs } from "react-router";+import { resolveApiKeyContext } from "./lib/authenticate.server";+import { openApiHandler } from "./lib/handler.server";++const PREFIX = "/api/v1";++export async function action({ request }: ActionFunctionArgs) {+ if (request.method === "OPTIONS") {+ return new Response(null, { status: 204 });+ }++ // Throws a 401/403/429 Response on auth failure, which propagates as the response.+ const context = await resolveApiKeyContext(request);++ const { matched, response } = await openApiHandler.handle(request, {+ prefix: PREFIX,+ context+ });++ if (matched && response) return response;+ return Response.json({ error: "Operation not found" }, { status: 404 });+}++export function loader() {+ return new Response("Method Not Allowed", {+ status: 405,+ headers: { Allow: "POST, OPTIONS" }+ });+}diff --git a/apps/erp/app/routes/api+/v1+/lib/authenticate.server.ts b/apps/erp/app/routes/api+/v1+/lib/authenticate.server.tsnew file mode 100644index 0000000000..32b669ba81--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/lib/authenticate.server.ts@@ -0,0 +1,69 @@+// Resolve an incoming Carbon API v1 request to an AuthedContext.+//+// v1 accepts API keys only, sent as `Authorization: Bearer crbn_…` (the convention the+// rest.carbon.ms proxy uses) or the raw `carbon-key` header. Client + rate limit + plan+// gate + expiry are handled by reusing the carbon-key branch of requirePermissions; the+// per-operation scope gate lives in oRPC middleware and reads the scopes we attach here.++import {+ getCompanyIdFromAPIKey,+ requirePermissions+} from "@carbon/auth/auth.server";+import type { AuthedContext } from "./base.server";++/**+ * Authenticate a raw API key into an AuthedContext. Shared by the v1 HTTP+ * transport and the MCP endpoint's carbon-key branch, so the+ * requirePermissions-then-read-scopes dance exists once.+ *+ * requirePermissions' carbon-key branch reads the `carbon-key` header, so the key+ * is presented that way regardless of how the caller sent it. Empty+ * required-permissions: the per-operation scope check lives in oRPC middleware.+ * The scope read hits the same 30s cache requirePermissions just warmed — a Redis+ * hit, not a second apiKey select.+ */+export async function authenticateApiKey(+ url: string,+ rawKey: string+): Promise<AuthedContext> {+ const authHeaders = new Headers();+ authHeaders.set("carbon-key", rawKey);+ const { client, companyId, companyGroupId, userId } =+ await requirePermissions(new Request(url, { headers: authHeaders }), {});++ const { data: keyRow } = await getCompanyIdFromAPIKey(rawKey);++ return {+ client,+ companyId,+ companyGroupId,+ userId,+ authKind: "api-key",+ scopes: keyRow?.scopes ?? {}+ };+}++export async function resolveApiKeyContext(+ request: Request+): Promise<AuthedContext> {+ const authorization = request.headers.get("authorization") ?? "";+ const bearer = /^bearer\s+/i.test(authorization)+ ? authorization.replace(/^bearer\s+/i, "").trim()+ : "";+ const rawKey = request.headers.get("carbon-key")?.trim() || bearer;++ if (!rawKey) {+ throw new Response(+ "Unauthorized: send your API key as `Authorization: Bearer crbn_…`.",+ { status: 401 }+ );+ }+ if (!rawKey.startsWith("crbn_")) {+ throw new Response(+ "The Carbon API v1 accepts API keys only. Use the MCP endpoint for OAuth connectors.",+ { status: 401 }+ );+ }++ return authenticateApiKey(request.url, rawKey);+}diff --git a/apps/erp/app/routes/api+/v1+/lib/base.server.ts b/apps/erp/app/routes/api+/v1+/lib/base.server.tsnew file mode 100644index 0000000000..bd2fd076b4--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/lib/base.server.ts@@ -0,0 +1,101 @@+// oRPC context + middleware shared by the HTTP transport and the MCP/agent bridges.++import type { ManifestEntry, ToolPermission } from "@carbon/api";+import type { Database } from "@carbon/database";+import { ORPCError, os } from "@orpc/server";+import type { SupabaseClient } from "@supabase/supabase-js";+import { isMcpBlockedTool } from "../../mcp+/lib/mcp-blocked-tools";++/**+ * The identity every Carbon API call runs as. Built once per request (from an API+ * key on HTTP, or from the resolved MCP/agent auth) and injected as oRPC context;+ * the service dispatch reads `client`/`companyId`/`userId`/`companyGroupId` from it.+ */+export interface AuthedContext {+ client: SupabaseClient<Database>;+ userId: string;+ companyId: string;+ companyGroupId: string;+ /** `"api-key"` runs the per-operation scope gate. `"oauth"` (MCP connector) does+ * not — its RLS/role already bounds it, exactly as MCP behaves today. `"session"`+ * is an already-authorized in-process caller (the in-app agent behind the route's+ * requirePermissions, and the workflow engine acting as the workflow's owner) —+ * not "oauth" because that names a wire protocol, not a trust decision. */+ authKind: "api-key" | "oauth" | "session";+ /** The API key's scopes: `{ "<module>_<action>": [companyId, …] }`. */+ scopes: Record<string, string[]>;+}++export const base = os.$context<AuthedContext>();++/**+ * Enforce that an API-key caller holds the operation's permission. `module: null`+ * gates only on a valid key of the company (today's MCP behavior for account/shared);+ * otherwise every action in the permission must be scoped to the active company.+ * The exact-companyId check (no `"0"` wildcard) matches requirePermissions' key path.+ */+export function assertScopes(+ scopes: Record<string, string[]>,+ companyId: string,+ permission: ToolPermission+): void {+ if (permission.module === null) return;+ for (const action of permission.actions) {+ const key = `${permission.module}_${action}`;+ if (!scopes[key]?.includes(companyId)) {+ throw new ORPCError("FORBIDDEN", {+ message: `API key lacks the required scope: ${key}`+ });+ }+ }+}++/** Per-operation gate middleware — runs the scope check for API-key callers.+ * The blocked-name guard is belt-and-braces: blocked tools are already excluded+ * from the manifest at generation time, so this only fires if that exclusion+ * ever regresses — the surface stays closed instead of silently opening. */+export const gate = (meta: ManifestEntry) =>+ base.middleware(async ({ context, next }) => {+ if (isMcpBlockedTool(meta.name)) throw new ORPCError("NOT_FOUND");+ if (context.authKind === "api-key") {+ assertScopes(context.scopes, context.companyId, meta.permission);+ }+ return next();+ });++const PROGRAMMING_ERRORS: ReadonlyArray<Function> = [+ TypeError,+ ReferenceError,+ RangeError,+ SyntaxError+];++/**+ * Turn a service's deliberate `throw new Error(...)` into a 422 carrying its+ * message; oRPC would otherwise rewrite it to an opaque 500 with the text only+ * in `cause`, which the encoder never serializes.+ *+ * Classification is by constructor because the ERP service layer has no domain+ * error class: a plain `Error` was written by a person; a `TypeError` and friends+ * mean a real defect, so those keep their 500 with the detail withheld.+ *+ * Must NOT attach `data.supabase` — `callOperation` keys its `Database error:`+ * envelope off that field, so adding it would silently change MCP output.+ */+export const mapThrownErrors = base.middleware(async ({ next }) => {+ try {+ return await next();+ } catch (err) {+ if (err instanceof ORPCError) throw err;+ if (+ err instanceof Error &&+ !PROGRAMMING_ERRORS.some((ctor) => err instanceof ctor)+ ) {+ throw new ORPCError("UNPROCESSABLE_CONTENT", {+ message: err.message,+ cause: err+ });+ }+ throw err;+ }+});diff --git a/apps/erp/app/routes/api+/v1+/lib/call.server.ts b/apps/erp/app/routes/api+/v1+/lib/call.server.tsnew file mode 100644index 0000000000..e4e1678825--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/lib/call.server.ts@@ -0,0 +1,92 @@+// The ONE server-side entry point for running a Carbon API operation outside HTTP:+// MCP call_tool, the in-app agent, and the workflow dispatcher all call this. It+// runs the operation through the real oRPC procedure (gate middleware included) via+// server-side call(), and folds the outcome back into the { success, … } envelope+// the legacy executeFunction callers expect.++import { call, ORPCError } from "@orpc/server";+import { isMcpBlockedTool } from "../../mcp+/lib/mcp-blocked-tools";+import type { AuthedContext } from "./base.server";+import {+ operationId,+ operationsByName,+ unshapeHttpBody+} from "./operations.server";+import { router } from "./router.server";++export type CallResult =+ | { success: true; data: unknown; count?: number }+ | { success: false; error: string; errorKind: "database" | "execution" };++export async function callOperation(+ name: string,+ context: AuthedContext,+ args?: Record<string, unknown> | string+): Promise<CallResult> {+ // The step order is the contract — it reproduces executeFunction's exactly.+ if (typeof args === "string") {+ try {+ args = args.trim().length > 0 ? JSON.parse(args) : {};+ } catch {+ return {+ success: false,+ error: "Invalid JSON arguments",+ errorKind: "execution"+ };+ }+ }++ if (isMcpBlockedTool(name)) {+ return {+ success: false,+ error: `Tool disabled: ${name} is not available via MCP.`,+ errorKind: "execution"+ };+ }++ const meta = operationsByName.get(name);+ const procedure = meta ? router[meta.module]?.[operationId(meta)] : undefined;+ if (!meta || !procedure) {+ return {+ success: false,+ error: `Operation not found: ${name}`,+ errorKind: "execution"+ };+ }++ try {+ // The handler shapes the HTTP body (bare single results, `{ results, count }`+ // lists); unshapeHttpBody reverses it so MCP/agent/workflow callers keep+ // DispatchResult semantics.+ const body = await call(+ procedure,+ (args as Record<string, unknown> | undefined) ?? {},+ { context }+ );+ const result = unshapeHttpBody(meta, body);+ return {+ success: true,+ data: result.data,+ ...(result.count !== undefined ? { count: result.count } : {})+ };+ } catch (err) {+ const supabase =+ err instanceof ORPCError+ ? (err.data as { supabase?: unknown } | undefined)?.supabase+ : undefined;+ if (supabase) {+ // A Supabase failure keeps MCP's exact `Database error:` text, raw error+ // JSON included — the errorKind lets the formatter skip its `Error: ` prefix.+ return {+ success: false,+ error: `Database error: ${JSON.stringify(supabase)}`,+ errorKind: "database"+ };+ }+ return {+ success: false,+ error: err instanceof Error ? err.message : "Function execution failed",+ errorKind: "execution"+ };+ }+}diff --git a/apps/erp/app/routes/api+/v1+/lib/dispatch-parity.test.ts b/apps/erp/app/routes/api+/v1+/lib/dispatch-parity.test.tsnew file mode 100644index 0000000000..a171a601f5--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/lib/dispatch-parity.test.ts@@ -0,0 +1,541 @@+// Dispatch contract tests, pinned against REAL manifest entries.+//+// History: these began as an A/B parity harness against the legacy MCP+// `executeFunction` — every case ran both implementations and compared the captured+// service arguments element-by-element. The executor is deleted now, so the captured+// values stand as golden literals: they ARE executeFunction's behavior, and a change+// here is a behavior change for MCP, the agent, the workflow engine and HTTP at once.++import { ORPCError } from "@orpc/server";+import { beforeEach, describe, expect, it, vi } from "vitest";++const spies = vi.hoisted(() => ({+ getAccountLedger: vi.fn(),+ getTrialBalance: vi.fn(),+ upsertAccount: vi.fn(),+ upsertQuoteLinePrices: vi.fn(),+ generateInventoryCountLines: vi.fn(),+ upsertNotificationPreference: vi.fn(),+ insertJob: vi.fn(),+ insertIssue: vi.fn(),+ insertPurchaseOrder: vi.fn(),+ insertSalesOrder: vi.fn(),+ FAKE_DB: { __kysely: true },+ FAKE_CLIENT: { __supabase: true }+}));++// The registry imports every module's service namespace; mock them all so the test+// never drags real app code (glossary/lingui/server-only graphs) into vitest. The+// exemplar modules export recording spies; the rest are empty namespaces.+vi.mock("~/modules/account/account.service", () => ({+ upsertNotificationPreference: spies.upsertNotificationPreference+}));+vi.mock("~/modules/accounting/accounting.ee.service", () => ({+ getAccountLedger: spies.getAccountLedger,+ getTrialBalance: spies.getTrialBalance,+ upsertAccount: spies.upsertAccount+}));+vi.mock("~/modules/documents/documents.service", () => ({}));+vi.mock("~/modules/inventory/inventory.service", () => ({+ generateInventoryCountLines: spies.generateInventoryCountLines+}));+vi.mock("~/modules/invoicing/invoicing.service", () => ({}));+vi.mock("~/modules/items/items.service", () => ({}));+vi.mock("~/modules/people/people.service", () => ({}));+vi.mock("~/modules/production/production.mcp.server", () => ({}));+vi.mock("~/modules/production/production.service", () => ({+ insertJob: spies.insertJob+}));+vi.mock("~/modules/purchasing/purchasing.service", () => ({+ insertPurchaseOrder: spies.insertPurchaseOrder+}));+vi.mock("~/modules/quality/quality.service", () => ({+ insertIssue: spies.insertIssue+}));+vi.mock("~/modules/resources/resources.service", () => ({}));+vi.mock("~/modules/sales/sales.service", () => ({+ upsertQuoteLinePrices: spies.upsertQuoteLinePrices,+ insertSalesOrder: spies.insertSalesOrder+}));+vi.mock("~/modules/settings/settings.service", () => ({}));+vi.mock("~/modules/shared/shared.service", () => ({}));+vi.mock("~/modules/users/users.service", () => ({}));+vi.mock("~/services/database.server", () => ({+ getDatabaseClient: () => spies.FAKE_DB+}));+vi.mock("@carbon/logger", () => ({+ getLogger: () => ({+ error: vi.fn(),+ warn: vi.fn(),+ info: vi.fn(),+ debug: vi.fn()+ })+}));++import { MCP_BLOCKED_TOOL_NAMES } from "../../mcp+/lib/mcp-blocked-tools";+import type { AuthedContext } from "./base.server";+import { callOperation } from "./call.server";+import {+ type DispatchResult,+ dispatchOperation,+ enrichWithAuthContext+} from "./dispatch.server";+import { operationsByName } from "./operations.server";++const ctx: AuthedContext = {+ client: spies.FAKE_CLIENT as unknown as AuthedContext["client"],+ companyId: "c1",+ companyGroupId: "g1",+ userId: "u1",+ authKind: "session",+ scopes: {}+};++type Spy = ReturnType<typeof vi.fn>;++interface RunResult {+ dispatch?: DispatchResult;+ dispatchError?: unknown;+ calls: unknown[][];+}++async function runDispatch(+ name: string,+ spy: Spy,+ args?: Record<string, unknown>+): Promise<RunResult> {+ const meta = operationsByName.get(name);+ if (!meta) throw new Error(`${name} missing from the generated manifest`);++ let dispatch: DispatchResult | undefined;+ let dispatchError: unknown;+ try {+ dispatch = await dispatchOperation(meta, ctx, args);+ } catch (err) {+ dispatchError = err;+ }+ const calls = spy.mock.calls.map((c) => [...c]);+ spy.mockClear();++ return { dispatch, dispatchError, calls };+}++const allSpies = [+ spies.getAccountLedger,+ spies.getTrialBalance,+ spies.upsertAccount,+ spies.upsertQuoteLinePrices,+ spies.generateInventoryCountLines,+ spies.upsertNotificationPreference,+ spies.insertJob,+ spies.insertIssue,+ spies.insertPurchaseOrder,+ spies.insertSalesOrder+];++beforeEach(() => {+ for (const spy of allSpies) {+ spy.mockReset();+ spy.mockResolvedValue({ data: null, error: null });+ }+});++describe("dispatchOperation service-call contract (golden, ex-executeFunction parity)", () => {+ // The `companyId` in a. and a2. is the fix for the `args` branch skipping+ // enrichWithAuthContext. getAccountLedger's args type REQUIRES companyId; without+ // the stamp it took neither its companyId nor its companyIds branch and the query+ // went out unscoped in application code, leaning entirely on RLS.+ it("a. passes a flat-schema `args` through whole and stamps injectAuth fields", async () => {+ const r = await runDispatch(+ "accounting_getAccountLedger",+ spies.getAccountLedger,+ { accountNumber: "1000", limit: 5 }+ );+ expect(r.calls).toEqual([+ [spies.FAKE_CLIENT, { accountNumber: "1000", limit: 5, companyId: "c1" }]+ ]);+ });++ it("a2. fills context positional params (companyGroupId, companyId) from context", async () => {+ const r = await runDispatch(+ "accounting_getTrialBalance",+ spies.getTrialBalance,+ { startDate: "2026-01-01" }+ );+ expect(r.calls).toEqual([+ [+ spies.FAKE_CLIENT,+ "g1",+ "c1",+ { startDate: "2026-01-01", companyId: "c1" }+ ]+ ]);+ });++ it("b. _operation create at top level: stripped, createdBy/updatedBy/companyId stamped", async () => {+ const r = await runDispatch(+ "accounting_upsertAccount",+ spies.upsertAccount,+ {+ _operation: "create",+ account: { name: "Cash", number: "1000" }+ }+ );+ expect(r.calls).toEqual([+ [+ spies.FAKE_CLIENT,+ {+ name: "Cash",+ number: "1000",+ createdBy: "u1",+ updatedBy: "u1",+ companyId: "c1"+ }+ ]+ ]);+ });++ it("c. _operation update nested in the payload: stripped, createdBy suppressed", async () => {+ const r = await runDispatch(+ "accounting_upsertAccount",+ spies.upsertAccount,+ {+ account: { _operation: "update", id: "a1", name: "Cash" }+ }+ );+ const [, payload] = r.calls[0] as [unknown, Record<string, unknown>];+ expect(payload).toEqual({+ id: "a1",+ name: "Cash",+ updatedBy: "u1",+ companyId: "c1"+ });+ expect("createdBy" in payload).toBe(false);+ });++ it("d. caller-supplied createdBy on an update is removed (no forged attribution)", async () => {+ const r = await runDispatch(+ "accounting_upsertAccount",+ spies.upsertAccount,+ {+ _operation: "update",+ account: { id: "a1", createdBy: "forged" }+ }+ );+ const [, payload] = r.calls[0] as [unknown, Record<string, unknown>];+ expect("createdBy" in payload).toBe(false);+ });+ it("e. conflicting _operation values are rejected before the service runs", async () => {+ const r = await runDispatch(+ "accounting_upsertAccount",+ spies.upsertAccount,+ {+ _operation: "create",+ account: { _operation: "update", name: "x" }+ }+ );+ expect(r.calls).toEqual([]);+ expect(r.dispatchError).toBeInstanceOf(ORPCError);+ expect((r.dispatchError as ORPCError<string, unknown>).message).toBe(+ "accounting_upsertAccount received conflicting _operation values (create, update)."+ );+ });++ it("f. missing _operation on a tool that requires it is rejected before the service runs", async () => {+ const r = await runDispatch(+ "accounting_upsertAccount",+ spies.upsertAccount,+ {+ account: { name: "x" }+ }+ );+ expect(r.calls).toEqual([]);+ expect(r.dispatchError).toBeInstanceOf(ORPCError);+ expect((r.dispatchError as ORPCError<string, unknown>).message).toBe(+ 'accounting_upsertAccount requires _operation to be "create" (insert a new record) or "update" (modify an existing one).'+ );+ });++ it("g. array payload on an insert: every object element gets createdBy stamped AFTER the spread; nothing else injected", async () => {+ const r = await runDispatch(+ "sales_upsertQuoteLinePrices",+ spies.upsertQuoteLinePrices,+ {+ quoteId: "q1",+ lineId: "l1",+ quoteLinePrices: [+ { quantity: 1, unitPrice: 5, createdBy: "forged" },+ 42+ ]+ }+ );+ expect(r.calls).toEqual([+ [+ spies.FAKE_DB,+ "c1",+ "q1",+ "l1",+ [{ quantity: 1, unitPrice: 5, createdBy: "u1" }, 42]+ ]+ ]);+ const rows = (r.calls[0] as unknown[])[4] as Record<string, unknown>[];+ expect("companyId" in rows[0]).toBe(false);+ expect("updatedBy" in rows[0]).toBe(false);+ });++ it("h. array payload on an update passes through untouched", () => {+ // No manifest op combines `_operation` with an array payload, so this pins the+ // enrichment helper directly.+ const rows = [{ id: "p1", createdBy: "orig" }];+ const out = enrichWithAuthContext(+ rows,+ ctx,+ ["companyId", "createdBy", "updatedBy"],+ "update"+ );+ expect(out).toBe(rows);+ expect(rows[0]).toEqual({ id: "p1", createdBy: "orig" });+ });++ it("i. a `db` service param receives the Kysely client from getDatabaseClient()", async () => {+ const r = await runDispatch(+ "inventory_generateInventoryCountLines",+ spies.generateInventoryCountLines,+ { locationId: "loc1" }+ );+ expect(r.calls).toEqual([+ [+ spies.FAKE_DB,+ {+ locationId: "loc1",+ companyId: "c1",+ createdBy: "u1",+ updatedBy: "u1"+ }+ ]+ ]);+ });++ it("j. a thenable-but-not-Promise result (Supabase builder) is awaited and unwrapped", async () => {+ spies.getAccountLedger.mockReset();+ spies.getAccountLedger.mockReturnValue({+ then: (resolve: (v: unknown) => void) =>+ resolve({ data: [{ id: "e1" }], error: null, count: 1 })+ });+ const r = await runDispatch(+ "accounting_getAccountLedger",+ spies.getAccountLedger,+ {}+ );+ expect(r.dispatch).toEqual({ data: [{ id: "e1" }], count: 1 });+ });++ it("k. a Supabase error throws BAD_REQUEST carrying the raw error (D4)", async () => {+ const supabaseError = {+ message: "duplicate key value",+ code: "23505",+ details: "Key (number)=(1000) already exists.",+ hint: null+ };+ spies.getAccountLedger.mockReset();+ spies.getAccountLedger.mockResolvedValue({+ data: null,+ error: supabaseError+ });+ const r = await runDispatch(+ "accounting_getAccountLedger",+ spies.getAccountLedger,+ {}+ );+ expect(r.dispatchError).toBeInstanceOf(ORPCError);+ const orpcError = r.dispatchError as ORPCError<string, unknown>;+ expect(orpcError.message).toBe("duplicate key value");+ // The raw error rides on the ORPCError so callOperation can reconstruct MCP's+ // byte-identical `Database error: ${JSON.stringify(error)}` text.+ expect(+ (orpcError.data as { supabase?: unknown } | undefined)?.supabase+ ).toEqual(supabaseError);+ });++ it("l. a single-key payload whose key matches no param is unwrapped positionally", async () => {+ const r = await runDispatch(+ "account_upsertNotificationPreference",+ spies.upsertNotificationPreference,+ { args: { channel: "email", enabled: true } }+ );+ expect(r.calls).toEqual([+ [spies.FAKE_CLIENT, { channel: "email", enabled: true, companyId: "c1" }]+ ]);+ });++ it("m. a flat-field payload matching no param is passed whole as the positional", async () => {+ const r = await runDispatch(+ "accounting_upsertAccount",+ spies.upsertAccount,+ {+ _operation: "create",+ name: "Cash",+ number: "1000"+ }+ );+ expect(r.calls).toEqual([+ [+ spies.FAKE_CLIENT,+ {+ name: "Cash",+ number: "1000",+ createdBy: "u1",+ updatedBy: "u1",+ companyId: "c1"+ }+ ]+ ]);+ });++ it("n. a Supabase { data, count } result keeps its count on the dispatch result", async () => {+ spies.getAccountLedger.mockReset();+ spies.getAccountLedger.mockResolvedValue({+ data: [{ id: "e1" }, { id: "e2" }],+ error: null,+ count: 7+ });+ const r = await runDispatch(+ "accounting_getAccountLedger",+ spies.getAccountLedger,+ {}+ );+ expect(r.dispatch).toEqual({+ data: [{ id: "e1" }, { id: "e2" }],+ count: 7+ });+ });+});++// The exact ids the workflow engine's create actions dispatch+// (packages/workflows/src/catalog/actions.ts). Their results must stay readable by+// create.ts's idIn(): an `id` on the returned object, or on an element of a list.+//+// The payloads are the ones runCreateAction actually builds — the catalog's+// required inputs, flat, with nulls dropped. callOperation runs the real oRPC+// procedure, so these also pin that input validation accepts what the workflow+// engine sends. job.create is the load-bearing one: it sends `insertJob`'s inner+// fields at the top level even though that schema declares an `input` wrapper.+const WORKFLOW_CALL_IDS: Array<[string, Spy, Record<string, unknown>]> = [+ ["production_insertJob", spies.insertJob, { itemId: "item_1", quantity: 5 }],+ [+ "quality_insertIssue",+ spies.insertIssue,+ {+ name: "n",+ priority: "High",+ source: "Internal",+ locationId: "loc_1",+ nonConformanceTypeId: "nct_1"+ }+ ],+ [+ "purchasing_insertPurchaseOrder",+ spies.insertPurchaseOrder,+ { supplierId: "sup_1" }+ ],+ ["sales_insertSalesOrder", spies.insertSalesOrder, { customerId: "cust_1" }]+];++/** A schema-valid getAccountLedger payload (every field is required). */+const LEDGER_ARGS = {+ accountId: "acc_1",+ startDate: "2026-01-01",+ endDate: "2026-01-31",+ limit: 5,+ offset: 0+};++function idIn(payload: unknown): string | undefined {+ // Mirror of packages/jobs/src/workflows/actions/create.ts — what the workflow+ // engine actually runs over a dispatch result.+ if (Array.isArray(payload)) {+ for (const entry of payload) {+ const id = idIn(entry);+ if (id !== undefined) return id;+ }+ return undefined;+ }+ if (!payload || typeof payload !== "object") return undefined;+ const id = (payload as Record<string, unknown>).id;+ return typeof id === "string" ? id : undefined;+}++describe("callOperation (the MCP/agent/workflow entry point)", () => {+ it.each(+ WORKFLOW_CALL_IDS+ )("%s returns data the workflow create action can read an id out of", async (name, spy, args) => {+ spy.mockResolvedValue({ data: { id: "rec_1" }, error: null });+ const asObject = await callOperation(name, ctx, args);+ expect(asObject).toEqual({ success: true, data: { id: "rec_1" } });+ expect(idIn((asObject as { data: unknown }).data)).toBe("rec_1");++ spy.mockResolvedValue({ data: [{ id: "rec_2" }], error: null });+ const asList = await callOperation(name, ctx, args);+ expect(idIn((asList as { data: unknown }).data)).toBe("rec_2");+ });++ it("maps a Supabase error to the errorKind:database envelope with MCP's exact text", async () => {+ const supabaseError = { message: "boom", code: "XX000" };+ spies.getAccountLedger.mockResolvedValue({+ data: null,+ error: supabaseError+ });+ const result = await callOperation(+ "accounting_getAccountLedger",+ ctx,+ LEDGER_ARGS+ );+ expect(result).toEqual({+ success: false,+ errorKind: "database",+ error: `Database error: ${JSON.stringify(supabaseError)}`+ });+ });++ it("returns the legacy not-found envelope for an unknown name", async () => {+ const result = await callOperation("sales_doesNotExist", ctx, {});+ expect(result).toEqual({+ success: false,+ errorKind: "execution",+ error: "Operation not found: sales_doesNotExist"+ });+ });++ it("rejects unparseable string arguments the way executeFunction did", async () => {+ const result = await callOperation(+ "accounting_getAccountLedger",+ ctx,+ "{nope"+ );+ expect(result).toEqual({+ success: false,+ errorKind: "execution",+ error: "Invalid JSON arguments"+ });+ });+});++describe("blocked tools (D5)", () => {+ it("excludes every blocked tool from the operation catalog", () => {+ for (const name of MCP_BLOCKED_TOOL_NAMES) {+ expect(+ operationsByName.has(name),+ `${name} must not be in OPERATIONS`+ ).toBe(false);+ }+ });++ it("callOperation refuses a blocked tool with the MCP disabled text", async () => {+ const result = await callOperation("settings_seedCompany", ctx, {});+ expect(result).toEqual({+ success: false,+ errorKind: "execution",+ error: "Tool disabled: settings_seedCompany is not available via MCP."+ });+ });+});diff --git a/apps/erp/app/routes/api+/v1+/lib/dispatch.server.ts b/apps/erp/app/routes/api+/v1+/lib/dispatch.server.tsnew file mode 100644index 0000000000..27e26d535d--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/lib/dispatch.server.ts@@ -0,0 +1,349 @@+// The bridge from an oRPC procedure to a Carbon service function.+//+// Owns the executeFunction lineage in full: positional-arg assembly from+// serviceParams, payload stamping via enrichWithAuthContext, `_operation` handling,+// and the Supabase unwrap. HTTP, MCP, the agent and the workflow dispatcher all pass+// through here. Unlike the legacy executor (which returned { success, … }), this+// THROWS an ORPCError on failure: the HTTP handler maps that to a status code and+// callOperation reconstructs the { success:false, error } envelope.++import type { AuthField, ManifestEntry } from "@carbon/api";+import { ORPCError } from "@orpc/server";+import { getDatabaseClient } from "~/services/database.server";+import type { AuthedContext } from "./base.server";+import { functionRegistry } from "./registry.server";++export interface DispatchResult {+ data: unknown;+ count?: number;+}++export type McpOperation = "create" | "update";++/** The identity fields the payload stamp reads — satisfied by both AuthedContext+ * and the legacy ExecutorContext. */+type AuthStampContext = Pick<+ AuthedContext,+ "userId" | "companyId" | "companyGroupId"+>;++// Stamps auth identity onto typed payloads. Carbon's services expect auth+// fields inside the payload (predates MCP). `fields` is per-tool from+// tool-metadata.json so reads stay clean and updates don't overwrite createdBy.+export function enrichWithAuthContext(+ value: unknown,+ context: AuthStampContext,+ fields: AuthField[],+ operation?: McpOperation+): unknown {+ if (!value || typeof value !== "object") return value;+ if (fields.length === 0) return value;++ // Array payloads (e.g. the row list for upsertQuoteLinePrices) need per-element+ // stamping — enrichment never reached inside them, so a NOT NULL createdBy on+ // the row table failed. Only createdBy is injected into elements (and only for+ // an insert): element keys are spread straight into an INSERT, so injecting+ // companyId/updatedBy could add a column the row table doesn't have. The+ // service owns companyId for these rows. createdBy is stamped AFTER the spread+ // so a caller can't forge audit attribution by supplying it in a row.+ if (Array.isArray(value)) {+ if (operation === "update" || !fields.includes("createdBy")) return value;+ return value.map((element) =>+ element && typeof element === "object" && !Array.isArray(element)+ ? { ...(element as Record<string, unknown>), createdBy: context.userId }+ : element+ );+ }++ const enriched: Record<string, unknown> = {+ ...(value as Record<string, unknown>)+ };++ // A caller-supplied createdBy would send the service down its insert branch.+ if (operation === "update") {+ delete enriched.createdBy;+ } else if (fields.includes("createdBy")) {+ // Overwrite, never fill a gap — a caller-supplied createdBy would attribute+ // the record to someone else. The array branch stamps after its spread for+ // the same reason, and the two shapes must not disagree.+ enriched.createdBy = context.userId;+ }+ if (fields.includes("updatedBy")) {+ enriched.updatedBy = context.userId;+ }+ if (fields.includes("companyId")) {+ enriched.companyId = context.companyId;+ }+ if (fields.includes("companyGroupId")) {+ enriched.companyGroupId = context.companyGroupId;+ }++ return enriched;+}++// Pulls the MCP-only `_operation` flag out of the args, top level or nested.+// Returns every value it found so the caller can reject contradictory ones.+export function extractOperation(args: Record<string, any> | undefined): {+ operations: string[];+ args: Record<string, any> | undefined;+} {+ if (!args) return { operations: [], args };++ const operations: string[] = [];+ const cleaned: Record<string, any> = {};++ if (args._operation !== undefined) operations.push(String(args._operation));++ for (const [key, value] of Object.entries(args)) {+ if (key === "_operation") continue;+ if (value && typeof value === "object" && !Array.isArray(value)) {+ const { _operation, ...rest } = value as Record<string, any>;+ if (_operation !== undefined) {+ operations.push(String(_operation));+ cleaned[key] = rest;+ continue;+ }+ }+ cleaned[key] = value;+ }++ return { operations, args: cleaned };+}++const SCALAR_PARAM_TYPES = new Set(["string", "number", "integer", "boolean"]);++// The declared JSON-Schema type of a top-level parameter, when that type is a+// scalar. `["string","null"]` unions are common in the manifest, so the null+// member is ignored rather than treated as a non-scalar.+function declaredScalarParam(+ meta: ManifestEntry,+ name: string+): string | undefined {+ const prop = (+ meta.schema as { properties?: Record<string, { type?: unknown }> }+ )?.properties?.[name];+ const raw = Array.isArray(prop?.type)+ ? (prop.type as unknown[]).find((t) => t !== "null")+ : prop?.type;+ return typeof raw === "string" && SCALAR_PARAM_TYPES.has(raw)+ ? raw+ : undefined;+}++/** Params the loop fills from context rather than from the request body. */+const CONTEXT_PARAM_NAMES = new Set([+ "client",+ "db",+ "userId",+ "companyId",+ "companyGroupId",+ "eliminationClient",+ "args"+]);++/**+ * Is `paramName` a key the caller genuinely addresses, or does it just happen to+ * collide with a field of the object this param expects? A service whose sole+ * payload param is a destructured object can share its name with one of that+ * object's own fields — `upsertMaintenanceDispatchComment(client, comment: {+ * maintenanceDispatchId, comment, … })`, where reading `body.comment` hands the+ * service the string instead of the record.+ *+ * A wrapper op declares exactly one property named for the param — read it. An op+ * whose schema lists the param's own FIELDS is describing the object, not+ * addressing it — pass the whole body. `_operation` is a synthetic discriminator+ * and any property that is itself another serviceParam is addressed on its own+ * pass, so neither counts toward that decision.+ */+function addressesWholeParam(meta: ManifestEntry, paramName: string): boolean {+ const properties = (meta.schema as { properties?: Record<string, unknown> })+ ?.properties;+ // Undeclared, so a key of this name can only be the caller nesting the payload+ // under it — the documented `{ account: {...} }` wrapper.+ if (!properties || !(paramName in properties)) return true;++ const payloadParams = meta.serviceParams.filter(+ (p) => !CONTEXT_PARAM_NAMES.has(p)+ );+ if (payloadParams.length !== 1 || payloadParams[0] !== paramName) return true;++ const own = Object.keys(properties).filter(+ (k) =>+ k !== "_operation" && !(k !== paramName && meta.serviceParams.includes(k))+ );+ return own.length === 1 && own[0] === paramName;+}++function supabaseErrorMessage(error: unknown): string {+ if (typeof error === "string") return error;+ if (error && typeof error === "object" && "message" in error) {+ return String((error as { message: unknown }).message);+ }+ return JSON.stringify(error);+}++export async function dispatchOperation(+ meta: ManifestEntry,+ context: AuthedContext,+ input: unknown+): Promise<DispatchResult> {+ const rawArgs =+ input && typeof input === "object"+ ? (input as Record<string, any>)+ : undefined;++ // Strip the MCP `_operation` discriminator before the args reach the service.+ const { operations: requestedOperations, args: normalizedArgs } =+ extractOperation(rawArgs);++ const funcName = meta.name.slice(meta.module.length + 1);+ const moduleFns =+ functionRegistry[meta.module as keyof typeof functionRegistry];+ const func = (moduleFns as Record<string, unknown> | undefined)?.[funcName];+ if (typeof func !== "function") {+ throw new ORPCError("NOT_FOUND", {+ message: `Operation not found: ${meta.name}`+ });+ }++ const needsOperation = Boolean(+ (meta.schema as { properties?: Record<string, unknown> })?.properties+ ?._operation+ );+ const distinctOperations = [...new Set(requestedOperations)];+ if (needsOperation && distinctOperations.length > 1) {+ throw new ORPCError("BAD_REQUEST", {+ message: `${meta.name} received conflicting _operation values (${distinctOperations.join(", ")}).`+ });+ }+ const requestedOperation = distinctOperations[0];+ if (+ needsOperation &&+ requestedOperation !== "create" &&+ requestedOperation !== "update"+ ) {+ throw new ORPCError("BAD_REQUEST", {+ message: `${meta.name} requires _operation to be "create" (insert a new record) or "update" (modify an existing one).`+ });+ }+ const operation = needsOperation+ ? (requestedOperation as McpOperation)+ : undefined;++ const functionArgs: any[] = [];+ for (const paramName of meta.serviceParams) {+ if (paramName === "client") {+ functionArgs.push(context.client);+ } else if (paramName === "db") {+ functionArgs.push(getDatabaseClient());+ } else if (paramName === "userId") {+ functionArgs.push(context.userId);+ } else if (paramName === "companyId") {+ functionArgs.push(context.companyId);+ } else if (paramName === "companyGroupId") {+ functionArgs.push(context.companyGroupId);+ } else if (paramName === "eliminationClient") {+ // A second client for consolidation reads, defaulted by the service to its+ // own `client`. Context, never caller-supplied.+ functionArgs.push(context.client);+ } else if (paramName === "args") {+ // Two wire shapes, told apart by the operation's own schema: when it+ // declares an `args` object the body is `{ args: {...} }`, otherwise the+ // body already IS the args object. A flat body is accepted for both — 18+ // ops mix `args` with sibling top-level params and the extra keys are+ // inert, since setGenericQueryFilters reads only filters/sorts/offset/limit.+ const wrapped = normalizedArgs?.args;+ const value =+ (meta.schema as { properties?: Record<string, unknown> })?.properties+ ?.args &&+ wrapped &&+ typeof wrapped === "object" &&+ !Array.isArray(wrapped)+ ? wrapped+ : normalizedArgs || {};+ functionArgs.push(+ enrichWithAuthContext(value, context, meta.injectAuth, operation)+ );+ } else if (+ normalizedArgs &&+ paramName in normalizedArgs &&+ addressesWholeParam(meta, paramName)+ ) {+ functionArgs.push(+ enrichWithAuthContext(+ normalizedArgs[paramName],+ context,+ meta.injectAuth,+ operation+ )+ );+ } else if (+ declaredScalarParam(meta, paramName) &&+ addressesWholeParam(meta, paramName)+ ) {+ // A scalar param with no matching key. The object fallbacks below would+ // hand the service the whole payload as an id (`.eq("id", { apiKeyId })`+ // matches nothing and reports success); `undefined` keeps the positional+ // arity intact. A missing REQUIRED scalar is rejected earlier by input+ // validation, so only optional ones legitimately reach here. The+ // addressesWholeParam guard keeps a collision op — whose same-named schema+ // entry describes a FIELD, so it looks scalar — falling through instead.+ functionArgs.push(undefined);+ } else if (+ normalizedArgs &&+ Object.keys(normalizedArgs).length === 1 &&+ !meta.serviceParams.some((p) => p in normalizedArgs) &&+ typeof Object.values(normalizedArgs)[0] === "object" &&+ Object.values(normalizedArgs)[0] !== null+ ) {+ // Single-key payload whose name doesn't match a param — unwrap and use it+ // positionally (the documented `{ args: {...} }` wrapper, or a guessed key).+ functionArgs.push(+ enrichWithAuthContext(+ Object.values(normalizedArgs)[0],+ context,+ meta.injectAuth,+ operation+ )+ );+ } else if (normalizedArgs && Object.keys(normalizedArgs).length > 0) {+ // No key matched — pass the whole args object positionally (flat-field calls+ // like upsertPart(client, part)).+ functionArgs.push(+ enrichWithAuthContext(+ { ...normalizedArgs },+ context,+ meta.injectAuth,+ operation+ )+ );+ }+ // else: optional param with nothing to fill — skip.+ }++ let result = await (func as (...args: any[]) => any)(...functionArgs);+ // Supabase query builders are thenable but not yet executed.+ if (+ result &&+ typeof result === "object" &&+ typeof result.then === "function"+ ) {+ result = await result;+ }++ // Supabase response shape { data, error, count } — unwrap, or throw on error.+ if (result && typeof result === "object" && "data" in result) {+ const r = result as { data: unknown; error?: unknown; count?: number };+ if (r.error) {+ // The raw error rides along so callOperation can reconstruct MCP's+ // byte-identical `Database error: ${JSON.stringify(error)}` text, and HTTP+ // callers get the Postgres code/details/hint the way Supabase REST does.+ throw new ORPCError("BAD_REQUEST", {+ message: supabaseErrorMessage(r.error),+ data: { supabase: r.error }+ });+ }+ return { data: r.data, count: r.count ?? undefined };+ }+ return { data: result };+}diff --git a/apps/erp/app/routes/api+/v1+/lib/handler.server.ts b/apps/erp/app/routes/api+/v1+/lib/handler.server.tsnew file mode 100644index 0000000000..66205b1aca--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/lib/handler.server.ts@@ -0,0 +1,6 @@+// Module-scope OpenAPIHandler singleton for the Carbon API v1 HTTP transport.++import { OpenAPIHandler } from "@orpc/openapi/fetch";+import { router } from "./router.server";++export const openApiHandler = new OpenAPIHandler(router);diff --git a/apps/erp/app/routes/api+/v1+/lib/operations.server.ts b/apps/erp/app/routes/api+/v1+/lib/operations.server.tsnew file mode 100644index 0000000000..fa8d867200--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/lib/operations.server.ts@@ -0,0 +1,94 @@+// The operation catalog for the Carbon API v1 surface. Reads the generated MCP+// manifest (tool-metadata.json) and shapes it for the oRPC router and the MCP/agent+// bridges — a single source of truth for HTTP and MCP.+//+// (Decision 7's build-time relocation of this manifest into @carbon/api is deferred+// to Docs Phase 2; see the plan. For now the committed manifest is the source.)++import type { ManifestEntry } from "@carbon/api";+import raw from "../../mcp+/lib/tool-metadata.json";++export const OPERATIONS = (raw as { tools: ManifestEntry[] }).tools;++/** operation name (`module_func`) → entry. */+export const operationsByName = new Map<string, ManifestEntry>(+ OPERATIONS.map((op) => [op.name, op])+);++/** The bare operation id (the name without its `module_` prefix). */+export function operationId(op: ManifestEntry): string {+ return op.name.slice(op.module.length + 1);+}++/**+ * Whether an operation's HTTP response is the LIST envelope `{ results, count }`+ * or the bare payload.+ *+ * The old contract wrapped everything, which stacked our envelope under every+ * generated client's own result wrapper — callers wrote `res.data.data.field`.+ * The Stripe convention fixes it: single results are the body itself; only list+ * results carry an envelope, because `count` means something there.+ *+ * Decided STATICALLY from the reflected response schema so the runtime shaping+ * (router handler), the reverse mapping (`callOperation`), and the published+ * output schema can never disagree. An operation with no reflected schema is+ * treated as bare — those are `any`/void shapes with no pagination.+ */+export function isListOperation(op: ManifestEntry): boolean {+ const type = (op.responseSchema as { type?: string | string[] } | undefined)+ ?.type;+ return type === "array" || (Array.isArray(type) && type.includes("array"));+}++/**+ * The success body over HTTP. Single results are the payload itself — wrapping+ * everything in `{ data }` stacked our envelope under every generated client's own+ * result wrapper, so callers wrote `res.data.data.field`. Lists keep the envelope+ * because `count` belongs there (the Stripe convention). Keyed off+ * `isListOperation` — the same bit `shapeHttpBody` and `callOperation` use — so the+ * published schema and the runtime behavior cannot drift.+ */+export function outputSchema(op: ManifestEntry): Record<string, unknown> {+ if (!isListOperation(op)) return op.responseSchema ?? {};+ return {+ type: "object",+ properties: {+ results: op.responseSchema ?? {},+ count: {+ type: ["number", "null"],+ description: "Total matching rows, present on paginated reads."+ }+ },+ required: ["results"]+ };+}++/** Shape a dispatch result into the HTTP body `outputSchema` promises. */+export function shapeHttpBody(+ op: ManifestEntry,+ result: { data: unknown; count?: number }+): unknown {+ // `results`, not `data`: generated clients wrap responses in their own `.data`,+ // so an envelope field named `data` reads back as `res.data.data`.+ return isListOperation(op)+ ? { results: result.data, count: result.count ?? null }+ : result.data;+}++/**+ * Reverse of `shapeHttpBody`, for the non-HTTP callers (MCP, agent, workflows)+ * that need DispatchResult semantics back. Keyed off the same static bit — never+ * value sniffing, which would mis-unwrap a payload that happens to carry a+ * `data` key.+ */+export function unshapeHttpBody(+ op: ManifestEntry,+ body: unknown+): { data: unknown; count?: number } {+ if (!isListOperation(op)) return { data: body };+ const envelope = body as { results: unknown; count: number | null };+ return {+ data: envelope.results,+ ...(envelope.count !== null ? { count: envelope.count } : {})+ };+}diff --git a/apps/erp/app/routes/api+/v1+/lib/orpc-mechanics.test.ts b/apps/erp/app/routes/api+/v1+/lib/orpc-mechanics.test.tsnew file mode 100644index 0000000000..846ed77d8c--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/lib/orpc-mechanics.test.ts@@ -0,0 +1,250 @@+// Validates the oRPC wiring the Carbon API v1 surface depends on, without booting the+// app: a runtime-built router of procedures, the OpenAPIHandler matching a prefixed+// POST path, server-side call(), the scope gate, and the custom JSON-Schema converter+// feeding OpenAPIGenerator. Uses the REAL base/gate/jsonSchema/converter with tiny+// inline handlers (so it never pulls the full service registry).++import type { ManifestEntry } from "@carbon/api";+import { CarbonJsonSchemaConverter, jsonSchema } from "@carbon/api/schema";+import { OpenAPIGenerator } from "@orpc/openapi";+import { OpenAPIHandler } from "@orpc/openapi/fetch";+import { call } from "@orpc/server";+import { describe, expect, it } from "vitest";+import { type AuthedContext, base, gate } from "./base.server";+import { outputSchema, shapeHttpBody } from "./operations.server";+import { specOptions } from "./spec-options.server";++const PREFIX = "/api/v1";++function meta(overrides: Partial<ManifestEntry>): ManifestEntry {+ return {+ name: "demo_ping",+ module: "demo",+ classification: "READ",+ description: "demo ping",+ paramCount: 1,+ serviceParams: ["client", "args"],+ injectAuth: [],+ permission: { module: null, actions: [] },+ schema: { type: "object", properties: { name: { type: "string" } } },+ ...overrides+ };+}++const ping = base+ .use(gate(meta({})))+ .route({+ method: "POST",+ path: "/demo/ping",+ tags: ["demo"],+ summary: "demo ping"+ })+ .input(+ jsonSchema({ type: "object", properties: { name: { type: "string" } } })+ )+ .output(+ jsonSchema(+ // The REAL schema builder, with a list-shaped response — pins that the+ // converter carries the current { results, count } envelope into the spec.+ outputSchema(+ meta({+ responseSchema: {+ type: "array",+ items: { type: "object", properties: { id: { type: "string" } } }+ }+ })+ )+ )+ )+ .handler(({ input }) => ({ data: input }));++const gatedMeta = meta({+ name: "parts_getParts",+ module: "parts",+ permission: { module: "parts", actions: ["view"] }+});+const gated = base+ .use(gate(gatedMeta))+ .route({ method: "POST", path: "/parts/getParts", summary: "gated" })+ .input(jsonSchema({ type: "object", properties: {} }))+ .handler(() => ({ data: "ok" }));++const router = { demo: { ping }, parts: { getParts: gated } };+const handler = new OpenAPIHandler(router);++function ctx(overrides: Partial<AuthedContext> = {}): AuthedContext {+ return {+ client: {} as AuthedContext["client"],+ userId: "u1",+ companyId: "c1",+ companyGroupId: "g1",+ authKind: "oauth",+ scopes: {},+ ...overrides+ };+}++describe("oRPC mechanics for the Carbon API v1 surface", () => {+ it("matches a prefixed POST path and returns the handler result over HTTP", async () => {+ const request = new Request(`https://x.test${PREFIX}/demo/ping`, {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({ name: "hello" })+ });+ const { matched, response } = await handler.handle(request, {+ prefix: PREFIX,+ context: ctx()+ });+ expect(matched).toBe(true);+ expect(response?.status).toBe(200);+ const body = (await response?.json()) as { data?: { name?: string } };+ expect(body.data?.name).toBe("hello");+ });++ it("does not match an unknown operation path", async () => {+ const request = new Request(`https://x.test${PREFIX}/demo/nope`, {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: "{}"+ });+ const { matched } = await handler.handle(request, {+ prefix: PREFIX,+ context: ctx()+ });+ expect(matched).toBe(false);+ });++ it("runs the middleware chain via server-side call()", async () => {+ const result = await call(+ router.demo.ping,+ { name: "y" },+ { context: ctx() }+ );+ expect(result).toEqual({ data: { name: "y" } });+ });++ it("403s an API-key caller missing the required scope", async () => {+ const request = new Request(`https://x.test${PREFIX}/parts/getParts`, {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: "{}"+ });+ const { matched, response } = await handler.handle(request, {+ prefix: PREFIX,+ context: ctx({ authKind: "api-key", scopes: {} })+ });+ expect(matched).toBe(true);+ expect(response?.status).toBe(403);+ });++ it("allows an API-key caller holding the scope for the active company", async () => {+ const result = await call(+ router.parts.getParts,+ {},+ { context: ctx({ authKind: "api-key", scopes: { parts_view: ["c1"] } }) }+ );+ expect(result).toEqual({ data: "ok" });+ });++ it("skips the scope gate for oauth (connector) callers", async () => {+ const result = await call(+ router.parts.getParts,+ {},+ { context: ctx({ authKind: "oauth" }) }+ );+ expect(result).toEqual({ data: "ok" });+ });++ it("emits the precomputed JSON Schema into the OpenAPI spec via the custom converter", async () => {+ const generator = new OpenAPIGenerator({+ schemaConverters: [new CarbonJsonSchemaConverter()]+ });+ const spec = (await generator.generate(router, {+ info: { title: "Carbon API", version: "1.0.0" }+ })) as {+ paths?: Record<string, unknown>;+ };+ expect(Object.keys(spec.paths ?? {})).toContain("/demo/ping");+ });++ it("emits the response schema into the spec's 200 body", async () => {+ // Every procedure carries an `.output()`; for lists that is the+ // `{ results, count }` envelope wrapping the schema reflected from the+ // service's return type. Without the converter reaching the output side, the+ // spec documents requests only — which is what it did before responses existed.+ const generator = new OpenAPIGenerator({+ schemaConverters: [new CarbonJsonSchemaConverter()]+ });+ const spec = (await generator.generate(router, {+ info: { title: "Carbon API", version: "1.0.0" }+ })) as any;++ const body =+ spec.paths["/demo/ping"].post.responses["200"].content["application/json"]+ .schema;+ expect(body.properties.results.items.properties.id).toEqual({+ type: "string"+ });+ expect(body.properties.count.type).toEqual(["number", "null"]);+ expect(body.required).toContain("results");+ });++ it("returns single results bare and lists in the { results, count } envelope", () => {+ // Wrapping everything stacked our envelope under every generated client's own+ // result wrapper (`res.data.data.field`). Single results are now the body+ // itself; only lists carry the envelope, because `count` means something+ // there. If either assertion fails, the published schema and the runtime+ // shaping in buildProcedure's handler must change TOGETHER — both key off+ // isListOperation.+ const single = meta({+ responseSchema: { type: "object", properties: { id: { type: "string" } } }+ });+ expect(outputSchema(single)).toEqual({+ type: "object",+ properties: { id: { type: "string" } }+ });++ const list = meta({+ responseSchema: { type: "array", items: { type: "object" } }+ });+ const wrapped = outputSchema(list) as any;+ expect(wrapped.properties.results.type).toBe("array");+ expect(wrapped.properties.count.type).toEqual(["number", "null"]);+ expect(wrapped.required).toEqual(["results"]);++ // No reflected schema → bare and unconstrained, never a phantom envelope.+ expect(outputSchema(meta({ responseSchema: undefined }))).toEqual({});++ // The runtime shaping keys off the SAME bit, so it cannot disagree.+ expect(shapeHttpBody(single, { data: { id: "x" } })).toEqual({ id: "x" });+ expect(shapeHttpBody(list, { data: [1], count: 7 })).toEqual({+ results: [1],+ count: 7+ });+ expect(shapeHttpBody(list, { data: [] })).toEqual({+ results: [],+ count: null+ });+ });++ it("declares exactly ONE auth scheme: Bearer", async () => {+ // The server also accepts the internal `carbon-key` header as a compat alias+ // (authenticate.server.ts), but the spec documents the ONE recommended way so+ // every generated SDK has a single auth story. Adding a second scheme here+ // would hand "either way" to every client generator — if that ever seems+ // desirable again, it was tried and unified away on purpose.+ const generator = new OpenAPIGenerator({+ schemaConverters: [new CarbonJsonSchemaConverter()]+ });+ const spec = (await generator.generate(router, specOptions())) as any;++ expect(Object.keys(spec.components.securitySchemes)).toEqual([+ "bearerAuth"+ ]);+ expect(spec.components.securitySchemes.bearerAuth).toMatchObject({+ type: "http",+ scheme: "bearer"+ });+ expect(spec.security).toEqual([{ bearerAuth: [] }]);+ });+});diff --git a/apps/erp/app/routes/api+/v1+/lib/registry.server.ts b/apps/erp/app/routes/api+/v1+/lib/registry.server.tsnew file mode 100644index 0000000000..6d8c806747--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/lib/registry.server.ts@@ -0,0 +1,40 @@+// The service-function registry the Carbon API dispatch resolves against: every+// module's service namespace, keyed by the manifest's module name. This is the ONE+// copy — the oRPC dispatch, MCP call_tool, the in-app agent, and the workflow+// dispatcher all resolve through it.++import * as accountFunctions from "~/modules/account/account.service";+import * as accountingFunctions from "~/modules/accounting/accounting.ee.service";+import * as documentsFunctions from "~/modules/documents/documents.service";+import * as inventoryFunctions from "~/modules/inventory/inventory.service";+import * as invoicingFunctions from "~/modules/invoicing/invoicing.service";+import * as itemsFunctions from "~/modules/items/items.service";+import * as peopleFunctions from "~/modules/people/people.service";+import * as productionMcpFunctions from "~/modules/production/production.mcp.server";+import * as productionFunctions from "~/modules/production/production.service";+import * as purchasingFunctions from "~/modules/purchasing/purchasing.service";+import * as qualityFunctions from "~/modules/quality/quality.service";+import * as resourcesFunctions from "~/modules/resources/resources.service";+import * as salesFunctions from "~/modules/sales/sales.service";+import * as settingsFunctions from "~/modules/settings/settings.service";+import * as sharedFunctions from "~/modules/shared/shared.service";+import * as usersFunctions from "~/modules/users/users.service";++// Combine all functions into a single registry.+export const functionRegistry = {+ account: accountFunctions,+ accounting: accountingFunctions,+ documents: documentsFunctions,+ inventory: inventoryFunctions,+ invoicing: invoicingFunctions,+ items: itemsFunctions,+ people: peopleFunctions,+ production: { ...productionFunctions, ...productionMcpFunctions },+ purchasing: purchasingFunctions,+ quality: qualityFunctions,+ resources: resourcesFunctions,+ sales: salesFunctions,+ settings: settingsFunctions,+ shared: sharedFunctions,+ users: usersFunctions+};diff --git a/apps/erp/app/routes/api+/v1+/lib/router.server.ts b/apps/erp/app/routes/api+/v1+/lib/router.server.tsnew file mode 100644index 0000000000..458aebf69e--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/lib/router.server.ts@@ -0,0 +1,69 @@+// The Carbon API oRPC router, built at module load from the operation manifest.+// A plain nested object `{ [module]: { [operationId]: procedure } }` is a valid oRPC+// router for both OpenAPIHandler (HTTP) and server-side call() (MCP/agent).++import type { ManifestEntry } from "@carbon/api";+import { jsonSchema, jsonSchemaInput } from "@carbon/api/schema";+import { base, gate, mapThrownErrors } from "./base.server";+import { dispatchOperation } from "./dispatch.server";+import {+ OPERATIONS,+ operationId,+ outputSchema,+ shapeHttpBody+} from "./operations.server";++// Property names oRPC reserves on a router object — an operation id must not collide+// (`then` is the load-bearing one: routers are thenable-detected).+const RESERVED_KEYS = new Set([+ "then",+ "bind",+ "valueOf",+ "toString",+ "toJSON"+]);++function buildProcedure(meta: ManifestEntry, id: string) {+ return (+ base+ // Outside the gate so it also covers anything the gate itself throws+ // through — it re-raises ORPCErrors untouched, so 403s/404s are unaffected.+ .use(mapThrownErrors)+ .use(gate(meta))+ .route({+ method: "POST",+ path: `/${meta.module}/${id}`,+ tags: [meta.module],+ summary: meta.description+ })+ // Input validates; output does NOT — shapeHttpBody rewrites the body, so a+ // correct response does not match the declared response schema.+ .input(jsonSchemaInput(meta.schema))+ .output(jsonSchema(outputSchema(meta)))+ // callOperation reverses this shaping with the same static bit, so+ // MCP/agent/workflow callers still see DispatchResult semantics.+ .handler(async ({ input, context }) =>+ shapeHttpBody(meta, await dispatchOperation(meta, context, input))+ )+ );+}++export const router: Record<+ string,+ Record<string, ReturnType<typeof buildProcedure>>+> = (() => {+ const out: Record<+ string,+ Record<string, ReturnType<typeof buildProcedure>>+ > = {};+ for (const meta of OPERATIONS) {+ const id = operationId(meta);+ if (RESERVED_KEYS.has(id) || RESERVED_KEYS.has(meta.module)) {+ throw new Error(+ `Carbon API operation "${meta.name}" collides with a reserved oRPC router key.`+ );+ }+ (out[meta.module] ??= {})[id] = buildProcedure(meta, id);+ }+ return out;+})();diff --git a/apps/erp/app/routes/api+/v1+/lib/spec-options.server.ts b/apps/erp/app/routes/api+/v1+/lib/spec-options.server.tsnew file mode 100644index 0000000000..38c4eb3ff0--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/lib/spec-options.server.ts@@ -0,0 +1,34 @@+// The OpenAPI document options for the Carbon API spec — extracted from the+// openapi.json route so the mechanics test asserts on the REAL options rather+// than a copy that could drift.++import { getAppUrl } from "@carbon/env";+import type { OpenAPIGeneratorGenerateOptions } from "@orpc/openapi";++export function specOptions(): OpenAPIGeneratorGenerateOptions {+ return {+ info: {+ title: "Carbon API",+ version: "1.0.0",+ description:+ "Carbon's service-layer API — read and write your manufacturing data the safe way."+ },+ servers: [{ url: `${getAppUrl() || ""}/api/v1` }],+ // ONE documented way in: `Authorization: Bearer crbn_…` — the convention every+ // doc sample and the rest.carbon.ms proxy use, and what generated SDKs will+ // configure. The server also accepts the raw internal `carbon-key` header+ // (authenticate.server.ts) as a compatibility alias, deliberately NOT declared+ // here: a spec that says "either way" gives every generated client two auth+ // stories instead of one.+ security: [{ bearerAuth: [] }],+ components: {+ securitySchemes: {+ bearerAuth: {+ type: "http",+ scheme: "bearer",+ description: "A Carbon API key (`crbn_…`) sent as a Bearer token."+ }+ }+ }+ };+}diff --git a/apps/erp/app/routes/api+/v1+/openapi[.]json.ts b/apps/erp/app/routes/api+/v1+/openapi[.]json.tsnew file mode 100644index 0000000000..cdd8610e37--- /dev/null+++ b/apps/erp/app/routes/api+/v1+/openapi[.]json.ts@@ -0,0 +1,27 @@+// GET /api/v1/openapi.json — the generated OpenAPI 3 spec for the Carbon API.+// Public, so clients can generate a typed client in any language. Memoized at module+// scope (the router and its schemas are static for the process lifetime).++import { CarbonJsonSchemaConverter } from "@carbon/api/schema";+import { OpenAPIGenerator } from "@orpc/openapi";+import { router } from "./lib/router.server";+import { specOptions } from "./lib/spec-options.server";++// The promise, not the string: concurrent cold-start requests on this public+// route must share ONE generation of the 1,495-operation spec.+let cachedSpec: Promise<string> | null = null;++async function generateSpec(): Promise<string> {+ const generator = new OpenAPIGenerator({+ schemaConverters: [new CarbonJsonSchemaConverter()]+ });+ const spec = await generator.generate(router, specOptions());+ return JSON.stringify(spec);+}++export async function loader() {+ cachedSpec ??= generateSpec();+ return new Response(await cachedSpec, {+ headers: { "content-type": "application/json" }+ });+}diff --git a/apps/erp/app/routes/x+/settings+/api-keys.$id.tsx b/apps/erp/app/routes/x+/settings+/api-keys.$id.tsxindex 435254db5a..bf25ce275c 100644--- a/apps/erp/app/routes/x+/settings+/api-keys.$id.tsx+++ b/apps/erp/app/routes/x+/settings+/api-keys.$id.tsx@@ -8,6 +8,7 @@ import { data, redirect, useNavigate, useParams } from "react-router";import { useRouteData } from "~/hooks";import type { ApiKey } from "~/modules/settings";import { ApiKeyForm, apiKeyValidator, upsertApiKey } from "~/modules/settings";+import { invalidateApiKeyCache } from "~/modules/settings/settings.server";import { getParams, path } from "~/utils/path";export async function action({ request, params }: ActionFunctionArgs) {@@ -56,6 +57,9 @@ export async function action({ request, params }: ActionFunctionArgs) {);}+ // A scope/expiry edit must not keep authenticating from the 30s auth cache.+ await invalidateApiKeyCache(id, companyId);+throw redirect(`${path.to.apiKeys}?${getParams(request)}`,await flash(request, success("Updated API key"))diff --git a/apps/erp/app/routes/x+/settings+/api-keys.delete.$id.tsx b/apps/erp/app/routes/x+/settings+/api-keys.delete.$id.tsxindex 3d2f20946e..b11cd89f8b 100644--- a/apps/erp/app/routes/x+/settings+/api-keys.delete.$id.tsx+++ b/apps/erp/app/routes/x+/settings+/api-keys.delete.$id.tsx@@ -1,5 +1,5 @@import { error, success } from "@carbon/auth";-import { requirePermissions } from "@carbon/auth/auth.server";+import { bustApiKeyCache, requirePermissions } from "@carbon/auth/auth.server";import { flash } from "@carbon/auth/session.server";import { requirePlan } from "@carbon/ee/plan.server";import { useLingui } from "@lingui/react/macro";@@ -9,6 +9,7 @@ import { ConfirmDelete } from "~/components/Modals";import { useRouteData } from "~/hooks";import type { ApiKey } from "~/modules/settings";import { deleteApiKey } from "~/modules/settings";+import { invalidateApiKeyCache } from "~/modules/settings/settings.server";import { getParams, path } from "~/utils/path";export async function action({ request, params }: ActionFunctionArgs) {@@ -32,6 +33,9 @@ export async function action({ request, params }: ActionFunctionArgs) {);}+ // Bust BEFORE the delete — the keyHash is unreadable once the row is gone.+ const keyHash = await invalidateApiKeyCache(id, companyId);+const { error: deleteApiKeyError } = await deleteApiKey(client, id);if (deleteApiKeyError) {throw redirect(@@ -40,6 +44,10 @@ export async function action({ request, params }: ActionFunctionArgs) {);}+ // Bust again now the row is gone: an auth read racing the first bust could+ // have re-primed the cache with the still-live row.+ if (keyHash) await bustApiKeyCache(keyHash);+throw redirect(`${path.to.apiKeys}?${getParams(request)}`,await flash(request, success("Successfully deleted API key"))diff --git a/apps/erp/app/utils/path.ts b/apps/erp/app/utils/path.tsindex 1a2e255e11..b9494c6d5b 100644--- a/apps/erp/app/utils/path.ts+++ b/apps/erp/app/utils/path.ts@@ -1401,7 +1401,7 @@ export const path = {materials: `${x}/items/materials`,materialType: (id: string) => generatePath(`${x}/items/types/${id}`),materialTypes: `${x}/items/types`,- mcpDocs: withDocsHost("https://docs.carbon.ms/mcp"),+ mcpDocs: withDocsHost("https://docs.carbon.ms/api/mcp"),// Credit / Debit memos — payment-shaped documents (the `memo` table). The// list lives in the invoicing nav beside Payments; details mirror payments.memo: (id: string) => generatePath(`${x}/credits/${id}`),diff --git a/apps/erp/package.json b/apps/erp/package.jsonindex b6fb5371be..ab7046b157 100644--- a/apps/erp/package.json+++ b/apps/erp/package.json@@ -12,6 +12,7 @@"@ai-sdk/openai": "catalog:","@ai-sdk/react": "2.0.174","@base-ui-components/react": "1.0.0-rc.0",+ "@carbon/api": "workspace:*","@carbon/auth": "workspace:*","@carbon/database": "workspace:*","@carbon/documents": "workspace:*",@@ -46,6 +47,8 @@"@modelcontextprotocol/sdk": "1.29.0","@monaco-editor/react": "4.7.0","@nanostores/react": "catalog:",+ "@orpc/openapi": "catalog:",+ "@orpc/server": "catalog:","@paper-design/shaders-react": "^0.0.57","@react-aria/i18n": "catalog:","@react-email/components": "catalog:",diff --git a/apps/erp/react-router.config.ts b/apps/erp/react-router.config.tsindex eff99d02a6..27eaf05857 100644--- a/apps/erp/react-router.config.ts+++ b/apps/erp/react-router.config.ts@@ -5,7 +5,7 @@ import { vercelPreset } from "@vercel/react-router/vite";export default {ssr: true,presets: process.env.VERCEL ? [vercelPreset()] : undefined,- future: { unstable_optimizeDeps: true, v8_middleware: true },+ future: { unstable_optimizeDeps: true, v8_middleware: true, v8_viteEnvironmentApi: true },allowedActionOrigins:process.env.NODE_ENV === "development"? ["erp.*.dev", "**.localhost"]diff --git a/apps/erp/test/mcp-tool-permissions.test.ts b/apps/erp/test/mcp-tool-permissions.test.tsnew file mode 100644index 0000000000..8425af3d51--- /dev/null+++ b/apps/erp/test/mcp-tool-permissions.test.ts@@ -0,0 +1,120 @@+import { describe, expect, it } from "vitest";+import metadata from "../app/routes/api+/mcp+/lib/tool-metadata.json";++// Pins the permission-derivation rules in scripts/lib/service-metadata.ts+// (derivePermission + permissionActionsFor) against the REAL generated manifest.+// These permissions gate every API-key call at the oRPC layer, so a generator+// change that silently re-derives them is an authorization change — it must fail+// here first.++type Tool = {+ name: string;+ module: string;+ classification: "READ" | "WRITE" | "DESTRUCTIVE";+ permission: { module: string | null; actions: string[] };+};++const allTools = metadata.tools as Tool[];++// PERMISSION_OVERRIDES in scripts/lib/service-metadata.ts — route-verified+// exceptions that win over the derivation rules. Pinned exactly below and+// excluded from the rule-based assertions.+const OVERRIDDEN = new Set([+ "settings_getApiKeys",+ "settings_upsertApiKey",+ "settings_deleteApiKey"+]);++const tools = allTools.filter((t) => !OVERRIDDEN.has(t.name));++const funcName = (t: Tool) => t.name.slice(t.module.length + 1).toLowerCase();++describe("permission overrides", () => {+ it("API-key management gates on users_update, matching its ERP routes", () => {+ for (const name of OVERRIDDEN) {+ const t = allTools.find((t) => t.name === name);+ expect(t, name).toBeDefined();+ expect(t?.permission, name).toEqual({+ module: "users",+ actions: ["update"]+ });+ }+ });+});++describe("permission module mapping", () => {+ it("maps items_* to the 'parts' permission module", () => {+ for (const t of tools.filter((t) => t.module === "items")) {+ expect(t.permission.module, t.name).toBe("parts");+ }+ });++ it("maps account_* and shared_* to null (valid-key-of-company gate only)", () => {+ for (const t of tools.filter(+ (t) => t.module === "account" || t.module === "shared"+ )) {+ expect(t.permission.module, t.name).toBeNull();+ }+ });++ it("maps every other module to itself", () => {+ for (const t of tools.filter(+ (t) => !["items", "account", "shared"].includes(t.module)+ )) {+ expect(t.permission.module, t.name).toBe(t.module);+ }+ });+});++describe("permission action derivation", () => {+ it("every READ op gates on view only", () => {+ for (const t of tools.filter((t) => t.classification === "READ")) {+ expect(t.permission.actions, t.name).toEqual(["view"]);+ }+ });++ it("every delete* op gates on delete", () => {+ for (const t of tools.filter(+ (t) => t.classification !== "READ" && funcName(t).startsWith("delete")+ )) {+ expect(t.permission.actions, t.name).toEqual(["delete"]);+ }+ });++ it("every upsert* op gates on create AND update (open question 2 in the parent plan — pinned so a change is deliberate)", () => {+ for (const t of tools.filter(+ (t) => t.classification !== "READ" && funcName(t).startsWith("upsert")+ )) {+ expect(t.permission.actions, t.name).toEqual(["create", "update"]);+ }+ });++ it("insert|create|add|new|copy|duplicate|generate* ops gate on create", () => {+ for (const t of tools.filter(+ (t) =>+ t.classification !== "READ" &&+ !funcName(t).startsWith("upsert") &&+ /^(insert|create|add|new|copy|duplicate|generate)/.test(funcName(t))+ )) {+ expect(t.permission.actions, t.name).toEqual(["create"]);+ }+ });++ it("every remaining write verb gates on update", () => {+ for (const t of tools.filter(+ (t) =>+ t.classification !== "READ" &&+ !/^(upsert|delete|insert|create|add|new|copy|duplicate|generate)/.test(+ funcName(t)+ )+ )) {+ expect(t.permission.actions, t.name).toEqual(["update"]);+ }+ });++ it("every op has a non-empty actions array", () => {+ for (const t of tools) {+ expect(t.permission.actions.length, t.name).toBeGreaterThan(0);+ }+ });+});diff --git a/apps/mes/react-router.config.ts b/apps/mes/react-router.config.tsindex 4ac60bc949..33bf20e1d5 100644--- a/apps/mes/react-router.config.ts+++ b/apps/mes/react-router.config.ts@@ -4,7 +4,7 @@ import { vercelPreset } from "@vercel/react-router/vite";export default {ssr: true,presets: process.env.VERCEL ? [vercelPreset()] : undefined,- future: { unstable_optimizeDeps: true, v8_middleware: true },+ future: { unstable_optimizeDeps: true, v8_middleware: true, v8_viteEnvironmentApi: true },allowedActionOrigins:process.env.NODE_ENV === "development"? ["mes.*.dev", "**.localhost"]diff --git a/apps/starter/react-router.config.ts b/apps/starter/react-router.config.tsindex 9388d8902d..c5c3fff4c8 100644--- a/apps/starter/react-router.config.ts+++ b/apps/starter/react-router.config.ts@@ -4,5 +4,5 @@ import { vercelPreset } from "@vercel/react-router/vite";export default {ssr: true,presets: process.env.VERCEL ? [vercelPreset()] : undefined,- future: { v8_middleware: true },+ future: { v8_middleware: true, v8_viteEnvironmentApi: true },} satisfies Config;diff --git a/biome.jsonc b/biome.jsoncindex 0d61d1a1d0..8071b269ab 100644--- a/biome.jsonc+++ b/biome.jsonc@@ -13,6 +13,10 @@"!**/mcp*/lib/server.ts","**/*.json","!**/mcp*/lib/tool-metadata.json",+ // Generated, and its ONE-LINE-PER-OPERATION layout is the point: formatting+ // it to nine lines an operation turns a single changed schema into a+ // nine-line hunk, which is exactly what this file exists to avoid.+ "!**/mcp*/lib/tool-manifest.digest.json","contrib/building/examples/**/*"]},diff --git a/docs/app/api-reference/layout.tsx b/docs/app/api-reference/layout.tsxdeleted file mode 100644index 7d0988e1ba..0000000000--- a/docs/app/api-reference/layout.tsx+++ /dev/null@@ -1,44 +0,0 @@-import type { ReactNode } from "react";-import { ApiNav } from "@/components/api/api-nav";-import { ApiConfigProvider } from "@/components/api/config-context";-import { Configurator } from "@/components/api/configurator";-import { TableOfContents } from "@/components/api/toc";-import { MainHeader } from "@/components/main-header";-import { NavScrollChevron } from "@/components/nav-scroll-chevron";-import { navTree } from "@/lib/api-data";--export default function ApiReferenceLayout({- children-}: {- children: ReactNode;-}) {- return (- <div className="min-h-screen w-full bg-ed-paper">- <ApiConfigProvider>- <MainHeader- active="api"- mobileNav={- <>- <Configurator />- <ApiNav tree={navTree} />- </>- }- />-- <div className="mx-auto flex w-full max-w-370 pt-16">- <aside className="sticky top-16 hidden h-[calc(100dvh-64px)] w-70 shrink-0 overflow-y-auto border-r border-ed-hairline px-5 py-7 scrollbar-hidden-until-scroll nav-scroll-fade lg:block">- <Configurator />- <ApiNav tree={navTree} />- <NavScrollChevron />- </aside>- <main className="min-w-0 flex-1 px-6 pb-35 pt-10 lg:px-14">- {children}- </main>- <aside className="hidden w-58 shrink-0 px-7 pt-10 xl:block">- <TableOfContents />- </aside>- </div>- </ApiConfigProvider>- </div>- );-}diff --git a/docs/app/mcp/authentication/page.tsx b/docs/app/api/authentication/page.tsxsimilarity index 69%rename from docs/app/mcp/authentication/page.tsxrename to docs/app/api/authentication/page.tsxindex 9dcc54903e..ac3f5dff9e 100644--- a/docs/app/mcp/authentication/page.tsx+++ b/docs/app/api/authentication/page.tsx@@ -14,21 +14,21 @@ import { ContentFooter } from "@/components/api/page-footer";import { pageSeo, SEO } from "@/lib/seo";export const metadata = pageSeo({- title: `${SEO.mcp.auth.title} — Carbon`,- ogTitle: SEO.mcp.auth.title,- description: SEO.mcp.auth.description,- path: "/mcp/authentication",- eyebrow: "MCP"+ title: `${SEO.carbonApi.auth.title} — Carbon`,+ ogTitle: SEO.carbonApi.auth.title,+ description: SEO.carbonApi.auth.description,+ path: "/api/authentication",+ eyebrow: "Carbon API"});-export default function McpAuthenticationPage() {+export default function ApiAuthenticationPage() {return (<DocPage>- <DocEyebrow>MCP</DocEyebrow>+ <DocEyebrow>Carbon API</DocEyebrow><DocTitle>Authentication</DocTitle><Lead>- An MCP client inherits exactly the identity it authenticates as — and- can only do what that identity can. There are two flows, by client type.+ A client inherits exactly the identity it authenticates as — and can+ only do what that identity can. There are two flows, by client type.</Lead><H2 id="connector">Connector (OAuth)</H2>@@ -49,10 +49,9 @@ export default function McpAuthenticationPage() {<H2 id="permissions">Permissions</H2><P>- Either way, the assistant can only do what that identity can — a- connector inherits your role and company, a key carries the scopes you- granted it. Use a separate key per client, so revoking one doesn't break- the rest.+ Either way, the client can only do what that identity can — a connector+ inherits your role and company, a key carries the scopes you granted it.+ Use a separate key per client, so revoking one doesn't break the rest.</P><H2 id="errors">Errors</H2>@@ -74,7 +73,10 @@ export default function McpAuthenticationPage() {/></Table>- <ContentFooter prev={{ label: "Overview", url: "/mcp" }} />+ <ContentFooter+ prev={{ label: "Connect over MCP", url: "/api/mcp" }}+ next={{ label: "Client SDKs", url: "/api/sdks" }}+ /></DocPage>);}diff --git a/docs/app/api-reference/[module]/[resource]/page.tsx b/docs/app/api/data/[module]/[resource]/page.tsxsimilarity index 72%rename from docs/app/api-reference/[module]/[resource]/page.tsxrename to docs/app/api/data/[module]/[resource]/page.tsxindex 6edb94f8b6..bed9db16b3 100644--- a/docs/app/api-reference/[module]/[resource]/page.tsx+++ b/docs/app/api/data/[module]/[resource]/page.tsx@@ -3,7 +3,7 @@ import { notFound } from "next/navigation";import { BaseUrl } from "@/components/api/base-url";import { Breadcrumb } from "@/components/api/breadcrumb";import { EndpointSection } from "@/components/api/endpoint-section";-import { ViewCallout, TableCallout } from "@/components/api/view-callout";+import { TableCallout, ViewCallout, WriteSteerCallout } from "@/components/api/view-callout";import { allResourceParams, apiBase, getResource } from "@/lib/api-data";import { TABLE_VIEW_COMPANIONS, VIEW_TABLE_COMPANIONS } from "@/lib/api-companion-views";import { pageSeo } from "@/lib/seo";@@ -18,11 +18,11 @@ export async function generateMetadata(props: Params): Promise<Metadata> {const { module, resource } = await props.params;const found = getResource(module, resource);return pageSeo({- title: found ? `${found.resource.name} — Carbon API` : "Carbon API",- ogTitle: found?.resource.name ?? "Carbon API",+ title: found ? `${found.resource.name} — Carbon Data API` : "Carbon Data API",+ ogTitle: found?.resource.name ?? "Carbon Data API",description: found?.resource.description,- path: `/api-reference/${module}/${resource}`,- eyebrow: found ? found.module.name : "API reference"+ path: `/api/data/${module}/${resource}`,+ eyebrow: found ? found.module.name : "Data API"});}@@ -35,7 +35,10 @@ export default async function ResourcePage(props: Params) {return (<div className="max-w-295"><Breadcrumb- items={[{ label: "API", href: "/api-reference" }, { label: mod.name }]}+ items={[+ { label: "Data API", href: "/api/data" },+ { label: mod.name }+ ]}/><h1 className="m-0 mt-2 text-ed-32 font-semibold tracking-tight leading-[120%] text-ed-ink">{r.name}@@ -45,17 +48,18 @@ export default async function ResourcePage(props: Params) {</p><BaseUrl path={r.endpoints[0]?.path ?? ""} />+ {r.kind === "table" && <WriteSteerCallout />}{r.kind === "table" && TABLE_VIEW_COMPANIONS[r.table] && (<ViewCallouttableName={r.table}viewName={TABLE_VIEW_COMPANIONS[r.table].viewTable}- viewHref={`/api-reference/${TABLE_VIEW_COMPANIONS[r.table].viewModule}/${TABLE_VIEW_COMPANIONS[r.table].viewSlug}`}+ viewHref={`/api/data/${TABLE_VIEW_COMPANIONS[r.table].viewModule}/${TABLE_VIEW_COMPANIONS[r.table].viewSlug}`}/>)}{r.kind === "view" && VIEW_TABLE_COMPANIONS[r.table] && (<TableCallouttableName={VIEW_TABLE_COMPANIONS[r.table].tableTable}- tableHref={`/api-reference/${VIEW_TABLE_COMPANIONS[r.table].tableModule}/${VIEW_TABLE_COMPANIONS[r.table].tableSlug}`}+ tableHref={`/api/data/${VIEW_TABLE_COMPANIONS[r.table].tableModule}/${VIEW_TABLE_COMPANIONS[r.table].tableSlug}`}/>)}diff --git a/docs/app/api-reference/authentication/page.tsx b/docs/app/api/data/authentication/page.tsxsimilarity index 86%rename from docs/app/api-reference/authentication/page.tsxrename to docs/app/api/data/authentication/page.tsxindex f476b45d8b..62cc34b469 100644--- a/docs/app/api-reference/authentication/page.tsx+++ b/docs/app/api/data/authentication/page.tsx@@ -19,8 +19,8 @@ export const metadata = pageSeo({title: `${SEO.api.auth.title} — Carbon`,ogTitle: SEO.api.auth.title,description: SEO.api.auth.description,- path: "/api-reference/authentication",- eyebrow: "API reference"+ path: "/api/data/authentication",+ eyebrow: "Data API"});const REQUEST = `curl 'https://rest.carbon.ms/item?limit=1' \\@@ -66,11 +66,11 @@ export default async function AuthenticationPage() {const html = await highlight(REQUEST, "curl");return (<DocPage>- <DocEyebrow>REST API</DocEyebrow>+ <DocEyebrow>Data API</DocEyebrow><DocTitle>Authentication</DocTitle><Lead>- Carbon authenticates public API requests with a scoped, optionally- expiring API key.+ Carbon authenticates Data API requests with a scoped, optionally+ expiring API key — the same key that unlocks the Carbon API.</Lead><P>Create a key in{" "}@@ -81,6 +81,13 @@ export default async function AuthenticationPage() {<Code>Authorization: Bearer <api-key></Code>.</P><CodeBlock html={html} code={REQUEST} label="Example request" />+ <P>+ That's the hosted Data API at <Code>rest.carbon.ms</Code>, which takes+ the key as a bearer token and forwards it as the <Code>carbon-key</Code>{" "}+ header internally. If you run Carbon yourself and call PostgREST+ directly, send <Code>carbon-key: crbn_…</Code> against{" "}+ <Code>/rest/v1/<table></Code> instead.+ </P><H2 id="creating-a-key">Creating a key</H2><P>@@ -184,12 +191,12 @@ export default async function AuthenticationPage() {cols="72px 1fr"cells={[<Code key="c">429</Code>,- "Rate limit exceeded — every key allows 60 requests per minute. Back off and retry per the X-RateLimit-* and Retry-After response headers."+ "Rate limit exceeded — every key allows 60 requests per minute by default, a platform-set limit shown (not editable) in Settings → API Keys. Back off and retry per the X-RateLimit-* and Retry-After response headers."]}/></Table>- <ContentFooter prev={{ label: "Overview", url: "/api-reference" }} />+ <ContentFooter prev={{ label: "Overview", url: "/api/data" }} /></DocPage>);}diff --git a/docs/app/api-reference/page.tsx b/docs/app/api/data/page.tsxsimilarity index 68%rename from docs/app/api-reference/page.tsxrename to docs/app/api/data/page.tsxindex c7925cb22f..a052cc99cc 100644--- a/docs/app/api-reference/page.tsx+++ b/docs/app/api/data/page.tsx@@ -13,7 +13,6 @@ import {Row} from "@/components/api/doc";import { ContentFooter } from "@/components/api/page-footer";-import { SdkCards } from "@/components/api/sdk-cards";import { apiBase } from "@/lib/api-data";import { highlight } from "@/lib/highlight";import { pageSeo, SEO } from "@/lib/seo";@@ -22,18 +21,18 @@ export const metadata = pageSeo({title: `${SEO.api.intro.title} — Carbon`,ogTitle: SEO.api.intro.title,description: SEO.api.intro.description,- path: "/api-reference",- eyebrow: "API reference"+ path: "/api/data",+ eyebrow: "Data API"});const ENV = `# .env-CARBON_API_URL=${apiBase}-CARBON_API_KEY=<your-api-key>`;+CARBON_DATA_API_URL=${apiBase}+CARBON_DATA_API_KEY=<your-api-key>`;const INIT = `import { createClient } from '@supabase/supabase-js'-const apiUrl = process.env.CARBON_API_URL-const apiKey = process.env.CARBON_API_KEY+const apiUrl = process.env.CARBON_DATA_API_URL+const apiKey = process.env.CARBON_DATA_API_KEYexport const carbon = createClient(apiUrl, apiKey)`;@@ -45,26 +44,27 @@ export default async function ApiIntroPage() {return (<DocPage>- <DocEyebrow>REST API</DocEyebrow>+ <DocEyebrow>Data API</DocEyebrow><DocTitle>Overview</DocTitle><Lead>- The Carbon API is a REST interface over your manufacturing data — every- table and view is an endpoint, with full read and write access.+ The Data API is direct REST access to Carbon's tables and views — the+ escape hatch beneath the <DocLink href="/api">Carbon API</DocLink>.+ Every table and view is an endpoint.</Lead><P>- There are three ways to call it: directly over HTTP, through the{" "}- <DocLink href="#client-libraries">JavaScript SDK</DocLink>, or from the{" "}- <DocLink href="/mcp">MCP server</DocLink>. Start by creating an{" "}- <DocLink href="/api-reference/authentication">API key</DocLink>.+ Reach for the <DocLink href="/api">Carbon API</DocLink> first. This+ surface is for the case it doesn't cover — when you know exactly what+ you're touching. Start by creating an{" "}+ <DocLink href="/api/data/authentication">API key</DocLink>.</P>- <H2 id="client-libraries">Client libraries</H2>- <P>- Carbon's API is standard REST, so it works from any language. The- recommended client is the JavaScript SDK, built on{" "}- <Code>supabase-js</Code>.- </P>- <SdkCards />+ <Warn title="You are outside the service layer">+ Nothing here validates, recalculates, or posts. A write goes straight+ to the table, so the values that depend on it — order totals, statuses,+ ledger entries — are not maintained for you. Use the{" "}+ <DocLink href="/api">Carbon API</DocLink> unless you know exactly what+ the table touches.+ </Warn><H2 id="tables-and-views">Tables & views</H2><P>@@ -87,7 +87,7 @@ export default async function ApiIntroPage() {<Rowcols="1fr 1fr"cells={[- "List / retrieve / analytics",+ "List / retrieve",<>The <strong>view</strong> (plural, e.g. salesInvoices)</>,]}/>@@ -107,7 +107,11 @@ export default async function ApiIntroPage() {</P><H2 id="quickstart">Quickstart</H2>- <P>Save your key and the API URL as environment variables:</P>+ <P>+ The Data API is standard REST — call it from any language, or use{" "}+ <Code>supabase-js</Code> as shown here. Save your key and the API URL as+ environment variables:+ </P><CodeBlock html={env} code={ENV} label=".env" /><P>Then initialize the client:</P><CodeBlock html={init} code={INIT} label="lib/carbon.ts" />@@ -118,7 +122,7 @@ export default async function ApiIntroPage() {</P><ContentFooter- next={{ label: "Authentication", url: "/api-reference/authentication" }}+ next={{ label: "Authentication", url: "/api/data/authentication" }}/></DocPage>);diff --git a/docs/app/mcp/layout.tsx b/docs/app/api/layout.tsxsimilarity index 56%rename from docs/app/mcp/layout.tsxrename to docs/app/api/layout.tsxindex 557271f0e1..f1f6195bb5 100644--- a/docs/app/mcp/layout.tsx+++ b/docs/app/api/layout.tsx@@ -1,38 +1,41 @@import type { ReactNode } from "react";+import { ContextualNav } from "@/components/api/contextual-nav";import { ApiConfigProvider } from "@/components/api/config-context";import { Configurator } from "@/components/api/configurator";-import { McpNav } from "@/components/api/mcp-nav";-import { TableOfContents } from "@/components/api/toc";import { MainHeader } from "@/components/main-header";import { NavScrollChevron } from "@/components/nav-scroll-chevron";+import { navTree } from "@/lib/api-data";import { toolsNavTree } from "@/lib/tools-data";-export default function McpLayout({ children }: { children: ReactNode }) {+/**+ * One layout for the whole API surface — one header entry, one configurator, and+ * ONE tree at a time: the sidebar is contextual (see ContextualNav), showing the+ * Carbon API catalog everywhere except under /api/data, where the Data API's+ * resource tree swaps in with a way back.+ */+function ApiSidebar() {+ return (+ <>+ <Configurator />+ <ContextualNav operations={toolsNavTree} tree={navTree} />+ </>+ );+}++export default function ApiLayout({ children }: { children: ReactNode }) {return (<div className="min-h-screen w-full bg-ed-paper"><ApiConfigProvider>- <MainHeader- active="mcp"- mobileNav={- <>- <Configurator />- <McpNav tools={toolsNavTree} />- </>- }- />+ <MainHeader active="api" mobileNav={<ApiSidebar />} /><div className="mx-auto flex w-full max-w-370 pt-16"><aside className="sticky top-16 hidden h-[calc(100dvh-64px)] w-70 shrink-0 overflow-y-auto border-r border-ed-hairline px-5 py-7 scrollbar-hidden-until-scroll nav-scroll-fade lg:block">- <Configurator />- <McpNav tools={toolsNavTree} />+ <ApiSidebar /><NavScrollChevron /></aside><main className="min-w-0 flex-1 px-6 pb-35 pt-10 lg:px-14">{children}</main>- <aside className="hidden w-58 shrink-0 px-7 pt-10 xl:block">- <TableOfContents />- </aside></div></ApiConfigProvider></div>diff --git a/docs/app/mcp/page.tsx b/docs/app/api/mcp/page.tsxsimilarity index 67%rename from docs/app/mcp/page.tsxrename to docs/app/api/mcp/page.tsxindex 8d93cd1597..02ab83572c 100644--- a/docs/app/mcp/page.tsx+++ b/docs/app/api/mcp/page.tsx@@ -2,25 +2,29 @@ import { CodeBlock } from "@/components/api/code-block";import { DEFAULT_MCP_ENDPOINT } from "@/components/api/config-constants";import { McpEndpoint } from "@/components/api/config-inline";import {+ Code,DocEyebrow,DocLink,DocPage,DocTitle,H2,Lead,- P+ P,+ Row,+ Table} from "@/components/api/doc";import { Faq, type FaqEntry } from "@/components/api/faq";import { ContentFooter } from "@/components/api/page-footer";import { highlight } from "@/lib/highlight";import { pageSeo, SEO } from "@/lib/seo";+import { toolCounts } from "@/lib/tools-data";export const metadata = pageSeo({- title: `${SEO.mcp.intro.title} — Carbon`,- ogTitle: SEO.mcp.intro.title,- description: SEO.mcp.intro.description,- path: "/mcp",- eyebrow: "MCP"+ title: `${SEO.carbonApi.mcp.title} — Carbon`,+ ogTitle: SEO.carbonApi.mcp.title,+ description: SEO.carbonApi.mcp.description,+ path: "/api/mcp",+ eyebrow: "Carbon API"});// Sourced from the config so the samples below stay in lockstep with what@@ -70,12 +74,12 @@ const FAQ: FaqEntry[] = [a: "Carbon doesn't send it anywhere new — your MCP client does, to whatever model provider it runs on, under that provider's terms. Scope keys tightly and prefer a read-only key when you only need to read."},{- q: "Is MCP available on my plan?",+ q: "Is the Carbon API available on my plan?",a: "On Carbon Cloud, API and MCP access is a Business-plan feature — Starter keys are rejected with 403. Self-hosted, it's part of the Enterprise feature set and requires a commercial license. See Licensing for the full picture."},{q: "Is there a rate limit?",- a: "Each key has its own limit and window, set in Settings → API Keys. Go over it and calls return 429 with X-RateLimit-* headers telling the client when to retry."+ a: "Each key has its own limit and window — 60 requests per minute by default. It's platform-controlled: the Rate Limit column in Settings → API Keys shows the limit in force, but there's no field to change it. Go over it and calls return 429 with X-RateLimit-* and Retry-After headers telling the client when to retry."},{q: "I'm getting 401 Unauthorized",@@ -91,7 +95,7 @@ const FAQ: FaqEntry[] = [}];-export default async function McpPage() {+export default async function ConnectOverMcpPage() {const [code, cursor] = await Promise.all([highlight(CLAUDE_CODE, "curl"),highlight(CURSOR, "json")@@ -99,12 +103,12 @@ export default async function McpPage() {return (<DocPage>- <DocEyebrow>MCP</DocEyebrow>- <DocTitle>Model Context Protocol</DocTitle>+ <DocEyebrow>Carbon API</DocEyebrow>+ <DocTitle>Connect over MCP</DocTitle><Lead>Carbon runs an MCP server, so AI clients — Claude Code, Claude Desktop,- Cursor, ChatGPT — can read and write your manufacturing data in plain- language.+ Cursor, ChatGPT — can reach the Carbon API and read or write your+ manufacturing data in plain language.</Lead><P>The server lives at <McpEndpoint />. Connect it one of two ways,@@ -127,6 +131,45 @@ export default async function McpPage() {/><CodeBlock html={cursor} code={CURSOR} label=".cursor/mcp.json" />+ <H2 id="discovery">Discovery</H2>+ <P>+ The server does not register all{" "}+ {toolCounts().total.toLocaleString()} operations as tools — that+ would flood a model's context. It exposes three meta-tools instead, and+ the model loads only what a task needs:+ </P>+ <Table>+ <Row head cols="150px 1fr" cells={["Meta-tool", "What it does"]} />+ <Row+ cols="150px 1fr"+ cells={[+ <Code key="s">search_tools</Code>,+ "Find operations by query, module, or classification."+ ]}+ />+ <Row+ cols="150px 1fr"+ cells={[+ <Code key="d">describe_tool</Code>,+ "Get an operation's input schema and description."+ ]}+ />+ <Row+ cols="150px 1fr"+ cells={[+ <Code key="c">call_tool</Code>,+ "Invoke an operation by name with its arguments."+ ]}+ />+ </Table>+ <P>+ A typical flow is <Code>search_tools</Code> → <Code>describe_tool</Code>{" "}+ → <Code>call_tool</Code>, which keeps the model's context lean no matter+ how large the catalog grows. The same operations are also plain HTTP+ endpoints — every one has a page of its own, listed by module in the+ sidebar.+ </P>+<H2 id="ask">What you can ask</H2><P>Once connected, ask in natural language:</P><ul className="m-0 mt-3 flex list-none flex-col gap-2 p-0">@@ -141,16 +184,17 @@ export default async function McpPage() {))}</ul><P>- Next: <DocLink href="/mcp/authentication">Authentication</DocLink> for- the auth flows, and <DocLink href="/mcp/tools">Tools</DocLink> for how- the assistant finds what it needs.+ Next: <DocLink href="/api/authentication">Authentication</DocLink> for+ the auth flows, and <DocLink href="/api/sdks">Client SDKs</DocLink> for+ calling the same operations from your own code.</P><H2 id="faq">FAQ</H2><Faq items={FAQ} /><ContentFooter- next={{ label: "Authentication", url: "/mcp/authentication" }}+ prev={{ label: "Overview", url: "/api" }}+ next={{ label: "Authentication", url: "/api/authentication" }}/></DocPage>);diff --git a/docs/app/api/operations/[operation]/page.tsx b/docs/app/api/operations/[operation]/page.tsxnew file mode 100644index 0000000000..a2df295329--- /dev/null+++ b/docs/app/api/operations/[operation]/page.tsx@@ -0,0 +1,218 @@+import type { Metadata } from "next";+import { notFound } from "next/navigation";+import { Breadcrumb } from "@/components/api/breadcrumb";+import { CodeBlock } from "@/components/api/code-block";+import { DocPage, H2, P } from "@/components/api/doc";+import { OperationPanel } from "@/components/api/operation-panel";+import {+ type JsonSchemaNode,+ SchemaTable+} from "@/components/api/schema-table";+import { highlight } from "@/lib/highlight";+import {+ buildOperationSamples,+ operationPath,+ SAMPLE_GRAMMAR,+ SAMPLE_KEYS,+ type SampleKey+} from "@/lib/operation-samples";+import { pageSeo } from "@/lib/seo";+import {+ allToolParams,+ getTool,+ operationLabel,+ type ToolClass+} from "@/lib/tools-data";++type Params = { params: Promise<{ operation: string }> };++export function generateStaticParams() {+ return allToolParams().map((p) => ({ operation: p.tool }));+}++export async function generateMetadata(props: Params): Promise<Metadata> {+ const { operation } = await props.params;+ const found = getTool(operation);+ // The full, callable name stays in the page title — that is the string a reader+ // pastes into a search box — while the heading drops the module prefix the+ // breadcrumb already carries.+ return pageSeo({+ title: found ? `${found.tool.name} — Carbon API` : "Carbon API",+ ogTitle: found?.tool.name ?? "Carbon API",+ description: found?.tool.description,+ path: `/api/operations/${operation}`,+ eyebrow: found ? `Carbon API · ${found.module.name}` : "Carbon API"+ });+}++/**+ * A representative value for a reflected response schema. Enums use their first+ * real value and nullables show the non-null form — a sample exists to be read.+ * Anything the schema genuinely doesn't describe — a depth-capped branch, an+ * `any` — renders as the "…" marker, never as `null`: null reads as a real value+ * a caller might receive, while "…" reads as what it is, an omission. Arrays+ * render a single element; one row shows the shape.+ */+const OMITTED = "…";++function exampleFromSchema(schema: unknown, depth = 0): unknown {+ if (!schema || typeof schema !== "object") return OMITTED;+ const s = schema as JsonSchemaNode;++ if (Array.isArray(s.enum) && s.enum.length > 0) return s.enum[0];+ // Past the reflected schemas' own depth — nothing real left to show.+ if (depth > 8) return OMITTED;++ const types = Array.isArray(s.type) ? s.type : s.type ? [s.type] : [];+ const primary = types.find((t) => t !== "null") ?? types[0];++ switch (primary) {+ case "array":+ return [s.items ? exampleFromSchema(s.items, depth + 1) : OMITTED];+ case "object": {+ if (s.properties) {+ const out: Record<string, unknown> = {};+ for (const [key, value] of Object.entries(s.properties)) {+ out[key] = exampleFromSchema(value, depth + 1);+ }+ return out;+ }+ if (s.additionalProperties && typeof s.additionalProperties === "object") {+ return { [OMITTED]: exampleFromSchema(s.additionalProperties, depth + 1) };+ }+ // A bare `{type:"object"}` is the walker's own truncation (cycle or cap).+ return OMITTED;+ }+ case "number":+ case "integer":+ return 0;+ case "boolean":+ return true;+ case "string":+ return "string";+ case "null":+ return null;+ default:+ return OMITTED;+ }+}++/**+ * Whether an operation returns a body worth showing. A write that reflects as+ * `{type:"null"}` returns nothing (327 of them do), and 65 operations reflect no+ * schema at all — rendering either as a `null` or `{}` sample invited the reader+ * to unwrap a value that does not exist. No body, no Response section.+ */+function hasResponseBody(schema: unknown): boolean {+ if (!schema || typeof schema !== "object") return false;+ const s = schema as JsonSchemaNode;++ if (Array.isArray(s.anyOf)) return s.anyOf.some(hasResponseBody);++ const types = Array.isArray(s.type) ? s.type : s.type ? [s.type] : [];+ if (types.length > 0) return types.some((t) => t !== "null");++ // No `type` and no union: only a shape (properties/items) carries anything.+ return Boolean(s.properties || s.items || s.additionalProperties);+}++/**+ * The HTTP success body: single results are the payload itself; lists carry the+ * `{ results, count }` envelope — the only place `count` means anything. Mirrors+ * `isListOperation`/`shapeHttpBody` in the v1 surface: the split is decided by+ * whether the reflected response schema is an array. Null when the operation+ * returns no body — the panel drops its Response section entirely.+ */+function responseBody(responseSchema: unknown): string | null {+ if (!hasResponseBody(responseSchema)) return null;+ const schema = responseSchema as JsonSchemaNode;+ const types = Array.isArray(schema.type)+ ? schema.type+ : schema.type+ ? [schema.type]+ : [];+ const payload = exampleFromSchema(schema);+ return JSON.stringify(+ types.includes("array") ? { results: payload, count: null } : payload,+ null,+ 2+ );+}++const BADGE: Record<ToolClass, string> = {+ READ: "bg-ed-green-bg text-ed-green-strong border-ed-green-border",+ WRITE: "bg-ed-blue-bg text-ed-brand-ink border-ed-blue-border",+ DESTRUCTIVE: "bg-ed-red-bg text-ed-red border-ed-red-border"+};++export default async function OperationPage(props: Params) {+ const { operation } = await props.params;+ const found = getTool(operation);+ if (!found) notFound();+ const { module: mod, tool: t } = found;++ const samples = buildOperationSamples(t.name, mod.slug, t.schema);+ const httpPath = operationPath(t.name, mod.slug);+ const schemaJson = JSON.stringify(t.schema, null, 2);++ const responseJson = responseBody(t.responseSchema);+ const [schemaHtml, responseHtml, ...sampleHtml] = await Promise.all([+ highlight(schemaJson, "json"),+ responseJson ? highlight(responseJson, "json") : undefined,+ ...SAMPLE_KEYS.map((k) => highlight(samples[k], SAMPLE_GRAMMAR[k]))+ ]);+ const highlighted = Object.fromEntries(+ SAMPLE_KEYS.map((k, i) => [k, sampleHtml[i]])+ ) as Record<SampleKey, string>;++ const description = t.description+ ? t.description.charAt(0).toUpperCase() + t.description.slice(1)+ : "";++ return (+ <DocPage wide>+ <Breadcrumb+ items={[+ { label: "Carbon API", href: "/api" },+ { label: mod.name }+ ]}+ />+ <div className="mt-2 flex flex-wrap items-center gap-3">+ <h1 className="m-0 break-all font-mono text-ed-24 font-semibold tracking-tight leading-[120%] text-ed-ink">+ {operationLabel(t.name, mod.slug)}+ </h1>+ <span+ className={`inline-flex shrink-0 items-center rounded-md border px-2 py-0.5 font-mono text-ed-11 font-semibold ${BADGE[t.classification]}`}+ >+ {t.classification}+ </span>+ </div>+ {description && <P>{description}.</P>}++ {/* The request sample runs full width: in a half column the Python and+ JavaScript samples had to wrap so hard they broke mid-token. Below it the+ parameter table and the raw schema sit side by side — the same contract in+ its human and machine forms. */}+ <div className="mt-7">+ <OperationPanel+ samples={samples}+ highlighted={highlighted}+ httpPath={httpPath}+ responseHtml={responseHtml}+ />+ </div>++ <div className="mt-2 grid grid-cols-1 items-start gap-x-12 gap-y-8 lg:grid-cols-2">+ <div className="min-w-0">+ <H2 id="parameters">Parameters</H2>+ <SchemaTable schema={t.schema} />+ </div>+ <div className="min-w-0">+ <H2 id="schema">Input schema</H2>+ <CodeBlock html={schemaHtml} code={schemaJson} label="schema" />+ </div>+ </div>++ </DocPage>+ );+}diff --git a/docs/app/api/page.tsx b/docs/app/api/page.tsxnew file mode 100644index 0000000000..c64d4328f7--- /dev/null+++ b/docs/app/api/page.tsx@@ -0,0 +1,132 @@+import {+ Code,+ DocEyebrow,+ DocLink,+ DocPage,+ DocTitle,+ H2,+ Lead,+ P+} from "@/components/api/doc";+import { ContentFooter } from "@/components/api/page-footer";+import { SdkCardGrid } from "@/components/api/sdk-cards";+import { sdkLanguageCards } from "@/components/api/sdk-languages";+import { pageSeo, SEO } from "@/lib/seo";+import { toolCounts } from "@/lib/tools-data";++export const metadata = pageSeo({+ title: `${SEO.carbonApi.intro.title} — Carbon`,+ ogTitle: SEO.carbonApi.intro.title,+ description: SEO.carbonApi.intro.description,+ path: "/api",+ eyebrow: "Carbon API"+});++// Counts are read from the generated catalog so the copy can never go stale.+const {+ total: OPERATION_COUNT,+ modules: MODULE_COUNT,+ byClass: BY_CLASS+} = toolCounts();++/* Scale, at a glance. The overview's first job is orientation, and three numbers+ * do it faster than the sentence they replace — the sections below then explain+ * each one in order (operations, transports). Chrome matches `Table`. */+function StatStrip({ stats }: { stats: [string, string][] }) {+ return (+ <div className="mt-6 grid grid-cols-3 overflow-hidden rounded-[10px] border border-ed-warm-300">+ {stats.map(([value, label], i) => (+ <div+ key={label}+ className={`px-4 py-[13px] ${i > 0 ? "border-l border-ed-warm-300" : ""}`}+ >+ <p className="m-0 text-ed-24 font-semibold leading-[120%] tracking-tight text-ed-ink tabular-nums">+ {value}+ </p>+ <p className="m-0 mt-1 font-mono text-ed-12 uppercase tracking-[0.06em] text-ed-ink/60">+ {label}+ </p>+ </div>+ ))}+ </div>+ );+}++export default function ApiOverviewPage() {+ return (+ <DocPage>+ <DocEyebrow>Carbon API</DocEyebrow>+ <DocTitle>The Carbon API</DocTitle>+ <Lead>+ The Carbon API is the service layer — the same code the app runs when+ you click a button. Every call validates its input, recalculates what+ depends on it, and enforces your permissions. It's the surface to build+ on.+ </Lead>++ <StatStrip+ stats={[+ [OPERATION_COUNT.toLocaleString(), "Operations"],+ [String(MODULE_COUNT), "Modules"],+ ["2", "Transports"]+ ]}+ />++ <H2 id="operations">What you can call</H2>+ <P>+ Create a job, draft a quote, adjust inventory, post an invoice —{" "}+ {OPERATION_COUNT.toLocaleString()} operations across {MODULE_COUNT}{" "}+ modules, the same set the app itself calls. Each carries a{" "}+ <Code>READ</Code> / <Code>WRITE</Code> / <Code>DESTRUCTIVE</Code>{" "}+ classification — {BY_CLASS.READ.toLocaleString()} read,{" "}+ {BY_CLASS.WRITE.toLocaleString()} write,{" "}+ {BY_CLASS.DESTRUCTIVE.toLocaleString()} destructive — so a client can+ filter or gate by risk.+ </P>+ <P>+ Every operation has a page of its own with a copyable sample in six+ languages — browse them by module in the sidebar, or search from+ anywhere in these docs.+ </P>++ <H2 id="connect">How you connect</H2>+ <P>+ Every operation is reachable two ways, with the same arguments and the+ same permissions: over plain HTTP as{" "}+ <Code>POST /api/v1/{module}/{operation}</Code>, and+ as a tool over MCP — so any MCP client, Claude Code, Cursor or ChatGPT,+ can read and write in plain language.+ </P>+ <P>+ <DocLink href="/api/mcp">Connect over MCP</DocLink> covers the setup,+ and <DocLink href="/api/authentication">Authentication</DocLink> covers+ how a client proves who it is and what it's allowed to touch.+ </P>++ <H2 id="sdks">Build in your language</H2>+ <P>+ Carbon publishes an OpenAPI spec for all{" "}+ {OPERATION_COUNT.toLocaleString()} operations, with input schemas taken+ from the validators the server runs and response shapes reflected from+ the service functions. A typed client is one generator command away —+ nothing hand-maintained to fall behind.+ </P>+ <SdkCardGrid cards={sdkLanguageCards("/api/sdks")} />+ <P>+ Full commands, the spec URL, and how to authenticate a generated client+ are on <DocLink href="/api/sdks">Client SDKs</DocLink>.+ </P>++ <H2 id="data">The Data API</H2>+ <P>+ The <DocLink href="/api/data">Data API</DocLink> is the escape hatch —+ every table and view as a REST endpoint, for the rare case this surface+ doesn't cover. It skips the service layer, so a write there skips the+ validation and recalculation with it. Reach for it when you know+ exactly what the table touches.+ </P>++ <ContentFooter next={{ label: "Connect over MCP", url: "/api/mcp" }} />+ </DocPage>+ );+}diff --git a/docs/app/api/sdks/page.tsx b/docs/app/api/sdks/page.tsxnew file mode 100644index 0000000000..5fba632c7e--- /dev/null+++ b/docs/app/api/sdks/page.tsx@@ -0,0 +1,231 @@+import { CodeBlock } from "@/components/api/code-block";+import { ApiKeysLink } from "@/components/api/config-inline";+import {+ Code,+ DocEyebrow,+ DocLink,+ DocPage,+ DocTitle,+ H2,+ Lead,+ P,+ Row,+ Table+} from "@/components/api/doc";+import { ContentFooter } from "@/components/api/page-footer";+import { SdkCardGrid } from "@/components/api/sdk-cards";+import { sdkLanguageCards } from "@/components/api/sdk-languages";+import { highlight } from "@/lib/highlight";+import { pageSeo, SEO } from "@/lib/seo";+import { toolCounts } from "@/lib/tools-data";++export const metadata = pageSeo({+ title: `${SEO.carbonApi.sdks.title} — Carbon`,+ ogTitle: SEO.carbonApi.sdks.title,+ description: SEO.carbonApi.sdks.description,+ path: "/api/sdks",+ eyebrow: "Carbon API"+});++/* Samples hardcode the DEFAULT origin so applyConfig() rewrites them to whatever+ * instance the reader configured — a divergent literal would never substitute. */+const SPEC_URL = "https://app.carbon.ms/api/v1/openapi.json";++const FETCH_SPEC = `curl ${SPEC_URL} -o openapi.json`;++const HEY_API_CONFIG = `// openapi-ts.config.ts+import { defineConfig } from "@hey-api/openapi-ts";++export default defineConfig({+ input: "${SPEC_URL}",+ output: "src/client",+ plugins: [+ "@hey-api/client-fetch",+ {+ name: "@hey-api/sdk",+ operations: {+ // One class per Carbon module: Sales.getQuotes, Production.insertJob, …+ strategy: "byTags",+ container: "class",+ nestingDelimiters: /(?!)/,+ methodName: (name) => name.split(".").pop() ?? name+ }+ }+ ]+});`;++const HEY_API = `npm install -D @hey-api/openapi-ts typescript+npx openapi-ts`;++const PYTHON_CLIENT = `pipx install openapi-python-client --include-deps+openapi-python-client generate --url ${SPEC_URL}`;++const GO_CLIENT = `go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen@latest \\+ -generate types,client -package carbon \\+ -o carbon.gen.go openapi.json`;++const OPENAPI_GENERATOR = `docker run --rm -v $PWD:/local openapitools/openapi-generator-cli generate \\+ -i ${SPEC_URL} \\+ -g ruby \\+ -o /local/carbon-client`;++const HEY_API_AUTH = `import { client } from "./src/client/client.gen";++client.setConfig({+ auth: "<api-key>"+});`;++export default async function ApiSdksPage() {+ const counts = toolCounts();+ const [+ fetchSpec,+ heyApiConfig,+ heyApi,+ pythonClient,+ goClient,+ openapiGenerator,+ heyApiAuth+ ] = await Promise.all([+ highlight(FETCH_SPEC, "curl"),+ highlight(HEY_API_CONFIG, "javascript"),+ highlight(HEY_API, "curl"),+ highlight(PYTHON_CLIENT, "curl"),+ highlight(GO_CLIENT, "curl"),+ highlight(OPENAPI_GENERATOR, "curl"),+ highlight(HEY_API_AUTH, "javascript")+ ]);++ return (+ <DocPage>+ <DocEyebrow>Carbon API</DocEyebrow>+ <DocTitle>Client SDKs</DocTitle>+ <Lead>+ Carbon publishes an OpenAPI spec for all{" "}+ {counts.total.toLocaleString()} operations, so a typed client in your+ language is one generator command away — nothing hand-maintained to fall+ behind.+ </Lead>+ <SdkCardGrid cards={sdkLanguageCards()} />++ <H2 id="spec">The spec</H2>+ <P>+ The spec is public — no key needed to fetch it, so it works in CI and+ codegen pipelines:+ </P>+ <CodeBlock html={fetchSpec} code={FETCH_SPEC} label="Terminal" />+ <P>+ Inside are all {counts.total.toLocaleString()} operations, each a{" "}+ <Code>POST</Code> tagged by its module, with input schemas taken from+ the same validators the server runs and response shapes on ~95% of+ operations — so a generated client is typed in both directions.+ </P>++ <H2 id="typescript">TypeScript</H2>+ <P>+ <DocLink href="https://heyapi.dev/openapi-ts/get-started">+ @hey-api/openapi-ts+ </DocLink>{" "}+ generates a typed fetch client plus request/response types, grouped one+ class per Carbon module:+ </P>+ <CodeBlock+ html={heyApiConfig}+ code={HEY_API_CONFIG}+ label="openapi-ts.config.ts"+ />+ <CodeBlock html={heyApi} code={HEY_API} label="Terminal" />++ <H2 id="python">Python</H2>+ <P>+ <DocLink href="https://github.com/openapi-generators/openapi-python-client">+ openapi-python-client+ </DocLink>{" "}+ generates a modern client with typed models:+ </P>+ <CodeBlock html={pythonClient} code={PYTHON_CLIENT} label="Terminal" />++ <H2 id="go">Go</H2>+ <P>+ <DocLink href="https://github.com/oapi-codegen/oapi-codegen">+ oapi-codegen+ </DocLink>{" "}+ generates a typed client and request/response structs — pure Go, no+ Java runtime. Fetch the spec first (the command above), then:+ </P>+ <CodeBlock html={goClient} code={GO_CLIENT} label="Terminal" />++ <H2 id="any-language">Ruby, C#, PHP — any language</H2>+ <P>+ <DocLink href="https://github.com/OpenAPITools/openapi-generator">+ openapi-generator+ </DocLink>{" "}+ covers 50+ languages. Its official Docker image needs no Java install —+ swap <Code>-g ruby</Code> for <Code>csharp</Code>, <Code>php</Code>,+ or any other generator (with Java 11+ installed,{" "}+ <Code>npx openapi-generator-cli</Code> takes the same flags):+ </P>+ <CodeBlock+ html={openapiGenerator}+ code={OPENAPI_GENERATOR}+ label="Terminal"+ />++ <H2 id="auth">Authenticate the client</H2>+ <P>+ One way in: the spec declares a single Bearer scheme, so every generated+ client sends a scoped API key from{" "}+ <ApiKeysLink>Settings → API Keys</ApiKeysLink> as{" "}+ <Code>Authorization: Bearer crbn_…</Code>. For the TypeScript client+ that is one config line:+ </P>+ <CodeBlock html={heyApiAuth} code={HEY_API_AUTH} label="src/api.ts" />++ <H2 id="responses">What comes back</H2>+ <P>+ Single results are the response body itself — no envelope to unwrap.+ List results come as <Code>{"{ results, count }"}</Code>, since a total+ only means something on a paginated read. Both shapes are in the spec,+ so generated return types already carry them. Failures return an error+ body with an HTTP status:+ </P>+ <Table>+ <Row head cols="90px 1fr" cells={["Status", "Meaning"]} />+ <Row+ cols="90px 1fr"+ cells={[+ <Code key="s">400</Code>,+ "The write failed — the message carries the database error"+ ]}+ />+ <Row+ cols="90px 1fr"+ cells={[+ <Code key="s">403</Code>,+ "The key lacks the operation's required scope"+ ]}+ />+ <Row+ cols="90px 1fr"+ cells={[<Code key="s">404</Code>, "No such operation"]}+ />+ <Row+ cols="90px 1fr"+ cells={[+ <Code key="s">429</Code>,+ "Rate limited — respect Retry-After"+ ]}+ />+ </Table>+ <P>+ Key-level failures (an expired or missing key) return{" "}+ <Code>401</Code> before the operation runs — see{" "}+ <DocLink href="/api/authentication">Authentication</DocLink>.+ </P>++ <ContentFooter+ prev={{ label: "Authentication", url: "/api/authentication" }}+ editPath="docs/app/api/sdks/page.tsx"+ />+ </DocPage>+ );+}diff --git a/docs/app/api/search/route.ts b/docs/app/api/search/route.tsindex 335faeae63..3ffdd80d1e 100644--- a/docs/app/api/search/route.ts+++ b/docs/app/api/search/route.ts@@ -4,9 +4,32 @@ import { buildSearchIndexes } from "@/lib/search-index";/* Single search endpoint across all four surfaces (Reference docs, the Guide, API* resources, MCP tools). Canonical fumadocs pattern: one combined `indexes` array, each* entry `tag`ged (docs | guide | resources | tools) so the header's surface pills can- * filter via `?tag=`. Result count is capped client-side (no server limit in fumadocs). */+ * filter via `?tag=`. */-export const { GET } = createSearchAPI("advanced", {+const { GET: search } = createSearchAPI("advanced", {language: "english",indexes: buildSearchIndexes()});++/**+ * Fumadocs has no server-side result limit, and with 1,495 operations indexed a+ * common prefix is pathological: "get" matches every READ operation and returned a+ * 544 KB body — per keystroke — of which the palette displays eight pages.+ *+ * Results arrive relevance-ordered, so truncating keeps the best matches. The cap is+ * well above what the client can show (MAX_PAGES x MAX_ROWS_PER_PAGE in+ * `search-command.tsx`) so grouping still has spare rows to work with; it exists to+ * stop the tail, not to do the client's job.+ */+const MAX_RESULTS = 80;++export async function GET(request: Request): Promise<Response> {+ const response = await search(request as Parameters<typeof search>[0]);+ if (!response.ok) return response;++ const results = await response.json();+ if (!Array.isArray(results) || results.length <= MAX_RESULTS) {+ return Response.json(results);+ }+ return Response.json(results.slice(0, MAX_RESULTS));+}diff --git a/docs/app/layout.tsx b/docs/app/layout.tsxindex 852ca936dd..bba830729c 100644--- a/docs/app/layout.tsx+++ b/docs/app/layout.tsx@@ -42,6 +42,7 @@ export const metadata: Metadata = {"MES","MRP","manufacturing software",+ "Carbon API","REST API","MCP"],diff --git a/docs/app/mcp/tools/[tool]/page.tsx b/docs/app/mcp/tools/[tool]/page.tsxdeleted file mode 100644index e234f08aab..0000000000--- a/docs/app/mcp/tools/[tool]/page.tsx+++ /dev/null@@ -1,175 +0,0 @@-import type { Metadata } from "next";-import { notFound } from "next/navigation";-import { Breadcrumb } from "@/components/api/breadcrumb";-import { CodeBlock } from "@/components/api/code-block";-import { Code, DocPage, H2, P } from "@/components/api/doc";-import { highlight } from "@/lib/highlight";-import { pageSeo } from "@/lib/seo";-import { allToolParams, getTool, type ToolClass } from "@/lib/tools-data";--type Params = { params: Promise<{ tool: string }> };--export function generateStaticParams() {- return allToolParams();-}--export async function generateMetadata(props: Params): Promise<Metadata> {- const { tool } = await props.params;- const found = getTool(tool);- return pageSeo({- title: found ? `${found.tool.name} — Carbon MCP` : "Carbon MCP",- ogTitle: found?.tool.name ?? "Carbon MCP",- description: found?.tool.description,- path: `/mcp/tools/${tool}`,- eyebrow: found ? `MCP · ${found.module.name}` : "MCP"- });-}--const BADGE: Record<ToolClass, string> = {- READ: "bg-ed-green-bg text-ed-green-strong border-ed-green-border",- WRITE: "bg-ed-blue-bg text-ed-brand-ink border-ed-blue-border",- DESTRUCTIVE: "bg-ed-red-bg text-ed-red border-ed-red-border"-};--type JsonProp = {- type?: string;- description?: string;- enum?: unknown[];- format?: string;- items?: { type?: string };-};-type JsonSchema = {- properties?: Record<string, JsonProp>;- required?: string[];-};--function propType(p: JsonProp): string {- if (Array.isArray(p.enum) && p.enum.length) return "enum";- if (p.type === "array") return `${p.items?.type ?? "any"}[]`;- return p.format ?? p.type ?? "any";-}--/** Render a tool's input schema as a readable parameter list (required first). */-function Parameters({ schema }: { schema: unknown }) {- const s = (schema ?? {}) as JsonSchema;- const props = s.properties ?? {};- const required = new Set(s.required ?? []);- const names = Object.keys(props).sort(- (a, b) => Number(required.has(b)) - Number(required.has(a))- );- if (names.length === 0) return <P>This tool takes no arguments.</P>;-- return (- <div className="mt-2.5 divide-y divide-ed-hairline border-t border-ed-hairline">- {names.map((name) => {- const p = props[name];- return (- <div key={name} className="py-[13px]">- <div className="flex flex-wrap items-center gap-2">- <code className="font-mono text-ed-13 text-ed-ink">- {name}- </code>- <span className="font-mono text-ed-12 text-ed-ink/54">- {propType(p)}- </span>- {required.has(name) ? (- <span className="text-ed-11 font-medium text-ed-amber-text">- required- </span>- ) : (- <span className="text-ed-11 font-medium text-ed-ink/48">- optional- </span>- )}- </div>- {p.description && (- <p className="m-0 mt-1.5 text-ed-14 leading-normal text-ed-ink/74">- {p.description}- </p>- )}- </div>- );- })}- </div>- );-}--function exampleArg(prop: unknown): unknown {- if (!prop || typeof prop !== "object") return "string";- switch ((prop as { type?: string }).type) {- case "number":- case "integer":- return 0;- case "boolean":- return true;- case "array":- return [];- case "object":- return {};- default:- return "string";- }-}--function exampleArgs(schema: unknown): Record<string, unknown> {- const s = (schema ?? {}) as {- properties?: Record<string, unknown>;- required?: string[];- };- const props = s.properties ?? {};- const required = s.required ?? Object.keys(props);- const out: Record<string, unknown> = {};- for (const key of required) out[key] = exampleArg(props[key]);- return out;-}--export default async function ToolPage(props: Params) {- const { tool } = await props.params;- const found = getTool(tool);- if (!found) notFound();- const { module: mod, tool: t } = found;-- const schemaJson = JSON.stringify(t.schema, null, 2);- const callSnippet = `call_tool(${JSON.stringify({ name: t.name, arguments: exampleArgs(t.schema) }, null, 2)})`;- const [callHtml, schemaHtml] = await Promise.all([- highlight(callSnippet, "javascript"),- highlight(schemaJson, "json")- ]);-- const description = t.description- ? t.description.charAt(0).toUpperCase() + t.description.slice(1)- : "";-- return (- <DocPage>- <Breadcrumb- items={[{ label: "MCP", href: "/mcp" }, { label: mod.name }]}- />- <div className="mt-2 flex flex-wrap items-center gap-3">- <h1 className="m-0 break-all font-mono text-ed-24 font-semibold tracking-tight leading-[120%] text-ed-ink">- {t.name}- </h1>- <span- className={`inline-flex shrink-0 items-center rounded-md border px-2 py-0.5 font-mono text-ed-11 font-semibold ${BADGE[t.classification]}`}- >- {t.classification}- </span>- </div>- {description && <P>{description}.</P>}-- <H2 id="parameters">Parameters</H2>- <Parameters schema={t.schema} />-- <H2 id="call">Call it</H2>- <P>- Invoke it through the <Code>call_tool</Code> meta-tool with its- arguments:- </P>- <CodeBlock html={callHtml} code={callSnippet} label="call_tool" />-- <H2 id="schema">Input schema</H2>- <P>The raw JSON Schema the tool validates its arguments against.</P>- <CodeBlock html={schemaHtml} code={schemaJson} label="schema" />- </DocPage>- );-}diff --git a/docs/app/mcp/tools/page.tsx b/docs/app/mcp/tools/page.tsxdeleted file mode 100644index adb846b556..0000000000--- a/docs/app/mcp/tools/page.tsx+++ /dev/null@@ -1,115 +0,0 @@-import {- Code,- DocEyebrow,- DocPage,- DocTitle,- H2,- Lead,- P,- Row,- Table-} from "@/components/api/doc";-import { pageSeo, SEO } from "@/lib/seo";--export const metadata = pageSeo({- title: `${SEO.mcp.tools.title} — Carbon`,- ogTitle: SEO.mcp.tools.title,- description: SEO.mcp.tools.description,- path: "/mcp/tools",- eyebrow: "MCP"-});--const MODULES: [string, number][] = [- ["Sales", 181],- ["Items", 147],- ["Production", 132],- ["Inventory", 113],- ["Purchasing", 109],- ["Resources", 96],- ["Quality", 85],- ["Settings", 83],- ["Accounting", 81],- ["Shared", 50],- ["People", 46],- ["Invoicing", 34],- ["Users", 26],- ["Documents", 14],- ["Account", 10]-];--export default function McpToolsPage() {- return (- <DocPage>- <DocEyebrow>MCP</DocEyebrow>- <DocTitle>Tools</DocTitle>- <Lead>- Carbon's MCP server exposes more than 1,200 tools across 15 modules —- without flooding the assistant's context with all of them at once.- </Lead>-- <H2 id="discovery">Tool discovery</H2>- <P>- Rather than list every tool, the server presents three meta-tools. The- model uses them to find and load only the tools a task needs:- </P>- <Table>- <Row head cols="150px 1fr" cells={["Meta-tool", "What it does"]} />- <Row- cols="150px 1fr"- cells={[- <Code key="s">search_tools</Code>,- "Find tools by query, module, or classification."- ]}- />- <Row- cols="150px 1fr"- cells={[- <Code key="d">describe_tool</Code>,- "Get a tool's input schema and description."- ]}- />- <Row- cols="150px 1fr"- cells={[- <Code key="c">call_tool</Code>,- "Invoke a tool by name with its arguments."- ]}- />- </Table>- <P>- A typical flow is <Code>search_tools</Code> → <Code>describe_tool</Code>{" "}- → <Code>call_tool</Code>, which keeps the model's context lean no matter- how large the catalog grows.- </P>-- <H2 id="classification">Classification</H2>- <P>Every tool is classified, so a client can gate actions by risk:</P>- <Table>- <Row head cols="130px 1fr 72px" cells={["Class", "Grants", "Count"]} />- <Row- cols="130px 1fr 72px"- cells={[<Code key="r">READ</Code>, "Read rows", "617"]}- />- <Row- cols="130px 1fr 72px"- cells={[<Code key="w">WRITE</Code>, "Create & update rows", "438"]}- />- <Row- cols="130px 1fr 72px"- cells={[<Code key="x">DESTRUCTIVE</Code>, "Delete rows", "152"]}- />- </Table>-- <H2 id="modules">Modules</H2>- <P>- The catalog is grouped into 15 modules — browse them in the sidebar:- </P>- <Table>- <Row head cols="1fr 72px" cells={["Module", "Tools"]} />- {MODULES.map(([name, count]) => (- <Row key={name} cols="1fr 72px" cells={[name, String(count)]} />- ))}- </Table>- </DocPage>- );-}diff --git a/docs/app/not-found.tsx b/docs/app/not-found.tsxindex 3c629c214f..e97a079e53 100644--- a/docs/app/not-found.tsx+++ b/docs/app/not-found.tsx@@ -20,10 +20,14 @@ const LINKS = [},{label: "API",- desc: "REST resources for every table and view",- href: "/api-reference"+ desc: "The service layer — read and write the safe way",+ href: "/api"},- { label: "MCP", desc: "Connect AI clients to your data", href: "/mcp" }+ {+ label: "Data API",+ desc: "Direct REST access to every table and view",+ href: "/api/data"+ }];function Arrow() {diff --git a/docs/app/sitemap.ts b/docs/app/sitemap.tsindex e162f74961..7f702c74a0 100644--- a/docs/app/sitemap.ts+++ b/docs/app/sitemap.ts@@ -20,40 +20,37 @@ export default function sitemap(): MetadataRoute.Sitemap {out.push({ url: abs(page.url), changeFrequency: "monthly", priority: 0.7 });}- // REST API reference+ // Carbon API (the headline surface — service layer, reached over MCP today)+ out.push({ url: abs("/api"), changeFrequency: "monthly", priority: 0.7 });+ out.push({ url: abs("/api/mcp"), changeFrequency: "monthly", priority: 0.5 });out.push({- url: abs("/api-reference"),- changeFrequency: "monthly",- priority: 0.6- });- out.push({- url: abs("/api-reference/authentication"),+ url: abs("/api/authentication"),changeFrequency: "yearly",priority: 0.5});- for (const { module, resource } of allResourceParams()) {+ out.push({ url: abs("/api/sdks"), changeFrequency: "monthly", priority: 0.5 });+ for (const { tool } of allToolParams()) {out.push({- url: abs(`/api-reference/${module}/${resource}`),+ url: abs(`/api/operations/${tool}`),changeFrequency: "monthly",priority: 0.5});}- // MCP- out.push({ url: abs("/mcp"), changeFrequency: "monthly", priority: 0.6 });+ // Data API (PostgREST — the secondary data plane, demoted below the Carbon API)out.push({- url: abs("/mcp/authentication"),- changeFrequency: "yearly",+ url: abs("/api/data"),+ changeFrequency: "monthly",priority: 0.5});out.push({- url: abs("/mcp/tools"),- changeFrequency: "monthly",- priority: 0.5+ url: abs("/api/data/authentication"),+ changeFrequency: "yearly",+ priority: 0.4});- for (const { tool } of allToolParams()) {+ for (const { module, resource } of allResourceParams()) {out.push({- url: abs(`/mcp/tools/${tool}`),+ url: abs(`/api/data/${module}/${resource}`),changeFrequency: "monthly",priority: 0.4});diff --git a/docs/components/api/api-nav.tsx b/docs/components/api/api-nav.tsxindex f3137b7aa4..6fbeeb4c79 100644--- a/docs/components/api/api-nav.tsx+++ b/docs/components/api/api-nav.tsx@@ -19,9 +19,9 @@ const METHOD_ABBR: Record<string, string> = {DELETE: "DEL",};-const REST_API = [- { label: "Overview", href: "/api-reference" },- { label: "Authentication", href: "/api-reference/authentication" },+const DATA_API = [+ { label: "Overview", href: "/api/data" },+ { label: "Authentication", href: "/api/data/authentication" },];const GS_ACTIVE = "bg-ed-brand/10 font-demi text-ed-brand-ink";@@ -65,9 +65,11 @@ function ResourceIcon({ kind, active }: { kind: "table" | "view"; active?: booleexport function ApiNav({ tree }: { tree: NavModule[] }) {const pathname = usePathname();+ // Resources live at /api/data/{module}/{resource} — index 3 and 4, since the+ // Data API is a section INSIDE /api rather than its own root.const parts = pathname.split("/");- const activeModule = parts[2];- const activeResource = parts[3];+ const activeModule = parts[3];+ const activeResource = parts[4];const [open, setOpen] = useState<Set<string>>(() => new Set(activeModule ? [activeModule] : []));const activeRef = useRef<HTMLAnchorElement>(null);@@ -84,8 +86,8 @@ export function ApiNav({ tree }: { tree: NavModule[] }) {<div><nav className="flex flex-col gap-0.5"><div className="mb-2.5">- <p className={SECTION_LABEL}>REST API</p>- {REST_API.map((item) => (+ <p className={SECTION_LABEL}>Data API</p>+ {DATA_API.map((item) => (<Linkkey={item.href}href={item.href}@@ -128,7 +130,7 @@ export function ApiNav({ tree }: { tree: NavModule[] }) {<ul className="mt-0.5 mb-1.5 ml-[13px] list-none border-l border-ed-warm-150 py-0.5 pl-2">{m.resources.map((r) => {const isActive = activeModule === m.slug && activeResource === r.slug;- const href = `/api-reference/${m.slug}/${r.slug}`;+ const href = `/api/data/${m.slug}/${r.slug}`;return (<li key={r.slug}><Linkdiff --git a/docs/components/api/api-surface-nav.tsx b/docs/components/api/api-surface-nav.tsxnew file mode 100644index 0000000000..ac2697039d--- /dev/null+++ b/docs/components/api/api-surface-nav.tsx@@ -0,0 +1,194 @@+"use client";++import Link from "next/link";+import { usePathname } from "next/navigation";+import { useEffect, useMemo, useRef, useState } from "react";+import { openSearch } from "@/components/search/search-command";+import { operationLabel, type ToolNavModule } from "@/lib/tools-data";++const CLASS_DOT: Record<string, string> = {+ READ: "bg-ed-green-strong",+ WRITE: "bg-ed-brand-ink",+ DESTRUCTIVE: "bg-ed-red",+};++const GETTING_STARTED = [+ { label: "Overview", href: "/api" },+ { label: "Connect over MCP", href: "/api/mcp" },+ { label: "Authentication", href: "/api/authentication" },+ { label: "Client SDKs", href: "/api/sdks" },+];++const GS_ACTIVE = "bg-ed-brand/10 font-demi text-ed-brand-ink";+const GS_IDLE = "text-ed-ink/80 hover:bg-ed-hairline/55 hover:text-ed-ink";+const SECTION_LABEL =+ "m-0 font-mono text-ed-12 font-semibold uppercase tracking-[0.06em] text-ed-ink/60";+const GS_LINK = "block rounded-md px-2 py-[3.5px] text-ed-14 leading-[135%] transition-colors";++function Chevron({ open }: { open: boolean }) {+ return (+ <svg+ width="11"+ height="11"+ viewBox="0 0 12 12"+ fill="none"+ className={`shrink-0 transition-transform duration-200 ${open ? "rotate-90" : ""}`}+ aria-hidden="true"+ >+ <path d="M4.5 3L7.5 6L4.5 9" stroke="rgba(38,35,35,0.48)" strokeWidth="1.3" strokeLinecap="round" strokeLinejoin="round" />+ </svg>+ );+}++function ClassDot({ c }: { c: string }) {+ return (+ <span+ className={`h-1.5 w-1.5 shrink-0 rounded-full ${CLASS_DOT[c] || "bg-ed-ink/40"}`}+ aria-label={c}+ />+ );+}++/**+ * Middle truncation: end-truncation erased exactly the characters that tell long+ * siblings apart — three adjacent rows all rendered `getCustomerItemPriceOve…`, and+ * singular/plural pairs differ only in their final letter. Keeping the tail intact+ * yields `getCustomerItemPr…Override` vs `…Overrides`. Short labels skip the split.+ */+function MidTruncatedLabel({ text }: { text: string }) {+ if (text.length <= 22) {+ return <span className="truncate font-mono text-ed-13">{text}</span>;+ }+ const tail = text.slice(-9);+ const head = text.slice(0, -9);+ return (+ <span className="flex min-w-0 font-mono text-ed-13">+ <span className="truncate">{head}</span>+ <span className="shrink-0">{tail}</span>+ </span>+ );+}++/** The Carbon API sidebar: getting-started links plus the operation catalog grouped by+ * module. Finding one goes through the global palette (the button above opens it+ * on the API surface); this tree is for browsing. Operation slugs are the oRPC+ * operation ids, so each row links to `/api/operations/<slug>` — the same surface MCP+ * `call_tool` and HTTP reach. */+export function ApiSurfaceNav({ operations }: { operations: ToolNavModule[] }) {+ const pathname = usePathname();+ const parts = pathname.split("/");+ const activeOp = parts[1] === "api" && parts[2] === "operations" ? parts[3] : undefined;++ const activeOpModule = useMemo(() => {+ if (!activeOp) return undefined;+ return operations.find((m) => m.tools.some((t) => t.slug === activeOp))?.slug;+ }, [operations, activeOp]);++ const [open, setOpen] = useState<Set<string>>(() => new Set(activeOpModule ? [activeOpModule] : []));+ const activeRef = useRef<HTMLAnchorElement>(null);++ useEffect(() => {+ if (activeOpModule)+ setOpen((p) => (p.has(activeOpModule) ? p : new Set(p).add(activeOpModule)));+ }, [activeOpModule]);+ useEffect(() => {+ activeRef.current?.scrollIntoView({ block: "center" });+ }, []);++ const totalOps = useMemo(+ () => operations.reduce((n, m) => n + m.tools.length, 0),+ [operations]+ );++ return (+ <div>+ <nav className="flex flex-col gap-0.5">+ <div className="mb-2.5">+ <p className={`${SECTION_LABEL} mb-[3px] px-2 py-1.5`}>Getting Started</p>+ {GETTING_STARTED.map((item) => (+ <Link+ key={item.href}+ href={item.href}+ className={`${GS_LINK} ${pathname === item.href ? GS_ACTIVE : GS_IDLE}`}+ >+ {item.label}+ </Link>+ ))}+ </div>++ {/* Finding an operation among 1,495 is the palette's job — it searches+ names, parameters and descriptions across every surface. The icon opens+ it already filtered to the API, so this tree stays a browse tree and+ costs no vertical space. */}+ <div className="flex items-center justify-between px-2 pb-[3px] pt-1.5">+ <p className={SECTION_LABEL}>Carbon API</p>+ <button+ type="button"+ onClick={() => openSearch("tools")}+ title={`Search ${totalOps.toLocaleString()} operations (⌘K)`}+ aria-label="Search operations"+ className="-mr-1 flex size-6 shrink-0 items-center justify-center rounded-md text-ed-ink/45 transition-colors hover:bg-ed-row-hover hover:text-ed-ink"+ >+ <svg width="13" height="13" viewBox="0 0 16 16" fill="none" aria-hidden="true">+ <circle cx="7" cy="7" r="4.5" stroke="currentColor" strokeWidth="1.3" />+ <path d="M10.5 10.5L13.5 13.5" stroke="currentColor" strokeWidth="1.3" strokeLinecap="round" />+ </svg>+ </button>+ </div>++ {operations.map((m) => {+ const isOpen = open.has(m.slug);+ return (+ <div key={m.slug}>+ <button+ type="button"+ onClick={() => {+ setOpen((prev) => {+ const next = new Set(prev);+ if (next.has(m.slug)) next.delete(m.slug);+ else next.add(m.slug);+ return next;+ });+ }}+ className="flex w-full items-center justify-between gap-2 rounded-[7px] px-2 py-[5px] transition-colors hover:bg-ed-hairline/50"+ >+ <span className="flex items-center gap-[7px]">+ <Chevron open={isOpen} />+ <span className="font-mono text-ed-12 font-semibold uppercase tracking-[0.06em] text-ed-ink/60">+ {m.name}+ </span>+ </span>+ <span className="font-mono text-ed-12 tabular-nums text-ed-ink/42">+ {m.tools.length}+ </span>+ </button>++ {isOpen && (+ <ul className="mt-0.5 mb-1.5 ml-[13px] list-none border-l border-ed-warm-150 py-0.5 pl-2">+ {m.tools.map((t) => {+ const isActive = activeOp === t.slug;+ return (+ <li key={t.slug}>+ <Link+ ref={isActive ? activeRef : undefined}+ href={`/api/operations/${t.slug}`}+ title={`${t.name} · ${t.classification}`}+ className={`flex items-center gap-2 rounded-md px-2 py-[3.5px] leading-[135%] transition-colors ${+ isActive ? GS_ACTIVE : GS_IDLE+ }`}+ >+ <ClassDot c={t.classification} />+ <MidTruncatedLabel text={operationLabel(t.name, m.slug)} />+ </Link>+ </li>+ );+ })}+ </ul>+ )}+ </div>+ );+ })}+ </nav>+ </div>+ );+}diff --git a/docs/components/api/config-constants.ts b/docs/components/api/config-constants.tsindex ad9e086226..12eb4f4a82 100644--- a/docs/components/api/config-constants.ts+++ b/docs/components/api/config-constants.ts@@ -13,6 +13,20 @@ export const DEFAULT_APP_ORIGIN = "https://app.carbon.ms";export const DEFAULT_MCP_ENDPOINT = `${DEFAULT_APP_ORIGIN}/api/mcp`;+/** Carbon Cloud regions for the CARBON API — app origins, since `/api/v1` is served+ * by the app rather than the REST host. The US and ITAR values are the same two+ * `getAppUrl()` falls back to in `packages/env`; keep them in step.+ *+ * Deliberately NOT the Data API's list: that plane is one `rest.` host plus a+ * self-hosted escape, and is configured on its own. */+export const CARBON_REGIONS = [+ { id: "us", label: "US", origin: DEFAULT_APP_ORIGIN },+ { id: "eu", label: "EU", origin: "https://app.eu.carbon.ms" },+ { id: "itar", label: "ITAR", origin: "https://itar.carbon.ms" }+] as const;++export type CarbonRegionId = (typeof CARBON_REGIONS)[number]["id"];+/** Stand-in for the origin when we don't know which instance the reader is on.* Mirrors the `<api-key>` convention: obviously a placeholder when copy-pasted. */export const HOST_PLACEHOLDER = "<your-host>";diff --git a/docs/components/api/config-context.tsx b/docs/components/api/config-context.tsxindex 680a7a77c5..35e0d70c43 100644--- a/docs/components/api/config-context.tsx+++ b/docs/components/api/config-context.tsx@@ -39,9 +39,12 @@ type Ctx = {/** null = the reader's instance is unknown; render HOST_PLACEHOLDER instead. */base: string | null;setBase: (v: string | null, app?: string | null) => void;- /** App host (Settings, MCP). Configured separately from the REST host upstream,- * so it is carried explicitly rather than guessed from `base`. */+ /** App host (Settings, MCP, and every `/api/v1` sample). Configured separately+ * from the REST host upstream, so it is carried explicitly rather than guessed+ * from `base` — and settable on its own, since the Carbon API surface picks a+ * region while the Data API surface picks a REST host. */appBase: string | null;+ setAppBase: (v: string | null) => void;isDefault: boolean;isUnknown: boolean;apiKey: string;@@ -57,6 +60,7 @@ const ApiConfigCtx = createContext<Ctx>({base: null,setBase: () => {},appBase: null,+ setAppBase: () => {},isDefault: false,isUnknown: true,apiKey: "",@@ -81,13 +85,17 @@ export function ApiConfigProvider({ children }: { children: React.ReactNode }) {// Precedence: a choice the reader saved themselves outranks the `?host=`// hint from a referring app, which outranks "unknown".const savedBase = localStorage.getItem(BASE_STORAGE_KEY);+ const savedApp = localStorage.getItem(APP_STORAGE_KEY);const savedKey = localStorage.getItem(KEY_STORAGE_KEY);if (savedKey) setApiKeyState(savedKey);+ // Read on its own: the Carbon API surface saves a region (app origin) without+ // ever touching the REST base, so gating this on `savedBase` dropped that+ // choice on every reload.+ if (savedApp) setAppBaseState(savedApp);if (savedBase) {// Saved by the reader in the dialog, so the key may be shown against it.setBaseState(savedBase);- setAppBaseState(localStorage.getItem(APP_STORAGE_KEY));return;}@@ -117,6 +125,18 @@ export function ApiConfigProvider({ children }: { children: React.ReactNode }) {} catch {}}, []);+ /** The Carbon API surface's own setter: `/api/v1` samples, the MCP endpoint and+ * the Settings links all hang off the app origin, and none of them care which+ * REST host the Data API surface is pointed at. */+ const setAppBase = (v: string | null) => {+ const val = v === null ? null : v.trim().replace(/\/+$/, "");+ setAppBaseState(val || null);+ try {+ if (val) localStorage.setItem(APP_STORAGE_KEY, val);+ else localStorage.removeItem(APP_STORAGE_KEY);+ } catch {}+ };+/** Saving through the dialog is what makes a host the reader's OWN choice, so this* is the only path that persists one or lets the key be shown against it.* `app` is the instance's app host when known (the ERP passes it; the two are@@ -124,24 +144,20 @@ export function ApiConfigProvider({ children }: { children: React.ReactNode }) {const setBase = (v: string | null, app: string | null = null) => {if (v === null) {setBaseState(null);- setAppBaseState(null);setBaseFromLink(false);try {localStorage.removeItem(BASE_STORAGE_KEY);- localStorage.removeItem(APP_STORAGE_KEY);} catch {}return;}const val = (v || "").trim().replace(/\/+$/, "");if (!val) return;setBaseState(val);- setAppBaseState(app);setBaseFromLink(false);try {localStorage.setItem(BASE_STORAGE_KEY, val);- if (app) localStorage.setItem(APP_STORAGE_KEY, app);- else localStorage.removeItem(APP_STORAGE_KEY);} catch {}+ if (app) setAppBase(app);};const setApiKey = (v: string) => {@@ -159,6 +175,7 @@ export function ApiConfigProvider({ children }: { children: React.ReactNode }) {base,setBase,appBase,+ setAppBase,isDefault: base === DEFAULT_API_BASE,isUnknown: base === null,// Withheld while the host came from a link rather than the reader, and for@@ -241,6 +258,17 @@ export function applyConfig(}const mcp = mcpEndpointFor(base, appBase);out = out.split(DEFAULT_MCP_ENDPOINT).join(html ? escapeHtml(mcp) : mcp);+ // Carbon API (`/api/v1/…`) samples are served by the APP, not the REST host, so+ // they carry the app origin literally. Rewrite it after the MCP endpoint above —+ // that one starts with the same origin, and replacing the longer, more specific+ // needle first keeps this from cutting it in half.+ const app = appOrigin(base, appBase);+ if (app !== null && app !== DEFAULT_APP_ORIGIN) {+ out = out.split(DEFAULT_APP_ORIGIN).join(html ? escapeHtml(app) : app);+ } else if (app === null) {+ const placeholder = html ? escapeHtml(HOST_PLACEHOLDER) : HOST_PLACEHOLDER;+ out = out.split(DEFAULT_APP_ORIGIN).join(placeholder);+ }if (apiKey) {if (html) {const keyEsc = escapeHtml(apiKey);diff --git a/docs/components/api/configurator.tsx b/docs/components/api/configurator.tsxindex 0813e8ebfd..23875b599e 100644--- a/docs/components/api/configurator.tsx+++ b/docs/components/api/configurator.tsx@@ -1,9 +1,15 @@"use client";import * as Dialog from "@radix-ui/react-dialog";+import { usePathname } from "next/navigation";import { useEffect, useRef, useState } from "react";import { parseBaseUrl } from "./base-url-parse";-import { DEFAULT_API_BASE, DEFAULT_APP_ORIGIN } from "./config-constants";+import {+ CARBON_REGIONS,+ DEFAULT_API_BASE,+ DEFAULT_APP_ORIGIN+} from "./config-constants";+import { HOST_PLACEHOLDER, useApiConfig } from "./config-context";function ServerIcon({ className }: { className?: string }) {@@ -76,31 +82,64 @@ function ModeCard({);}+/** The two planes configure DIFFERENT hosts, so they get different choices.+ *+ * The Carbon API is served by the app, and Carbon Cloud runs it in three regions —+ * so the reader picks a region (or their own instance). The Data API is one `rest.`+ * host, so it keeps "not sure / cloud / self-hosted". They write different fields+ * (`appBase` vs `base`), which is what lets one surface's choice survive the+ * other's. */+type CarbonMode = (typeof CARBON_REGIONS)[number]["id"] | "self";+type DataMode = "unknown" | "cloud" | "self";+export function Configurator() {const {base,setBase,+ appBase,+ setAppBase,isDefault,isUnknown,apiKey,setApiKey,openRequest,} = useApiConfig();+ // The sidebar already swaps its tree under /api/data (see ContextualNav); the+ // host control above it follows the same split.+ const isDataApi = (usePathname() ?? "").startsWith("/api/data");+const [open, setOpen] = useState(false);- const [mode, setMode] = useState<"unknown" | "cloud" | "self">("unknown");+ const [mode, setMode] = useState<DataMode>("unknown");+ const [region, setRegion] = useState<CarbonMode>("us");const [url, setUrl] = useState("");const [key, setKey] = useState("");const [showKey, setShowKey] = useState(false);const [urlError, setUrlError] = useState("");- // With no instance configured the trigger shows the placeholder rather than a- // hostname, so the sidebar states plainly that the host is not yet known.- const host = base === null ? HOST_PLACEHOLDER : base.replace(/^https?:\/\//, "");++ // Each surface's trigger names the host ITS samples actually call. With nothing+ // configured both show the placeholder rather than a hostname — showing a reader+ // on their own instance a carbon.ms host is the bug that state exists to fix.+ const shown = isDataApi ? base : appBase;+ const host =+ shown === null ? HOST_PLACEHOLDER : shown.replace(/^https?:\/\//, "");// Seed the draft from current config whenever the dialog opens.const onOpenChange = (next: boolean) => {if (next) {+ const matched = CARBON_REGIONS.find((r) => r.origin === appBase);+ // No region configured yet defaults the CARD to US — the origin every sample+ // on this surface is authored against — while the trigger keeps saying+ // `<your-host>` until Save makes it the reader's own choice.+ setRegion(matched ? matched.id : appBase ? "self" : "us");setMode(isUnknown ? "unknown" : isDefault ? "cloud" : "self");- setUrl(isUnknown || isDefault ? "" : (base ?? ""));+ const selfUrl = isDataApi+ ? isUnknown || isDefault+ ? ""+ : (base ?? "")+ : matched+ ? ""+ : (appBase ?? "");+ setUrl(selfUrl);setKey(apiKey);setShowKey(false);setUrlError("");@@ -123,24 +162,46 @@ export function Configurator() {}, [openRequest]);const save = () => {- if (mode === "self") {+ const selfHosted = isDataApi ? mode === "self" : region === "self";+ let typed: string | null = null;+ if (selfHosted) {const result = parseBaseUrl(url);if ("error" in result) {setUrlError(result.error);return;}- setBase(result.url);- } else if (mode === "cloud") {- setBase(DEFAULT_API_BASE, DEFAULT_APP_ORIGIN);+ typed = result.url;+ }++ if (isDataApi) {+ if (typed) setBase(typed);+ // REST host only — NOT the paired app origin. `appOrigin()` already resolves+ // the cloud base to app.carbon.ms on its own, and passing it here overwrote+ // a region the reader had chosen on the Carbon API surface.+ else if (mode === "cloud") setBase(DEFAULT_API_BASE);+ else setBase(null);} else {- setBase(null);+ setAppBase(+ typed ?? CARBON_REGIONS.find((r) => r.id === region)?.origin ?? null+ );}setApiKey(key);setOpen(false);};+ // Follows the card the reader has SELECTED, not what is saved: someone picking+ // EU or their own instance should be sent to that instance's key settings, and+ // the region cards are the only place this surface knows the origin from.+ const draftOrigin =+ region === "self"+ ? url.trim().replace(/\/+$/, "")+ : CARBON_REGIONS.find((r) => r.id === region)?.origin;+ const keyOrigin =+ (isDataApi ? appBase : draftOrigin) || appBase || DEFAULT_APP_ORIGIN;+const reset = () => {setMode("unknown");+ setRegion("us");setUrl("");setKey("");setUrlError("");@@ -186,7 +247,9 @@ export function Configurator() {<div><Dialog.Title className="m-0 text-ed-16 font-semi text-ink">API configuration</Dialog.Title><Dialog.Description className="m-0 mt-[3px] text-ed-13 leading-normal text-ed-ink/60">- Tune the base URL and key used across the code samples.+ {isDataApi+ ? "Tune the base URL and key used across the code samples."+ : "Pick the instance the code samples should call, and the key they carry."}</Dialog.Description></div><Dialog.Close@@ -205,12 +268,27 @@ export function Configurator() {<p className="m-0 mb-2 font-mono text-ed-11 font-semibold uppercase tracking-[0.07em] text-ed-ink/50">Environment</p>- <div className="grid grid-cols-3 gap-2">- <ModeCard active={mode === "unknown"} onClick={() => setMode("unknown")} title="Not sure" sub="<your-host>" />- <ModeCard active={mode === "cloud"} onClick={() => setMode("cloud")} title="Carbon Cloud" sub="rest.carbon.ms" />- <ModeCard active={mode === "self"} onClick={() => setMode("self")} title="Self-hosted" sub="Your instance" />- </div>- {mode === "self" && (+ {isDataApi ? (+ <div className="grid grid-cols-3 gap-2">+ <ModeCard active={mode === "unknown"} onClick={() => setMode("unknown")} title="Not sure" sub="<your-host>" />+ <ModeCard active={mode === "cloud"} onClick={() => setMode("cloud")} title="Carbon Cloud" sub="rest.carbon.ms" />+ <ModeCard active={mode === "self"} onClick={() => setMode("self")} title="Self-hosted" sub="Your instance" />+ </div>+ ) : (+ <div className="grid grid-cols-2 gap-2">+ {CARBON_REGIONS.map((r) => (+ <ModeCard+ key={r.id}+ active={region === r.id}+ onClick={() => setRegion(r.id)}+ title={r.label}+ sub={r.origin.replace(/^https?:\/\//, "")}+ />+ ))}+ <ModeCard active={region === "self"} onClick={() => setRegion("self")} title="Self-hosted" sub="Your instance" />+ </div>+ )}+ {(isDataApi ? mode === "self" : region === "self") && (<div className="mt-2"><inputvalue={url}@@ -222,7 +300,11 @@ export function Configurator() {onKeyDown={(e) => {if (e.key === "Enter") save();}}- placeholder="https://api.your-domain.com"+ placeholder={+ isDataApi+ ? "https://api.your-domain.com"+ : "https://carbon.your-domain.com"+ }aria-invalid={!!urlError}className={`w-full rounded-lg border bg-white px-[11px] py-[9px] font-mono text-ed-12 text-ed-ink outline-none placeholder:text-ed-ink/42 ${urlError ? "border-ed-red-bright focus:border-ed-red-bright" : "border-ed-warm-300 focus:border-ed-brand"@@ -266,7 +348,7 @@ export function Configurator() {<p className="m-0 mt-[7px] text-ed-12 leading-normal text-ed-ink/55">Stored in this browser only and dropped into the samples. Never sent to Carbon.{" "}<a- href="https://app.carbon.ms/x/settings/api-keys"+ href={`${keyOrigin}/x/settings/api-keys`}target="_blank"rel="noreferrer"className="text-ed-brand-ink no-underline hover:underline"diff --git a/docs/components/api/contextual-nav.tsx b/docs/components/api/contextual-nav.tsxnew file mode 100644index 0000000000..c3d68dc6d3--- /dev/null+++ b/docs/components/api/contextual-nav.tsx@@ -0,0 +1,68 @@+"use client";++import Link from "next/link";+import { usePathname } from "next/navigation";+import type { NavModule } from "@/lib/api-data";+import type { ToolNavModule } from "@/lib/tools-data";+import { ApiNav } from "./api-nav";+import { ApiSurfaceNav } from "./api-surface-nav";++/**+ * One sidebar slot, one tree at a time. Stacking both catalogs (15 Carbon API+ * modules + 474 Data API resources) in a 280px column put the Data API section+ * below the fold — it added bulk AND nobody found it. Instead the path decides:+ * under /api/data the resource tree renders with a way back; everywhere else the+ * sidebar carries only the Carbon API, and the Data API is one quiet link at the+ * bottom — the escape hatch, sized like one.+ */+export function ContextualNav({+ operations,+ tree,+}: {+ operations: ToolNavModule[];+ tree: NavModule[];+}) {+ const pathname = usePathname();+ const inDataApi = pathname === "/api/data" || pathname.startsWith("/api/data/");++ if (inDataApi) {+ return (+ <div>+ <Link+ href="/api"+ className="mb-3 flex items-center gap-[7px] rounded-md px-2 py-1 text-ed-14 text-ed-brand-ink transition-colors hover:bg-ed-hairline/55"+ >+ <svg width="11" height="11" viewBox="0 0 12 12" fill="none" aria-hidden="true">+ <path d="M7.5 3L4.5 6L7.5 9" stroke="currentColor" strokeWidth="1.3" strokeLinecap="round" strokeLinejoin="round" />+ </svg>+ Carbon API+ </Link>+ <ApiNav tree={tree} />+ </div>+ );+ }++ return (+ <div>+ <ApiSurfaceNav operations={operations} />+ <div className="mt-4 border-t border-ed-hairline pt-3">+ <Link+ href="/api/data"+ className="flex items-center justify-between gap-2 rounded-[7px] px-2 py-[5px] transition-colors hover:bg-ed-hairline/50"+ >+ <span className="flex items-center gap-2">+ <svg width="13" height="13" viewBox="0 0 16 16" fill="none" aria-hidden="true" className="shrink-0">+ <ellipse cx="8" cy="4" rx="5.5" ry="2.3" stroke="rgba(38,35,35,0.5)" strokeWidth="1.2" />+ <path d="M2.5 4v8c0 1.27 2.46 2.3 5.5 2.3s5.5-1.03 5.5-2.3V4" stroke="rgba(38,35,35,0.5)" strokeWidth="1.2" />+ <path d="M2.5 8c0 1.27 2.46 2.3 5.5 2.3S13.5 9.27 13.5 8" stroke="rgba(38,35,35,0.5)" strokeWidth="1.2" />+ </svg>+ <span className="text-ed-14 text-ed-ink/80">Data API</span>+ </span>+ <svg width="11" height="11" viewBox="0 0 12 12" fill="none" aria-hidden="true" className="shrink-0">+ <path d="M4.5 3L7.5 6L4.5 9" stroke="rgba(38,35,35,0.48)" strokeWidth="1.3" strokeLinecap="round" strokeLinejoin="round" />+ </svg>+ </Link>+ </div>+ </div>+ );+}diff --git a/docs/components/api/doc.tsx b/docs/components/api/doc.tsxindex 1eb6eb853b..776c4df348 100644--- a/docs/components/api/doc.tsx+++ b/docs/components/api/doc.tsx@@ -1,7 +1,18 @@import type { ReactNode } from "react";-export function DocPage({ children }: { children: ReactNode }) {- return <div className="max-w-190">{children}</div>;+/**+ * `max-w-190` (760px) is a PROSE measure — right for paragraphs, wrong for a+ * reference layout that puts a request sample and two columns of tables side by+ * side. Those pass `wide` to use the column the page actually has.+ */+export function DocPage({+ children,+ wide = false+}: {+ children: ReactNode;+ wide?: boolean;+}) {+ return <div className={wide ? "w-full" : "max-w-190"}>{children}</div>;}export function DocEyebrow({ children }: { children: ReactNode }) {diff --git a/docs/components/api/mcp-nav.tsx b/docs/components/api/mcp-nav.tsxdeleted file mode 100644index ce31ac0a38..0000000000--- a/docs/components/api/mcp-nav.tsx+++ /dev/null@@ -1,150 +0,0 @@-"use client";--import Link from "next/link";-import { usePathname } from "next/navigation";-import { useEffect, useMemo, useRef, useState } from "react";-import type { ToolNavModule } from "@/lib/tools-data";--const CLASS_DOT: Record<string, string> = {- READ: "bg-ed-green-strong",- WRITE: "bg-ed-brand-ink",- DESTRUCTIVE: "bg-ed-red",-};--const MCP_LINKS = [- { label: "Overview", href: "/mcp" },- { label: "Authentication", href: "/mcp/authentication" },- { label: "Tools", href: "/mcp/tools" },-];--const GS_ACTIVE = "bg-ed-brand/10 font-demi text-ed-brand-ink";-const GS_IDLE = "text-ed-ink/80 hover:bg-ed-hairline/55 hover:text-ed-ink";-const SECTION_LABEL =- "m-0 mb-[3px] px-2 py-1.5 font-mono text-ed-12 font-semibold uppercase tracking-[0.06em] text-ed-ink/60";-const GS_LINK = "block rounded-md px-2 py-[3.5px] text-ed-14 leading-[135%] transition-colors";--function Chevron({ open }: { open: boolean }) {- return (- <svg- width="11"- height="11"- viewBox="0 0 12 12"- fill="none"- className={`shrink-0 transition-transform duration-200 ${open ? "rotate-90" : ""}`}- aria-hidden="true"- >- <path d="M4.5 3L7.5 6L4.5 9" stroke="rgba(38,35,35,0.48)" strokeWidth="1.3" strokeLinecap="round" strokeLinejoin="round" />- </svg>- );-}--/** Tools are grouped under their module, so drop the redundant `<module>_` prefix from the label. */-function toolLabel(name: string, moduleSlug: string): string {- return name.startsWith(`${moduleSlug}_`) ? name.slice(moduleSlug.length + 1) : name;-}--function ClassDot({ c }: { c: string }) {- return (- <span- className={`h-1.5 w-1.5 shrink-0 rounded-full ${CLASS_DOT[c] || "bg-ed-ink/40"}`}- aria-label={c}- />- );-}--export function McpNav({ tools }: { tools: ToolNavModule[] }) {- const pathname = usePathname();- const parts = pathname.split("/");- const activeTool = parts[1] === "mcp" && parts[2] === "tools" ? parts[3] : undefined;-- const activeToolModule = useMemo(() => {- if (!activeTool) return undefined;- return tools.find((m) => m.tools.some((t) => t.slug === activeTool))?.slug;- }, [tools, activeTool]);-- const [open, setOpen] = useState<Set<string>>(() => new Set(activeToolModule ? [activeToolModule] : []));- const activeRef = useRef<HTMLAnchorElement>(null);-- useEffect(() => {- if (activeToolModule)- setOpen((p) => (p.has(activeToolModule) ? p : new Set(p).add(activeToolModule)));- }, [activeToolModule]);- useEffect(() => {- activeRef.current?.scrollIntoView({ block: "center" });- }, []);-- return (- <div>- <nav className="flex flex-col gap-0.5">- <div className="mb-2.5">- <p className={SECTION_LABEL}>Getting Started</p>- {MCP_LINKS.map((item) => (- <Link- key={item.href}- href={item.href}- className={`${GS_LINK} ${pathname === item.href ? GS_ACTIVE : GS_IDLE}`}- >- {item.label}- </Link>- ))}- </div>-- <p className={SECTION_LABEL}>Tools</p>- {tools.map((m) => {- const isOpen = open.has(m.slug);- return (- <div key={m.slug}>- <button- type="button"- onClick={() =>- setOpen((prev) => {- const next = new Set(prev);- if (next.has(m.slug)) next.delete(m.slug);- else next.add(m.slug);- return next;- })- }- className="flex w-full items-center justify-between gap-2 rounded-[7px] px-2 py-[5px] transition-colors hover:bg-ed-hairline/50"- >- <span className="flex items-center gap-[7px]">- <Chevron open={isOpen} />- <span className="font-mono text-ed-12 font-semibold uppercase tracking-[0.06em] text-ed-ink/60">- {m.name}- </span>- </span>- <span className="font-mono text-ed-12 tabular-nums text-ed-ink/42">- {m.tools.length}- </span>- </button>-- {isOpen && (- <ul className="mt-0.5 mb-1.5 ml-[13px] list-none border-l border-ed-warm-150 py-0.5 pl-2">- {m.tools.map((t) => {- const isActive = activeTool === t.slug;- return (- <li key={t.slug}>- <Link- ref={isActive ? activeRef : undefined}- href={`/mcp/tools/${t.slug}`}- title={`${t.name} · ${t.classification}`}- className={`flex items-center gap-2 rounded-md px-2 py-[3.5px] leading-[135%] transition-colors ${- isActive ? GS_ACTIVE : GS_IDLE- }`}- >- <ClassDot c={t.classification} />- <span className="truncate font-mono text-ed-13">- {toolLabel(t.name, m.slug)}- </span>- </Link>- </li>- );- })}- </ul>- )}- </div>- );- })}- </nav>- </div>- );-}diff --git a/docs/components/api/operation-panel.tsx b/docs/components/api/operation-panel.tsxnew file mode 100644index 0000000000..d57ca8577a--- /dev/null+++ b/docs/components/api/operation-panel.tsx@@ -0,0 +1,193 @@+"use client";++/* Request panel for a Carbon API operation.+ *+ * An operation is reachable over two transports — plain HTTP (`POST /api/v1/…`) and+ * the MCP `call_tool` meta-tool — so the transport is a tab, and HTTP additionally+ * gets a language picker. Chrome, copy button and language `<select>` mirror the Data+ * API's `code-panel.tsx` so both surfaces read as one product; samples run through the+ * same `applyConfig`, so the host/API-key configurator drives these too.+ */++import { useState } from "react";+import { applyConfig, useApiConfig } from "./config-context";+import {+ HTTP_LANG_LABELS as LANG_LABEL,+ HTTP_LANGS,+ type HttpLang,+ type SampleKey,+ type Transport,+} from "@/lib/operation-samples";++const TRANSPORT_LABEL: Record<Transport, string> = {+ http: "HTTP",+ mcp: "MCP",+};++function CopyButton({ text }: { text: string }) {+ const [copied, setCopied] = useState(false);+ return (+ <button+ type="button"+ onClick={() => {+ navigator.clipboard?.writeText(text);+ setCopied(true);+ setTimeout(() => setCopied(false), 1400);+ }}+ className="absolute top-2.5 right-2.5 z-10 rounded-md border border-ed-dark-line-2 bg-ed-dark-surface px-2 py-[3px] font-mono text-ed-11 text-ed-text-faint transition-colors hover:border-ed-dark-line-3 hover:text-white"+ >+ {copied ? "Copied" : "Copy"}+ </button>+ );+}++function LangSelect({+ value,+ onChange,+}: {+ value: HttpLang;+ onChange: (v: HttpLang) => void;+}) {+ return (+ <div className="relative shrink-0">+ <select+ aria-label="Code language"+ value={value}+ onChange={(e) => onChange(e.target.value as HttpLang)}+ className="cursor-pointer appearance-none rounded-md border border-ed-dark-line-2 bg-ed-dark-surface py-1 pl-2.5 pr-[26px] font-mono text-ed-12 text-ed-text-faint transition-colors hover:border-ed-dark-line-3 hover:text-white focus:border-ed-dark-line-3 focus:outline-none"+ >+ {HTTP_LANGS.map((l) => (+ <option key={l} value={l} className="bg-ed-dark-bg text-ed-text-faint">+ {LANG_LABEL[l]}+ </option>+ ))}+ </select>+ <svg+ width="10"+ height="10"+ viewBox="0 0 12 12"+ fill="none"+ aria-hidden="true"+ className="pointer-events-none absolute right-[9px] top-1/2 -translate-y-1/2"+ >+ <path+ d="M3 4.5L6 7.5L9 4.5"+ stroke="#8C8C88"+ strokeWidth="1.3"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+ </div>+ );+}++export function OperationPanel({+ samples,+ highlighted,+ httpPath,+ responseHtml,+}: {+ samples: Record<SampleKey, string>;+ highlighted: Record<SampleKey, string>;+ httpPath: string;+ /** Shiki HTML for the success envelope. */+ responseHtml?: string;+}) {+ const [transport, setTransport] = useState<Transport>("http");+ const [lang, setLang] = useState<HttpLang>("curl");+ const { base, apiKey, appBase } = useApiConfig();++ const key: SampleKey = transport === "http" ? `http.${lang}` : "mcp";++ return (+ <div className="flex flex-col gap-4">+ <Panel>+ <div className="flex h-11 items-center justify-between gap-2 border-b border-ed-dark-line pr-2 pl-2">+ <div+ role="tablist"+ aria-label="Transport"+ className="flex min-w-0 items-center gap-1"+ >+ {(Object.keys(TRANSPORT_LABEL) as Transport[]).map((t) => (+ <button+ key={t}+ type="button"+ role="tab"+ aria-selected={transport === t}+ onClick={() => setTransport(t)}+ className={`rounded-md px-2.5 py-1 font-mono text-ed-12 transition-colors ${+ transport === t+ ? "bg-ed-dark-surface text-white"+ : "text-ed-text-faint hover:text-white"+ }`}+ >+ {TRANSPORT_LABEL[t]}+ </button>+ ))}+ <span className="ml-1.5 truncate font-mono text-ed-12 text-ed-text-muted">+ {transport === "http" ? `POST ${httpPath}` : "call_tool"}+ </span>+ </div>+ {transport === "http" && <LangSelect value={lang} onChange={setLang} />}+ </div>+ <div className="relative">+ <CopyButton+ text={applyConfig(samples[key], base, apiKey, false, appBase)}+ />+ {/* biome-ignore lint/security/noDangerouslySetInnerHtml: build-time shiki HTML */}+ <div+ className="api-shiki"+ dangerouslySetInnerHTML={{+ __html: applyConfig(highlighted[key], base, apiKey, true, appBase),+ }}+ />+ </div>+ </Panel>++ {responseHtml && (+ <Panel>+ {/* Native <details>, collapsed by default: the request is what a reader+ came for; the response shape is one click away. The sample stays in+ the DOM either way, so Cmd-F and the search index still reach it. */}+ <details className="group">+ <summary className="flex h-10 cursor-pointer list-none items-center justify-between px-3.5 transition-colors hover:bg-ed-dark-surface/60 group-open:border-b group-open:border-ed-dark-line [&::-webkit-details-marker]:hidden">+ <span className="font-mono text-ed-12 tracking-[0.04em] text-ed-text-muted">+ Response+ </span>+ <svg+ width="11"+ height="11"+ viewBox="0 0 12 12"+ fill="none"+ aria-hidden="true"+ className="transition-transform duration-200 group-open:rotate-90 motion-reduce:transition-none"+ >+ <path+ d="M4.5 3L7.5 6L4.5 9"+ stroke="#8C8C88"+ strokeWidth="1.3"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+ </summary>+ {/* biome-ignore lint/security/noDangerouslySetInnerHtml: build-time shiki HTML */}+ <div+ className="api-shiki"+ dangerouslySetInnerHTML={{ __html: responseHtml }}+ />+ </details>+ </Panel>+ )}+ </div>+ );+}++function Panel({ children }: { children: React.ReactNode }) {+ return (+ <div className="overflow-hidden rounded-xl border border-ed-dark-line bg-ed-dark-bg shadow-[0_1px_2px_rgba(0,0,0,0.06)]">+ {children}+ </div>+ );+}diff --git a/docs/components/api/schema-table.tsx b/docs/components/api/schema-table.tsxnew file mode 100644index 0000000000..7717a5eddb--- /dev/null+++ b/docs/components/api/schema-table.tsx@@ -0,0 +1,316 @@+"use client";++/* Recursive, expandable JSON-Schema renderer for Carbon API operation parameters.+ *+ * The manifest's schemas are generated by converting the real zod validators+ * (`scripts/lib/validator-to-json-schema.ts`), so they carry enum values, nested+ * object shapes, array element shapes, and constraints. The previous flat renderer+ * collapsed all of that to a bare label — `enum` with the values hidden, `object`+ * with the fields dropped.+ *+ * Not Fumadocs' AutoTypeTable: that reflects TypeScript types out of `.ts` files, so+ * feeding it these 1,495 JSON Schemas would mean code-generating an interface per+ * operation, and it still renders flat with no drill-down. This mirrors the in-house+ * accordion (`editorial/field-table.tsx`) instead — same button + CSS-grid-rows+ * reveal, so nested rows stay in the DOM when collapsed and remain findable with+ * Cmd-F and by the search index.+ */++import { useId, useState } from "react";++export type JsonSchemaNode = {+ type?: string | string[];+ description?: string;+ enum?: unknown[];+ const?: unknown;+ format?: string;+ default?: unknown;+ properties?: Record<string, JsonSchemaNode>;+ required?: string[];+ items?: JsonSchemaNode;+ additionalProperties?: boolean | JsonSchemaNode;+ anyOf?: JsonSchemaNode[];+ minimum?: number;+ maximum?: number;+ exclusiveMinimum?: number;+ exclusiveMaximum?: number;+ minLength?: number;+ maxLength?: number;+ minItems?: number;+ pattern?: string;+};++/** A `type` that arrived as `["string","null"]` — zod's nullable representation. */+function typeNames(node: JsonSchemaNode): string[] {+ if (Array.isArray(node.type)) return node.type.map(String);+ return node.type ? [String(node.type)] : [];+}++function isPlainObjectSchema(node: JsonSchemaNode): boolean {+ return typeNames(node).includes("object") || node.properties != null;+}++/** The value schema of a `Record<string, T>` (zod emits `additionalProperties`). */+function recordValueSchema(node: JsonSchemaNode): JsonSchemaNode | null {+ const additional = node.additionalProperties;+ return additional && typeof additional === "object" ? additional : null;+}++/** The short label shown next to the field name. */+export function typeLabel(node: JsonSchemaNode): string {+ if (!node || Object.keys(node).length === 0) return "any";+ if (node.const !== undefined) return JSON.stringify(node.const);+ if (Array.isArray(node.enum) && node.enum.length > 0) return "enum";++ if (Array.isArray(node.anyOf) && node.anyOf.length > 0) {+ const labels = [...new Set(node.anyOf.map(typeLabel))];+ return labels.join(" | ");+ }++ const names = typeNames(node);++ if (names.includes("array")) {+ const item = node.items;+ const inner = item ? typeLabel(item) : "any";+ const arrayLabel = `${inner}[]`;+ return names.includes("null") ? `${arrayLabel} | null` : arrayLabel;+ }++ if (names.includes("object") || node.properties || recordValueSchema(node)) {+ const value = recordValueSchema(node);+ // A record has a value schema but no fixed properties.+ const base =+ value && !node.properties+ ? `Record<string, ${typeLabel(value)}>`+ : "object";+ return names.includes("null") ? `${base} | null` : base;+ }++ if (names.length > 0) return names.join(" | ");+ return node.format ?? "any";+}++/** Child rows to reveal when a row is expanded, or null when it is a leaf. */+function childrenOf(+ node: JsonSchemaNode+): { properties: Record<string, JsonSchemaNode>; required: Set<string> } | null {+ if (node.properties && Object.keys(node.properties).length > 0) {+ return {+ properties: node.properties,+ required: new Set(node.required ?? []),+ };+ }+ // Array of objects — drill into the element shape.+ const item = node.items;+ if (item?.properties && Object.keys(item.properties).length > 0) {+ return {+ properties: item.properties,+ required: new Set(item.required ?? []),+ };+ }+ // Record whose values are objects.+ const value = recordValueSchema(node);+ if (value?.properties && Object.keys(value.properties).length > 0) {+ return {+ properties: value.properties,+ required: new Set(value.required ?? []),+ };+ }+ return null;+}++/** Constraint chips (`min 0`, `max 1`, …) — the detail a bare type label loses. */+function constraints(node: JsonSchemaNode): string[] {+ const out: string[] = [];+ if (node.minimum !== undefined) out.push(`min ${node.minimum}`);+ if (node.exclusiveMinimum !== undefined) out.push(`> ${node.exclusiveMinimum}`);+ if (node.maximum !== undefined) out.push(`max ${node.maximum}`);+ if (node.exclusiveMaximum !== undefined) out.push(`< ${node.exclusiveMaximum}`);+ if (node.minLength !== undefined) out.push(`min length ${node.minLength}`);+ if (node.maxLength !== undefined) out.push(`max length ${node.maxLength}`);+ if (node.minItems !== undefined) out.push(`min items ${node.minItems}`);+ if (node.format) out.push(node.format);+ if (node.pattern) out.push(`pattern ${node.pattern}`);+ return out;+}++function enumValues(node: JsonSchemaNode): unknown[] | null {+ if (Array.isArray(node.enum) && node.enum.length > 0) return node.enum;+ // `string[]` whose element is an enum — the values belong to the element.+ if (Array.isArray(node.items?.enum) && node.items.enum.length > 0) {+ return node.items.enum;+ }+ return null;+}++function Chip({ children }: { children: React.ReactNode }) {+ return (+ <span className="inline-flex items-center rounded-[5px] border border-ed-hairline bg-ed-inset px-1.5 py-px font-mono text-ed-11 text-ed-ink-66">+ {children}+ </span>+ );+}++function SchemaRow({+ name,+ node,+ required,+ depth,+}: {+ name: string;+ node: JsonSchemaNode;+ required: boolean;+ depth: number;+}) {+ const [open, setOpen] = useState(false);+ const panelId = `schema-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;++ const values = enumValues(node);+ const kids = childrenOf(node);+ const limits = constraints(node);+ // Only offer a chevron when there is genuinely something to reveal — no dead+ // affordances on plain scalar rows.+ const expandable = Boolean(values || kids || limits.length > 0);++ return (+ <div>+ <button+ type="button"+ aria-expanded={expandable ? open : undefined}+ aria-controls={expandable ? panelId : undefined}+ onClick={() => expandable && setOpen((o) => !o)}+ style={{ paddingLeft: `${16 + depth * 18}px` }}+ className={`flex w-full items-center gap-2 py-[11px] pr-4 text-left hover:bg-ed-row-hover ${+ expandable ? "cursor-pointer" : "cursor-default"+ }`}+ >+ <code className="font-mono text-ed-13 text-ed-ink">{name}</code>+ {required ? (+ <span className="text-ed-11 font-medium text-ed-amber-text">+ required+ </span>+ ) : (+ <span className="text-ed-11 font-medium text-ed-ink/48">optional</span>+ )}+ {node.default !== undefined && (+ <span className="font-mono text-ed-11 text-ed-ink/48">+ default {JSON.stringify(node.default)}+ </span>+ )}+ <span className="ml-auto whitespace-nowrap font-mono text-ed-12 text-ed-ink-45">+ {typeLabel(node)}+ </span>+ <span+ aria-hidden="true"+ className={`w-3.5 shrink-0 text-center text-ed-18 leading-none text-ed-brand-ink transition-transform duration-200 motion-reduce:transition-none ${+ expandable ? "" : "opacity-0"+ } ${open ? "rotate-45" : ""}`}+ >+ ++ </span>+ </button>++ {node.description && (+ <p+ style={{ paddingLeft: `${16 + depth * 18}px` }}+ className="m-0 -mt-1 pb-2.5 pr-4 text-ed-14 leading-normal text-ed-ink/74"+ >+ {node.description}+ </p>+ )}++ {expandable && (+ <div+ className={`grid overflow-hidden transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none ${+ open ? "grid-rows-[1fr]" : "grid-rows-[0fr]"+ }`}+ >+ <div className="min-h-0 overflow-hidden">+ {/* A `0fr` row still renders its content, so nested rows stay tabbable+ while collapsed unless they are inert. */}+ <div+ id={panelId}+ role="region"+ inert={!open}+ className="border-t border-ed-hairline bg-ed-inset"+ >+ {(values || limits.length > 0) && (+ <div+ style={{ paddingLeft: `${16 + (depth + 1) * 18}px` }}+ className="flex flex-wrap items-center gap-1.5 py-2.5 pr-4"+ >+ {limits.map((c) => (+ <Chip key={c}>{c}</Chip>+ ))}+ {values?.map((v) => (+ <Chip key={String(v)}>{JSON.stringify(v)}</Chip>+ ))}+ </div>+ )}+ {kids && (+ <div className="divide-y divide-ed-hairline border-t border-ed-hairline first:border-t-0">+ {sortByRequired(kids.properties, kids.required).map((key) => (+ <SchemaRow+ key={key}+ name={key}+ node={kids.properties[key]}+ required={kids.required.has(key)}+ depth={depth + 1}+ />+ ))}+ </div>+ )}+ </div>+ </div>+ </div>+ )}+ </div>+ );+}++/** Required fields first, then alphabetical — the order a caller fills them in. */+function sortByRequired(+ properties: Record<string, JsonSchemaNode>,+ required: Set<string>+): string[] {+ return Object.keys(properties).sort((a, b) => {+ const diff = Number(required.has(b)) - Number(required.has(a));+ return diff !== 0 ? diff : a.localeCompare(b);+ });+}++export function SchemaTable({ schema }: { schema: unknown }) {+ const root = (schema ?? {}) as JsonSchemaNode;+ const properties = root.properties ?? {};+ const required = new Set(root.required ?? []);+ const names = sortByRequired(properties, required);++ if (names.length === 0) {+ return (+ <p className="mt-2.5 text-ed-15 leading-normal text-ed-ink/74">+ This operation takes no arguments.+ </p>+ );+ }++ return (+ <div className="my-5 overflow-hidden rounded-xl border border-ed-hairline bg-ed-paper">+ <div className="flex items-center gap-3 border-b border-ed-hairline bg-ed-header px-4 py-[9px] font-mono text-ed-10 font-semibold uppercase tracking-[0.07em] text-ed-ink-45">+ <span>Parameter</span>+ <span className="ml-auto">Type</span>+ <span className="w-3.5" />+ </div>+ <div className="divide-y divide-ed-hairline">+ {names.map((name) => (+ <SchemaRow+ key={name}+ name={name}+ node={properties[name]}+ required={required.has(name)}+ depth={0}+ />+ ))}+ </div>+ </div>+ );+}diff --git a/docs/components/api/sdk-cards.tsx b/docs/components/api/sdk-cards.tsxindex af262a1e95..a7b9795492 100644--- a/docs/components/api/sdk-cards.tsx+++ b/docs/components/api/sdk-cards.tsx@@ -1,8 +1,11 @@import type { ReactNode } from "react";-import { siFlutter, siPython, siSwift, siTypescript } from "simple-icons";++/* Card grid for SDK/language choices — brand-icon tile, name, one-line+ * description, arrow CTA. Data-driven: the page supplies the cards (the Client+ * SDKs page feeds it the generator languages), this file owns only the visual. *//** A simple-icons brand glyph (filled path on a 24×24 viewBox). */-function Brand({ path }: { path: string }) {+export function Brand({ path }: { path: string }) {return (<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d={path} />@@ -38,46 +41,20 @@ function Arrow() {);}-// Supabase's official client libraries — https://supabase.com/docs/guides/api/rest/client-libs-const CARDS = [- {- glyph: <Brand path={siTypescript.path} />,- tone: "bg-[#E8F0FB] text-[#3178C6]",- name: "JavaScript & TypeScript",- desc: "The recommended client — supabase-js. Read and write Carbon with carbon.from('…').",- href: "#quickstart",- cta: "Quickstart",- },- {- glyph: <Brand path={siFlutter.path} />,- tone: "bg-[#E5EFF9] text-[#02569B]",- name: "Dart & Flutter",- desc: "The official supabase-flutter SDK for Dart and Flutter apps.",- href: "https://supabase.com/docs/reference/dart/introduction",- cta: "Supabase Dart",- },- {- glyph: <Brand path={siSwift.path} />,- tone: "bg-ed-red-bg text-[#E0431F]",- name: "Swift",- desc: "The official supabase-swift SDK for iOS, macOS, and server-side Swift.",- href: "https://supabase.com/docs/reference/swift/introduction",- cta: "Supabase Swift",- },- {- glyph: <Brand path={siPython.path} />,- tone: "bg-[#EAF1F8] text-[#3776AB]",- name: "Python",- desc: "The official supabase-py client, or call the REST API directly with requests.",- href: "https://supabase.com/docs/reference/python/introduction",- cta: "Supabase Python",- },-];+export interface SdkCard {+ glyph: ReactNode;+ /** Tile background/foreground classes, e.g. `bg-[#E8F0FB] text-[#3178C6]`. */+ tone: string;+ name: string;+ desc: string;+ href: string;+ cta: string;+}-export function SdkCards() {+export function SdkCardGrid({ cards }: { cards: SdkCard[] }) {return (<div className="mt-[18px] grid grid-cols-1 gap-3.5 sm:grid-cols-2">- {CARDS.map((c) => (+ {cards.map((c) => (<akey={c.name}href={c.href}diff --git a/docs/components/api/sdk-languages.tsx b/docs/components/api/sdk-languages.tsxnew file mode 100644index 0000000000..1807402703--- /dev/null+++ b/docs/components/api/sdk-languages.tsx@@ -0,0 +1,72 @@+import { siGo, siPhp, siPython, siRuby, siSharp, siTypescript } from "simple-icons";+import { Brand, type SdkCard } from "./sdk-cards";++/* The generator languages, shared by the Client SDKs page (where each card jumps+ * to its own section) and the API overview (where the same cards send a reader+ * to that page). One list, so an edit to a description — or dropping a language,+ * as Java was — can never leave the two surfaces disagreeing.+ *+ * Each card carries its ANCHOR, not a href: `sdkLanguageCards()` leaves it a bare+ * fragment for the SDKs page's own cards and prefixes the path everywhere else,+ * so linking from a second page can't quietly turn the on-page jumps into+ * cross-document navigations. */+type SdkLanguage = Omit<SdkCard, "href"> & { anchor: string };++const SDK_LANGUAGES: SdkLanguage[] = [+ {+ glyph: <Brand path={siTypescript.path} />,+ tone: "bg-[#E8F0FB] text-[#3178C6]",+ name: "TypeScript",+ desc: "A fully typed client from @hey-api/openapi-ts — request and response types included.",+ anchor: "typescript",+ cta: "Generate"+ },+ {+ glyph: <Brand path={siPython.path} />,+ tone: "bg-[#EAF1F8] text-[#3776AB]",+ name: "Python",+ desc: "A modern typed client with openapi-python-client — attrs models and httpx under the hood.",+ anchor: "python",+ cta: "Generate"+ },+ {+ glyph: <Brand path={siGo.path} />,+ tone: "bg-[#E5F4F9] text-[#00ADD8]",+ name: "Go",+ desc: "A typed client from oapi-codegen — pure Go, no Java runtime needed.",+ anchor: "go",+ cta: "Generate"+ },+ {+ glyph: <Brand path={siRuby.path} />,+ tone: "bg-ed-red-bg text-[#CC342D]",+ name: "Ruby",+ desc: "A client from openapi-generator — its Docker image needs no Java install (-g ruby).",+ anchor: "any-language",+ cta: "Generate"+ },+ {+ glyph: <Brand path={siSharp.path} />,+ tone: "bg-[#EEEAF6] text-[#512BD4]",+ name: "C#",+ desc: "A client from openapi-generator — its Docker image needs no Java install (-g csharp).",+ anchor: "any-language",+ cta: "Generate"+ },+ {+ glyph: <Brand path={siPhp.path} />,+ tone: "bg-[#EBECF3] text-[#777BB4]",+ name: "PHP",+ desc: "A client from openapi-generator — its Docker image needs no Java install (-g php).",+ anchor: "any-language",+ cta: "Generate"+ }+];++/** `base` is the path to prefix — omit it on the Client SDKs page itself. */+export function sdkLanguageCards(base = ""): SdkCard[] {+ return SDK_LANGUAGES.map(({ anchor, ...card }) => ({+ ...card,+ href: `${base}#${anchor}`+ }));+}diff --git a/docs/components/api/view-callout.tsx b/docs/components/api/view-callout.tsxindex ce3e25802a..474de93614 100644--- a/docs/components/api/view-callout.tsx+++ b/docs/components/api/view-callout.tsx@@ -1,9 +1,36 @@import Link from "next/link";+/**+ * Rendered at the top of every table resource page: the Data API can write+ * straight to this table, but doing so skips the service layer, so derived+ * values aren't recalculated. Steer writes to the Carbon API.+ */+export function WriteSteerCallout() {+ return (+ <div className="my-5 rounded-xl border border-ed-amber-stroke/70 bg-ed-amber-fill px-4 py-3.5">+ <p className="m-0 text-ed-14 font-semi text-ed-amber-text">+ You are outside the service layer+ </p>+ <p className="m-0 mt-1 text-ed-14 leading-[155%] text-ed-ink/78">+ Nothing here validates, recalculates, or posts — a write to this table+ won't maintain the values that depend on it (totals, statuses, ledger+ entries). Reach for the{" "}+ <Link+ href="/api"+ className="font-medium text-ed-brand-ink underline decoration-ed-blue-border underline-offset-2 hover:decoration-ed-brand-ink"+ >+ Carbon API+ </Link>{" "}+ first; use this surface when you know exactly what this table touches.+ </p>+ </div>+ );+}+/*** Rendered on table resource pages that have a companion view with computed- * columns (e.g. salesInvoice → salesInvoices). Tells the reader to use the- * view for reads and the table for writes.+ * columns (e.g. salesInvoice → salesInvoices). Tells the reader to read from+ * the view for accurate computed values.*/export function ViewCallout({tableName,@@ -29,8 +56,7 @@ export function ViewCallout({>{viewName}</Link>{" "}- view instead. Use this table for <strong>create</strong>, <strong>update</strong>,- and <strong>delete</strong> operations.+ view instead.</p></div>);diff --git a/docs/components/main-header.tsx b/docs/components/main-header.tsxindex afa022c4ee..bc6f67c144 100644--- a/docs/components/main-header.tsx+++ b/docs/components/main-header.tsx@@ -7,13 +7,12 @@ import { SiteLogo } from "./site-logo";const NAV = [{ key: "reference", label: "Reference", href: "/docs" },{ key: "guides", label: "Guides", href: "/guides/order" },- { key: "api", label: "API", href: "/api-reference" },- { key: "mcp", label: "MCP", href: "/mcp" },+ { key: "api", label: "API", href: "/api" },] as const;type Active = (typeof NAV)[number]["key"];-/** The single site-wide header: Carbon · Guide · Reference · API · Open Carbon.+/** The single site-wide header: Carbon · Reference · Guides · API · Open Carbon.* `mobileNav` is the current surface's section tree, surfaced in the hamburger* drawer below `lg` where the desktop sidebar is hidden. */export function MainHeader({ active, mobileNav }: { active?: Active; mobileNav?: ReactNode }) {diff --git a/docs/components/mobile-nav.tsx b/docs/components/mobile-nav.tsxindex efdcabe110..81565d2dee 100644--- a/docs/components/mobile-nav.tsx+++ b/docs/components/mobile-nav.tsx@@ -4,13 +4,13 @@* The mobile navigation drawer. Below `lg` the section sidebars are hidden and the* header's link row collapses, so this is the *only* way to move around on a phone:* a hamburger in the header opens a left drawer that carries the site-level nav- * (Guides · Reference · API · MCP) plus, when a surface passes one, its full section- * tree. The header stays on top (higher z) so the hamburger morphs to an X and can- * close what it opened; the scrim and Esc close it too.+ * (Reference · Guides · API · Data API) plus, when a surface passes one, its full+ * section tree. The header stays on top (higher z) so the hamburger morphs to an X and+ * can close what it opened; the scrim and Esc close it too.*- * Section trees are passed as `children`. Reference/API/MCP use `<Link>`, so a route- * change closes the drawer on its own; the editorial Guide navigates via client state- * (no route change), so its tree calls `useMobileNavClose()` to dismiss on select.+ * Section trees are passed as `children`. Reference/API/Data API use `<Link>`, so a+ * route change closes the drawer on its own; the editorial Guide navigates via client+ * state (no route change), so its tree calls `useMobileNavClose()` to dismiss on select.*/import Link from "next/link";import { usePathname } from "next/navigation";@@ -27,8 +27,7 @@ import { createPortal } from "react-dom";const NAV = [{ key: "reference", label: "Reference", href: "/docs" },{ key: "guides", label: "Guides", href: "/guides/order" },- { key: "api", label: "API", href: "/api-reference" },- { key: "mcp", label: "MCP", href: "/mcp" },+ { key: "api", label: "API", href: "/api" },] as const;type Active = (typeof NAV)[number]["key"];diff --git a/docs/components/search/search-command.tsx b/docs/components/search/search-command.tsxindex 57788549fb..1ec4bfd556 100644--- a/docs/components/search/search-command.tsx+++ b/docs/components/search/search-command.tsx@@ -42,23 +42,23 @@ const SURFACES = [{ key: "all", label: "All", tag: undefined },{ key: "guide", label: "Guide", tag: "guide" },{ key: "docs", label: "Reference", tag: "docs" },- { key: "resources", label: "API", tag: "resources" },- { key: "tools", label: "MCP", tag: "tools" },+ { key: "tools", label: "API", tag: "tools" },+ { key: "resources", label: "Data API", tag: "resources" },] as const;const surfaceToneClasses: Record<string, string> = {guide: "border-ed-blue-border bg-ed-blue-bg text-ed-blue-mid",api: "border-ed-green-border bg-ed-green-bg text-ed-green-text",- mcp: "border-ed-amber-stroke bg-ed-amber-fill text-ed-amber-text",+ "data-api": "border-ed-amber-stroke bg-ed-amber-fill text-ed-amber-text",docs: "border-ed-warm-400 bg-ed-warm-150 text-ed-ink/60",};// Which surface a result belongs to is read back off its URL — the flat result list-// from fetchClient doesn't echo the index `tag`.+// from fetchClient doesn't echo the index `tag`. Check /api/data before /api.function surfaceOf(url: string): { label: string; key: string } {if (url.startsWith("/guides")) return { label: "Guide", key: "guide" };- if (url.startsWith("/api-reference")) return { label: "API", key: "api" };- if (url.startsWith("/mcp")) return { label: "MCP", key: "mcp" };+ if (url.startsWith("/api/data")) return { label: "Data API", key: "data-api" };+ if (url.startsWith("/api")) return { label: "API", key: "api" };return { label: "Reference", key: "docs" };}@@ -71,6 +71,18 @@ function SearchGlyph({ className }: { className?: string }) {);}+/**+ * Opening the palette from elsewhere in the tree. The palette lives in the header+ * and owns its own state, so a sibling (the API sidebar) cannot lift it — a DOM+ * event is the smallest bridge that does not thread context through every layout.+ * `tag` preselects a surface pill, so "search the API" lands already filtered.+ */+const OPEN_SEARCH_EVENT = "carbon:open-search";++export function openSearch(tag?: string): void {+ window.dispatchEvent(new CustomEvent(OPEN_SEARCH_EVENT, { detail: { tag } }));+}+export function SearchCommand() {const [open, setOpen] = useState(false);const [tag, setTag] = useState<string | undefined>(undefined);@@ -109,6 +121,17 @@ export function SearchCommand() {return () => window.removeEventListener("keydown", onKey);}, []);+ // Opened from elsewhere (the API sidebar), optionally on a preselected surface.+ useEffect(() => {+ function onOpen(e: Event) {+ const requested = (e as CustomEvent<{ tag?: string }>).detail?.tag;+ if (requested !== undefined) setTag(requested);+ setOpen(true);+ }+ window.addEventListener(OPEN_SEARCH_EVENT, onOpen);+ return () => window.removeEventListener(OPEN_SEARCH_EVENT, onOpen);+ }, []);+// Keep the highlighted row in range and scrolled into view as results change.useEffect(() => {setActive(0);diff --git a/docs/content/docs/reference/api-keys.mdx b/docs/content/docs/building/api-keys.mdxsimilarity index 75%rename from docs/content/docs/reference/api-keys.mdxrename to docs/content/docs/building/api-keys.mdxindex 19bc9ef99c..4ea7ef9ef1 100644--- a/docs/content/docs/reference/api-keys.mdx+++ b/docs/content/docs/building/api-keys.mdx@@ -21,12 +21,12 @@ The full format is `crbn_` followed by a random token. The same dialog also hand## How a key authenticates a request-Send the key in the **`carbon-key`** HTTP header on every request:+Send the key as a bearer token on every request. The hosted Data API lives at `rest.carbon.ms`:```http-GET /rest/v1/salesOrder?select=id,salesOrderId,status-Host: your-carbon-host-carbon-key: crbn_your_key_here+GET /salesOrder?select=id,salesOrderId,status+Host: rest.carbon.ms+Authorization: Bearer crbn_your_key_here```Carbon hashes the incoming key, looks up the matching record, and checks two things before it lets the request through:@@ -34,7 +34,11 @@ Carbon hashes the incoming key, looks up the matching record, and checks two thi- **Expiry.** If the key has an `expiresAt` in the past, the request is rejected.- **Rate limit.** The request is counted against the key's window; if the window is full, the request is rejected.-There is no separate login step and no token to refresh. The header is the whole handshake. The same `carbon-key` header works for the REST API, the edge functions, and (rewritten from a `Bearer` token) the MCP endpoint.+There is no separate login step and no token to refresh. The header is the whole handshake.++<Callout type="note" title="Bearer at the edge, carbon-key underneath">+`rest.carbon.ms` takes the key as `Authorization: Bearer crbn_…` and forwards it internally as the `carbon-key` header that the database reads. If you run Carbon yourself and call PostgREST directly, send `carbon-key: crbn_…` against `/rest/v1/<table>` instead. The MCP endpoint that fronts the Carbon API takes the same `Bearer` token either way.+</Callout>## Permission scoping@@ -59,15 +63,23 @@ The limit is counted per key, not per company, so one integration burning its alA rejected request comes back `429` with `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` and `Retry-After` (`packages/auth/src/services/auth.server.ts:255`). Read `Retry-After` and wait it out rather than hammering through the rejection.-## The REST and OpenAPI surface+## What the key unlocks++One key unlocks two surfaces. Reach for the Carbon API first; drop to the Data API only when you need raw table access.-The key unlocks Carbon's auto-generated REST API. Every table Carbon exposes is reachable at a PostgREST endpoint (`/rest/v1/<table>`), and the same row-level security that governs the app governs these calls — a request carrying a `carbon-key` is scoped to that key's company and permissions by the database itself, not just the application layer. That means the key can only ever touch data its scopes allow, the same rules the UI enforces.+### The Carbon API-The full endpoint catalogue, with request and response shapes per resource, lives in the generated [API reference](/api-reference). Point your client at those endpoints, send the `carbon-key` header, and you have programmatic read/write across the modules your key is scoped for.+The [Carbon API](/api) is Carbon's service layer — the safe way to read and write, running the same validation, recalculation, and permission checks the app itself uses. Reach it over plain HTTP at `POST /api/v1/{module}/{operation}` — the key goes in an `Authorization: Bearer` header, and the full operation catalogue is described by [`/api/v1/openapi.json`](/api). The same surface is also exposed over MCP: the creation dialog hands you a ready-to-paste command that registers the key with an AI assistant, which then operates strictly within the key's scopes. See [Connect over MCP](/api/mcp).-## The MCP endpoint+### The Data API++The same key also unlocks the [Data API](/api/data) — direct REST access to every table and view, hosted at `rest.carbon.ms` (the full endpoint catalogue is generated in the [reference](/api/data)). The same row-level security that governs the app governs these calls: the key is scoped to its company and permissions by the database itself, not just the application layer, so it can only ever touch data its scopes allow.++<Callout type="warn" title="You are outside the service layer">+The Data API writes straight to tables, so Carbon does not recalculate the derived values — totals, statuses, ledger entries — that it maintains when you write through the Carbon API. It's the escape hatch: reach for the Carbon API first, and use the Data API when it doesn't cover what you need and you know exactly what the table touches.+</Callout>-Carbon also exposes an MCP endpoint (`/api/mcp`) so an AI assistant can call Carbon's tools with your key. The creation dialog gives you the exact command to register it, passing the key as an `Authorization: Bearer` token that Carbon resolves the same way as the `carbon-key` header. The assistant then operates strictly within the key's scopes — the same permission boundary as any other API call.+The full endpoint catalogue, with request and response shapes per resource, lives in the generated [Data API reference](/api/data).## Keys versus webhooks@@ -82,8 +94,8 @@ They are independent: a webhook is not authenticated with an API key (Carbon doe<Card title="Webhooks" href="/docs/building/webhooks">Get an HTTP callback when a Carbon record changes, then pull the detail with your key.</Card>- <Card title="API reference" href="/api-reference">- The generated endpoint catalogue for every table and resource.+ <Card title="Data API" href="/api/data">+ The generated endpoint catalogue for every table and view.</Card></Cards>diff --git a/docs/content/docs/building/meta.json b/docs/content/docs/building/meta.jsonindex 6f97226d61..3c2795090f 100644--- a/docs/content/docs/building/meta.json+++ b/docs/content/docs/building/meta.json@@ -1,5 +1,5 @@{- "title": "Building",+ "title": "Building on Carbon","defaultOpen": true,- "pages": ["webhooks", "local-development"]+ "pages": ["api-keys", "webhooks", "local-development"]}diff --git a/docs/content/docs/building/webhooks.mdx b/docs/content/docs/building/webhooks.mdxindex c4c2776e64..f7bfc6b853 100644--- a/docs/content/docs/building/webhooks.mdx+++ b/docs/content/docs/building/webhooks.mdx@@ -74,7 +74,7 @@ Carbon does **not** sign webhook payloads. There is no shared secret or signatur<Card title="Integrations" href="/docs/integrations">Prefer a packaged connector? See the first-party integrations.</Card>- <Card title="Authentication" href="/api-reference/authentication">- Pull the full record from the API after a webhook tells you it changed.+ <Card title="API keys" href="/docs/building/api-keys">+ Pull the full record from the Carbon API after a webhook tells you it changed.</Card></Cards>diff --git a/docs/content/docs/index.mdx b/docs/content/docs/index.mdxindex 56f33e02ee..c89dd0e9c7 100644--- a/docs/content/docs/index.mdx+++ b/docs/content/docs/index.mdx@@ -26,3 +26,20 @@ Come here when you already know the noun you need and want the precise detail beThe entities behind the Guide: methods, reordering, routings, and more.</Card></Cards>++## Build on Carbon++<Cards>+ <Card title="Carbon API" href="/api">+ The service layer — read and write your data the safe way, over HTTP or MCP.+ </Card>+ <Card title="Data API" href="/api/data">+ Direct table access — the escape hatch, when the Carbon API doesn't cover it.+ </Card>+ <Card title="API keys" href="/docs/building/api-keys">+ Scoped secrets that let an external system call Carbon on your behalf.+ </Card>+ <Card title="Webhooks" href="/docs/building/webhooks">+ Get an HTTP callback the moment a subscribed record changes.+ </Card>+</Cards>diff --git a/docs/content/docs/reference/company-settings.mdx b/docs/content/docs/reference/company-settings.mdxindex 7d698568b8..789af9b199 100644--- a/docs/content/docs/reference/company-settings.mdx+++ b/docs/content/docs/reference/company-settings.mdx@@ -104,7 +104,7 @@ A few more company-wide lookups live under **Settings → System** and have thei<Cards><Card title="Numbering sequences" href="/docs/reference/sequences">The per-company generators behind every readable document number.</Card>- <Card title="API keys" href="/docs/reference/api-keys">Scoped secrets that let external systems call the Carbon API.</Card>+ <Card title="API keys" href="/docs/building/api-keys">Scoped secrets that let external systems call the Carbon API.</Card><Card title="Approvals" href="/docs/reference/approvals">Approval rules that gate documents above a threshold.</Card><Card title="Notifications" href="/docs/reference/notifications">How the notification groups above reach people.</Card></Cards>diff --git a/docs/content/docs/reference/meta.json b/docs/content/docs/reference/meta.jsonindex fc6b957770..6b556d5df1 100644--- a/docs/content/docs/reference/meta.json+++ b/docs/content/docs/reference/meta.json@@ -54,7 +54,6 @@"sequences","import-export","documents",- "api-keys","people","training","permissions",diff --git a/docs/content/docs/reference/permissions.mdx b/docs/content/docs/reference/permissions.mdxindex 977c0d5b27..64bb997397 100644--- a/docs/content/docs/reference/permissions.mdx+++ b/docs/content/docs/reference/permissions.mdx@@ -5,7 +5,7 @@ description: How Carbon decides who can see and change what, from the module-actEveryone who works in Carbon signs in against one company, and Carbon decides what they can do from a set of small, explicit grants. A grant is a pair: a **module** (a slice of the app, like Sales or Inventory) and an **action** on it (view, create, update, or delete). Grant someone `sales_view` and they can read sales orders; grant `inventory_update` and they can edit inventory. Nothing is implied and nothing is global. A person with no grants can sign in and see nothing.-You rarely set those grants one at a time. Each employee gets an **employee type** that carries a template of grants, and you tune the exceptions per person from there. This page is the map of that system, from the permission model at the bottom to the people at the top. For the individuals themselves see [people](/docs/reference/people); for programmatic access that uses the same model, see [API keys](/docs/reference/api-keys). Permissions decide what someone may do once they are in; for how they prove who they are on the way in, see [two-factor authentication](/docs/reference/two-factor).+You rarely set those grants one at a time. Each employee gets an **employee type** that carries a template of grants, and you tune the exceptions per person from there. This page is the map of that system, from the permission model at the bottom to the people at the top. For the individuals themselves see [people](/docs/reference/people); for programmatic access that uses the same model, see [API keys](/docs/building/api-keys). Permissions decide what someone may do once they are in; for how they prove who they are on the way in, see [two-factor authentication](/docs/reference/two-factor).## The module-action model@@ -28,7 +28,7 @@ Every permission screen in Carbon is the same widget: a matrix with a **row perInternally each grant stores the list of companies it applies to, so one person can hold different permissions in each company they belong to. In the UI you always edit permissions for the company you're currently in. The special value `"0"` means "all companies" and is how a true cross-company administrator is represented. See [multi-company setup](/docs/reference/intercompany) for how a user spans several companies.</Callout>-Carbon enforces these grants in two places at once. The app checks them to show or hide screens and buttons, and the database enforces the same grants through row-level security, so a request that skips the UI still can't reach data the grant doesn't allow. That second layer is what makes the same model safe for [API keys](/docs/reference/api-keys), which carry scopes in exactly this `module_action` shape.+Carbon enforces these grants in two places at once. The app checks them to show or hide screens and buttons, and the database enforces the same grants through row-level security, so a request that skips the UI still can't reach data the grant doesn't allow. That second layer is what makes the same model safe for [API keys](/docs/building/api-keys), which carry scopes in exactly this `module_action` shape.## Employee types@@ -96,7 +96,7 @@ PIN accounts are scoped to the floor by design. They carry only the grants their<Card title="People" href="/docs/reference/people">The individual accounts these permissions apply to.</Card>- <Card title="API keys" href="/docs/reference/api-keys">+ <Card title="API keys" href="/docs/building/api-keys">Programmatic access using the same module-action scopes.</Card><Card title="The MES app" href="/docs/reference/mes">diff --git a/docs/content/docs/reference/two-factor.mdx b/docs/content/docs/reference/two-factor.mdxindex f94d83e5ac..b96c7b3b88 100644--- a/docs/content/docs/reference/two-factor.mdx+++ b/docs/content/docs/reference/two-factor.mdx@@ -82,7 +82,7 @@ It also means at least two people should hold user-management permission. If youMachine access is never challenged, and that's by design — there's nobody present to read a code off a phone.<FieldTable>- <Field name="API keys">Keep working exactly as before. They carry their own scopes and rate limits; see [API keys](/docs/reference/api-keys).</Field>+ <Field name="API keys">Keep working exactly as before. They carry their own scopes and rate limits; see [API keys](/docs/building/api-keys).</Field><Field name="Integrations">Anything authenticating as the company rather than as a person is unaffected.</Field><Field name="Shop-floor PIN operators">Never prompted. Operators pin in at a shared terminal rather than signing in, so there's no personal session to protect and no phone to scan with. The person who signed the terminal in is the one two-factor applies to.</Field></FieldTable>diff --git a/docs/lib/api-data.ts b/docs/lib/api-data.tsindex a051ecdb95..cab66a5f38 100644--- a/docs/lib/api-data.ts+++ b/docs/lib/api-data.ts@@ -22,7 +22,7 @@ export function allResourceParams(): { module: string; resource: string }[] {export const firstResourcePath: string = (() => {const m = apiModules[0];const r = m?.resources[0];- return m && r ? `/api-reference/${m.slug}/${r.slug}` : "/api-reference";+ return m && r ? `/api/data/${m.slug}/${r.slug}` : "/api/data";})();// Slim nav tree (no code samples) for the sidebar.diff --git a/docs/lib/highlight.ts b/docs/lib/highlight.tsindex bea925d190..9df48779d0 100644--- a/docs/lib/highlight.ts+++ b/docs/lib/highlight.ts@@ -7,7 +7,17 @@ function getHighlighter() {if (!highlighterPromise) {highlighterPromise = createHighlighter({themes: ["github-dark-default"],- langs: ["bash", "javascript", "python", "go", "json"],+ langs: [+ "bash",+ "javascript",+ "python",+ "go",+ "php",+ "ruby",+ "java",+ "csharp",+ "json"+ ],});}return highlighterPromise;@@ -18,6 +28,10 @@ const LANG: Record<string, string> = {javascript: "javascript",python: "python",go: "go",+ php: "php",+ ruby: "ruby",+ java: "java",+ csharp: "csharp",json: "json",};diff --git a/docs/lib/operation-samples.ts b/docs/lib/operation-samples.tsnew file mode 100644index 0000000000..a9bf522f3c--- /dev/null+++ b/docs/lib/operation-samples.ts@@ -0,0 +1,276 @@+import { DEFAULT_APP_ORIGIN, DEFAULT_MCP_ENDPOINT } from "@/components/api/config-constants";+import type { JsonSchemaNode } from "@/components/api/schema-table";++/**+ * Request samples for one Carbon API operation, in both transports it is reachable+ * over. Built with the literal default hosts so `applyConfig` can rewrite them to+ * whatever instance the reader configured (see `config-context.tsx`).+ */++export const TRANSPORTS = ["http", "mcp"] as const;+export type Transport = (typeof TRANSPORTS)[number];++/**+ * Order matters — it is the dropdown order. cURL first (it is the one everyone can+ * read), then the languages Carbon integrators actually write in: web, scripting,+ * services, and the two that dominate manufacturing back-offices, .NET and Java.+ */+export const HTTP_LANGS = [+ "curl",+ "javascript",+ "python",+ "go",+ "csharp",+ "java",+ "php",+ "ruby"+] as const;+export type HttpLang = (typeof HTTP_LANGS)[number];++/** Sample key: every HTTP language, plus the single MCP snippet. */+export type SampleKey = `http.${HttpLang}` | "mcp";++export const SAMPLE_KEYS: SampleKey[] = [+ ...HTTP_LANGS.map((l) => `http.${l}` as SampleKey),+ "mcp",+];++/** The shiki grammar to highlight each sample with. */+export const SAMPLE_GRAMMAR: Record<SampleKey, string> = {+ "http.curl": "curl",+ "http.javascript": "javascript",+ "http.python": "python",+ "http.go": "go",+ "http.csharp": "csharp",+ "http.java": "java",+ "http.php": "php",+ "http.ruby": "ruby",+ mcp: "javascript",+};++/** Dropdown labels — the language's own spelling, not its key. */+export const HTTP_LANG_LABELS: Record<HttpLang, string> = {+ curl: "cURL",+ javascript: "JavaScript",+ python: "Python",+ go: "Go",+ csharp: "C#",+ java: "Java",+ php: "PHP",+ ruby: "Ruby"+};++/**+ * A representative value for a parameter. An enum uses its first real value rather+ * than `"string"`, so the copyable sample is one the operation would actually accept.+ */+function exampleArg(prop: unknown): unknown {+ if (!prop || typeof prop !== "object") return "string";+ const p = prop as JsonSchemaNode;+ if (Array.isArray(p.enum) && p.enum.length > 0) return p.enum[0];+ if (p.default !== undefined) return p.default;+ const type = Array.isArray(p.type) ? p.type.find((t) => t !== "null") : p.type;+ switch (type) {+ case "number":+ case "integer":+ return 0;+ case "boolean":+ return true;+ case "array":+ return [];+ case "object":+ return {};+ default:+ return "string";+ }+}++/** Required arguments only — the smallest call that can succeed. */+export function exampleArgs(schema: unknown): Record<string, unknown> {+ const s = (schema ?? {}) as {+ properties?: Record<string, unknown>;+ required?: string[];+ };+ const props = s.properties ?? {};+ const required = s.required ?? Object.keys(props);+ const out: Record<string, unknown> = {};+ for (const key of required) out[key] = exampleArg(props[key]);+ return out;+}++/** `sales_copyQuote` + module `sales` → `copyQuote`, the id used in the v1 path. */+export function operationPath(toolName: string, moduleSlug: string): string {+ const id = toolName.startsWith(`${moduleSlug}_`)+ ? toolName.slice(moduleSlug.length + 1)+ : toolName;+ return `/api/v1/${moduleSlug}/${id}`;+}++function indent(json: string, spaces: number): string {+ const pad = " ".repeat(spaces);+ return json.split("\n").join(`\n${pad}`);+}++export function buildOperationSamples(+ toolName: string,+ moduleSlug: string,+ schema: unknown+): Record<SampleKey, string> {+ const args = exampleArgs(schema);+ const path = operationPath(toolName, moduleSlug);+ const url = `${DEFAULT_APP_ORIGIN}${path}`;+ const body = JSON.stringify(args, null, 2);+ const hasArgs = Object.keys(args).length > 0;++ const curl = [+ `curl -X POST '${url}' \\`,+ ` -H 'Authorization: Bearer <api-key>' \\`,+ hasArgs ? ` -H 'Content-Type: application/json' \\` : ` -H 'Content-Type: application/json'`,+ ...(hasArgs ? [` -d '${indent(body, 2)}'`] : []),+ ].join("\n");++ const javascript = `const response = await fetch("${url}", {+ method: "POST",+ headers: {+ Authorization: "Bearer <api-key>",+ "Content-Type": "application/json"+ },+ body: JSON.stringify(${indent(body, 2)})+});++const data = await response.json();`;++ const python = `import requests++response = requests.post(+ "${url}",+ headers={+ "Authorization": "Bearer <api-key>",+ "Content-Type": "application/json",+ },+ json=${indent(body, 4)},+)++data = response.json()`;++ // MCP reaches the same operation through the call_tool meta-tool, where the tool+ // name keeps its module prefix.+ const mcp = `// POST ${DEFAULT_MCP_ENDPOINT}+call_tool(${JSON.stringify({ name: toolName, arguments: args }, null, 2)})`;++ const go = `package main++import (+ "bytes"+ "net/http"+)++func main() {+ body := []byte(\`${indent(body, 1).replace(/\n/g, "\n\t")}\`)++ req, _ := http.NewRequest("POST", "${url}", bytes.NewBuffer(body))+ req.Header.Set("Authorization", "Bearer <api-key>")+ req.Header.Set("Content-Type", "application/json")++ res, err := http.DefaultClient.Do(req)+ if err != nil {+ panic(err)+ }+ defer res.Body.Close()+}`;++ const csharp = `using System.Net.Http;+using System.Net.Http.Headers;+using System.Text;++var client = new HttpClient();+client.DefaultRequestHeaders.Authorization =+ new AuthenticationHeaderValue("Bearer", "<api-key>");++var body = new StringContent(+ """+ ${indent(body, 4)}+ """,+ Encoding.UTF8,+ "application/json");++var response = await client.PostAsync("${url}", body);+var data = await response.Content.ReadAsStringAsync();`;++ const java = `import java.net.URI;+import java.net.http.*;++var client = HttpClient.newHttpClient();++var request = HttpRequest.newBuilder()+ .uri(URI.create("${url}"))+ .header("Authorization", "Bearer <api-key>")+ .header("Content-Type", "application/json")+ .POST(HttpRequest.BodyPublishers.ofString("""+ ${indent(body, 8)}+ """))+ .build();++var response = client.send(request, HttpResponse.BodyHandlers.ofString());`;++ const php = `<?php++$ch = curl_init('${url}');++curl_setopt_array($ch, [+ CURLOPT_RETURNTRANSFER => true,+ CURLOPT_POST => true,+ CURLOPT_HTTPHEADER => [+ 'Authorization: Bearer <api-key>',+ 'Content-Type: application/json',+ ],+ CURLOPT_POSTFIELDS => json_encode(${phpArray(args, 4)}),+]);++$data = json_decode(curl_exec($ch), true);+curl_close($ch);`;++ const ruby = `require "net/http"+require "json"++uri = URI("${url}")++request = Net::HTTP::Post.new(uri)+request["Authorization"] = "Bearer <api-key>"+request["Content-Type"] = "application/json"+request.body = JSON.generate(${rubyHash(args, 2)})++response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|+ http.request(request)+end++data = JSON.parse(response.body)`;++ return {+ "http.curl": curl,+ "http.javascript": javascript,+ "http.python": python,+ "http.go": go,+ "http.csharp": csharp,+ "http.java": java,+ "http.php": php,+ "http.ruby": ruby,+ mcp,+ };+}++/** PHP has no JSON literal, so the body is rendered as an associative array. */+function phpArray(value: unknown, spaces: number): string {+ const json = JSON.stringify(value, null, 2)+ .replace(/^\{/, "[")+ .replace(/\}$/, "]")+ .replace(/"([^"]+)":/g, "'$1' =>")+ .replace(/"/g, "'");+ return indent(json, spaces);+}++/** Ruby renders the body as a hash literal with symbol-ish string keys. */+function rubyHash(value: unknown, spaces: number): string {+ const json = JSON.stringify(value, null, 2).replace(/"([^"]+)":/g, '"$1" =>');+ return indent(json, spaces);+}diff --git a/docs/lib/search-index.ts b/docs/lib/search-index.tsindex d237daaad1..17878d4c9f 100644--- a/docs/lib/search-index.ts+++ b/docs/lib/search-index.ts@@ -8,13 +8,14 @@ import {termSlug,} from "@carbon/glossary";import { guideSource, source } from "@/lib/source";-import { toolModules } from "@/lib/tools-data";+import { operationLabel, toolModules } from "@/lib/tools-data";const GLOSSARY_URL = "/docs/glossary";/* One Orama index over all four doc surfaces. Each entry is `tag`ged so the single* /api/search endpoint can be filtered per surface (the header's All/Guide/Reference/- * API/MCP pills map to these tags). MDX pages reuse the `structuredData` the+ * API/Data API pills map to these tags — `tools` is the Carbon API operation catalog,+ * `resources` is the PostgREST Data API). MDX pages reuse the `structuredData` the* fumadocs-mdx pipeline already produces (the same field createFromSource read); the* generated API/MCP data is shaped into structuredData by hand so column- and* parameter-level matches still land the right page. */@@ -47,32 +48,59 @@ function toolParamNames(schema: unknown): string[] {return [];}+/**+ * Most operation descriptions are generated by de-camelCasing the function name+ * (`getActiveEmployeeAbilities` -> "get active employee abilities"), so they restate+ * the title and are worth neither the index space nor the result row. Only the+ * handful of hand-written ones say something new.+ */+function isGeneratedDescription(toolName: string, description: string): boolean {+ const fn = toolName.slice(toolName.indexOf("_") + 1);+ const decamelized = fn+ .replace(/([A-Z])/g, " $1")+ .trim()+ .toLowerCase();+ return description.trim().toLowerCase() === decamelized;+}+function toolIndexes(): AdvancedIndex[] {return toolModules.flatMap((mod) =>mod.tools.map((tool) => {const params = toolParamNames(tool.schema);- const contents: StructuredData["contents"] = [- {- heading: undefined,- content: `${tool.description}. ${tool.classification} tool in the ${mod.name} module.`,- },- ];+ const generated = isGeneratedDescription(tool.name, tool.description);+ const contents: StructuredData["contents"] = [];++ // A real description earns a line; a de-camelCased name does not — the title+ // already says it, twice over in the result row.+ if (!generated) {+ contents.push({ heading: undefined, content: tool.description });+ }if (params.length) {- contents.push({ heading: undefined, content: `Parameters: ${params.join(", ")}.` });+ contents.push({+ heading: undefined,+ content: `Parameters: ${params.join(", ")}.`,+ });}+ // The full callable name stays searchable, so "items_getMaterial" still hits+ // even though the title shows the short label.+ contents.push({ heading: undefined, content: tool.name });+return {- id: `/mcp/tools/${tool.slug}`,- url: `/mcp/tools/${tool.slug}`,- title: tool.name,- description: tool.description,+ id: `/api/operations/${tool.slug}`,+ url: `/api/operations/${tool.slug}`,+ title: operationLabel(tool.name, mod.slug),+ // Classification is the one fact the title does not carry; the module is+ // already in the breadcrumbs.+ description: generated ? tool.classification : tool.description,tag: "tools",- breadcrumbs: ["MCP", mod.name],+ breadcrumbs: ["API", mod.name],structuredData: { headings: [], contents },};}),);}+function resourceIndexes(): AdvancedIndex[] {return apiModules.flatMap((mod) =>mod.resources.map((r) => {@@ -100,12 +128,12 @@ function resourceIndexes(): AdvancedIndex[] {contents.push({ heading: undefined, content: `Fields: ${fields.join(", ")}.` });}return {- id: `/api-reference/${mod.slug}/${r.slug}`,- url: `/api-reference/${mod.slug}/${r.slug}`,+ id: `/api/data/${mod.slug}/${r.slug}`,+ url: `/api/data/${mod.slug}/${r.slug}`,title: r.name,description: r.description,tag: "resources",- breadcrumbs: ["API", mod.name],+ breadcrumbs: ["Data API", mod.name],structuredData: { headings, contents },};}),diff --git a/docs/lib/seo.ts b/docs/lib/seo.tsindex 62b1e080d7..cd0cc301fa 100644--- a/docs/lib/seo.ts+++ b/docs/lib/seo.ts@@ -26,26 +26,33 @@ export const SEO = {},api: {intro: {- title: "API reference",- description: "Carbon's REST API — every table and view is an endpoint.",+ title: "Data API",+ description:+ "Direct REST access to Carbon's tables and views — the escape hatch under the Carbon API.",},auth: {- title: "API authentication",+ title: "Data API authentication",description: "Create a scoped API key, send it as a bearer token.",},},- mcp: {+ carbonApi: {intro: {- title: "MCP server",+ title: "The Carbon API",+ description:+ "Carbon's service layer — the safe way to read and write, with validation and permissions built in.",+ },+ mcp: {+ title: "Connect over MCP",description: "Connect Carbon to Claude, Cursor, and other AI clients over MCP.",},auth: {- title: "MCP authentication",- description: "Authenticate MCP clients with OAuth or a scoped API key.",+ title: "Carbon API authentication",+ description: "Authenticate with OAuth or a scoped API key.",},- tools: {- title: "MCP tools",- description: "1,200+ tools, reached through one lean discovery pattern.",+ sdks: {+ title: "Client SDKs",+ description:+ "Generate a typed client in any language from the Carbon API's OpenAPI spec.",},},// Per-guide blurb, keyed by flow slug — shared by every chapter of that guide.diff --git a/docs/lib/tools-data.ts b/docs/lib/tools-data.tsindex 7cacedbca5..9e82b9df2e 100644--- a/docs/lib/tools-data.ts+++ b/docs/lib/tools-data.ts@@ -8,6 +8,9 @@ export interface ToolItem {classification: ToolClass;description: string;schema: unknown;+ /** Response `data` shape, reflected from the service's return type. Absent when+ * the return type yielded nothing usable (an `any`, a void, an opaque shape). */+ responseSchema?: unknown;}export interface ToolModule {name: string;@@ -21,6 +24,19 @@ interface ToolData {export const toolModules: ToolModule[] = (raw as ToolData).modules;+/**+ * Display name for an operation: the callable name minus its `{module}_` prefix.+ * Every surface that shows an operation already states its module — the sidebar+ * groups by it, the detail page breadcrumbs it — so the prefix is redundant noise on+ * an already-long identifier. The FULL name stays wherever it is callable (the+ * `call_tool` snippet, the page title) since that is the string you actually send.+ */+export function operationLabel(name: string, moduleSlug: string): string {+ return name.startsWith(`${moduleSlug}_`)+ ? name.slice(moduleSlug.length + 1)+ : name;+}+export function getTool(slug: string): { module: ToolModule; tool: ToolItem } | null {for (const m of toolModules) {const tool = m.tools.find((t) => t.slug === slug);@@ -33,6 +49,31 @@ export function allToolParams(): { tool: string }[] {return toolModules.flatMap((m) => m.tools.map((t) => ({ tool: t.slug })));}+export interface ToolCounts {+ /** Total number of operations across every module. */+ total: number;+ /** Number of modules. */+ modules: number;+ /** Operation count per classification. */+ byClass: Record<ToolClass, number>;+ /** `[module name, operation count]`, sorted by count descending. */+ perModule: [string, number][];+}++/** Counts derived from the generated catalog, so the docs copy can never go stale. */+export function toolCounts(): ToolCounts {+ const byClass: Record<ToolClass, number> = { READ: 0, WRITE: 0, DESTRUCTIVE: 0 };+ let total = 0;+ const perModule: [string, number][] = [];+ for (const m of toolModules) {+ total += m.tools.length;+ perModule.push([m.name, m.tools.length]);+ for (const t of m.tools) byClass[t.classification] += 1;+ }+ perModule.sort((a, b) => b[1] - a[1]);+ return { total, modules: toolModules.length, byClass, perModule };+}+// Slim nav tree (no schemas) for the sidebar.export interface ToolNavItem {name: string;diff --git a/docs/next.config.mjs b/docs/next.config.mjsindex bab57312cd..7cedf9b6b0 100644--- a/docs/next.config.mjs+++ b/docs/next.config.mjs@@ -48,6 +48,37 @@ const config = {destination: "/docs/platform/self-hosting",permanent: true,},+ // The Data API moved from its own root to a section inside /api, so the whole+ // surface lives under one header entry, one sidebar and one host/API-key+ // configurator. Paths below the root are unchanged, so :path* maps 1:1 —+ // /api-reference/sales/customer -> /api/data/sales/customer.+ {+ source: "/api-reference/:path*",+ destination: "/api/data/:path*",+ permanent: true,+ },+ { source: "/api-reference", destination: "/api/data", permanent: true },+ // MCP folded into the Carbon API surface: MCP is a transport, not a top-level+ // surface. The old /mcp URLs redirect into /api. Operation slugs are unchanged+ // (they are the oRPC operation ids), so /mcp/tools/:tool maps 1:1.+ {+ source: "/mcp/tools/:tool",+ destination: "/api/operations/:tool",+ permanent: true,+ },+ { source: "/mcp/tools", destination: "/api", permanent: true },+ {+ source: "/mcp/authentication",+ destination: "/api/authentication",+ permanent: true,+ },+ { source: "/mcp", destination: "/api/mcp", permanent: true },+ // API keys moved from Reference into the Building section.+ {+ source: "/docs/reference/api-keys",+ destination: "/docs/building/api-keys",+ permanent: true,+ },];},};diff --git a/docs/scripts/generate-api-docs.mjs b/docs/scripts/generate-api-docs.mjsindex e5e3ecb50e..cc0587a390 100644--- a/docs/scripts/generate-api-docs.mjs+++ b/docs/scripts/generate-api-docs.mjs@@ -383,6 +383,7 @@ for (const t of allTools) {classification: t.classification,description: t.description || "",schema: t.schema || {},+ responseSchema: t.responseSchema,});}const toolModules = [...toolsByModule.entries()]diff --git a/mise.toml b/mise.tomlnew file mode 100644index 0000000000..6a0493c69b--- /dev/null+++ b/mise.toml@@ -0,0 +1,2 @@+[tools]+node = "22"diff --git a/package.json b/package.jsonindex 2415edd808..256423efdc 100755--- a/package.json+++ b/package.json@@ -20,7 +20,9 @@"tsx": "catalog:","turbo": "2.9.6","typescript": "catalog:",- "vite-plugin-babel-macros": "catalog:"+ "vite": "catalog:",+ "vite-plugin-babel-macros": "catalog:",+ "zod": "catalog:"},"lint-staged": {"(apps|packages|docs)/**/*.{js,ts,jsx,tsx}": [@@ -33,12 +35,13 @@"private": true,"scripts": {"build": "turbo run build",+ "build:docs": "turbo run build --filter=docs","build:erp": "turbo run build --filter=erp","build:mes": "turbo run build --filter=mes",- "build:docs": "turbo run build --filter=docs",+ "check:manifest": "tsx scripts/check-manifest.ts","check:workflow-catalog": "tsx scripts/check-workflow-catalog.ts",- "ci:migrations": "pnpm --filter ci ci:migrations","ci:deploy": "pnpm --filter ci ci:deploy",+ "ci:migrations": "pnpm --filter ci ci:migrations","clean": "turbo run clean && rimraf ./node_modules && rimraf ./pnpm-lock.yaml","db:check:backups": "pnpm --filter @carbon/jobs db:check:backups --","db:check:datasets": "pnpm --filter @carbon/database db:check:datasets --",@@ -59,13 +62,13 @@"generate:swagger": "tsx scripts/generate-swagger-docs.ts && pnpm exec biome format ./packages/database/src/swagger-docs-schema.ts --write --files-max-size=20000000","generate:types": "tsx scripts/generate-db-types.ts","generate:workflow-catalog": "tsx scripts/generate-workflow-catalog.ts && pnpm exec biome check --write packages/workflows/src/catalog/",- "lint": "turbo run lint",+ "install-skills": "bash .ai/scripts/install-skills.sh","lingui:check": "pnpm run lingui:extract && pnpm run lingui:compile",+ "lingui:clean": "node ./scripts/strip-po-headers.mjs","lingui:compile": "lingui compile --namespace es","lingui:extract": "lingui extract --clean",- "lingui:clean": "node ./scripts/strip-po-headers.mjs",- "postinstall": "pnpm --filter @carbon/documents build",- "install-skills": "bash .ai/scripts/install-skills.sh",+ "lint": "turbo run lint",+ "postinstall": "pnpm --filter @carbon/documents build && pnpm run generate:mcp","prepare": "pnpm exec husky install; if [ -f .ai/scripts/install-skills.sh ]; then bash .ai/scripts/install-skills.sh; fi","test": "turbo run test","translate": "pnpm run lingui:extract && pnpm exec linguito translate --llm && pnpm lingui:clean",diff --git a/packages/api/AGENTS.md b/packages/api/AGENTS.mdnew file mode 100644index 0000000000..11e1a886c5--- /dev/null+++ b/packages/api/AGENTS.md@@ -0,0 +1,60 @@+# @carbon/api++The Carbon API contract layer: the types for the generated operation manifest, and+the Standard-Schema wrapper that lets oRPC carry precomputed JSON Schemas without a+zod round-trip. Internal workspace package — never published to npm.++## Always++- Treat `ManifestEntry` as the shape of the GENERATED manifest — the data itself is+ the erp app's gitignored `routes/api+/mcp+/lib/tool-metadata.json`, produced by+ `pnpm generate:mcp` (turbo root task `//#generate:mcp`; `typecheck`/`build`/`test`+ depend on it). Change the generator (`scripts/lib/service-metadata.ts`) and these+ types together.+- Keep `jsonSchema()` a pass-through validator (never rejects). It is the **output**+ wrapper: `shapeHttpBody` rewrites the HTTP body, so a correct response does not+ match the operation's declared response schema and validating it would reject+ real responses.+- `jsonSchemaInput()` is the **input** wrapper and DOES validate, via+ `z.fromJSONSchema` (zod is already a workspace dependency — no Ajv, no+ JSON-Schema validator library). Keep it permissive in the two ways the+ dispatcher depends on: unknown keys are preserved, not stripped, and a lone+ required wrapper's contents may be sent flat (the workflow engine's+ `job.create` sends `insertJob`'s inner fields at the top level). An+ unconvertible schema falls back to pass-through rather than failing every+ request to that operation.+- Keep `@orpc/openapi` imports in `schema.ts` type-only — it is a devDependency, and+ the runtime module must not pull it in.++## Never++- Hand-edit `tool-metadata.json` or `tool-manifest.digest.json` — both are generated;+ `pnpm check:manifest` (pre-commit gated) fails on a stale digest.+- Add runtime dependencies beyond the `@orpc/*` client-side packages without asking.++## Validation Commands++```bash+pnpm exec turbo run typecheck --filter=@carbon/api+pnpm run check:manifest # digest current?+```++## Key Exports++| Subpath | Provides |+|---------|----------|+| `.` (index) | Manifest types: `ManifestEntry`, `ToolPermission`, `Classification`, `AuthField`, `PermissionAction` (re-exports `./schema` too) |+| `./schema` | `jsonSchema()` pass-through Standard Schema wrapper, `CarbonJsonSchemaConverter` (OpenAPI generator plugin), `CARBON_VENDOR` |++## Consumers++- `apps/erp/app/routes/api+/v1+/lib/` — the oRPC router/dispatch/gate read+ `ManifestEntry` and build procedures with `jsonSchema()`.+- `scripts/lib/service-metadata.ts` + `scripts/lib/manifest-digest.ts` — the+ generator emits entries in this shape and hashes them for the digest.++## Cross-References++- `.claude/rules/mcp-tools-reference.md` — the manifest/generator/dispatch pipeline+- `.ai/plans/2026-09-07-orpc-completion.md` — D1 records why the manifest is one+ file here rather than per-module shards (deferred, with revisit triggers)diff --git a/packages/api/CLAUDE.md b/packages/api/CLAUDE.mdnew file mode 100644index 0000000000..43c994c2d3--- /dev/null+++ b/packages/api/CLAUDE.md@@ -0,0 +1 @@diff --git a/packages/api/package.json b/packages/api/package.jsonnew file mode 100644index 0000000000..5892363c7f--- /dev/null+++ b/packages/api/package.json@@ -0,0 +1,29 @@+{+ "name": "@carbon/api",+ "private": true,+ "version": "0.0.0",+ "sideEffects": false,+ "exports": {+ ".": "./src/index.ts",+ "./schema": "./src/schema.ts"+ },+ "scripts": {+ "clean": "rimraf .turbo node_modules dist",+ "lint": "biome lint --write ",+ "test": "vitest run --passWithNoTests",+ "typecheck": "tsgo --noEmit"+ },+ "dependencies": {+ "@orpc/client": "catalog:",+ "@orpc/contract": "catalog:",+ "@orpc/openapi-client": "catalog:",+ "zod": "catalog:"+ },+ "devDependencies": {+ "@carbon/config": "workspace:*",+ "@orpc/openapi": "catalog:",+ "tsx": "catalog:",+ "typescript": "catalog:",+ "vitest": "catalog:"+ }+}diff --git a/packages/api/src/index.ts b/packages/api/src/index.tsnew file mode 100644index 0000000000..24eaf3052a--- /dev/null+++ b/packages/api/src/index.ts@@ -0,0 +1,8 @@+// @carbon/api — the Carbon API contract layer.+//+// The operation manifest's types live in `./manifest-types` (the generated data+// itself lives in the erp app — see that file's header); the Standard-Schema+// wrapper and OpenAPI converter live in `./schema`.++export * from "./manifest-types";+export * from "./schema";diff --git a/packages/api/src/manifest-types.ts b/packages/api/src/manifest-types.tsnew file mode 100644index 0000000000..919fcf311b--- /dev/null+++ b/packages/api/src/manifest-types.ts@@ -0,0 +1,48 @@+// Types for the generated Carbon API operation manifest. The DATA is generated by+// `scripts/generate-mcp.ts` into the erp app's gitignored+// `routes/api+/mcp+/lib/tool-metadata.json` (its committed record is the sibling+// `tool-manifest.digest.json`); these types are the contract consumers read against.+// Keep them in sync with the generator's output shape.++export type Classification = "READ" | "WRITE" | "DESTRUCTIVE";++/** Audit/identity fields the dispatcher stamps into a service payload. */+export type AuthField =+ | "companyId"+ | "companyGroupId"+ | "createdBy"+ | "updatedBy";++export type PermissionAction = "view" | "create" | "update" | "delete";++/**+ * The permission an API-key caller must hold to invoke the operation.+ * `module` is `null` for operations that gate only on a valid key of the company+ * (e.g. `account`, `shared`) rather than a specific permission module.+ */+export interface ToolPermission {+ module: string | null;+ actions: PermissionAction[];+}++/** One operation in the manifest — the successor of a `tool-metadata.json` entry. */+export interface ManifestEntry {+ name: string;+ module: string;+ classification: Classification;+ description: string;+ paramCount: number;+ serviceParams: string[];+ injectAuth: AuthField[];+ permission: ToolPermission;+ /** The JSON Schema for the operation's input. When the service branches on+ * `"createdBy" in payload`, a required `_operation: "create" | "update"`+ * property is present here — that property IS the marker (there is no parallel+ * flag), matching how the dispatcher decides today. */+ schema: Record<string, unknown>;+ /** The JSON Schema for the operation's RESPONSE `data`, reflected from the+ * service function's TypeScript return type — absent when nothing useful could+ * be derived (an `any`, a void, or an opaque shape). Describes the payload the+ * dispatcher puts in `data`, not the `{ data, count }` envelope around it. */+ responseSchema?: Record<string, unknown>;+}diff --git a/packages/api/src/schema.ts b/packages/api/src/schema.tsnew file mode 100644index 0000000000..f2267c799a--- /dev/null+++ b/packages/api/src/schema.ts@@ -0,0 +1,152 @@+// Standard-Schema wrapper for the Carbon API.+//+// Every operation's input is a precomputed JSON Schema (built by the service parser),+// NOT a zod schema. oRPC's `.input()` accepts any Standard Schema v1 object, so we wrap+// the JSON Schema in a Standard Schema object that carries the raw JSON Schema, so the+// OpenAPI generator can emit it verbatim.+//+// Two wrappers, and the difference is load-bearing:+// - `jsonSchemaInput()` VALIDATES. Used for `.input()`.+// - `jsonSchema()` is a pass-through. Used for `.output()`, where the handler's own+// body shaping is not described by the operation's response schema, so validating+// would reject correct responses.+//+// Type-only imports from `@orpc/openapi` (a devDependency) are erased at build, so this+// runtime module never pulls the openapi package in — the converter class only needs to+// match the interface shape.++import type { AnySchema } from "@orpc/contract";+import type {+ ConditionalSchemaConverter,+ JSONSchema,+ SchemaConvertOptions+} from "@orpc/openapi";+import { z } from "zod";++/** Standard Schema vendor tag identifying a Carbon precomputed-JSON-Schema input. */+export const CARBON_VENDOR = "carbon-json-schema";++/** Standard Schema v1 issue shape (structurally what zod's `error.issues` provide). */+export interface CarbonSchemaIssue {+ readonly message: string;+ readonly path?: ReadonlyArray<PropertyKey | { readonly key: PropertyKey }>;+}++/** A Standard Schema v1 object carrying a precomputed JSON Schema. */+export interface CarbonJsonSchema {+ "~standard": {+ version: 1;+ vendor: typeof CARBON_VENDOR;+ validate: (+ value: unknown+ ) => { value: unknown } | { issues: readonly CarbonSchemaIssue[] };+ };+ /** The precomputed JSON Schema, read by `CarbonJsonSchemaConverter`. */+ jsonSchema: Record<string, unknown>;+}++/**+ * Wrap a precomputed JSON Schema as a pass-through Standard Schema. The validator+ * never rejects — it returns `{ value }` unchanged.+ *+ * This is the OUTPUT wrapper. `shapeHttpBody` rewrites a DispatchResult into the+ * HTTP body, so a response legitimately does not match the operation's declared+ * response schema. For request input use `jsonSchemaInput`.+ */+export function jsonSchema(schema: Record<string, unknown>): CarbonJsonSchema {+ return {+ "~standard": {+ version: 1,+ vendor: CARBON_VENDOR,+ validate: (value: unknown) => ({ value })+ },+ jsonSchema: schema+ };+}++/**+ * Wrap a precomputed JSON Schema as a VALIDATING Standard Schema, for `.input()`.+ *+ * Conversion is lazy and memoized — the router builds ~1500 procedures at module+ * load, and only the ones actually called pay for it.+ *+ * Deliberately permissive in two ways the dispatcher relies on: unknown keys are+ * preserved rather than stripped, so its positional fallbacks still see the whole+ * payload; and a schema zod cannot represent falls back to pass-through rather+ * than failing every request to that operation.+ */+export function jsonSchemaInput(+ schema: Record<string, unknown>+): CarbonJsonSchema {+ let compiled: z.ZodType | null | undefined;+ let unwrapped: z.ZodType | null | undefined;++ return {+ "~standard": {+ version: 1,+ vendor: CARBON_VENDOR,+ validate: (value: unknown) => {+ if (compiled === undefined) compiled = compileJsonSchema(schema);+ if (compiled === null) return { value };++ const result = compiled.safeParse(value);+ if (result.success) return { value: result.data };++ // The dispatcher accepts a lone wrapper's contents sent flat — the+ // workflow engine's create actions send `{ itemId, quantity }` to an+ // operation declaring `{ input: {...} }` — so validation must accept+ // every shape dispatch does. Narrow on purpose: only when the wrapper is+ // the schema's ONLY required property.+ if (unwrapped === undefined) unwrapped = compileSoleWrapper(schema);+ if (unwrapped && unwrapped.safeParse(value).success) return { value };++ return { issues: result.error.issues };+ }+ },+ jsonSchema: schema+ };+}++function compileJsonSchema(schema: unknown): z.ZodType | null {+ try {+ return z.fromJSONSchema(schema as Parameters<typeof z.fromJSONSchema>[0]);+ } catch {+ return null; // unconvertible — do not reject every request to it+ }+}++/** The schema of the single required object property, when it is the only one required. */+function compileSoleWrapper(schema: Record<string, unknown>): z.ZodType | null {+ const required = schema.required;+ if (!Array.isArray(required) || required.length !== 1) return null;+ const properties = schema.properties as+ | Record<string, { type?: unknown }>+ | undefined;+ const wrapper = properties?.[required[0] as string];+ if (!wrapper || wrapper.type !== "object") return null;+ return compileJsonSchema(wrapper);+}++/**+ * Teaches oRPC's `OpenAPIGenerator` how to turn a `CarbonJsonSchema` into OpenAPI:+ * it returns the carried JSON Schema verbatim. Registered via+ * `new OpenAPIGenerator({ schemaConverters: [new CarbonJsonSchemaConverter()] })`.+ * Without it, the generator cannot render our custom-vendor inputs.+ */+export class CarbonJsonSchemaConverter implements ConditionalSchemaConverter {+ condition(schema: AnySchema | undefined): boolean {+ return (+ schema !== undefined &&+ (schema as { "~standard"?: { vendor?: string } })["~standard"]?.vendor ===+ CARBON_VENDOR+ );+ }++ convert(+ schema: AnySchema | undefined,+ _options: SchemaConvertOptions+ ): [required: boolean, jsonSchema: Exclude<JSONSchema, boolean>] {+ const carried = (schema as unknown as CarbonJsonSchema).jsonSchema;+ return [true, carried as Exclude<JSONSchema, boolean>];+ }+}diff --git a/packages/api/tsconfig.json b/packages/api/tsconfig.jsonnew file mode 100644index 0000000000..0db46e7e9e--- /dev/null+++ b/packages/api/tsconfig.json@@ -0,0 +1,9 @@+{+ "extends": "@carbon/config/tsconfig/base.json",+ "compilerOptions": {+ "outDir": "./dist",+ "rootDir": "./src"+ },+ "include": ["src"],+ "exclude": ["node_modules", "dist"]+}diff --git a/packages/auth/AGENTS.md b/packages/auth/AGENTS.mdindex c5934b052f..26e7e193d1 100644--- a/packages/auth/AGENTS.md+++ b/packages/auth/AGENTS.md@@ -35,7 +35,7 @@ pnpm --filter @carbon/auth test| Subpath | Provides ||---------|----------|| `.` (index) | Env re-exports, Supabase client factories, `getClaims`, cookie/http/result utils, validators |-| `./auth.server` | `requirePermissions`, API key auth, `hashApiKey`, `hashOAuthSecret` |+| `./auth.server` | `requirePermissions`, API key auth (30s Redis-cached `getApiKeyRecord` + `bustApiKeyCache`, from `services/api-key.server.ts`), `hashApiKey`, `hashOAuthSecret` || `./mfa.server` | TOTP MFA: `enrollTotpFactor`, `verifyTotpChallenge`, `unenrollTotpFactor`, `userHasVerifiedTotpFactor` (Redis-cached), `adminDeleteTotpFactors` || `./session.server` | `createCookieSessionStorage`, `requireAuthSession` (incl. MFA re-check), `destroyAuthSession`, session refresh, pending-MFA session + `completeMfaChallenge` || `./company.server` | Company switching, `updateCompanySession` |diff --git a/packages/auth/src/services/api-key-cache.test.ts b/packages/auth/src/services/api-key-cache.test.tsnew file mode 100644index 0000000000..3adcaefc7b--- /dev/null+++ b/packages/auth/src/services/api-key-cache.test.ts@@ -0,0 +1,134 @@+import { beforeEach, describe, expect, it, vi } from "vitest";++// Same simulation preamble as auth-redis-resilience.test.ts: @carbon/kv is wrapped+// in withResilience(), so reads/writes resolve `null` instead of throwing when+// Redis is unreachable.+vi.mock("@carbon/kv", () => ({+ redis: {+ get: vi.fn().mockResolvedValue(null),+ set: vi.fn().mockResolvedValue(null),+ del: vi.fn().mockResolvedValue(null),+ getdel: vi.fn().mockResolvedValue(null)+ }+}));++// Env is validated at import time (getEnv throws on missing required vars), so we+// stub the config module rather than requiring a full environment in the test run.+vi.mock("../config/env", () => ({+ RESEND_DOMAIN: "test.dev",+ DOMAIN: "localhost",+ ERP_URL: "http://localhost:3000",+ MES_URL: "http://localhost:3001",+ VERCEL_URL: "",+ CarbonEdition: "Community",+ REFRESH_ACCESS_TOKEN_THRESHOLD: 60,+ SESSION_KEY: "auth",+ SESSION_MAX_AGE: 60 * 60 * 24 * 7,+ SESSION_SECRET: "test-session-secret"+}));++const db = vi.hoisted(() => ({ single: vi.fn() }));++vi.mock("../lib/supabase/client.server", () => {+ const chain: Record<string, unknown> = {};+ chain.from = vi.fn(() => chain);+ chain.select = vi.fn(() => chain);+ chain.eq = vi.fn(() => chain);+ chain.single = db.single;+ return { getCarbonServiceRole: vi.fn(() => chain) };+});++import { redis } from "@carbon/kv";+import {+ type ApiKeyRecord,+ apiKeyCacheKey,+ bustApiKeyCache,+ getApiKeyRecord,+ hashApiKey+} from "./api-key.server";++const mockRedis = redis as unknown as {+ get: ReturnType<typeof vi.fn>;+ set: ReturnType<typeof vi.fn>;+ del: ReturnType<typeof vi.fn>;+};++const ROW: ApiKeyRecord = {+ id: "key1",+ companyId: "c1",+ companyGroupId: "g1",+ createdBy: "u1",+ scopes: { sales_view: ["c1"] },+ rateLimit: 60,+ rateLimitWindow: "1m",+ expiresAt: null+};++const KEY = "crbn_test_key";+const CACHE_KEY = apiKeyCacheKey(hashApiKey(KEY));++beforeEach(() => {+ vi.clearAllMocks();+ mockRedis.get.mockResolvedValue(null);+ mockRedis.set.mockResolvedValue("OK");+ mockRedis.del.mockResolvedValue(1);+ db.single.mockResolvedValue({ data: ROW, error: null });+});++describe("getApiKeyRecord", () => {+ it("cache miss: one DB read, then writes the record with a 30s TTL", async () => {+ const record = await getApiKeyRecord(KEY);+ expect(record).toEqual(ROW);+ expect(db.single).toHaveBeenCalledTimes(1);+ expect(mockRedis.set).toHaveBeenCalledWith(+ CACHE_KEY,+ JSON.stringify(ROW),+ "EX",+ 30+ );+ });++ it("cache hit: returns the cached record with zero DB reads", async () => {+ mockRedis.get.mockResolvedValue(JSON.stringify(ROW));+ const record = await getApiKeyRecord(KEY);+ expect(record).toEqual(ROW);+ expect(db.single).not.toHaveBeenCalled();+ });++ it("unknown key: returns null, caches the negative, and serves it without the DB", async () => {+ db.single.mockResolvedValue({+ data: null,+ error: { code: "PGRST116", message: "no rows" }+ });+ expect(await getApiKeyRecord(KEY)).toBeNull();+ expect(db.single).toHaveBeenCalledTimes(1);+ expect(mockRedis.set).toHaveBeenCalledWith(CACHE_KEY, "null", "EX", 30);++ mockRedis.get.mockResolvedValue("null");+ expect(await getApiKeyRecord(KEY)).toBeNull();+ expect(db.single).toHaveBeenCalledTimes(1);+ });++ it("lookup failure: does not cache the null, so a blip cannot 401 a valid key", async () => {+ db.single.mockResolvedValue({+ data: null,+ error: { code: "57P01", message: "terminating connection" }+ });+ expect(await getApiKeyRecord(KEY)).toBeNull();+ expect(mockRedis.set).not.toHaveBeenCalled();+ });++ it("Redis down (reads and writes resolve null): falls through to the DB without throwing", async () => {+ mockRedis.get.mockResolvedValue(null);+ mockRedis.set.mockResolvedValue(null);+ await expect(getApiKeyRecord(KEY)).resolves.toEqual(ROW);+ expect(db.single).toHaveBeenCalledTimes(1);+ });+});++describe("bustApiKeyCache", () => {+ it("deletes the cache entry for the key hash", async () => {+ await bustApiKeyCache("abc");+ expect(mockRedis.del).toHaveBeenCalledWith("apikey:auth:abc");+ });+});diff --git a/packages/auth/src/services/api-key.server.ts b/packages/auth/src/services/api-key.server.tsnew file mode 100644index 0000000000..58a8775dad--- /dev/null+++ b/packages/auth/src/services/api-key.server.ts@@ -0,0 +1,101 @@+import { createHash } from "node:crypto";+import { redis } from "@carbon/kv";+import { getLogger } from "@carbon/logger";+import { oncePerRequest } from "@carbon/logger/middleware.server";+import { getCarbonServiceRole } from "../lib/supabase/client.server";++const log = getLogger("auth");++const API_KEY_CACHE_PREFIX = "apikey:auth:";+// Short on purpose: the record carries scopes/expiry/rate-limit config, so a+// revoked or re-scoped key can act for at most this long (the api-keys routes+// additionally bust the entry on edit/revoke). Negative results are cached too —+// a bad key hammering the endpoint must not hammer Postgres.+const API_KEY_CACHE_TTL_SECONDS = 30;+/** PostgREST's code for a `.single()` that matched no rows. */+const NO_ROWS_FOUND = "PGRST116";++/** Hash an API key using SHA-256 for secure storage/lookup */+export function hashApiKey(rawKey: string): string {+ return createHash("sha256").update(rawKey).digest("hex");+}++export type ApiKeyRecord = {+ id: string;+ companyId: string;+ companyGroupId: string;+ createdBy: string;+ scopes: Record<string, string[]>;+ rateLimit: number;+ rateLimitWindow: "1m" | "1h" | "1d";+ expiresAt: string | null;+};++export function apiKeyCacheKey(keyHash: string): string {+ return `${API_KEY_CACHE_PREFIX}${keyHash}`;+}++/**+ * The apiKey row for a raw key, through a ~30s Redis cache. One HTTP API call+ * resolves the key twice (requirePermissions and the v1 scope read), so the+ * lookup is also memoized per request — safe for a credential row because the+ * request is authenticated BY that credential; nothing inside the request can+ * revoke it and then expect the same request to see the revocation.+ */+export function getApiKeyRecord(rawKey: string): Promise<ApiKeyRecord | null> {+ const keyHash = hashApiKey(rawKey);+ return oncePerRequest(`apikey:${keyHash}`, () => loadApiKeyRecord(keyHash));+}++async function loadApiKeyRecord(keyHash: string): Promise<ApiKeyRecord | null> {+ try {+ const cached = await redis.get(apiKeyCacheKey(keyHash));+ // The literal string "null" is a cached negative — an unknown key we already+ // looked up. A Redis miss (null) falls through to the database.+ if (cached) return JSON.parse(cached) as ApiKeyRecord | null;+ } catch (e) {+ log.error("Failed to read api key cache", { error: e });+ }++ const { data, error } = await getCarbonServiceRole()+ .from("apiKey")+ .select(+ "id, companyId, ...company(companyGroupId), createdBy, scopes, rateLimit, rateLimitWindow, expiresAt"+ )+ .eq("keyHash", keyHash)+ .single();++ const record = (data as unknown as ApiKeyRecord | null) ?? null;++ // Only cache a verdict the database actually gave. `.single()` reports "no rows"+ // as PGRST116; any other error also yields a null row, and caching THAT would+ // reject a valid key for the full TTL over a momentary outage.+ if (error && error.code !== NO_ROWS_FOUND) {+ log.error("Failed to read api key record", { error });+ return null;+ }++ // Best-effort: a failed write (Redis down, fail-soft via @carbon/kv+ // withResilience) must never abort the request — we have the row from the DB.+ try {+ await redis.set(+ apiKeyCacheKey(keyHash),+ JSON.stringify(record),+ "EX",+ API_KEY_CACHE_TTL_SECONDS+ );+ } catch (e) {+ log.error("Failed to cache api key record", { error: e });+ }++ return record;+}++/** Drop the cached record for a key hash — call when the key is edited or revoked. */+export async function bustApiKeyCache(keyHash: string): Promise<void> {+ try {+ await redis.del(apiKeyCacheKey(keyHash));+ } catch (e) {+ log.error("Failed to bust api key cache", { error: e });+ }+}diff --git a/packages/auth/src/services/auth.server.ts b/packages/auth/src/services/auth.server.tsindex 93c22b32a7..c51b750a45 100644--- a/packages/auth/src/services/auth.server.ts+++ b/packages/auth/src/services/auth.server.ts@@ -1,5 +1,8 @@import type { Database } from "@carbon/database";-import { checkApiKeyRateLimit } from "@carbon/database/ratelimit";+import {+ ApiKeyNotFoundError,+ checkApiKeyRateLimit+} from "@carbon/database/ratelimit";import { redis } from "@carbon/kv";import { getLogger } from "@carbon/logger";import { oncePerRequest } from "@carbon/logger/middleware.server";@@ -24,6 +27,7 @@ import { getCarbonServiceRole } from "../lib/supabase/client.server";import type { AuthSession } from "../types";import { path } from "../utils/path";import { error } from "../utils/result";+import { type ApiKeyRecord, getApiKeyRecord } from "./api-key.server";import { logAuthEvent } from "./auth-events.server";import { isCarbonOwnedCompany } from "./company.server";import {@@ -98,37 +102,29 @@ export async function getAuthAccountByAccessToken(accessToken: string) {return data.user;}-/** Hash an API key using SHA-256 for secure storage/lookup */-export function hashApiKey(rawKey: string): string {- return createHash("sha256").update(rawKey).digest("hex");-}-/** Hash an OAuth token or secret using SHA-256 for secure storage/lookup */export function hashOAuthSecret(raw: string): string {return createHash("sha256").update(raw).digest("hex");}-type ApiKeyRecord = {- id: string;- companyId: string;- companyGroupId: string;- createdBy: string;- scopes: Record<string, string[]>;- rateLimit: number;- rateLimitWindow: "1m" | "1h" | "1d";- expiresAt: string | null;-};--function getCompanyIdFromAPIKey(apiKey: string) {- const serviceRole = getCarbonServiceRole();- const keyHash = hashApiKey(apiKey);- return serviceRole- .from("apiKey")- .select(- "id, companyId, ...company(companyGroupId), createdBy, scopes, rateLimit, rateLimitWindow, expiresAt"- )- .eq("keyHash", keyHash)- .single();+// The API-key record cache lives in its own module; re-exported here so+// `@carbon/auth/auth.server` stays the only subpath consumers import.+export {+ type ApiKeyRecord,+ apiKeyCacheKey,+ bustApiKeyCache,+ getApiKeyRecord,+ hashApiKey+} from "./api-key.server";++// Exported so the Carbon API v1 surface can read a key's scopes for its per-operation+// scope gate (the gate lives in oRPC middleware, not in requirePermissions). The+// carbon-key branch of requirePermissions already covers client/rate-limit/plan/expiry.+// Kept as `{ data, error }` for its existing callers; the row now comes through the+// ~30s Redis cache (with per-request memoization) in api-key.server.ts.+export async function getCompanyIdFromAPIKey(apiKey: string) {+ const data = await getApiKeyRecord(apiKey);+ return { data, error: data ? null : new Error("API key not found") };}export function makeAuthSession(@@ -232,6 +228,11 @@ export async function requirePermissions(if (apiKey) {const company = await getCompanyIdFromAPIKey(apiKey);+ // A caller presenting a key is on the machine path: 401, never the /login+ // redirect requireAuthSession would answer with below.+ if (!company.data) {+ throw new Response("Invalid API key", { status: 401 });+ }if (company.data) {const apiKeyData = company.data as unknown as ApiKeyRecord;const companyId = apiKeyData.companyId;@@ -245,12 +246,22 @@ export async function requirePermissions(// Check rate limit via Postgres functionconst serviceRole = getCarbonServiceRole();- const rl = await checkApiKeyRateLimit(- serviceRole,- apiKeyData.id,- apiKeyData.rateLimit,- apiKeyData.rateLimitWindow- );+ let rl: Awaited<ReturnType<typeof checkApiKeyRateLimit>>;+ try {+ rl = await checkApiKeyRateLimit(+ serviceRole,+ apiKeyData.id,+ apiKeyData.rateLimit,+ apiKeyData.rateLimitWindow+ );+ } catch (err) {+ // The key was deleted while its auth record was still cached — that is a+ // revoked credential, not a server error.+ if (err instanceof ApiKeyNotFoundError) {+ throw new Response("Invalid API key", { status: 401 });+ }+ throw err;+ }if (!rl.success) {throw new Response("Rate limit exceeded", {status: 429,diff --git a/packages/checks/src/conformance/baseline.json b/packages/checks/src/conformance/baseline.jsonindex c75bd58de8..57c38e2a1a 100644--- a/packages/checks/src/conformance/baseline.json+++ b/packages/checks/src/conformance/baseline.json@@ -407,6 +407,7 @@"no-raw-rounding::apps/erp/app/modules/workflows/ui/Runs/WorkflowRunSteps.tsx::return `${(ms / 1000).toFixed(1)}s`;","no-raw-rounding::apps/erp/app/routes/_oauth+/register.ts::client_id_issued_at: Math.floor(Date.now() / 1000),","no-raw-rounding::apps/erp/app/routes/api+/items.$itemId.recalculate-cost.ts::message: `Unit cost updated to ${unitCost.toFixed(2)}`",+ "no-raw-rounding::apps/erp/app/routes/api+/mcp+/_index.ts::const retryAfterSeconds = Math.max(1, Math.ceil((reset - Date.now()) / 1000));","no-raw-rounding::apps/erp/app/routes/api+/quality.kpi.$key.ts::const days = Math.floor(","no-raw-rounding::apps/erp/app/routes/api+/quality.kpi.$key.ts::const week = Math.ceil(","no-raw-rounding::apps/erp/app/routes/api+/quality.kpi.$key.ts::const weeksOpen = Math.floor(",diff --git a/packages/database/src/ratelimit.ts b/packages/database/src/ratelimit.tsindex 9838598228..e4f18102e0 100644--- a/packages/database/src/ratelimit.ts+++ b/packages/database/src/ratelimit.ts@@ -1,5 +1,22 @@import type { SupabaseClient } from "@supabase/supabase-js";+/** Postgres foreign-key violation. */+const FK_VIOLATION = "23503";++/**+ * The API key no longer exists. `apiKeyRateLimit.apiKeyId` is+ * `REFERENCES "apiKey"(id) ON DELETE CASCADE`, so recording a request against a+ * key deleted moments ago (while its auth record is still cached) violates that+ * FK. Callers turn this into a 401 — the key is gone, which is an auth outcome,+ * not a server fault.+ */+export class ApiKeyNotFoundError extends Error {+ constructor() {+ super("API key no longer exists");+ this.name = "ApiKeyNotFoundError";+ }+}+export type RateLimitResult = {success: boolean;count: number;@@ -27,6 +44,15 @@ export async function checkApiKeyRateLimit(p_window: window});- if (error) throw error;+ if (error) {+ if (error.code === FK_VIOLATION) throw new ApiKeyNotFoundError();+ // Supabase hands back a plain object, not an Error. Throwing it raw reached+ // React Router's resource-route fallback, which stringified it to the+ // literal "[object Object]" — wrap it so the failure is legible.+ throw new Error(+ `check_api_key_rate_limit failed: ${error.message ?? JSON.stringify(error)}`,+ { cause: error }+ );+ }return data as RateLimitResult;}diff --git a/packages/database/supabase/functions/lib/response.ts b/packages/database/supabase/functions/lib/response.tsindex 93f7d80440..eb42ad3acb 100644--- a/packages/database/supabase/functions/lib/response.ts+++ b/packages/database/supabase/functions/lib/response.ts@@ -73,6 +73,34 @@ export function isDataLayerError(err: unknown): boolean {return false;}+/**+ * Compact, surfaceable summary of a ZodError's issues (`path: message; …`).+ *+ * A payload-validation failure is the CALLER's input contract, not a data-layer+ * leak — but the raw `.message` is a JSON dump, so `isDataLayerError` rightly+ * blocks it. Suppressing it entirely was worse: an API caller sending an+ * unsupported `adjustmentType` got only the service's generic fallback string,+ * with nothing to converge on. The issue text names payload fields and expected+ * values only — never table or constraint names.+ */+function zodIssueSummary(err: unknown): string | null {+ const e = err as { name?: unknown; issues?: unknown };+ if (e?.name !== "ZodError" || !Array.isArray(e.issues)) return null;+ const parts = (+ e.issues as Array<{ path?: unknown[]; message?: unknown }>+ )+ .slice(0, 5)+ .map((issue) => {+ const path = Array.isArray(issue.path) ? issue.path.join(".") : "";+ const message =+ typeof issue.message === "string" ? issue.message : "invalid";+ return path ? `${path}: ${message}` : message;+ });+ if (parts.length === 0) return null;+ const more = e.issues.length - parts.length;+ return `Invalid payload — ${parts.join("; ")}${more > 0 ? `; +${more} more` : ""}`;+}+/*** JSON error response built from a thrown value.*@@ -104,6 +132,9 @@ export function errorResponse(const body: Record<string, unknown> = {};if (typeof raw === "string" && raw !== "" && !isDataLayerError(err)) {body.message = raw;+ } else {+ const zodSummary = zodIssueSummary(err);+ if (zodSummary) body.message = zodSummary;}if (extra) {diff --git a/packages/database/supabase/functions/post-inventory-adjustment/index.ts b/packages/database/supabase/functions/post-inventory-adjustment/index.tsindex d3dc9670b4..c478b7b9d2 100644--- a/packages/database/supabase/functions/post-inventory-adjustment/index.ts+++ b/packages/database/supabase/functions/post-inventory-adjustment/index.ts@@ -1030,7 +1030,10 @@ serve(async (req: Request) => {logger.error("post-inventory-adjustment failed", {error: String((err as Error).stack ?? err),});- const isValidationError = err instanceof ValidationError;+ // A payload ZodError is the caller's input contract failing, same as our+ // own ValidationError — a 400, not an outage.+ const isValidationError =+ err instanceof ValidationError || err instanceof z.ZodError;return errorResponse(err, isValidationError ? 400 : 500);}});diff --git a/packages/glossary/src/terms.ts b/packages/glossary/src/terms.tsindex 064552db24..08f50dcf48 100644--- a/packages/glossary/src/terms.ts+++ b/packages/glossary/src/terms.ts@@ -1972,7 +1972,7 @@ export const terms = {"api-key": {term: msg`API key`,definition: msg`A scoped secret sent on the carbon-key request header that authenticates programmatic calls to Carbon, carrying its own permissions and rate limit rather than a user session's.`,- href: "/docs/reference/api-keys"+ href: "/docs/building/api-keys"},notification: {term: msg`Notification`,diff --git a/packages/jobs/AGENTS.md b/packages/jobs/AGENTS.mdindex 355bf60a91..59be60f63e 100644--- a/packages/jobs/AGENTS.md+++ b/packages/jobs/AGENTS.md@@ -158,8 +158,9 @@ Routing is off the catalog's `getActionRoute(id)`, never off the shape of an id.`packages/jobs` cannot import `~/modules/*` — the dependency only runs app → package. So`dispatcher.ts` holds a module-level `WorkflowDispatch` slot, and the ERP app fills it at boot:-`apps/erp/app/routes/api+/inngest.ts` calls `setWorkflowDispatch(executeFunction)` with the MCP-direct executor from `./mcp+/lib/direct-executor`. The type is structural, so the app satisfies it+`apps/erp/app/routes/api+/inngest.ts` registers a wrapper over `callOperation` (the Carbon API's+canonical dispatch, `./v1+/lib/call.server`) with `authKind: "session"` — the same entry point MCP+`call_tool` and the in-app agent use. The type is structural, so the app satisfies itwithout importing anything from here beyond the setter (re-exported from `@carbon/jobs/inngest`).With no dispatcher registered, create actions fail cleanly with "This step is not available in thisenvironment" — they do not throw.diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex e6eb3b4c52..b793b501ac 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -54,6 +54,21 @@ catalogs:'@nanostores/react':specifier: 0.7.3version: 0.7.3+ '@orpc/client':+ specifier: 1.15.0+ version: 1.15.0+ '@orpc/contract':+ specifier: 1.15.0+ version: 1.15.0+ '@orpc/openapi':+ specifier: 1.15.0+ version: 1.15.0+ '@orpc/openapi-client':+ specifier: 1.15.0+ version: 1.15.0+ '@orpc/server':+ specifier: 1.15.0+ version: 1.15.0'@paralleldrive/cuid2':specifier: 2.2.2version: 2.2.2@@ -344,7 +359,7 @@ importers:version: 1.40.0'@react-router/remix-routes-option-adapter':specifier: 'catalog:'- version: 7.18.0(@react-router/[email protected](patch_hash=10eab9c1af1b5cc376e67a81f64216bb5d6fcd8a94fc807eb46ecf1982b2cde4)(@react-router/[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected]))([email protected])+ version: 7.18.0(@react-router/[email protected](patch_hash=10eab9c1af1b5cc376e67a81f64216bb5d6fcd8a94fc807eb46ecf1982b2cde4)(@react-router/[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected]))([email protected])cookie:specifier: 'catalog:'version: 1.1.1@@ -381,7 +396,7 @@ importers:version: 5.9.4([email protected])([email protected])'@react-router/dev':specifier: 'catalog:'- version: 7.18.0(patch_hash=10eab9c1af1b5cc376e67a81f64216bb5d6fcd8a94fc807eb46ecf1982b2cde4)(@react-router/[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])+ version: 7.18.0(patch_hash=10eab9c1af1b5cc376e67a81f64216bb5d6fcd8a94fc807eb46ecf1982b2cde4)(@react-router/[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])'@types/aws-lambda':specifier: 8.10.152version: 8.10.152@@ -430,9 +445,15 @@ importers:typescript:specifier: 'catalog:'version: 5.8.3+ vite:+ specifier: 'catalog:'+ version: 8.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])vite-plugin-babel-macros:specifier: 'catalog:'- version: 1.0.6([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))+ version: 1.0.6([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))+ zod:+ specifier: 'catalog:'+ version: 4.5.4optionalDependencies:'@rollup/rollup-linux-x64-gnu':specifier: 4.60.1@@ -621,6 +642,9 @@ importers:'@base-ui-components/react':specifier: 1.0.0-rc.0version: 1.0.0-rc.0(@types/[email protected])([email protected]([email protected]))([email protected])+ '@carbon/api':+ specifier: workspace:*+ version: link:../../packages/api'@carbon/auth':specifier: workspace:*version: link:../../packages/auth@@ -723,6 +747,12 @@ importers:'@nanostores/react':specifier: 'catalog:'version: 0.7.3([email protected])([email protected])+ '@orpc/openapi':+ specifier: 'catalog:'+ version: 1.15.0(@opentelemetry/[email protected])([email protected])+ '@orpc/server':+ specifier: 'catalog:'+ version: 1.15.0(@opentelemetry/[email protected])([email protected])'@paper-design/shaders-react':specifier: ^0.0.57version: 0.0.57(@types/[email protected])([email protected])@@ -1817,6 +1847,37 @@ importers:specifier: 'catalog:'version: 5.8.3+ packages/api:+ dependencies:+ '@orpc/client':+ specifier: 'catalog:'+ version: 1.15.0(@opentelemetry/[email protected])+ '@orpc/contract':+ specifier: 'catalog:'+ version: 1.15.0(@opentelemetry/[email protected])+ '@orpc/openapi-client':+ specifier: 'catalog:'+ version: 1.15.0(@opentelemetry/[email protected])+ zod:+ specifier: 'catalog:'+ version: 4.5.4+ devDependencies:+ '@carbon/config':+ specifier: workspace:*+ version: link:../config+ '@orpc/openapi':+ specifier: 'catalog:'+ version: 1.15.0(@opentelemetry/[email protected])([email protected])+ tsx:+ specifier: 'catalog:'+ version: 4.21.0+ typescript:+ specifier: 'catalog:'+ version: 5.8.3+ vitest:+ specifier: 'catalog:'+ version: 4.1.6(@opentelemetry/[email protected])(@types/[email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))+packages/auth:dependencies:'@carbon/database':@@ -6413,6 +6474,63 @@ packages:resolution: {integrity: sha512-a61ljmRVVyG5MC/698C8/FfFDw5a8LOIvyOLW5fztgUXqUpc1jOfQzOitSCbge657OgXXThmY3Tk8fpiDb4UcA==}engines: {node: '>= 20.0.0'}+ '@orpc/[email protected]':+ resolution: {integrity: sha512-Qt0FdPSGySdQwy83iUWOq+Iqhw2gM9qHtyxfBbcw1mwOz1s4O2BwUFA3ymVTLIRRNYRgPrQLaBZhp8CacqeePg==}++ '@orpc/[email protected]':+ resolution: {integrity: sha512-zo8+x+5iqnIMrFdcj+ibVgn6dJneWzLNcD3kZQxrJFGFNAFoxvZbwryR5wOdcHkaSCeS3N7Ib2NydU6pihSYmg==}++ '@orpc/[email protected]':+ resolution: {integrity: sha512-Ah48o/rc00rN1yP5HcaoVsDCjdUhoh3JP1VibBbvwijhGvdOwRwiw5RWiGu442GSKcrPt9etAGhWXH88q8C3ww==}++ '@orpc/[email protected]':+ resolution: {integrity: sha512-MGyMAC6dvQ/YoUARpTN4L1MAnK4L2T3+Z7LA8PVva2rZ8XpKABZRcfqufyPfAC0nu/0uPeebnxHaXZ/OeUIOFg==}++ '@orpc/[email protected]':+ resolution: {integrity: sha512-nwdsVkIRTVhW+2kjtEwHQqfkYnmbJN6HTHvBfnt0KYrPftJ7qvwDo4WnoxfS7Q1jdUlVu8griT5cKZ1gAIYcpQ==}++ '@orpc/[email protected]':+ resolution: {integrity: sha512-l9FnL1MjQ8g77mB10/8D61okuKHLJBWhuwmd6OF65POHzBF177kMCcbHvRFEqUuxSbzP2eNiZGf3kXPMHmIKiQ==}+ peerDependencies:+ crossws: '>=0.3.4'+ ws: 8.21.0+ peerDependenciesMeta:+ crossws:+ optional: true+ ws:+ optional: true++ '@orpc/[email protected]':+ resolution: {integrity: sha512-A3/JE7pQYSrrRm6/WYJxV3GBhpMdJRPM3h47slQtWBUZe9Sao5En5WBc4tISGQNP2emcez6qIvDziSgD2T+img==}+ peerDependencies:+ '@opentelemetry/api': '>=1.9.0'+ peerDependenciesMeta:+ '@opentelemetry/api':+ optional: true++ '@orpc/[email protected]':+ resolution: {integrity: sha512-laFW7C4t1gEV0NIt4EjCVCBU3kFPnj2FObJLQkTH+DkEOzxVy6zyJ1coIncDSeOPxzbf7rG8cs0B2vQQyuROag==}++ '@orpc/[email protected]':+ resolution: {integrity: sha512-fcOl2004o3RnZxW7rhLuDCrCKSi/H2eWnyljeeoY+xykcygRf0ONCs2K2bSdxPm6cmvQGAXa9m8VBglG9oERVQ==}+ peerDependencies:+ fastify: '>=5.6.1'+ peerDependenciesMeta:+ fastify:+ optional: true++ '@orpc/[email protected]':+ resolution: {integrity: sha512-XYVfgmIt71YrPJSI7RKRiNWjcyktPYHpevkjeohGNBP5aSMAUL95quZArAWr+XOPp4U56XRao54I6wFMZa4How==}++ '@orpc/[email protected]':+ resolution: {integrity: sha512-3ye9SIIhYfJckQwyyGQQRHAEF5vW6QDbax7oi1mOQ9UBHaRDH5kcL28mT0JnETrUvgBoDRx+rfCsQaAOB4n3zw==}++ '@orpc/[email protected]':+ resolution: {integrity: sha512-fsTN+FrdPkseVx99yRenGJYSp0xOrEk9fODk8oh3zzricNYzlZ8GGgCYtDNgt9vFIR/J05dc+Nk76KhcPBQpLw==}++ '@orpc/[email protected]':+ resolution: {integrity: sha512-bje/xn6thDqJY/JQ7xoOjmD1KWE4FsyZOPgnPxwqTZLx/r00stRhLuFvk1hDEGj9UlG7NLZEijDVx0wqvcyDzA==}+'@oxc-project/[email protected]':resolution: {integrity: sha512-KzkdCd6Uxqnf6l3HOw1xfatAlUURA0g14cvBYFyJ5SaNOQbOUvBr9PKArcPcrNIeRsBdgcUzOGrhKveVpvOIGA==}@@ -11815,9 +11933,6 @@ packages:resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==}- resolution: {integrity: sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==}-resolution: {integrity: sha512-KLdwQm2NvGLDkQDCGvmiQrhkd0JbMzXthwQAUgWjQuQdBLFa3eiBP5arXZyA+f8x+x7OXgud6bq2rxjGtHV2tw==}@@ -14194,6 +14309,9 @@ packages:resolution: {integrity: sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==}+ resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==}+resolution: {integrity: sha512-T1h3B10BRPKfcObdBklX639tVz+xh34O7GjofqrqiAQdm7eHsQ00ih18x6wuJ/E6FxdtS2u3FmUGPDeEcMwzNA==}@@ -14693,6 +14811,10 @@ packages:resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==}+ resolution: {integrity: sha512-h36JMxKRqrAxVD8201FrCpyeNuUY9Y5zZwujr20fFO77tpUtGa6EZzfKw/3WaiBX95fq7+MpsuMLNdSnORAwSA==}+ engines: {node: '>=14.18.0'}+resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==}engines: {node: '>= 0.6'}@@ -15197,6 +15319,9 @@ packages:resolution: {integrity: sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ==}+ resolution: {integrity: sha512-iFE4hLDuloSWcD7mjdCDhx2bKcIsYbtOTpfH5MHHLSKMOUyjqQXTeZVa289uuwEGEKFoE/BAPbhaU4B774nceg==}+resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==}engines: {node: '>= 18'}@@ -15705,6 +15830,10 @@ packages:resolution: {integrity: sha512-wieBHXygIm7OyQOu5hQlkk62/WyCFYGlWg7L6/ZCUZwx0o398Zkn4pVmMyfYhfMG8kGrj/Krt8eIk6UKC6VzwA==}+ resolution: {integrity: sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==}+ engines: {node: '>=20'}+resolution: {integrity: sha512-FQT/OVqCD+7edmmJpsgCsY820RTD5AkBryuG5IUqR5YQZSdj5xlH5nLgH7YPths7WsLPSpSBNneJdM8aS8aeFA==}@@ -15982,6 +16111,10 @@ packages:resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==}engines: {node: '>=16'}+ resolution: {integrity: sha512-yANm3Jr3GiJ1qgJlxGAVxTOIcEOk1rhQHamlXtnrCK7EHP4HeM9OGxtMg/W7HFdrVzw/ZWJKGVIJusVH85sLtw==}+ engines: {node: '>=20'}+resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==}engines: {node: '>= 0.6'}@@ -19545,6 +19678,123 @@ snapshots:'@orama/[email protected]': {}+ '@orpc/[email protected](@opentelemetry/[email protected])':+ dependencies:+ '@orpc/shared': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server-fetch': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server-peer': 1.15.0(@opentelemetry/[email protected])+ transitivePeerDependencies:+ - '@opentelemetry/api'++ '@orpc/[email protected](@opentelemetry/[email protected])':+ dependencies:+ '@orpc/client': 1.15.0(@opentelemetry/[email protected])+ '@orpc/shared': 1.15.0(@opentelemetry/[email protected])+ '@standard-schema/spec': 1.1.0+ openapi-types: 12.1.3+ transitivePeerDependencies:+ - '@opentelemetry/api'++ '@orpc/[email protected]': {}++ '@orpc/[email protected](@opentelemetry/[email protected])':+ dependencies:+ '@orpc/client': 1.15.0(@opentelemetry/[email protected])+ '@orpc/contract': 1.15.0(@opentelemetry/[email protected])+ '@orpc/shared': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server': 1.15.0(@opentelemetry/[email protected])+ transitivePeerDependencies:+ - '@opentelemetry/api'++ dependencies:+ '@orpc/client': 1.15.0(@opentelemetry/[email protected])+ '@orpc/contract': 1.15.0(@opentelemetry/[email protected])+ '@orpc/interop': 1.15.0+ '@orpc/openapi-client': 1.15.0(@opentelemetry/[email protected])+ '@orpc/server': 1.15.0(@opentelemetry/[email protected])([email protected])+ '@orpc/shared': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server': 1.15.0(@opentelemetry/[email protected])+ json-schema-typed: 8.0.2+ rou3: 0.7.12+ transitivePeerDependencies:+ - '@opentelemetry/api'+ - crossws+ - fastify+ - ws++ dependencies:+ '@orpc/client': 1.15.0(@opentelemetry/[email protected])+ '@orpc/contract': 1.15.0(@opentelemetry/[email protected])+ '@orpc/interop': 1.15.0+ '@orpc/shared': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server-aws-lambda': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server-fastify': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server-fetch': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server-node': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server-peer': 1.15.0(@opentelemetry/[email protected])+ cookie: 1.1.1+ optionalDependencies:+ ws: 8.21.0+ transitivePeerDependencies:+ - '@opentelemetry/api'+ - fastify++ '@orpc/[email protected](@opentelemetry/[email protected])':+ dependencies:+ radash: 12.1.1+ type-fest: 5.9.0+ optionalDependencies:+ '@opentelemetry/api': 1.9.0++ '@orpc/[email protected](@opentelemetry/[email protected])':+ dependencies:+ '@orpc/shared': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server-fetch': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server-node': 1.15.0(@opentelemetry/[email protected])+ transitivePeerDependencies:+ - '@opentelemetry/api'++ '@orpc/[email protected](@opentelemetry/[email protected])':+ dependencies:+ '@orpc/shared': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server-node': 1.15.0(@opentelemetry/[email protected])+ transitivePeerDependencies:+ - '@opentelemetry/api'++ '@orpc/[email protected](@opentelemetry/[email protected])':+ dependencies:+ '@orpc/shared': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server': 1.15.0(@opentelemetry/[email protected])+ transitivePeerDependencies:+ - '@opentelemetry/api'++ '@orpc/[email protected](@opentelemetry/[email protected])':+ dependencies:+ '@orpc/shared': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server-fetch': 1.15.0(@opentelemetry/[email protected])+ transitivePeerDependencies:+ - '@opentelemetry/api'++ '@orpc/[email protected](@opentelemetry/[email protected])':+ dependencies:+ '@orpc/shared': 1.15.0(@opentelemetry/[email protected])+ '@orpc/standard-server': 1.15.0(@opentelemetry/[email protected])+ transitivePeerDependencies:+ - '@opentelemetry/api'++ '@orpc/[email protected](@opentelemetry/[email protected])':+ dependencies:+ '@orpc/shared': 1.15.0(@opentelemetry/[email protected])+ transitivePeerDependencies:+ - '@opentelemetry/api'+'@oxc-project/[email protected]': {}@@ -22096,7 +22346,7 @@ snapshots:'@react-pdf/primitives': 4.2.0'@react-pdf/stylesheet': 6.1.4- '@react-router/[email protected](patch_hash=10eab9c1af1b5cc376e67a81f64216bb5d6fcd8a94fc807eb46ecf1982b2cde4)(@react-router/[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])':+ '@react-router/[email protected](patch_hash=10eab9c1af1b5cc376e67a81f64216bb5d6fcd8a94fc807eb46ecf1982b2cde4)(@react-router/[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])':dependencies:'@babel/core': 7.29.0'@babel/generator': 7.29.1@@ -22126,7 +22376,7 @@ snapshots:semver: 7.7.4tinyglobby: 0.2.17valibot: 1.3.1([email protected])- vite: 7.3.5(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ vite: 8.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])vite-node: 3.2.4(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])optionalDependencies:'@react-router/serve': 7.18.0([email protected]([email protected]([email protected]))([email protected]))([email protected])@@ -22268,9 +22518,9 @@ snapshots:optionalDependencies:typescript: 5.8.3- '@react-router/[email protected](@react-router/[email protected](patch_hash=10eab9c1af1b5cc376e67a81f64216bb5d6fcd8a94fc807eb46ecf1982b2cde4)(@react-router/[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected]))([email protected])':+ '@react-router/[email protected](@react-router/[email protected](patch_hash=10eab9c1af1b5cc376e67a81f64216bb5d6fcd8a94fc807eb46ecf1982b2cde4)(@react-router/[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected]))([email protected])':dependencies:- '@react-router/dev': 7.18.0(patch_hash=10eab9c1af1b5cc376e67a81f64216bb5d6fcd8a94fc807eb46ecf1982b2cde4)(@react-router/[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])+ '@react-router/dev': 7.18.0(patch_hash=10eab9c1af1b5cc376e67a81f64216bb5d6fcd8a94fc807eb46ecf1982b2cde4)(@react-router/[email protected]([email protected]([email protected]([email protected]))([email protected]))([email protected]))(@types/[email protected])([email protected])([email protected])([email protected])([email protected]([email protected]([email protected]))([email protected]))([email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))([email protected])optionalDependencies:typescript: 5.8.3@@ -26031,8 +26281,6 @@ snapshots:- [email protected]: {}-@@ -26650,7 +26898,7 @@ snapshots:unist-util-remove-position: 5.0.0unist-util-visit: 5.1.0vfile: 6.0.3- zod: 4.4.3+ zod: 4.5.4optionalDependencies:'@types/mdast': 4.0.4'@types/mdx': 2.0.14@@ -28818,6 +29066,8 @@ snapshots:regex: 6.1.0regex-recursion: 6.0.2+ [email protected]: {}+dependencies:jose: 4.15.9@@ -29363,6 +29613,8 @@ snapshots:dependencies:inherits: 2.0.4+ [email protected]: {}+@@ -30110,6 +30362,8 @@ snapshots:+ [email protected]: {}+dependencies:debug: 4.4.3([email protected])@@ -30749,6 +31003,8 @@ snapshots:+ [email protected]: {}+@@ -31126,6 +31382,10 @@ snapshots:+ dependencies:+ tagged-tag: 1.0.0+dependencies:media-typer: 0.3.0@@ -31397,25 +31657,25 @@ snapshots:- tsx- yaml- [email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])):+ [email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])):dependencies:'@babel/core': 7.29.0'@babel/plugin-syntax-jsx': 7.28.6(@babel/[email protected])'@babel/plugin-syntax-typescript': 7.28.6(@babel/[email protected])'@types/babel__core': 7.20.5babel-plugin-macros: 3.1.0- vite: 7.3.5(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ vite: 7.3.5(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])transitivePeerDependencies:- supports-color- [email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])):+ [email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])):dependencies:'@babel/core': 7.29.0'@babel/plugin-syntax-jsx': 7.28.6(@babel/[email protected])'@babel/plugin-syntax-typescript': 7.28.6(@babel/[email protected])'@types/babel__core': 7.20.5babel-plugin-macros: 3.1.0- vite: 7.3.5(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ vite: 8.0.16(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])transitivePeerDependencies:- supports-color@@ -31515,6 +31775,22 @@ snapshots:tsx: 4.21.0yaml: 2.8.3+ [email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]):+ dependencies:+ lightningcss: 1.32.0+ picomatch: 4.0.4+ postcss: 8.5.18+ rolldown: 1.0.3+ tinyglobby: 0.2.17+ optionalDependencies:+ '@types/node': 24.12.2+ esbuild: 0.27.7+ fsevents: 2.3.3+ jiti: 2.7.0+ terser: 5.48.0+ tsx: 4.21.0+ yaml: 2.8.3+[email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected]):dependencies:lightningcss: 1.32.0@@ -31749,7 +32025,7 @@ snapshots:browserslist: 4.28.2chrome-trace-event: 1.0.4enhanced-resolve: 5.24.2- es-module-lexer: 2.1.0+ es-module-lexer: 2.3.0eslint-scope: 5.1.1events: 3.3.0graceful-fs: 4.2.11diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yamlindex 9e115bd770..d79a4aa1a0 100644--- a/pnpm-workspace.yaml+++ b/pnpm-workspace.yaml@@ -69,6 +69,11 @@ catalog:'@logtape/redaction': 2.2.3'@logtape/testing': 2.2.3'@nanostores/react': 0.7.3+ '@orpc/client': 1.15.0+ '@orpc/contract': 1.15.0+ '@orpc/openapi': 1.15.0+ '@orpc/openapi-client': 1.15.0+ '@orpc/server': 1.15.0'@paralleldrive/cuid2': 2.2.2'@react-aria/i18n': 3.12.16'@react-email/components': 0.3.3diff --git a/scripts/check-manifest.ts b/scripts/check-manifest.tsnew file mode 100644index 0000000000..411152ab98--- /dev/null+++ b/scripts/check-manifest.ts@@ -0,0 +1,76 @@+/**+ * Fails when the committed manifest digest no longer matches what the service files+ * imply — i.e. somebody changed a validator or a service signature without running+ * `pnpm generate:mcp`.+ *+ * This is what replaces reading the manifest diff in review. The manifest itself is+ * gitignored build output, so the digest is the only committed record of the+ * published contract; if it can go stale silently, it is worth nothing.+ *+ * Usage: pnpm check:manifest+ */++import * as fs from "fs";+import * as path from "path";++import {+ buildManifestDigest,+ diffDigests,+ formatDigestDiff,+ type ManifestDigest,+} from "./lib/manifest-digest";+import { buildAllToolMetadataWithValidators } from "./lib/service-metadata";++const ROOT = path.resolve(__dirname, "..");+const DIGEST_FILE = path.join(+ ROOT,+ "apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json"+);++async function main(): Promise<void> {+ if (!fs.existsSync(DIGEST_FILE)) {+ console.error(+ `check-manifest: ${path.relative(ROOT, DIGEST_FILE)} is missing — run \`pnpm generate:mcp\`.`+ );+ process.exit(1);+ }++ const committed = JSON.parse(+ fs.readFileSync(DIGEST_FILE, "utf-8")+ ) as ManifestDigest;++ const { tools, registryStats } = await buildAllToolMetadataWithValidators();+ const fresh = buildManifestDigest(tools);++ const diff = diffDigests(committed, fresh);+ const drifted =+ diff.added.length + diff.removed.length + diff.changed.length > 0;++ if (!drifted) {+ console.log(+ `check-manifest: ok — ${fresh.totalTools} operations across ${fresh.modules} modules, digest current.`+ );+ // A validator that silently fell back to source-text parsing publishes a lossy+ // schema. The digest can be perfectly current and still be built that way, so+ // report it separately rather than folding it into the pass/fail.+ if (registryStats.moduleErrors.length > 0) {+ console.warn(+ ` ⚠ ${registryStats.moduleErrors.length} module(s) failed to load; their schemas came from the textual fallback.`+ );+ }+ return;+ }++ console.error("check-manifest: the committed digest is stale.\n");+ console.error(formatDigestDiff(diff));+ console.error(+ `\n${diff.added.length} added, ${diff.removed.length} removed, ${diff.changed.length} changed.`+ );+ console.error("\nRun `pnpm generate:mcp` and commit the digest.");+ process.exit(1);+}++main().catch((err) => {+ console.error(err);+ process.exit(1);+});diff --git a/scripts/generate-mcp.ts b/scripts/generate-mcp.tsindex 3765449bf9..f31a99ae54 100644--- a/scripts/generate-mcp.ts+++ b/scripts/generate-mcp.ts@@ -1,8 +1,8 @@/*** MCP Tool Metadata Generator*- * Parses all *.service.ts files and generates tool-metadata.json- * with descriptions and JSON Schema for each tool's parameters.+ * Writes tool-metadata.json from the shared service parser+ * (`scripts/lib/service-metadata.ts`).** Usage: npx tsx scripts/generate-mcp.ts*/@@ -10,820 +10,33 @@import * as fs from "fs";import * as path from "path";-import { MCP_BLOCKED_TOOL_NAMES } from "../apps/erp/app/routes/api+/mcp+/lib/mcp-blocked-tools";-import type { AuthField } from "../apps/erp/app/routes/api+/mcp+/lib/types";+import {+ buildManifestDigest,+ serializeManifestDigest+} from "./lib/manifest-digest";+import { buildAllToolMetadataWithValidators } from "./lib/service-metadata";const ROOT = path.resolve(__dirname, "..");-const MODULES_DIR = path.join(ROOT, "apps/erp/app/modules");const METADATA_FILE = path.join(ROOT,"apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json");+/**+ * Committed companion to the (gitignored) manifest — see `lib/manifest-digest.ts`.+ * Small enough to read in a diff, so a schema regression is still visible in review.+ */+export const DIGEST_FILE = path.join(+ ROOT,+ "apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json"+);-const MODULE_LIST = [- "account",- "accounting",- "documents",- "inventory",- "invoicing",- "items",- "people",- "production",- "purchasing",- "quality",- "resources",- "sales",- "settings",- "shared",- "users",-];--const CONTEXT_PARAMS = new Set([- "client",- "db",- "companyId",- "userId",- "createdBy",- "updatedBy",- "companyGroupId",-]);--const DESCRIPTION_OVERRIDES: Record<string, string> = {- purchasing_insertPurchaseOrder:- "Create a new purchase order with all business logic - generates sequence, creates supplier interaction, resolves payment/shipping defaults from supplier. LLM can create a PO with just supplierId.",- purchasing_updatePurchaseOrder:- "Update an existing purchase order - handles exchange rate updates when currency changes",- purchasing_insertSupplierQuote:- "Create a new supplier quote with all business logic - generates sequence, creates supplier interaction, sets up external link. LLM can create a quote with just supplierId.",- purchasing_updateSupplierQuote:- "Update an existing supplier quote - handles exchange rate updates when currency changes",- sales_insertQuote:- "Create a new quote with all business logic - generates sequence, creates opportunity, resolves payment/shipping defaults from customer. LLM can create a quote with just customerId.",- sales_updateQuote:- "Update an existing quote - handles exchange rate updates when currency changes, syncs customer to opportunity",- sales_insertSalesOrder:- "Create a new sales order with all business logic - generates sequence, creates opportunity, resolves payment/shipping defaults from customer. LLM can create a sales order with just customerId.",- sales_updateSalesOrder:- "Update an existing sales order - handles exchange rate updates when currency changes, syncs customer to opportunity",- production_insertJob:- "Create a new job with all business logic - generates sequence, resolves location, copies method from item, recalculates requirements. LLM can create a job with just itemId and quantity.",- production_updateJob:- "Update an existing job - handles priority recalculation when deadline changes",- inventory_insertStockTransfer:- "Create a stock transfer with lines. Generates sequence ID automatically.",- inventory_updateStockTransfer: "Update an existing stock transfer",- inventory_insertWarehouseTransfer:- "Create a warehouse transfer between locations. Generates sequence ID automatically.",- inventory_updateWarehouseTransfer: "Update an existing warehouse transfer",-};--// Per-tool overrides of the auto-computed injectAuth set. The default rule-// (insert* → companyId + createdBy + updatedBy) is wrong for tools that spread-// their argument object straight into an INSERT on an append-only ledger table.-// Those tables now carry an updatedBy column (schema uniformity, migration-// 20260701143512), but by convention it must stay NULL — an "edit" is a new-// offsetting row, never an in-place mutation. Injecting updatedBy would stamp it-// on the ledger row and destroy the "untouched since creation" guarantee, so we-// drop it here. Both tools below insert([data]) where data is built from the-// spread of their injected args:-// - inventory_insertManualInventoryAdjustment → itemLedger-// - accounting_upsertFixedAssetUsageLog → fixedAssetUsageLog-// account_upsertNotificationPreference spreads its argument into an upsert on-// notificationPreference, which (like userModulePreference) carries no-// createdBy/updatedBy columns at all — injecting them breaks the write.-const INJECT_AUTH_OVERRIDES: Record<string, AuthField[]> = {- inventory_insertManualInventoryAdjustment: ["companyId", "createdBy"],- accounting_upsertFixedAssetUsageLog: ["companyId", "createdBy"],- account_upsertNotificationPreference: ["companyId"],-};--// ----------------------------------------------------------------------------// Types-// -----------------------------------------------------------------------------interface ParsedParam {- name: string;- typeStr: string;- optional: boolean;-}--interface ParsedFunction {- name: string;- params: ParsedParam[];-}--interface ToolMetadata {- name: string;- module: string;- classification: "READ" | "WRITE" | "DESTRUCTIVE";- description: string;- paramCount: number;- serviceParams: string[];- injectAuth: AuthField[];- schema: Record<string, unknown>;-}--// ----------------------------------------------------------------------------// Parsing helpers-// -----------------------------------------------------------------------------function findMatchingBrace(content: string, openPos: number): number {- const open = content[openPos];- const close = open === "(" ? ")" : open === "{" ? "}" : open === "[" ? "]" : ">";- let depth = 1;- let i = openPos + 1;- while (i < content.length && depth > 0) {- if (content[i] === open) depth++;- else if (content[i] === close) depth--;- i++;- }- return i - 1;-}--function splitAtTopLevel(str: string, delimiter: string): string[] {- const parts: string[] = [];- let depth = 0;- let current = "";- for (let i = 0; i < str.length; i++) {- const ch = str[i];- if ("({[<".includes(ch)) depth++;- else if (")}]>".includes(ch) && !isArrowClose(str, i)) depth--;- if (ch === delimiter && depth === 0) {- parts.push(current.trim());- current = "";- } else {- current += ch;- }- }- if (current.trim()) parts.push(current.trim());- return parts;-}--// The `>` in an arrow function (`() => ...`) is not a generic close. Counting it-// as one drives brace depth negative, so every top-level delimiter after the-// first arrow (e.g. a validator field after an `errorMap: () => ({...})`) stops-// splitting — silently truncating a tool's schema to the fields before it.-function isArrowClose(str: string, i: number): boolean {- return str[i] === ">" && str[i - 1] === "=";-}--function findTopLevelColon(str: string): number {- let depth = 0;- for (let i = 0; i < str.length; i++) {- const ch = str[i];- if ("({[<".includes(ch)) depth++;- else if (")}]>".includes(ch) && !isArrowClose(str, i)) depth--;- if (ch === ":" && depth === 0) return i;- }- return -1;-}--function parseExportedFunctions(content: string): ParsedFunction[] {- const results: ParsedFunction[] = [];- const regex = /export\s+(?:async\s+)?function\s+(\w+)\s*\(/g;- let match;-- while ((match = regex.exec(content)) !== null) {- const name = match[1];- const openParen = match.index + match[0].length - 1;- const closeParen = findMatchingBrace(content, openParen);- const rawParams = content.substring(openParen + 1, closeParen).trim();-- if (!rawParams) {- results.push({ name, params: [] });- continue;- }-- const paramStrings = splitAtTopLevel(rawParams, ",");- const params: ParsedParam[] = [];-- for (const p of paramStrings) {- if (!p) continue;- const colonIdx = findTopLevelColon(p);- if (colonIdx === -1) {- params.push({ name: p.trim(), typeStr: "unknown", optional: false });- continue;- }- const before = p.substring(0, colonIdx).trim();- const optional = before.endsWith("?");- const paramName = before.replace(/\?$/, "").trim();- const typeStr = p.substring(colonIdx + 1).trim();- params.push({ name: paramName, typeStr, optional });- }-- results.push({ name, params });- }-- return results;-}--// ----------------------------------------------------------------------------// Type → JSON Schema conversion-// -----------------------------------------------------------------------------function typeToJsonSchema(typeStr: string): Record<string, unknown> {- const t = typeStr.trim();-- // Nullable: "Type | null"- const nullableMatch = t.match(/^(.+?)\s*\|\s*null$/);- if (nullableMatch) {- const inner = typeToJsonSchema(nullableMatch[1].trim());- if (inner.type) {- return { ...inner, type: [inner.type, "null"] };- }- return inner;- }-- // String literal union: "A" | "B" | "C"- const literalParts = splitAtTopLevel(t, "|").map((s) => s.trim());- if (literalParts.length > 1 && literalParts.every((p) => /^"[^"]*"$/.test(p))) {- return {- type: "string",- enum: literalParts.map((p) => p.slice(1, -1)),- };- }-- // Primitives- if (t === "string") return { type: "string" };- if (t === "number") return { type: "number" };- if (t === "boolean") return { type: "boolean" };-- // Arrays- if (t === "string[]") return { type: "array", items: { type: "string" } };- if (t === "number[]") return { type: "array", items: { type: "number" } };- if (t.endsWith("[]")) {- const inner = typeToJsonSchema(t.slice(0, -2).trim());- return { type: "array", items: inner };- }-- // Json type- if (t === "Json" || t === "Json | null") return {};-- // (typeof X)[number] — enum array reference. Anchored: an unanchored match- // also fired for any inline object type that merely CONTAINS such a field,- // collapsing the whole object to a string.- if (/^\(typeof\s+\w+\)\s*\[number\]$/.test(t)) return { type: "string" };-- // Inline object: { field: Type; ... }- if (t.startsWith("{")) {- return parseInlineObjectType(t);- }-- // GenericQueryFilters & { ... }- if (t.includes("GenericQueryFilters")) {- const base: Record<string, unknown> = {- type: "object",- properties: {- limit: { type: "integer", default: 100 },- offset: { type: "integer", default: 0 },- },- };- const intersectMatch = t.match(/&\s*(\{.+\})\s*$/s);- if (intersectMatch) {- const extra = parseInlineObjectType(intersectMatch[1]);- if (extra.properties) {- base.properties = {- ...(base.properties as Record<string, unknown>),- ...(extra.properties as Record<string, unknown>),- };- }- }- return base;- }-- // Fallback- return {};-}--function parseInlineObjectType(typeStr: string): Record<string, unknown> {- let inner = typeStr.trim();- if (inner.startsWith("{")) inner = inner.slice(1);- if (inner.endsWith("}")) inner = inner.slice(0, -1);- inner = inner.trim();-- if (!inner) return { type: "object", properties: {} };-- const properties: Record<string, unknown> = {};- const required: string[] = [];-- const fields = splitObjectFields(inner);-- for (const field of fields) {- // Strip `//` line comments so an inline comment above a field (common in- // service arg type literals) never gets absorbed into the property key.- const f = field- .split("\n")- .map((line) => line.replace(/\/\/.*$/, ""))- .join("\n")- .trim();- if (!f) continue;-- const optional = f.includes("?:");- const colonIdx = f.indexOf("?:") !== -1 ? f.indexOf("?:") : f.indexOf(":");- if (colonIdx === -1) continue;-- const fieldName = f.substring(0, colonIdx).replace("?", "").trim();- if (CONTEXT_PARAMS.has(fieldName)) continue;-- const fieldType = f- .substring(colonIdx + (optional ? 2 : 1))- .trim()- .replace(/;$/, "")- .trim();-- properties[fieldName] = typeToJsonSchema(fieldType);- if (!optional) required.push(fieldName);- }-- const schema: Record<string, unknown> = { type: "object", properties };- if (required.length > 0) schema.required = required;- return schema;-}--function splitObjectFields(inner: string): string[] {- const fields: string[] = [];- let depth = 0;- let current = "";-- for (let i = 0; i < inner.length; i++) {- const ch = inner[i];- if ("({[<".includes(ch)) depth++;- else if (")}]>".includes(ch) && !isArrowClose(inner, i)) depth--;-- if (ch === ";" && depth === 0) {- fields.push(current.trim());- current = "";- } else {- current += ch;- }- }- if (current.trim()) fields.push(current.trim());- return fields;-}--// ----------------------------------------------------------------------------// Validator resolution-// -----------------------------------------------------------------------------function parseValidatorFields(- validatorName: string,- modelsContent: string,- seen: Set<string> = new Set()-): Record<string, unknown> | null {- // Cycle guard for mutually-referential validators.- if (seen.has(validatorName)) return null;- seen = new Set(seen).add(validatorName);-- const rhs = extractValidatorRhs(validatorName, modelsContent);- if (rhs === null) return null;-- const properties: Record<string, unknown> = {};- const required: string[] = [];- const mergeIn = (sub: Record<string, unknown> | null) => {- if (!sub) return;- Object.assign(properties, sub.properties as Record<string, unknown>);- for (const r of (sub.required as string[] | undefined) ?? []) {- if (!required.includes(r)) required.push(r);- }- };-- // Base validators pulled in by `Base.merge(...)` / `Base.extend(...)` — resolve- // each referenced `*Validator` (same file) and fold its fields in first, so the- // extension below can override. This is what makes- // `applyX(itemValidator.merge(z.object({...})))` resolvable instead of opaque.- const refs = new Set(- (rhs.match(/\b\w+Validator\b/g) ?? []).filter((n) => n !== validatorName)- );- for (const ref of refs) {- mergeIn(parseValidatorFields(ref, modelsContent, seen));- }-- // This validator's own object literal — for a `.merge(z.object({...}))` /- // wrapped chain the FIRST z.object is the extension; for a plain- // `z.object({...})` it is the whole thing. Wrappers (`applyX(...)`, `.refine`,- // `.superRefine`) are transparent to this scan.- mergeIn(parseFirstZObject(rhs));-- if (Object.keys(properties).length === 0) return null;- const result: Record<string, unknown> = { type: "object", properties };- if (required.length > 0) result.required = required;- return result;-}--// The assignment expression of `export const {name} = <expr>;`, captured to the-// first top-level `;` (arrow-guarded) so a `*Validator` reference or `z.object`-// from a later declaration is never pulled in.-function extractValidatorRhs(- validatorName: string,- modelsContent: string-): string | null {- const regex = new RegExp(`export\\s+const\\s+${validatorName}\\s*=\\s*`);- const match = regex.exec(modelsContent);- if (!match) return null;- const start = match.index + match[0].length;-- let depth = 0;- for (let i = start; i < modelsContent.length; i++) {- const ch = modelsContent[i];- if ("({[<".includes(ch)) depth++;- else if (")}]>".includes(ch) && !isArrowClose(modelsContent, i)) depth--;- else if (ch === ";" && depth === 0) {- return modelsContent.substring(start, i);- }- }- return modelsContent.substring(start);-}--// Parse the first `z.object({ ... })` in an expression into a JSON-Schema object.-function parseFirstZObject(expr: string): Record<string, unknown> | null {- const idx = expr.indexOf("z.object(");- if (idx === -1) return null;- const braceStart = expr.indexOf("{", idx);- if (braceStart === -1) return null;- const braceEnd = findMatchingBrace(expr, braceStart);- const inner = expr.substring(braceStart + 1, braceEnd).trim();-- const properties: Record<string, unknown> = {};- const required: string[] = [];-- // Validator fields are comma-separated, not semicolon-separated- const fields = splitAtTopLevel(inner, ",");-- for (const field of fields) {- const f = field.trim();- if (!f || f.startsWith("//")) continue;-- const colonMatch = f.match(/^(\w+)\s*:/);- if (!colonMatch) continue;- const fieldName = colonMatch[1];-- if (CONTEXT_PARAMS.has(fieldName)) continue;-- const zodExpr = f.substring(colonMatch[0].length).trim();- const schema = zodExprToJsonSchema(zodExpr);- const isOptional =- zodExpr.includes(".optional()") ||- zodExpr.includes(".nullable()") ||- zodExpr.startsWith("zfd.text(") ||- zodExpr.startsWith("zfd.numeric(") ||- zodExpr.includes(".default(");-- properties[fieldName] = schema;- if (!isOptional) required.push(fieldName);- }-- if (Object.keys(properties).length === 0) return null;- const result: Record<string, unknown> = { type: "object", properties };- if (required.length > 0) result.required = required;- return result;-}--function zodExprToJsonSchema(expr: string): Record<string, unknown> {- const e = expr.trim();-- if (e.includes("z.enum(")) {- const enumMatch = e.match(/z\.enum\(\[([^\]]+)\]\)/);- if (enumMatch) {- const values = enumMatch[1]- .split(",")- .map((s) => s.trim().replace(/^["']|["']$/g, ""))- .filter(Boolean);- return { type: "string", enum: values };- }- }-- if (e.startsWith("z.array(")) {- // Resolve the element schema so the array is well-formed rather than a bare- // `{type:"array"}` a caller can't fill.- const open = e.indexOf("(");- const close = findMatchingBrace(e, open);- const inner = e.substring(open + 1, close).trim();- return { type: "array", items: inner ? zodExprToJsonSchema(inner) : {} };- }- if (e.includes("z.number()")) return { type: "number" };- if (e.includes("z.boolean()")) return { type: "boolean" };- if (e.includes("z.string()") || e.startsWith("zfd.text("))- return { type: "string" };- if (e.includes("z.any()")) return {};- if (e.startsWith("zfd.numeric(")) return { type: "number" };- if (e.startsWith("z.preprocess(")) {- // A preprocessed enum whose values aren't an inline array can't be- // enumerated (the top-of-function z.enum check already ran on this same- // expr), so treat it as a string. Recursing on `e` here looped forever.- if (e.includes("z.enum(")) return { type: "string" };- if (e.includes("z.number()")) return { type: "number" };- return { type: "string" };- }-- return { type: "string" };-}--// ----------------------------------------------------------------------------// Classification & auth-// -----------------------------------------------------------------------------function classifyFunction(- name: string,- content?: string-): "READ" | "WRITE" | "DESTRUCTIVE" {- if (/^delete/.test(name)) return "DESTRUCTIVE";- // Require a camelCase boundary after the read prefix so a mutating name that merely starts with- // those letters is not misread as a reader — e.g. `issueMaterial` ("is"+lowercase) is a WRITE,- // while `isBlocked`/`getJob` ("is"/"get"+uppercase) stay READ.- if (/^(get|list|fetch|search|find|count|check|is|has|compute)(?![a-z])/.test(name))- return "READ";- // Destructive-by-omission: a write whose body deletes rows (e.g. the- // delete-then-reinsert `upsert*Prices` rewrite) can silently drop data the- // caller didn't include. Flag it so the client treats it as destructive, even- // though its name says `upsert`/`update`. injectAuth stays name-based below, so- // the insert branch still gets its createdBy.- if (content && functionBodyDeletes(content, name)) return "DESTRUCTIVE";- return "WRITE";-}--// True when the function body issues a row delete (supabase `.delete(` or Kysely-// `.deleteFrom(`). Comment/URL-safe via stripComments.-function functionBodyDeletes(content: string, funcName: string): boolean {- const body = extractFunctionBody(content, funcName);- if (body === null) return false;- const stripped = stripComments(body);- return /\.delete\s*\(/.test(stripped) || /\.deleteFrom\s*\(/.test(stripped);-}--function extractFunctionBody(content: string, funcName: string): string | null {- const regex = new RegExp(- `export\\s+(?:async\\s+)?function\\s+${funcName}\\s*\\(`- );- const match = regex.exec(content);- if (!match) return null;- const closeParen = findMatchingBrace(- content,- match.index + match[0].length - 1- );- const nextExport = content.indexOf("\nexport ", closeParen);- return content.substring(- closeParen,- nextExport === -1 ? content.length : nextExport- );-}--function computeInjectAuth(- funcName: string,- classification: "READ" | "WRITE" | "DESTRUCTIVE"-): AuthField[] {- const lower = funcName.toLowerCase();- // Only READ tools take no audit fields. A DESTRUCTIVE label is just a caller- // hint — a delete-then-reinsert `upsert*` still inserts rows and needs its- // createdBy/updatedBy, so audit injection is keyed off the name verb, not the- // classification. A genuine `delete*` matches neither verb group and falls- // through to companyId-only.- if (classification === "READ") {- return ["companyId"];- }- if (- /^(upsert|create|insert|add|new|copy|duplicate|generate)/.test(lower)- ) {- return ["companyId", "createdBy", "updatedBy"];- }- if (- /^(update|modify|set|change|edit|approve|reject|finalize|toggle|move|reorder|recalculate|sync|favorite|unfavorite|send|release|close|convert|run)/.test(- lower- )- ) {- return ["companyId", "updatedBy"];- }- return ["companyId"];-}--// Services that pick insert-vs-update this way are the only ones MCP can't infer.-function usesCreatedByDiscriminator(- content: string,- funcName: string-): boolean {- const body = extractFunctionBody(content, funcName);- if (body === null) return false;- return stripComments(body).includes('"createdBy" in');-}--// The `:` guard keeps `https://` intact.-function stripComments(source: string): string {- return source- .replace(/\/\*[\s\S]*?\*\//g, "")- .replace(/(^|[^:])\/\/.*$/gm, "$1");-}--function addOperationArg(schema: Record<string, unknown>): void {- const properties = (schema.properties ?? {}) as Record<string, unknown>;- properties._operation = {- type: "string",- enum: ["create", "update"],- description:- "Required. 'create' inserts a new record, 'update' modifies the existing record with this id.",- };- schema.properties = properties;- const required = ((schema.required as string[] | undefined) ?? []).slice();- if (!required.includes("_operation")) required.push("_operation");- schema.required = required;-}--function generateDescription(funcName: string): string {- return funcName- .replace(/([A-Z])/g, " $1")- .trim()- .toLowerCase();-}--// ----------------------------------------------------------------------------// Schema building for a function-// -----------------------------------------------------------------------------function buildToolSchema(- func: ParsedFunction,- modelsContent: string | null-): { schema: Record<string, unknown>; paramCount: number } {- const userParams = func.params.filter((p) => !CONTEXT_PARAMS.has(p.name));-- if (userParams.length === 0) {- return { schema: { type: "object", properties: {} }, paramCount: 0 };- }-- // Single object param — flatten its fields into the schema- if (userParams.length === 1) {- const param = userParams[0];-- // Check for validator reference: z.infer<typeof validatorName>. Skip when the- // type is an inline object literal (`{ ... }`) that merely CONTAINS a nested- // `z.infer<...>` field — that object should be flattened, not replaced by the- // nested schema.- const isInlineObject = param.typeStr.trim().startsWith("{");- const validatorMatch = isInlineObject- ? null- : param.typeStr.match(/z\.infer<typeof\s+(\w+)>/);- if (validatorMatch && modelsContent) {- const validatorName = validatorMatch[1];- const resolved = parseValidatorFields(validatorName, modelsContent);- if (resolved) {- const propCount = Object.keys(- (resolved.properties as Record<string, unknown>) || {}- ).length;- return { schema: resolved, paramCount: propCount };- }- }-- // Inline object type — flatten its fields to the top level. An- // array-of-objects (`{...}[]`) can't be flattened, so wrap it under the- // param name instead (typeToJsonSchema returns `{type:"array",...}`).- if (param.typeStr.trim().startsWith("{")) {- const resolved = typeToJsonSchema(param.typeStr);- if (resolved.type === "array") {- const schema: Record<string, unknown> = {- type: "object",- properties: { [param.name]: resolved },- required: param.optional ? undefined : [param.name],- };- return { schema, paramCount: 1 };- }- const propCount = Object.keys(- (resolved.properties as Record<string, unknown>) || {}- ).length;- return { schema: resolved, paramCount: propCount };- }-- // GenericQueryFilters- if (param.typeStr.includes("GenericQueryFilters")) {- const innerSchema = typeToJsonSchema(param.typeStr);- const schema: Record<string, unknown> = {- type: "object",- properties: { [param.name]: innerSchema },- };- const propCount = Object.keys(- (innerSchema.properties as Record<string, unknown>) || {}- ).length;- return { schema, paramCount: propCount };- }-- // Simple primitive param- const propSchema = typeToJsonSchema(param.typeStr);- const schema: Record<string, unknown> = {- type: "object",- properties: { [param.name]: propSchema },- required: param.optional ? undefined : [param.name],- };- return { schema, paramCount: 1 };- }-- // Multiple params — each becomes a property (or flattened if inline object)- const properties: Record<string, unknown> = {};- const required: string[] = [];- for (const param of userParams) {- // typeToJsonSchema handles inline objects AND arrays-of-objects (`{...}[]`),- // checking the `[]` suffix before the `{` prefix. Calling parseInlineObjectType- // directly here dropped the suffix, publishing an array param as a bare object.- properties[param.name] = typeToJsonSchema(param.typeStr);- if (!param.optional) required.push(param.name);- }-- const schema: Record<string, unknown> = { type: "object", properties };- if (required.length > 0) schema.required = required;- return { schema, paramCount: Object.keys(properties).length };-}--// ----------------------------------------------------------------------------// Main-// -----------------------------------------------------------------------------function loadModelsContent(mod: string): string | null {- const modelsPath = path.join(MODULES_DIR, mod, `${mod}.models.ts`);- if (fs.existsSync(modelsPath)) {- return fs.readFileSync(modelsPath, "utf-8");- }- // Fall back to the `.ee`-licensed variant (see root LICENSE) when a module- // keeps its single models file under that name.- const eeModelsPath = path.join(MODULES_DIR, mod, `${mod}.ee.models.ts`);- if (fs.existsSync(eeModelsPath)) {- return fs.readFileSync(eeModelsPath, "utf-8");- }- // Try shared models for cross-module validators- const sharedPath = path.join(MODULES_DIR, "shared", "index.ts");- if (fs.existsSync(sharedPath)) {- return fs.readFileSync(sharedPath, "utf-8");- }- return null;-}--export function generateToolMetadata(): void {+export async function generateToolMetadata(): Promise<void> {console.log("Generating tool metadata from service files...");- const allTools: ToolMetadata[] = [];-- for (const mod of MODULE_LIST) {- let serviceFile = path.join(MODULES_DIR, mod, `${mod}.service.ts`);- if (!fs.existsSync(serviceFile)) {- // Fall back to the `.ee`-licensed variant (see root LICENSE) when a- // module keeps its single service file under that name (e.g.- // accounting.ee.service.ts).- const eeServiceFile = path.join(- MODULES_DIR,- mod,- `${mod}.ee.service.ts`- );- if (!fs.existsSync(eeServiceFile)) {- console.warn(` ⚠ Service file not found: ${serviceFile}`);- continue;- }- serviceFile = eeServiceFile;- }-- let content = fs.readFileSync(serviceFile, "utf-8");- const modelsContent = loadModelsContent(mod);- const functions = parseExportedFunctions(content);-- // A module may expose MCP tools from a server-only companion file- // (`{mod}.mcp.server.ts`) when those functions must import `*.server`- // modules and therefore cannot live in the client-reachable service file.- const mcpServerFile = path.join(MODULES_DIR, mod, `${mod}.mcp.server.ts`);- if (fs.existsSync(mcpServerFile)) {- const mcpServerContent = fs.readFileSync(mcpServerFile, "utf-8");- content = `${content}\n${mcpServerContent}`;- functions.push(...parseExportedFunctions(mcpServerContent));- }-- let toolCount = 0;-- for (const func of functions) {- const toolName = `${mod}_${func.name}`;- if (MCP_BLOCKED_TOOL_NAMES.includes(toolName)) continue;-- const classification = classifyFunction(func.name, content);- const injectAuth =- INJECT_AUTH_OVERRIDES[toolName] ||- computeInjectAuth(func.name, classification);- const description =- DESCRIPTION_OVERRIDES[toolName] || generateDescription(func.name);- const serviceParams = func.params.map((p) => p.name);- const { schema, paramCount } = buildToolSchema(func, modelsContent);- if (- injectAuth.includes("createdBy") &&- usesCreatedByDiscriminator(content, func.name)- ) {- addOperationArg(schema);- }-- allTools.push({- name: toolName,- module: mod,- classification,- description,- paramCount,- serviceParams,- injectAuth,- schema,- });- toolCount++;- }-- console.log(` ✓ ${mod}: ${toolCount} tools`);- }+ const { tools: allTools, registryStats, responseStats, resolutions } =+ await buildAllToolMetadataWithValidators({+ onModule: (mod, count) => console.log(` ✓ ${mod}: ${count} tools`),+ });const metadata = {generated: new Date().toISOString(),@@ -832,11 +45,52 @@ export function generateToolMetadata(): void {tools: allTools,};- fs.writeFileSync(METADATA_FILE, JSON.stringify(metadata, null, 2));+ // Minified: this file is gitignored build output that only machines read, and+ // response schemas roughly tripled it. The readable artifact is the digest.+ fs.writeFileSync(METADATA_FILE, JSON.stringify(metadata));+ fs.writeFileSync(+ DIGEST_FILE,+ serializeManifestDigest(buildManifestDigest(allTools))+ );console.log(`\n✓ Generated metadata for ${allTools.length} tools`);- console.log(` Output: ${path.relative(ROOT, METADATA_FILE)}`);+ console.log(` Output: ${path.relative(ROOT, METADATA_FILE)} (gitignored)`);+ console.log(` Digest: ${path.relative(ROOT, DIGEST_FILE)} (committed)`);++ // Schema provenance. A validator that fell back to source-text parsing still+ // produces a manifest entry, so surface it rather than letting the degrade pass+ // silently — that fallback is the only path that can publish a lossy schema.+ const fallbacks = resolutions.filter((r) => r.how !== "native");+ console.log(+ ` Schemas: ${registryStats.validatorsConverted} validators converted from ${registryStats.modulesLoaded}/15 modules`+ );+ console.log(+ ` Responses: ${responseStats.derived}/${responseStats.functions} reflected from return types (${responseStats.empty} yielded nothing usable)`+ );+ if (registryStats.moduleErrors.length > 0) {+ console.warn(` ⚠ ${registryStats.moduleErrors.length} module(s) failed to load:`);+ for (const e of registryStats.moduleErrors) {+ console.warn(` ${e.module}: ${e.error}`);+ }+ }+ if (registryStats.conversionFailures.length > 0) {+ console.warn(+ ` ⚠ ${registryStats.conversionFailures.length} validator(s) failed to convert:`+ );+ for (const f of registryStats.conversionFailures.slice(0, 10)) {+ console.warn(` ${f.module}.${f.name}: ${f.error}`);+ }+ }+ if (fallbacks.length > 0) {+ const unique = [...new Set(fallbacks.map((f) => f.validatorName))];+ console.warn(+ ` ⚠ ${fallbacks.length} param(s) used the source-text fallback: ${unique.slice(0, 12).join(", ")}`+ );+ }}if (require.main === module) {- generateToolMetadata();+ generateToolMetadata().catch((err) => {+ console.error(err);+ process.exit(1);+ });}diff --git a/scripts/lib/manifest-digest.ts b/scripts/lib/manifest-digest.tsnew file mode 100644index 0000000000..a5f822244b--- /dev/null+++ b/scripts/lib/manifest-digest.ts@@ -0,0 +1,161 @@+/**+ * A small, committed summary of the generated tool manifest.+ *+ * `tool-metadata.json` itself is build-time output and gitignored — at 1.3 MB and+ * rewritten wholesale on every regeneration, it churned 250+ commits. But it was+ * also the only place a schema change was VISIBLE in review: the phantom-property+ * bug (an operation publishing 58 arguments where its validator has 15) was caught+ * by reading that diff.+ *+ * The digest keeps that signal at a fifth of the size, one line per operation, and+ * does not grow when schemas do (only the hash of one changes). It records the+ * facts a reviewer needs to notice a regression — classification, permission,+ * injected auth fields, the argument count, and a hash of the schema — so a changed+ * schema always shows up as a changed line, and a changed COUNT shows up as a+ * number a human can judge.+ */++import { createHash } from "crypto";+import type { ManifestEntry } from "@carbon/api";++/** One line per operation: enough to spot a regression, not enough to churn. */+export interface DigestEntry {+ name: string;+ classification: string;+ paramCount: number;+ /** Stable hash of the input schema — any shape change moves it. */+ schema: string;+ /** Stable hash of the response schema, or "none" when none was derived. */+ response: string;+ injectAuth: string;+ permission: string;+}++export interface ManifestDigest {+ totalTools: number;+ modules: number;+ tools: DigestEntry[];+}++/**+ * Hash with sorted keys so an incidental reordering of object properties — which+ * JSON.stringify preserves but which means nothing semantically — does not read as+ * a schema change.+ */+function stableHash(value: unknown): string {+ const canonical = JSON.stringify(sortKeys(value));+ return createHash("sha256").update(canonical).digest("hex").slice(0, 12);+}++function sortKeys(value: unknown): unknown {+ if (Array.isArray(value)) return value.map(sortKeys);+ if (value && typeof value === "object") {+ const out: Record<string, unknown> = {};+ for (const key of Object.keys(value as Record<string, unknown>).sort()) {+ out[key] = sortKeys((value as Record<string, unknown>)[key]);+ }+ return out;+ }+ return value;+}++/**+ * Serialize with ONE LINE PER OPERATION. Pretty-printing spreads each entry over+ * six lines, so a single changed schema reads as a six-line hunk; one line per+ * operation makes a changed operation exactly one changed line — which is the+ * whole point of keeping this file.+ */+export function serializeManifestDigest(digest: ManifestDigest): string {+ const lines = digest.tools.map((t) => ` ${JSON.stringify(t)}`);+ return [+ "{",+ ` "totalTools": ${digest.totalTools},`,+ ` "modules": ${digest.modules},`,+ ' "tools": [',+ lines.join(",\n"),+ " ]",+ "}",+ ""+ ].join("\n");+}++export function buildManifestDigest(tools: ManifestEntry[]): ManifestDigest {+ return {+ totalTools: tools.length,+ modules: new Set(tools.map((t) => t.module)).size,+ // Sorted by name: the generator walks modules in a fixed order today, but the+ // digest is a committed file and must not reorder because a service file moved.+ tools: [...tools]+ .sort((a, b) => a.name.localeCompare(b.name))+ .map((t) => ({+ name: t.name,+ classification: t.classification,+ paramCount: t.paramCount,+ schema: stableHash(t.schema),+ response: t.responseSchema ? stableHash(t.responseSchema) : "none",+ injectAuth: [...t.injectAuth].sort().join("+") || "none",+ permission: t.permission?.module+ ? `${t.permission.module}:${[...t.permission.actions].sort().join("+")}`+ : "none"+ }))+ };+}++export interface DigestDiff {+ added: string[];+ removed: string[];+ changed: Array<{ name: string; before: DigestEntry; after: DigestEntry }>;+}++export function diffDigests(+ before: ManifestDigest,+ after: ManifestDigest+): DigestDiff {+ const beforeByName = new Map(before.tools.map((t) => [t.name, t]));+ const afterByName = new Map(after.tools.map((t) => [t.name, t]));++ const changed: DigestDiff["changed"] = [];+ for (const [name, entry] of afterByName) {+ const prev = beforeByName.get(name);+ if (!prev) continue;+ if (JSON.stringify(prev) !== JSON.stringify(entry)) {+ changed.push({ name, before: prev, after: entry });+ }+ }++ return {+ added: [...afterByName.keys()].filter((n) => !beforeByName.has(n)).sort(),+ removed: [...beforeByName.keys()].filter((n) => !afterByName.has(n)).sort(),+ changed+ };+}++/** Human-readable summary of a digest diff, for the check script's output. */+export function formatDigestDiff(diff: DigestDiff): string {+ const lines: string[] = [];+ for (const name of diff.added) lines.push(` + ${name}`);+ for (const name of diff.removed) lines.push(` - ${name}`);+ for (const { name, before, after } of diff.changed) {+ const parts: string[] = [];+ if (before.paramCount !== after.paramCount) {+ parts.push(`args ${before.paramCount} → ${after.paramCount}`);+ }+ if (before.classification !== after.classification) {+ parts.push(`${before.classification} → ${after.classification}`);+ }+ if (before.permission !== after.permission) {+ parts.push(`permission ${before.permission} → ${after.permission}`);+ }+ if (before.injectAuth !== after.injectAuth) {+ parts.push(`injectAuth ${before.injectAuth} → ${after.injectAuth}`);+ }+ if (before.schema !== after.schema) parts.push("input schema changed");+ if (before.response !== after.response) {+ if (before.response === "none") parts.push("response added");+ else if (after.response === "none") parts.push("response LOST");+ else parts.push("response schema changed");+ }+ lines.push(` ~ ${name}: ${parts.join(", ")}`);+ }+ return lines.join("\n");+}diff --git a/scripts/lib/response-schema.ts b/scripts/lib/response-schema.tsnew file mode 100644index 0000000000..d8f334ab79--- /dev/null+++ b/scripts/lib/response-schema.ts@@ -0,0 +1,289 @@+/**+ * Derives each operation's RESPONSE schema by reflecting the service function's+ * TypeScript return type.+ *+ * The input side comes from zod validators (`validator-to-json-schema.ts`), but+ * nothing declares a response — it is whatever the service returns. Most services+ * `return client.from(...).select(...)`, and supabase-js infers the SELECTED+ * columns from the select string, so the compiler already knows the exact row+ * shape. This reads it back out with ts-morph.+ *+ * Measured over all 1500 exported service functions: 1423 (95%) yield a non-trivial+ * schema, ~10s to walk. The manifest grows 1.3 -> 1.6 MB, and it is gitignored.+ */++import * as fs from "fs";+import * as path from "path";+import { Node, Project, type Type } from "ts-morph";++export type JsonSchema = Record<string, unknown>;++const ROOT = path.resolve(__dirname, "../..");+const ERP_ROOT = path.join(ROOT, "apps/erp");+const MODULES_DIR = path.join(ERP_ROOT, "app/modules");++/**+ * Rows are wide (40+ columns) and embeds nest, so an uncapped walk can emit a+ * megabyte for one operation. Depth 6 covers the deepest real select — a row, an+ * embedded array, an embed of that, and their columns — which is where PostgREST+ * embeds actually stop. Measured: 5 and 6 cost 1.6 MB and 1.7 MB against 1.6 MB at+ * 4, so the cap is not what the size hinges on; capping too SHALLOW is visible,+ * since a truncated branch renders as a column of nulls in the docs sample.+ */+const MAX_DEPTH = 6;+/** A guard against pathological types, not a real limit — real rows sit well under. */+const MAX_PROPERTIES = 120;++/**+ * Peel the layers between the declared return type and the payload a caller sees:+ * `Promise<PostgrestSingleResponse<T>>` and the hand-rolled+ * `Promise<{ data: T | null; error }>` both reduce to `T`.+ *+ * This mirrors `dispatch.server.ts`, which unwraps the Supabase result to `data`+ * plus an optional `count` before returning it — so the schema describes what lands+ * in the response's `data`, not the driver's envelope.+ */+export function unwrapResponseType(type: Type, at: Node): Type {+ let current = type;+ for (let i = 0; i < 5; i++) {+ const name =+ current.getSymbol()?.getName() ?? current.getAliasSymbol()?.getName();+ const args = current.getTypeArguments();++ if ((name === "Promise" || /^Postgrest\w*Response$/.test(name ?? "")) && args.length > 0) {+ current = args[0];+ continue;+ }++ // `{ data: T | null; error: ... }` — the shape services hand-roll.+ const data = current.getProperty("data");+ if (data && current.getProperty("error")) {+ const dataType = data.getTypeAtLocation(at);+ current = stripNullish(dataType);+ continue;+ }++ break;+ }+ return current;+}++function stripNullish(type: Type): Type {+ if (!type.isUnion()) return type;+ const concrete = type+ .getUnionTypes()+ .filter((t) => !t.isNull() && !t.isUndefined());+ return concrete.length === 1 ? concrete[0] : type;+}++/**+ * Walk a TypeScript type into JSON Schema.+ *+ * `at` is the node types are resolved against (the function declaration) — a+ * property's type is only meaningful at a location. `seen` carries the type-text of+ * every ancestor so a self-referential type (a tree node, a row embedding its own+ * table) terminates instead of recursing forever.+ */+export function typeToJsonSchema(+ type: Type,+ at: Node,+ depth = 0,+ seen: ReadonlySet<string> = new Set()+): JsonSchema {+ if (depth > MAX_DEPTH) return {};++ if (type.isString()) return { type: "string" };+ if (type.isNumber()) return { type: "number" };+ if (type.isBoolean()) return { type: "boolean" };+ if (type.isNull() || type.isUndefined()) return { type: "null" };+ if (type.isAny() || type.isUnknown()) return {};+ if (type.isStringLiteral()) {+ return { type: "string", enum: [type.getLiteralValue()] };+ }+ if (type.isNumberLiteral()) {+ return { type: "number", enum: [type.getLiteralValue()] };+ }+ if (type.isBooleanLiteral()) return { type: "boolean" };++ if (type.isArray()) {+ const element = type.getArrayElementType();+ return {+ type: "array",+ items: element ? typeToJsonSchema(element, at, depth + 1, seen) : {}+ };+ }++ if (type.isUnion()) return unionToJsonSchema(type, at, depth, seen);++ if (type.isObject()) {+ const key = type.getText();+ // Cycle: the type is already being expanded further up this branch.+ if (seen.has(key)) return { type: "object" };++ const nextSeen = new Set(seen).add(key);++ // `Record<K, V>` / any index signature. TypeScript reports these as an object+ // with ZERO NAMED PROPERTIES, so a plain property walk emits a bare+ // `{type:"object"}` and the map's value type is lost — that alone accounted for+ // 9 operations with no usable response, plus every Record nested inside one+ // that otherwise worked. `additionalProperties` is the JSON Schema equivalent,+ // and the docs SchemaTable already renders it as `Record<string, …>`.+ const indexValue =+ type.getStringIndexType() ?? type.getNumberIndexType() ?? undefined;+ if (indexValue) {+ return {+ type: "object",+ additionalProperties: typeToJsonSchema(+ indexValue,+ at,+ depth + 1,+ nextSeen+ )+ };+ }++ const properties = type.getProperties();+ if (properties.length === 0) return { type: "object" };+ if (properties.length > MAX_PROPERTIES) return { type: "object" };++ const shape: Record<string, unknown> = {};+ const required: string[] = [];+ for (const property of properties) {+ const propertyType = property.getTypeAtLocation(at);+ shape[property.getName()] = typeToJsonSchema(+ propertyType,+ at,+ depth + 1,+ nextSeen+ );+ if (!property.isOptional()) required.push(property.getName());+ }++ const out: JsonSchema = { type: "object", properties: shape };+ if (required.length > 0) out.required = required;+ return out;+ }++ return {};+}++function unionToJsonSchema(+ type: Type,+ at: Node,+ depth: number,+ seen: ReadonlySet<string>+): JsonSchema {+ const members = type.getUnionTypes();+ const concrete = members.filter((t) => !t.isNull() && !t.isUndefined());+ const nullable = concrete.length !== members.length;++ // A union of string literals is an enum — the single most useful thing this+ // reflection recovers, and invisible in a hand-written response example.+ if (concrete.length > 0 && concrete.every((t) => t.isStringLiteral())) {+ return {+ type: nullable ? ["string", "null"] : "string",+ enum: concrete.map((t) => t.getLiteralValue())+ };+ }++ // `boolean` is internally `true | false`; keep it as one type.+ if (concrete.length > 0 && concrete.every((t) => t.isBooleanLiteral())) {+ return { type: nullable ? ["boolean", "null"] : "boolean" };+ }++ if (concrete.length === 1) {+ const inner = typeToJsonSchema(concrete[0], at, depth, seen);+ if (nullable && typeof inner.type === "string") {+ return { ...inner, type: [inner.type, "null"] };+ }+ return inner;+ }++ // Dedupe: `boolean` is internally `true | false`, so a MIXED union (the `Json`+ // type is the common one — string | number | boolean | object | array) yields two+ // identical `{type:"boolean"}` members. The all-boolean shortcut above only fires+ // when every member is a boolean literal, so mixed unions need this.+ const anyOf = dedupe(+ concrete.map((t) => typeToJsonSchema(t, at, depth + 1, seen))+ );+ if (anyOf.length === 1 && !nullable) return anyOf[0];+ return nullable ? { anyOf: [...anyOf, { type: "null" }] } : { anyOf };+}++function dedupe(schemas: JsonSchema[]): JsonSchema[] {+ const seen = new Set<string>();+ const out: JsonSchema[] = [];+ for (const schema of schemas) {+ const key = JSON.stringify(schema);+ if (seen.has(key)) continue;+ seen.add(key);+ out.push(schema);+ }+ return out;+}++export interface ResponseSchemaIndex {+ /** `{module}_{fn}` → response schema, absent when nothing useful was derived. */+ get(module: string, functionName: string): JsonSchema | null;+ readonly stats: { functions: number; derived: number; empty: number };+}++function isUseful(schema: JsonSchema): boolean {+ const keys = Object.keys(schema);+ if (keys.length === 0) return false;+ // `{ type: "object" }` alone says nothing a reader can use — but the same shape+ // carrying `additionalProperties` is a typed map and does.+ return !(keys.length === 1 && schema.type === "object");+}++/**+ * Reflect every module's service functions once. Loading the TS project is the+ * expensive part (~4s), so it happens here and the result is a plain lookup the+ * synchronous manifest builder can consult.+ */+export function buildResponseSchemaIndex(+ modules: readonly string[]+): ResponseSchemaIndex {+ const project = new Project({+ tsConfigFilePath: path.join(ERP_ROOT, "tsconfig.json"),+ skipAddingFilesFromTsConfig: true+ });++ const sources = modules.flatMap((mod) =>+ [`${mod}.service.ts`, `${mod}.ee.service.ts`, `${mod}.mcp.server.ts`]+ .map((name) => ({ mod, file: path.join(MODULES_DIR, mod, name) }))+ .filter((entry) => fs.existsSync(entry.file))+ .map((entry) => ({ mod: entry.mod, source: project.addSourceFileAtPath(entry.file) }))+ );+ project.resolveSourceFileDependencies();++ const schemas = new Map<string, JsonSchema>();+ const stats = { functions: 0, derived: 0, empty: 0 };++ for (const { mod, source } of sources) {+ for (const fn of source.getFunctions()) {+ if (!fn.isExported()) continue;+ stats.functions++;+ let schema: JsonSchema;+ try {+ schema = typeToJsonSchema(unwrapResponseType(fn.getReturnType(), fn), fn);+ } catch {+ stats.empty++;+ continue;+ }+ if (!isUseful(schema)) {+ stats.empty++;+ continue;+ }+ schemas.set(`${mod}_${fn.getName()}`, schema);+ stats.derived++;+ }+ }++ return {+ get(module, functionName) {+ return schemas.get(`${module}_${functionName}`) ?? null;+ },+ stats+ };+}diff --git a/scripts/lib/service-metadata.ts b/scripts/lib/service-metadata.tsnew file mode 100644index 0000000000..b649471f62--- /dev/null+++ b/scripts/lib/service-metadata.ts@@ -0,0 +1,1172 @@+/**+ * Service metadata parser — the pure core behind the MCP tool manifest and the+ * Carbon API contract.+ *+ * Textually parses every `apps/erp/app/modules/*.service.ts` (+ `.ee` / `.mcp.server`+ * companions) into operation metadata: classification, description, positional+ * service params, the audit fields to inject, the required permission, and a JSON+ * Schema for the input. NO filesystem writes and no process side effects — callers+ * (`scripts/generate-mcp.ts`) own emitting the manifest. Grounded against the+ * long-standing generator logic; the parsing helpers are moved verbatim.+ */++import * as fs from "fs";+import * as path from "path";++import type {+ AuthField,+ Classification,+ ManifestEntry,+ PermissionAction,+ ToolPermission,+} from "@carbon/api";+import { MCP_BLOCKED_TOOL_NAMES } from "../../apps/erp/app/routes/api+/mcp+/lib/mcp-blocked-tools";+import {+ buildResponseSchemaIndex,+ type ResponseSchemaIndex,+} from "./response-schema";+import {+ buildValidatorRegistry,+ CONTEXT_PARAMS,+ type ValidatorRegistry,+} from "./validator-registry";++const ROOT = path.resolve(__dirname, "../..");+const MODULES_DIR = path.join(ROOT, "apps/erp/app/modules");++export const MODULE_LIST = [+ "account",+ "accounting",+ "documents",+ "inventory",+ "invoicing",+ "items",+ "people",+ "production",+ "purchasing",+ "quality",+ "resources",+ "sales",+ "settings",+ "shared",+ "users",+];++const DESCRIPTION_OVERRIDES: Record<string, string> = {+ purchasing_insertPurchaseOrder:+ "Create a new purchase order with all business logic - generates sequence, creates supplier interaction, resolves payment/shipping defaults from supplier. LLM can create a PO with just supplierId.",+ purchasing_updatePurchaseOrder:+ "Update an existing purchase order - handles exchange rate updates when currency changes",+ purchasing_insertSupplierQuote:+ "Create a new supplier quote with all business logic - generates sequence, creates supplier interaction, sets up external link. LLM can create a quote with just supplierId.",+ purchasing_updateSupplierQuote:+ "Update an existing supplier quote - handles exchange rate updates when currency changes",+ sales_insertQuote:+ "Create a new quote with all business logic - generates sequence, creates opportunity, resolves payment/shipping defaults from customer. LLM can create a quote with just customerId.",+ sales_updateQuote:+ "Update an existing quote - handles exchange rate updates when currency changes, syncs customer to opportunity",+ sales_insertSalesOrder:+ "Create a new sales order with all business logic - generates sequence, creates opportunity, resolves payment/shipping defaults from customer. LLM can create a sales order with just customerId.",+ sales_updateSalesOrder:+ "Update an existing sales order - handles exchange rate updates when currency changes, syncs customer to opportunity",+ production_insertJob:+ "Create a new job with all business logic - generates sequence, resolves location, copies method from item, recalculates requirements. LLM can create a job with just itemId and quantity.",+ production_updateJob:+ "Update an existing job - handles priority recalculation when deadline changes",+ inventory_insertStockTransfer:+ "Create a stock transfer with lines. Generates sequence ID automatically.",+ inventory_updateStockTransfer: "Update an existing stock transfer",+ inventory_insertWarehouseTransfer:+ "Create a warehouse transfer between locations. Generates sequence ID automatically.",+ inventory_updateWarehouseTransfer: "Update an existing warehouse transfer",+};++// Per-tool overrides of the auto-computed injectAuth set. The default rule+// (insert* → companyId + createdBy + updatedBy) is wrong for tools that spread+// their argument object straight into an INSERT on an append-only ledger table.+// Those tables now carry an updatedBy column (schema uniformity, migration+// 20260701143512), but by convention it must stay NULL — an "edit" is a new+// offsetting row, never an in-place mutation. Injecting updatedBy would stamp it+// on the ledger row and destroy the "untouched since creation" guarantee, so we+// drop it here. Both tools below insert([data]) where data is built from the+// spread of their injected args:+// - inventory_insertManualInventoryAdjustment → itemLedger+// - accounting_upsertFixedAssetUsageLog → fixedAssetUsageLog+// account_upsertNotificationPreference spreads its argument into an upsert on+// notificationPreference, which (like userModulePreference) carries no+// createdBy/updatedBy columns at all — injecting them breaks the write.+const INJECT_AUTH_OVERRIDES: Record<string, AuthField[]> = {+ inventory_insertManualInventoryAdjustment: ["companyId", "createdBy"],+ accounting_upsertFixedAssetUsageLog: ["companyId", "createdBy"],+ account_upsertNotificationPreference: ["companyId"],+};++// service-module → permission-module. `items` operations are gated by the `parts`+// permission; `account` and `shared` gate only on a valid key of the company (no+// module permission), so they map to null. Every other module is identity.+const PERMISSION_MODULE_MAP: Record<string, string | null> = {+ items: "parts",+ account: null,+ shared: null,+};++// Per-tool permission overrides, for operations whose route gates on a DIFFERENT+// module than their service module (spot-checked against the real routes). Keep+// this hand-curated list small and grounded — each entry needs a verified route.+const PERMISSION_OVERRIDES: Record<string, ToolPermission> = {+ // API-key management is an admin capability: every route in the family —+ // x+/settings+/api-keys.tsx (list loader), api-keys.new.tsx, api-keys.$id.tsx,+ // api-keys.delete.$id.tsx — gates on { update: "users" }, not "settings".+ // Deriving "settings" would let a settings-scoped key mint new API keys.+ settings_getApiKeys: { module: "users", actions: ["update"] },+ settings_upsertApiKey: { module: "users", actions: ["update"] },+ settings_deleteApiKey: { module: "users", actions: ["update"] },+};++// ---------------------------------------------------------------------------+// Types+// ---------------------------------------------------------------------------++interface ParsedParam {+ name: string;+ typeStr: string;+ optional: boolean;+ description?: string;+}++interface ParsedFunction {+ name: string;+ params: ParsedParam[];+}++// ---------------------------------------------------------------------------+// Parsing helpers+// ---------------------------------------------------------------------------++// Comments must be structurally INERT to every scanner below: an unmatched `)`+// inside a `/** [from, to) … */` doc ended a param scan early, and a comma+// inside a `// …composer,` line split a parameter mid-comment — both published+// comment text as schema property names, which strict codegen (Go's+// oapi-codegen) rightly rejects. Returns the index just past a comment starting+// at i, or i when none does.+function skipComment(str: string, i: number): number {+ if (str[i] !== "/") return i;+ if (str[i + 1] === "/") {+ const nl = str.indexOf("\n", i);+ return nl === -1 ? str.length : nl;+ }+ if (str[i + 1] === "*") {+ const end = str.indexOf("*/", i + 2);+ return end === -1 ? str.length : end + 2;+ }+ return i;+}++function findMatchingBrace(content: string, openPos: number): number {+ const open = content[openPos];+ const close = open === "(" ? ")" : open === "{" ? "}" : open === "[" ? "]" : ">";+ let depth = 1;+ let i = openPos + 1;+ while (i < content.length && depth > 0) {+ const j = skipComment(content, i);+ if (j !== i) {+ i = j;+ continue;+ }+ if (content[i] === open) depth++;+ else if (content[i] === close) depth--;+ i++;+ }+ return i - 1;+}++function splitAtTopLevel(str: string, delimiter: string): string[] {+ const parts: string[] = [];+ let depth = 0;+ let current = "";+ for (let i = 0; i < str.length; i++) {+ const j = skipComment(str, i);+ if (j !== i) {+ current += str.slice(i, j);+ i = j - 1;+ continue;+ }+ const ch = str[i];+ if ("({[<".includes(ch)) depth++;+ else if (")}]>".includes(ch) && !isArrowClose(str, i)) depth--;+ if (ch === delimiter && depth === 0) {+ parts.push(current.trim());+ current = "";+ } else {+ current += ch;+ }+ }+ if (current.trim()) parts.push(current.trim());+ return parts;+}++// The `>` in an arrow function (`() => ...`) is not a generic close. Counting it+// as one drives brace depth negative, so every top-level delimiter after the+// first arrow (e.g. a validator field after an `errorMap: () => ({...})`) stops+// splitting — silently truncating a tool's schema to the fields before it.+function isArrowClose(str: string, i: number): boolean {+ return str[i] === ">" && str[i - 1] === "=";+}++/** Index of the first `char` at nesting depth 0, or -1. A defaulted parameter+ * splits on `=`, so that scan skips `=>` and `==`/`!=`/`<=`/`>=`. */+function findTopLevel(str: string, char: ":" | "="): number {+ let depth = 0;+ for (let i = 0; i < str.length; i++) {+ const j = skipComment(str, i);+ if (j !== i) {+ i = j - 1;+ continue;+ }+ const ch = str[i];+ if ("({[<".includes(ch)) depth++;+ else if (")}]>".includes(ch) && !isArrowClose(str, i)) depth--;+ if (ch !== char || depth !== 0) continue;+ if (char === "=") {+ const prev = str[i - 1];+ if (str[i + 1] === ">" || str[i + 1] === "=" || "!<>=".includes(prev)) {+ continue;+ }+ }+ return i;+ }+ return -1;+}++function inferTypeFromDefaultLiteral(literal: string): string {+ const t = literal.trim();+ if (t === "true" || t === "false") return "boolean";+ if (/^-?\d+(\.\d+)?$/.test(t)) return "number";+ if (/^["'`].*["'`]$/.test(t)) return "string";+ return "unknown";+}++// A destructuring pattern is not a name; storing the raw source text put braces and+// newlines into the manifest, so reformatting a signature churned the committed+// digest. The synthetic name only has to avoid `CONTEXT_PARAMS` and the dispatcher's+// `args` branch — nothing else reads a param name for meaning.+function destructuredParamName(raw: string, existing: ParsedParam[]): string {+ if (!raw.startsWith("{")) return raw;+ const base = "destructured";+ if (!existing.some((p) => p.name === base)) return base;+ let i = 2;+ while (existing.some((p) => p.name === `${base}${i}`)) i++;+ return `${base}${i}`;+}++function parseExportedFunctions(content: string): ParsedFunction[] {+ const results: ParsedFunction[] = [];+ const regex = /export\s+(?:async\s+)?function\s+(\w+)\s*\(/g;+ let match;++ while ((match = regex.exec(content)) !== null) {+ const name = match[1];+ const openParen = match.index + match[0].length - 1;+ const closeParen = findMatchingBrace(content, openParen);+ const rawParams = content.substring(openParen + 1, closeParen).trim();++ if (!rawParams) {+ results.push({ name, params: [] });+ continue;+ }++ const paramStrings = splitAtTopLevel(rawParams, ",");+ const params: ParsedParam[] = [];++ for (const p of paramStrings) {+ if (!p) continue;+ // With comment-inert splitting, a param keeps the comment that precedes+ // it: keep a `/** doc */` as its description, drop everything else.+ const doc = p.match(/\/\*\*([\s\S]*?)\*\//);+ const description = doc+ ? doc[1]+ .split("\n")+ .map((line) => line.replace(/^\s*\*?\s?/, "").trim())+ .join(" ")+ .trim() || undefined+ : undefined;+ const stripped = p+ .replace(/\/\*[\s\S]*?\*\//g, "")+ .split("\n")+ .map((line) => line.replace(/\/\/.*$/, ""))+ .join("\n")+ .trim();+ if (!stripped) continue;+ const colonIdx = findTopLevel(stripped, ":");+ if (colonIdx === -1) {+ const eqIdx = findTopLevel(stripped, "=");+ if (eqIdx === -1) {+ params.push({+ name: destructuredParamName(stripped, params),+ typeStr: "unknown",+ optional: false+ });+ } else {+ const paramName = stripped.substring(0, eqIdx).trim();+ const defaultLiteral = stripped.substring(eqIdx + 1).trim();+ params.push({+ name: paramName,+ typeStr: inferTypeFromDefaultLiteral(defaultLiteral),+ optional: true,+ description+ });+ }+ continue;+ }+ const before = stripped.substring(0, colonIdx).trim();+ const optional = before.endsWith("?");+ const rawName = before.replace(/\?$/, "").trim();+ const typeStr = stripped.substring(colonIdx + 1).trim();+ params.push({+ name: destructuredParamName(rawName, params),+ typeStr,+ optional,+ description+ });+ }++ results.push({ name, params });+ }++ return results;+}++// ---------------------------------------------------------------------------+// Type → JSON Schema conversion+// ---------------------------------------------------------------------------++function typeToJsonSchema(typeStr: string): Record<string, unknown> {+ const t = typeStr.trim();++ // Nullable: "Type | null"+ const nullableMatch = t.match(/^(.+?)\s*\|\s*null$/);+ if (nullableMatch) {+ const inner = typeToJsonSchema(nullableMatch[1].trim());+ if (Array.isArray(inner.anyOf)) {+ return { anyOf: [...(inner.anyOf as unknown[]), { type: "null" }] };+ }+ if (inner.type) {+ return { ...inner, type: [inner.type, "null"] };+ }+ return inner;+ }++ // String literal union: "A" | "B" | "C"+ const literalParts = splitAtTopLevel(t, "|").map((s) => s.trim());+ if (literalParts.length > 1 && literalParts.every((p) => /^"[^"]*"$/.test(p))) {+ return {+ type: "string",+ enum: literalParts.map((p) => p.slice(1, -1)),+ };+ }++ // General union: "string | string[]" and friends. MUST run before the+ // array-suffix check below — a union whose last member is an array ends with+ // "[]", and slicing two characters off the whole union recursed on garbage+ // ("string | string"), publishing `any[]` where the type was `string[]`.+ if (literalParts.length > 1) {+ const members: Record<string, unknown>[] = [];+ const seen = new Set<string>();+ for (const part of literalParts) {+ const member = typeToJsonSchema(part);+ const key = JSON.stringify(member);+ if (seen.has(key)) continue;+ seen.add(key);+ members.push(member);+ }+ if (members.length === 1) return members[0];+ return { anyOf: members };+ }++ // Primitives+ if (t === "string") return { type: "string" };+ if (t === "number") return { type: "number" };+ if (t === "boolean") return { type: "boolean" };++ // Arrays+ if (t === "string[]") return { type: "array", items: { type: "string" } };+ if (t === "number[]") return { type: "array", items: { type: "number" } };+ if (t.endsWith("[]")) {+ const inner = typeToJsonSchema(t.slice(0, -2).trim());+ return { type: "array", items: inner };+ }++ // Json type+ if (t === "Json" || t === "Json | null") return {};++ // (typeof X)[number] — enum array reference. Anchored: an unanchored match+ // also fired for any inline object type that merely CONTAINS such a field,+ // collapsing the whole object to a string.+ if (/^\(typeof\s+\w+\)\s*\[number\]$/.test(t)) return { type: "string" };++ // Inline object: { field: Type; ... }+ if (t.startsWith("{")) {+ return parseInlineObjectType(t);+ }++ // GenericQueryFilters & { ... }+ if (t.includes("GenericQueryFilters")) {+ const base: Record<string, unknown> = {+ type: "object",+ properties: {+ limit: { type: "integer", default: 100 },+ offset: { type: "integer", default: 0 },+ },+ };+ const intersectMatch = t.match(/&\s*(\{.+\})\s*$/s);+ if (intersectMatch) {+ const extra = parseInlineObjectType(intersectMatch[1]);+ if (extra.properties) {+ base.properties = {+ ...(base.properties as Record<string, unknown>),+ ...(extra.properties as Record<string, unknown>),+ };+ }+ }+ return base;+ }++ // Fallback+ return {};+}++function parseInlineObjectType(typeStr: string): Record<string, unknown> {+ let inner = typeStr.trim();+ if (inner.startsWith("{")) inner = inner.slice(1);+ if (inner.endsWith("}")) inner = inner.slice(0, -1);+ inner = inner.trim();++ if (!inner) return { type: "object", properties: {} };++ const properties: Record<string, unknown> = {};+ const required: string[] = [];++ const fields = splitObjectFields(inner);++ for (const field of fields) {+ // A `/** doc */` above a field is its description — capture it for the+ // schema, then strip EVERY comment form before reading the property name.+ // Absorbing one into the key published names like+ // `"/** Policy enforced… */\n expiredEntityPolicy"`, which strict codegen+ // (Go's oapi-codegen) rightly rejects.+ let description: string | undefined;+ const doc = field.match(/\/\*\*([\s\S]*?)\*\//);+ if (doc) {+ description =+ doc[1]+ .split("\n")+ .map((line) => line.replace(/^\s*\*?\s?/, "").trim())+ .join(" ")+ .trim() || undefined;+ }+ const f = field+ .replace(/\/\*[\s\S]*?\*\//g, "")+ .split("\n")+ .map((line) => line.replace(/\/\/.*$/, ""))+ .join("\n")+ .trim();+ if (!f) continue;++ // Anchor on the field's OWN name and colon. Searching for the first `?:`+ // anywhere found the one inside a NESTED object literal first+ // (`address: { addressLine1?: … }`), publishing the property name+ // "address: {\n addressLine1" — which strict codegen rightly rejects.+ const head = f.match(/^([A-Za-z_$][\w$]*)\s*(\?)?\s*:/);+ if (!head) continue;+ const fieldName = head[1];+ const optional = head[2] === "?";+ if (CONTEXT_PARAMS.has(fieldName)) continue;++ const fieldType = f+ .slice(head[0].length)+ .trim()+ .replace(/;$/, "")+ .trim();++ const fieldSchema = typeToJsonSchema(fieldType);+ properties[fieldName] = description+ ? { ...fieldSchema, description }+ : fieldSchema;+ if (!optional) required.push(fieldName);+ }++ const schema: Record<string, unknown> = { type: "object", properties };+ if (required.length > 0) schema.required = required;+ return schema;+}++function splitObjectFields(inner: string): string[] {+ const fields: string[] = [];+ let depth = 0;+ let current = "";++ for (let i = 0; i < inner.length; i++) {+ const j = skipComment(inner, i);+ if (j !== i) {+ current += inner.slice(i, j);+ i = j - 1;+ continue;+ }+ const ch = inner[i];+ if ("({[<".includes(ch)) depth++;+ else if (")}]>".includes(ch) && !isArrowClose(inner, i)) depth--;++ if (ch === ";" && depth === 0) {+ fields.push(current.trim());+ current = "";+ } else {+ current += ch;+ }+ }+ if (current.trim()) fields.push(current.trim());+ return fields;+}++// ---------------------------------------------------------------------------+// Validator resolution+// ---------------------------------------------------------------------------++function parseValidatorFields(+ validatorName: string,+ modelsContent: string,+ seen: Set<string> = new Set()+): Record<string, unknown> | null {+ // Cycle guard for mutually-referential validators.+ if (seen.has(validatorName)) return null;+ seen = new Set(seen).add(validatorName);++ const rhs = extractValidatorRhs(validatorName, modelsContent);+ if (rhs === null) return null;++ const properties: Record<string, unknown> = {};+ const required: string[] = [];+ const mergeIn = (sub: Record<string, unknown> | null) => {+ if (!sub) return;+ Object.assign(properties, sub.properties as Record<string, unknown>);+ for (const r of (sub.required as string[] | undefined) ?? []) {+ if (!required.includes(r)) required.push(r);+ }+ };++ // Base validators pulled in by `Base.merge(...)` / `Base.extend(...)` — resolve+ // each referenced `*Validator` (same file) and fold its fields in first, so the+ // extension below can override. This is what makes+ // `applyX(itemValidator.merge(z.object({...})))` resolvable instead of opaque.+ const refs = new Set(+ (rhs.match(/\b\w+Validator\b/g) ?? []).filter((n) => n !== validatorName)+ );+ for (const ref of refs) {+ mergeIn(parseValidatorFields(ref, modelsContent, seen));+ }++ // This validator's own object literal — for a `.merge(z.object({...}))` /+ // wrapped chain the FIRST z.object is the extension; for a plain+ // `z.object({...})` it is the whole thing. Wrappers (`applyX(...)`, `.refine`,+ // `.superRefine`) are transparent to this scan.+ mergeIn(parseFirstZObject(rhs));++ if (Object.keys(properties).length === 0) return null;+ const result: Record<string, unknown> = { type: "object", properties };+ if (required.length > 0) result.required = required;+ return result;+}++// The assignment expression of `export const {name} = <expr>;`, captured to the+// first top-level `;` (arrow-guarded) so a `*Validator` reference or `z.object`+// from a later declaration is never pulled in.+function extractValidatorRhs(+ validatorName: string,+ modelsContent: string+): string | null {+ const regex = new RegExp(`export\\s+const\\s+${validatorName}\\s*=\\s*`);+ const match = regex.exec(modelsContent);+ if (!match) return null;+ const start = match.index + match[0].length;++ let depth = 0;+ for (let i = start; i < modelsContent.length; i++) {+ const ch = modelsContent[i];+ if ("({[<".includes(ch)) depth++;+ else if (")}]>".includes(ch) && !isArrowClose(modelsContent, i)) depth--;+ else if (ch === ";" && depth === 0) {+ return modelsContent.substring(start, i);+ }+ }+ return modelsContent.substring(start);+}++// Parse the first `z.object({ ... })` in an expression into a JSON-Schema object.+function parseFirstZObject(expr: string): Record<string, unknown> | null {+ const idx = expr.indexOf("z.object(");+ if (idx === -1) return null;+ const braceStart = expr.indexOf("{", idx);+ if (braceStart === -1) return null;+ const braceEnd = findMatchingBrace(expr, braceStart);+ const inner = expr.substring(braceStart + 1, braceEnd).trim();++ const properties: Record<string, unknown> = {};+ const required: string[] = [];++ // Validator fields are comma-separated, not semicolon-separated+ const fields = splitAtTopLevel(inner, ",");++ for (const field of fields) {+ const f = field.trim();+ if (!f || f.startsWith("//")) continue;++ const colonMatch = f.match(/^(\w+)\s*:/);+ if (!colonMatch) continue;+ const fieldName = colonMatch[1];++ if (CONTEXT_PARAMS.has(fieldName)) continue;++ const zodExpr = f.substring(colonMatch[0].length).trim();+ const schema = zodExprToJsonSchema(zodExpr);+ const isOptional =+ zodExpr.includes(".optional()") ||+ zodExpr.includes(".nullable()") ||+ zodExpr.startsWith("zfd.text(") ||+ zodExpr.startsWith("zfd.numeric(") ||+ zodExpr.includes(".default(");++ properties[fieldName] = schema;+ if (!isOptional) required.push(fieldName);+ }++ if (Object.keys(properties).length === 0) return null;+ const result: Record<string, unknown> = { type: "object", properties };+ if (required.length > 0) result.required = required;+ return result;+}++function zodExprToJsonSchema(expr: string): Record<string, unknown> {+ const e = expr.trim();++ if (e.includes("z.enum(")) {+ const enumMatch = e.match(/z\.enum\(\[([^\]]+)\]\)/);+ if (enumMatch) {+ const values = enumMatch[1]+ .split(",")+ .map((s) => s.trim().replace(/^["']|["']$/g, ""))+ .filter(Boolean);+ return { type: "string", enum: values };+ }+ }++ if (e.startsWith("z.array(")) {+ // Resolve the element schema so the array is well-formed rather than a bare+ // `{type:"array"}` a caller can't fill.+ const open = e.indexOf("(");+ const close = findMatchingBrace(e, open);+ const inner = e.substring(open + 1, close).trim();+ return { type: "array", items: inner ? zodExprToJsonSchema(inner) : {} };+ }+ if (e.includes("z.number()")) return { type: "number" };+ if (e.includes("z.boolean()")) return { type: "boolean" };+ if (e.includes("z.string()") || e.startsWith("zfd.text("))+ return { type: "string" };+ if (e.includes("z.any()")) return {};+ if (e.startsWith("zfd.numeric(")) return { type: "number" };+ if (e.startsWith("z.preprocess(")) {+ // A preprocessed enum whose values aren't an inline array can't be+ // enumerated (the top-of-function z.enum check already ran on this same+ // expr), so treat it as a string. Recursing on `e` here looped forever.+ if (e.includes("z.enum(")) return { type: "string" };+ if (e.includes("z.number()")) return { type: "number" };+ return { type: "string" };+ }++ return { type: "string" };+}++// ---------------------------------------------------------------------------+// Classification, auth & permission+// ---------------------------------------------------------------------------++function classifyFunction(+ name: string,+ content?: string+): Classification {+ if (/^delete/.test(name)) return "DESTRUCTIVE";+ // Require a camelCase boundary after the read prefix so a mutating name that merely starts with+ // those letters is not misread as a reader — e.g. `issueMaterial` ("is"+lowercase) is a WRITE,+ // while `isBlocked`/`getJob` ("is"/"get"+uppercase) stay READ.+ if (/^(get|list|fetch|search|find|count|check|is|has|compute)(?![a-z])/.test(name))+ return "READ";+ // Destructive-by-omission: a write whose body deletes rows (e.g. the+ // delete-then-reinsert `upsert*Prices` rewrite) can silently drop data the+ // caller didn't include. Flag it so the client treats it as destructive, even+ // though its name says `upsert`/`update`. injectAuth stays name-based below, so+ // the insert branch still gets its createdBy.+ if (content && functionBodyDeletes(content, name)) return "DESTRUCTIVE";+ return "WRITE";+}++// True when the function body issues a row delete (supabase `.delete(` or Kysely+// `.deleteFrom(`). Comment/URL-safe via stripComments.+function functionBodyDeletes(content: string, funcName: string): boolean {+ const body = extractFunctionBody(content, funcName);+ if (body === null) return false;+ const stripped = stripComments(body);+ return /\.delete\s*\(/.test(stripped) || /\.deleteFrom\s*\(/.test(stripped);+}++function extractFunctionBody(content: string, funcName: string): string | null {+ const regex = new RegExp(+ `export\\s+(?:async\\s+)?function\\s+${funcName}\\s*\\(`+ );+ const match = regex.exec(content);+ if (!match) return null;+ const closeParen = findMatchingBrace(+ content,+ match.index + match[0].length - 1+ );+ const nextExport = content.indexOf("\nexport ", closeParen);+ return content.substring(+ closeParen,+ nextExport === -1 ? content.length : nextExport+ );+}++function computeInjectAuth(+ funcName: string,+ classification: Classification+): AuthField[] {+ const lower = funcName.toLowerCase();+ // Only READ tools take no audit fields. A DESTRUCTIVE label is just a caller+ // hint — a delete-then-reinsert `upsert*` still inserts rows and needs its+ // createdBy/updatedBy, so audit injection is keyed off the name verb, not the+ // classification. A genuine `delete*` matches neither verb group and falls+ // through to companyId-only.+ if (classification === "READ") {+ return ["companyId"];+ }+ if (+ /^(upsert|create|insert|add|new|copy|duplicate|generate)/.test(lower)+ ) {+ return ["companyId", "createdBy", "updatedBy"];+ }+ if (+ /^(update|modify|set|change|edit|approve|reject|finalize|toggle|move|reorder|recalculate|sync|favorite|unfavorite|send|release|close|convert|run)/.test(+ lower+ )+ ) {+ return ["companyId", "updatedBy"];+ }+ return ["companyId"];+}++// The permission an API-key caller must hold. `module` follows the service→permission+// map; `actions` are derived from the operation verb, mirroring `computeInjectAuth`'s+// verb groups but split into CRUD actions. An unmatched write verb (issue/post/ship/+// complete/...) requires `update` — the conservative mutation gate.+function derivePermission(+ toolName: string,+ mod: string,+ funcName: string,+ classification: Classification+): ToolPermission {+ if (PERMISSION_OVERRIDES[toolName]) return PERMISSION_OVERRIDES[toolName];++ const permModule =+ mod in PERMISSION_MODULE_MAP ? PERMISSION_MODULE_MAP[mod] : mod;++ return { module: permModule, actions: permissionActionsFor(funcName, classification) };+}++function permissionActionsFor(+ funcName: string,+ classification: Classification+): PermissionAction[] {+ if (classification === "READ") return ["view"];+ const lower = funcName.toLowerCase();+ if (/^upsert/.test(lower)) return ["create", "update"];+ if (/^delete/.test(lower)) return ["delete"];+ if (/^(insert|create|add|new|copy|duplicate|generate)/.test(lower))+ return ["create"];+ // Everything else that writes — the explicit update group plus unmatched+ // mutation verbs (issue/post/ship/receive/complete/...) — gates on update.+ return ["update"];+}++// Services that pick insert-vs-update this way are the only ones MCP can't infer.+function usesCreatedByDiscriminator(+ content: string,+ funcName: string+): boolean {+ const body = extractFunctionBody(content, funcName);+ if (body === null) return false;+ return stripComments(body).includes('"createdBy" in');+}++// The `:` guard keeps `https://` intact.+function stripComments(source: string): string {+ return source+ .replace(/\/\*[\s\S]*?\*\//g, "")+ .replace(/(^|[^:])\/\/.*$/gm, "$1");+}++function addOperationArg(schema: Record<string, unknown>): void {+ const properties = (schema.properties ?? {}) as Record<string, unknown>;+ properties._operation = {+ type: "string",+ enum: ["create", "update"],+ description:+ "Required. 'create' inserts a new record, 'update' modifies the existing record with this id.",+ };+ schema.properties = properties;+ const required = ((schema.required as string[] | undefined) ?? []).slice();+ if (!required.includes("_operation")) required.push("_operation");+ schema.required = required;+}++function generateDescription(funcName: string): string {+ return funcName+ .replace(/([A-Z])/g, " $1")+ .trim()+ .toLowerCase();+}++// ---------------------------------------------------------------------------+// Schema building for a function+// ---------------------------------------------------------------------------++function buildToolSchema(+ func: ParsedFunction,+ modelsContent: string | null,+ ctx: SchemaBuildContext = {}+): { schema: Record<string, unknown>; paramCount: number } {+ const userParams = func.params.filter((p) => !CONTEXT_PARAMS.has(p.name));++ if (userParams.length === 0) {+ return { schema: { type: "object", properties: {} }, paramCount: 0 };+ }++ // Single object param — flatten its fields into the schema+ if (userParams.length === 1) {+ const param = userParams[0];++ // Check for validator reference: z.infer<typeof validatorName>. Skip when the+ // type is an inline object literal (`{ ... }`) that merely CONTAINS a nested+ // `z.infer<...>` field — that object should be flattened, not replaced by the+ // nested schema.+ const trimmedType = param.typeStr.trim();+ const isInlineObject = trimmedType.startsWith("{");+ // The regex is unanchored, so it also matches a `z.infer<…>` NESTED inside a+ // wrapper (`lines: (Omit<z.infer<…>> & {…})[]`) — returning the validator's+ // schema verbatim there publishes one line's fields flat and drops the array.+ // Array-suffixed or parenthesized types fall through to typeToJsonSchema.+ const isWrappedType = trimmedType.endsWith("[]") || trimmedType.startsWith("(");+ const validatorMatch =+ isInlineObject || isWrappedType+ ? null+ : param.typeStr.match(/z\.infer<typeof\s+(\w+)>/);+ if (validatorMatch) {+ const validatorName = validatorMatch[1];++ // Preferred path: the REAL validator, converted by zod itself. Carries enum+ // values, numeric bounds and nested shapes the source-text parser cannot see.+ const native = ctx.validators?.getSchema(ctx.module ?? "", validatorName);+ if (native) {+ ctx.onResolved?.(validatorName, "native");+ const propCount = Object.keys(+ (native.properties as Record<string, unknown>) || {}+ ).length;+ return { schema: native, paramCount: propCount };+ }++ // Fallback: parse the validator's source text. Reached when the module failed+ // to load or zod could not represent the validator — never a silent downgrade,+ // the caller records it.+ if (modelsContent) {+ const resolved = parseValidatorFields(validatorName, modelsContent);+ if (resolved) {+ ctx.onResolved?.(validatorName, "textual");+ const propCount = Object.keys(+ (resolved.properties as Record<string, unknown>) || {}+ ).length;+ return { schema: resolved, paramCount: propCount };+ }+ }+ ctx.onResolved?.(validatorName, "unresolved");+ }++ // `(typeof someConstArray)[number]` — a union of string literals. The textual+ // parser flattens these to a bare "string"; the loaded const array gives the+ // real values.+ const constArrayMatch = param.typeStr.match(+ /^\(?typeof\s+(\w+)\)?\[number\]$/+ );+ if (constArrayMatch) {+ const values = ctx.validators?.getConstArray(+ ctx.module ?? "",+ constArrayMatch[1]+ );+ if (values) {+ return {+ schema: {+ type: "object",+ properties: { [param.name]: { type: "string", enum: values } },+ required: param.optional ? undefined : [param.name],+ },+ paramCount: 1,+ };+ }+ }++ // Inline object type — flatten its fields to the top level. An+ // array-of-objects (`{...}[]`) can't be flattened, so wrap it under the+ // param name instead (typeToJsonSchema returns `{type:"array",...}`).+ if (param.typeStr.trim().startsWith("{")) {+ const resolved = typeToJsonSchema(param.typeStr);+ if (resolved.type === "array") {+ const schema: Record<string, unknown> = {+ type: "object",+ properties: { [param.name]: resolved },+ required: param.optional ? undefined : [param.name],+ };+ return { schema, paramCount: 1 };+ }+ const propCount = Object.keys(+ (resolved.properties as Record<string, unknown>) || {}+ ).length;+ return { schema: resolved, paramCount: propCount };+ }++ // GenericQueryFilters+ if (param.typeStr.includes("GenericQueryFilters")) {+ const innerSchema = typeToJsonSchema(param.typeStr);+ const schema: Record<string, unknown> = {+ type: "object",+ properties: { [param.name]: innerSchema },+ };+ const propCount = Object.keys(+ (innerSchema.properties as Record<string, unknown>) || {}+ ).length;+ return { schema, paramCount: propCount };+ }++ // Simple primitive param+ const propSchema = typeToJsonSchema(param.typeStr);+ const schema: Record<string, unknown> = {+ type: "object",+ properties: {+ [param.name]: param.description+ ? { ...propSchema, description: param.description }+ : propSchema,+ },+ required: param.optional ? undefined : [param.name],+ };+ return { schema, paramCount: 1 };+ }++ // Multiple params — each becomes a property (or flattened if inline object)+ const properties: Record<string, unknown> = {};+ const required: string[] = [];+ for (const param of userParams) {+ // typeToJsonSchema handles inline objects AND arrays-of-objects (`{...}[]`),+ // checking the `[]` suffix before the `{` prefix. Calling parseInlineObjectType+ // directly here dropped the suffix, publishing an array param as a bare object.+ const propSchema = typeToJsonSchema(param.typeStr);+ properties[param.name] = param.description+ ? { ...propSchema, description: param.description }+ : propSchema;+ if (!param.optional) required.push(param.name);+ }++ const schema: Record<string, unknown> = { type: "object", properties };+ if (required.length > 0) schema.required = required;+ return { schema, paramCount: Object.keys(properties).length };+}++function loadModelsContent(mod: string): string | null {+ const modelsPath = path.join(MODULES_DIR, mod, `${mod}.models.ts`);+ if (fs.existsSync(modelsPath)) {+ return fs.readFileSync(modelsPath, "utf-8");+ }+ // Fall back to the `.ee`-licensed variant (see root LICENSE) when a module+ // keeps its single models file under that name.+ const eeModelsPath = path.join(MODULES_DIR, mod, `${mod}.ee.models.ts`);+ if (fs.existsSync(eeModelsPath)) {+ return fs.readFileSync(eeModelsPath, "utf-8");+ }+ // Try shared models for cross-module validators+ const sharedPath = path.join(MODULES_DIR, "shared", "index.ts");+ if (fs.existsSync(sharedPath)) {+ return fs.readFileSync(sharedPath, "utf-8");+ }+ return null;+}++// ---------------------------------------------------------------------------+// Public API+// ---------------------------------------------------------------------------++/** How a `z.infer<typeof X>` param's schema was obtained, for the accuracy report. */+export type ValidatorResolution = "native" | "textual" | "unresolved";++/** Per-module state threaded into `buildToolSchema`. */+interface SchemaBuildContext {+ module?: string;+ validators?: ValidatorRegistry;+ onResolved?: (validatorName: string, how: ValidatorResolution) => void;+}++export interface BuildOptions {+ /** Optional per-module progress callback (module name, tool count). */+ onModule?: (mod: string, count: number) => void;+ /**+ * Pre-converted validators. When absent every `z.infer<typeof X>` param falls+ * back to source-text parsing, which is the long-standing behavior — so callers+ * that cannot run the async loader still get a manifest.+ */+ validators?: ValidatorRegistry;+ /** Reflected response schemas, keyed `{module}_{fn}`. Absent = inputs only. */+ responses?: ResponseSchemaIndex;+ /** Called once per `z.infer` param with how its schema was resolved. */+ onValidatorResolved?: (+ toolName: string,+ validatorName: string,+ how: ValidatorResolution+ ) => void;+}++/**+ * Parse every module's service file(s) into the full operation manifest. Pure —+ * reads source files, returns metadata, writes nothing.+ */+export function buildAllToolMetadata(opts: BuildOptions = {}): ManifestEntry[] {+ const allTools: ManifestEntry[] = [];++ for (const mod of MODULE_LIST) {+ let serviceFile = path.join(MODULES_DIR, mod, `${mod}.service.ts`);+ if (!fs.existsSync(serviceFile)) {+ // Fall back to the `.ee`-licensed variant (see root LICENSE) when a+ // module keeps its single service file under that name (e.g.+ // accounting.ee.service.ts).+ const eeServiceFile = path.join(MODULES_DIR, mod, `${mod}.ee.service.ts`);+ if (!fs.existsSync(eeServiceFile)) {+ console.warn(` ⚠ Service file not found: ${serviceFile}`);+ continue;+ }+ serviceFile = eeServiceFile;+ }++ let content = fs.readFileSync(serviceFile, "utf-8");+ const modelsContent = loadModelsContent(mod);+ const functions = parseExportedFunctions(content);++ // A module may expose MCP tools from a server-only companion file+ // (`{mod}.mcp.server.ts`) when those functions must import `*.server`+ // modules and therefore cannot live in the client-reachable service file.+ const mcpServerFile = path.join(MODULES_DIR, mod, `${mod}.mcp.server.ts`);+ if (fs.existsSync(mcpServerFile)) {+ const mcpServerContent = fs.readFileSync(mcpServerFile, "utf-8");+ content = `${content}\n${mcpServerContent}`;+ functions.push(...parseExportedFunctions(mcpServerContent));+ }++ let toolCount = 0;++ for (const func of functions) {+ const toolName = `${mod}_${func.name}`;+ if (MCP_BLOCKED_TOOL_NAMES.includes(toolName)) continue;++ const classification = classifyFunction(func.name, content);+ const injectAuth =+ INJECT_AUTH_OVERRIDES[toolName] ||+ computeInjectAuth(func.name, classification);+ const description =+ DESCRIPTION_OVERRIDES[toolName] || generateDescription(func.name);+ const serviceParams = func.params.map((p) => p.name);+ const permission = derivePermission(+ toolName,+ mod,+ func.name,+ classification+ );+ const { schema, paramCount } = buildToolSchema(func, modelsContent, {+ module: mod,+ validators: opts.validators,+ onResolved: (validatorName, how) =>+ opts.onValidatorResolved?.(toolName, validatorName, how),+ });+ if (+ injectAuth.includes("createdBy") &&+ usesCreatedByDiscriminator(content, func.name)+ ) {+ addOperationArg(schema);+ }++ const responseSchema = opts.responses?.get(mod, func.name) ?? undefined;++ allTools.push({+ name: toolName,+ module: mod,+ classification,+ description,+ paramCount,+ serviceParams,+ injectAuth,+ permission,+ schema,+ ...(responseSchema ? { responseSchema } : {}),+ });+ toolCount++;+ }++ opts.onModule?.(mod, toolCount);+ }++ return allTools;+}++/** How each `z.infer` param's schema was resolved, per tool. */+export interface ValidatorResolutionRecord {+ toolName: string;+ validatorName: string;+ how: ValidatorResolution;+}++export interface BuildWithValidatorsResult {+ tools: ManifestEntry[];+ registryStats: ValidatorRegistry["stats"];+ responseStats: ResponseSchemaIndex["stats"];+ resolutions: ValidatorResolutionRecord[];+}++/**+ * The production entry point: load and convert the real validators, then build the+ * manifest against them. Falls back per-validator to source-text parsing, so a+ * module that fails to load degrades exactly one module's schemas rather than the+ * whole run — and `registryStats` / `resolutions` report every such case.+ */+export async function buildAllToolMetadataWithValidators(+ opts: Omit<BuildOptions, "validators"> = {}+): Promise<BuildWithValidatorsResult> {+ const validators = await buildValidatorRegistry(MODULE_LIST);+ const responses = buildResponseSchemaIndex(MODULE_LIST);+ const resolutions: ValidatorResolutionRecord[] = [];++ const tools = buildAllToolMetadata({+ ...opts,+ validators,+ responses,+ onValidatorResolved: (toolName, validatorName, how) => {+ resolutions.push({ toolName, validatorName, how });+ opts.onValidatorResolved?.(toolName, validatorName, how);+ },+ });++ return {+ tools,+ registryStats: validators.stats,+ responseStats: responses.stats,+ resolutions,+ };+}diff --git a/scripts/lib/stubs/lingui-macro.mjs b/scripts/lib/stubs/lingui-macro.mjsnew file mode 100644index 0000000000..af6e1322df--- /dev/null+++ b/scripts/lib/stubs/lingui-macro.mjs@@ -0,0 +1,19 @@+// Inert stand-in for the Lingui macro packages (`@lingui/react/macro`,+// `@lingui/core/macro`, `@lingui/macro`), aliased in by `validator-loader.ts`.+//+// Those are COMPILE-TIME macros: the real transform runs in the app's Vite+// pipeline. The validator loader pulls a module's `{module}.models.ts`, which+// transitively reaches UI components that import them — but it only ever reads+// zod validator objects, never renders. Without this the SSR loader externalizes+// the real (CJS) macro packages and dies on `Named export 'Trans' not found`.+export const useLingui = () => ({ t: (s) => String(s), i18n: {} });+export const Trans = () => null;+export const Plural = () => null;+export const Select = () => null;+export const SelectOrdinal = () => null;+export const msg = (s) => s;+export const t = (s) => String(s);+export const plural = (s) => s;+export const select = (s) => s;+export const selectOrdinal = (s) => s;+export default {};diff --git a/scripts/lib/validator-loader.ts b/scripts/lib/validator-loader.tsnew file mode 100644index 0000000000..608a97ba6e--- /dev/null+++ b/scripts/lib/validator-loader.ts@@ -0,0 +1,151 @@+/**+ * Loads the real zod validators out of `apps/erp/app/modules/{mod}/{mod}.models.ts`+ * so the manifest generator can convert them with native `z.toJSONSchema` instead of+ * regex-parsing validator source text.+ *+ * ## Why a Vite SSR server and not a plain `import()`+ *+ * Measured on this repo (2026-09-05) — a bare dynamic `import()` of the models files+ * fails for 14 of 15 modules, and each transport fails differently:+ *+ * - **ESM `import()`** — dies on `Named export 'textToTiptap' not found` for+ * `@carbon/utils` (ESM named-export analysis through the workspace package's+ * `export *` chain) and on `Unknown file extension ".css"` (a UI dep reached+ * transitively).+ * - **CJS `require()`** — clears both of those, then dies on+ * `Top-level await is currently not supported with the "cjs" output format`+ * (`@carbon/react`'s CodeBlock). CJS is also the wrong target for zod v4, whose+ * CJS build is both larger and — critically — would be a SECOND zod instance.+ *+ * Vite's SSR loader handles all of it natively (TS, the `~` alias, CSS, ESM ++ * top-level await), which is unsurprising: it is the same resolution the app itself+ * runs under.+ *+ * ## The single-zod-instance invariant (load-bearing)+ *+ * `z.toJSONSchema` dispatches on zod's internal class identity, so a validator built+ * by a DIFFERENT copy of zod converts wrong or throws. `ssr.external: ["zod",+ * "zod-form-data"]` keeps those two out of Vite's transform pipeline, so the loaded+ * models resolve the exact same ESM zod singleton this process imported. Do not+ * remove that external, and do not switch the loader to CJS.+ *+ * Verified: 15/15 modules load, 406 validators found, 406/406 convert, 0 throws.+ */++import * as fs from "fs";+import * as path from "path";+import type { z } from "zod";++const ROOT = path.resolve(__dirname, "../..");+const ERP_ROOT = path.join(ROOT, "apps/erp");+const MODULES_DIR = path.join(ERP_ROOT, "app/modules");+const LINGUI_STUB = path.join(__dirname, "stubs/lingui-macro.mjs");++/**+ * `@carbon/env` validates required vars at MODULE LOAD (see+ * `.claude/rules/environment-configuration.md`), and the models files reach it+ * transitively. This is a build-time codegen script with no runtime behavior, so+ * placeholders are set for any var that is not already present — never overriding a+ * real one, so running under a populated `.env.local` is unaffected.+ */+const ENV_PLACEHOLDERS: Record<string, string> = {+ INNGEST_SIGNING_KEY: "placeholder",+ INNGEST_EVENT_KEY: "placeholder",+ INNGEST_DEV: "1",+ SUPABASE_URL: "http://localhost:54321",+ SUPABASE_ANON_KEY: "placeholder",+ SUPABASE_SERVICE_ROLE_KEY: "placeholder",+ SUPABASE_DB_URL: "postgres://placeholder",+ REDIS_URL: "redis://localhost:6379",+ SESSION_SECRET: "placeholder",+ VERCEL_URL: "localhost",+ POSTHOG_API_HOST: "http://localhost",+ POSTHOG_PROJECT_PUBLIC_KEY: "placeholder",+ RESEND_API_KEY: "re_placeholder",+};++function applyEnvPlaceholders(): void {+ for (const [key, value] of Object.entries(ENV_PLACEHOLDERS)) {+ if (!process.env[key]) process.env[key] = value;+ }+}++/** Absolute path to a module's models file (`.models.ts`, else the `.ee` variant). */+export function modelsPathFor(mod: string): string | null {+ for (const name of [`${mod}.models.ts`, `${mod}.ee.models.ts`]) {+ const candidate = path.join(MODULES_DIR, mod, name);+ if (fs.existsSync(candidate)) return candidate;+ }+ return null;+}++/** Everything a module's models file exports, plus the failure reason when it didn't load. */+export interface LoadedModule {+ /** Exported name → value, for every export (validators AND const arrays). */+ exports: Record<string, unknown>;+ /** Present only when the module failed to load; `exports` is then empty. */+ error?: string;+}++export interface ValidatorLoader {+ /** Load one module's models file. Never throws — failures come back as `error`. */+ load(mod: string): Promise<LoadedModule>;+ /** Shut the Vite server down. Always call this, or the process will not exit. */+ close(): Promise<void>;+}++/**+ * Boot a Vite SSR server configured to resolve the ERP app's module graph.+ * `vite` is imported lazily so importing this file stays cheap for callers that+ * never load validators.+ */+export async function createValidatorLoader(): Promise<ValidatorLoader> {+ applyEnvPlaceholders();++ const { createServer } = await import("vite");+ const server = await createServer({+ root: ERP_ROOT,+ // The app's own vite.config.ts pulls plugins (React Router, lingui) that are+ // irrelevant here and slow to boot; resolve is configured explicitly instead.+ configFile: false,+ logLevel: "silent",+ resolve: {+ alias: {+ "~": path.join(ERP_ROOT, "app"),+ "@lingui/react/macro": LINGUI_STUB,+ "@lingui/core/macro": LINGUI_STUB,+ "@lingui/macro": LINGUI_STUB,+ },+ },+ server: { middlewareMode: true, watch: null },+ optimizeDeps: { noDiscovery: true },+ // See the single-zod-instance note in the file header — load-bearing.+ ssr: { external: ["zod", "zod-form-data"] },+ });++ return {+ async load(mod: string): Promise<LoadedModule> {+ const entry = modelsPathFor(mod);+ if (!entry) return { exports: {}, error: `no models file for "${mod}"` };+ try {+ const loaded = await server.ssrLoadModule(entry);+ return { exports: loaded as Record<string, unknown> };+ } catch (err) {+ const message = err instanceof Error ? err.message : String(err);+ return { exports: {}, error: message.split("\n")[0] };+ }+ },+ async close() {+ await server.close();+ },+ };+}++/** True when `value` is a zod schema built by THIS process's zod (see header). */+export function isZodSchema(value: unknown): value is z.ZodType {+ return (+ typeof value === "object" &&+ value !== null &&+ "_zod" in (value as Record<string, unknown>)+ );+}diff --git a/scripts/lib/validator-registry.ts b/scripts/lib/validator-registry.tsnew file mode 100644index 0000000000..fe622f61b4--- /dev/null+++ b/scripts/lib/validator-registry.ts@@ -0,0 +1,184 @@+/**+ * Converts every module's zod validators once, up front, into a synchronous lookup+ * the manifest generator can consult while parsing service files.+ *+ * `buildAllToolMetadata` is sync (and worth keeping that way — it is the pure,+ * testable core). Loading validators is inherently async, so the async work happens+ * here and the result is handed in as data.+ */++import type { z } from "zod";+import { createValidatorLoader, isZodSchema } from "./validator-loader";+import {+ type JsonSchema,+ validatorToJsonSchema,+} from "./validator-to-json-schema";++/**+ * Auth/tenancy fields the caller never supplies — they are injected server-side+ * from the authenticated context (`injectAuth`). They exist on the validators+ * because forms submit them, but publishing them in the manifest would invite a+ * caller to set `companyId`.+ *+ * Shared with the textual parser in `service-metadata.ts`: a validator resolved+ * natively and the same one resolved textually must strip the same set, so this is+ * the single copy.+ *+ * `eliminationClient` is a second Supabase client for consolidation reads. Left out+ * of this set it becomes a required field no caller can express.+ */+export const CONTEXT_PARAMS = new Set([+ "client",+ "db",+ "companyId",+ "userId",+ "createdBy",+ "updatedBy",+ "companyGroupId",+ "eliminationClient",+]);++/** A module whose validators are reused across modules when a local lookup misses. */+const FALLBACK_MODULE = "shared";++export interface ValidatorConversionFailure {+ module: string;+ name: string;+ error: string;+}++export interface ValidatorRegistry {+ /**+ * The converted schema for `validatorName`, looked up in `mod` and then in+ * `shared` (cross-module validators). Null when unknown or unconvertible — the+ * caller must fall back to textual parsing.+ */+ getSchema(mod: string, validatorName: string): JsonSchema | null;+ /** Values of an exported `as const` string array, for `(typeof X)[number]` params. */+ getConstArray(mod: string, exportName: string): string[] | null;+ readonly stats: {+ modulesLoaded: number;+ moduleErrors: Array<{ module: string; error: string }>;+ validatorsConverted: number;+ conversionFailures: ValidatorConversionFailure[];+ };+}++/**+ * Strip context params from the top level and from array `items` — a payload param+ * typed as an array of rows carries them per element, which is how `createdBy` used+ * to leak into `items.properties` (pinned by `apps/erp/test/mcp-tool-metadata.test.ts`).+ */+function stripContextParams(schema: JsonSchema): JsonSchema {+ const walk = (node: unknown): unknown => {+ if (Array.isArray(node)) return node.map(walk);+ if (typeof node !== "object" || node === null) return node;++ const obj = { ...(node as JsonSchema) };+ const properties = obj.properties as Record<string, unknown> | undefined;+ if (properties) {+ const kept: Record<string, unknown> = {};+ for (const [key, value] of Object.entries(properties)) {+ if (CONTEXT_PARAMS.has(key)) continue;+ kept[key] = walk(value);+ }+ obj.properties = kept;++ const required = obj.required as string[] | undefined;+ if (Array.isArray(required)) {+ const keptRequired = required.filter((r) => !CONTEXT_PARAMS.has(r));+ if (keptRequired.length > 0) obj.required = keptRequired;+ else delete obj.required;+ }+ }+ if (obj.items) obj.items = walk(obj.items);+ return obj;+ };++ return walk(schema) as JsonSchema;+}++function isConstStringArray(value: unknown): value is string[] {+ return (+ Array.isArray(value) &&+ value.length > 0 &&+ value.every((v) => typeof v === "string")+ );+}++/**+ * Load every module's models file and convert its validators. Never throws: a module+ * that fails to load, or a validator that fails to convert, is recorded in `stats`+ * and simply absent from the lookup, so the generator falls back to textual parsing+ * for exactly those and nothing else.+ */+export async function buildValidatorRegistry(+ modules: readonly string[]+): Promise<ValidatorRegistry> {+ const schemas = new Map<string, JsonSchema>();+ const constArrays = new Map<string, string[]>();+ const stats: ValidatorRegistry["stats"] = {+ modulesLoaded: 0,+ moduleErrors: [],+ validatorsConverted: 0,+ conversionFailures: [],+ };++ const loader = await createValidatorLoader();+ try {+ for (const mod of modules) {+ const { exports, error } = await loader.load(mod);+ if (error) {+ stats.moduleErrors.push({ module: mod, error });+ continue;+ }+ stats.modulesLoaded++;++ for (const [name, value] of Object.entries(exports)) {+ if (isConstStringArray(value)) {+ constArrays.set(`${mod}:${name}`, value);+ continue;+ }+ if (!isZodSchema(value)) continue;+ try {+ const converted = stripContextParams(+ validatorToJsonSchema(value as z.ZodType)+ );+ schemas.set(`${mod}:${name}`, converted);+ stats.validatorsConverted++;+ } catch (err) {+ stats.conversionFailures.push({+ module: mod,+ name,+ error: err instanceof Error ? err.message : String(err),+ });+ }+ }+ }+ } finally {+ await loader.close();+ }++ return {+ getSchema(mod, validatorName) {+ const found =+ schemas.get(`${mod}:${validatorName}`) ??+ schemas.get(`${FALLBACK_MODULE}:${validatorName}`) ??+ null;+ // Hand out a COPY. One validator backs many operations (supplierValidator+ // backs both insertSupplier and upsertSupplier), and downstream steps mutate+ // the schema in place — `addOperationArg` writes `_operation` onto it. Sharing+ // the object leaked that required argument onto sibling operations that never+ // take it.+ return found ? (structuredClone(found) as JsonSchema) : null;+ },+ getConstArray(mod, exportName) {+ return (+ constArrays.get(`${mod}:${exportName}`) ??+ constArrays.get(`${FALLBACK_MODULE}:${exportName}`) ??+ null+ );+ },+ stats,+ };+}diff --git a/scripts/lib/validator-to-json-schema.ts b/scripts/lib/validator-to-json-schema.tsnew file mode 100644index 0000000000..9a54a4bee6--- /dev/null+++ b/scripts/lib/validator-to-json-schema.ts@@ -0,0 +1,115 @@+/**+ * The one place a zod validator becomes a manifest JSON Schema.+ *+ * Conversion is native (`z.toJSONSchema`, zod >= 4). Everything else here is the+ * normalization the raw converter output needs before it can be published as the+ * caller contract for MCP, the v1 OpenAPI spec, and the docs.+ */++import { z } from "zod";++export type JsonSchema = Record<string, unknown>;++/**+ * `io: "input"` is deliberate: the manifest documents what a CALLER SENDS.+ *+ * The output side is the post-parse shape the service function receives — defaults+ * already applied (so they read as required), transforms already run — which is+ * neither the request contract nor the API response. Response schemas need+ * ReturnType reflection over the service functions and are a separate concern.+ *+ * `unrepresentable: "any"` maps `z.custom`/exotic transforms to `{}` instead of+ * throwing, so one odd field degrades to "any JSON" rather than losing the operation.+ */+const CONVERT_OPTIONS = {+ io: "input",+ unrepresentable: "any",+} as const;++/** Convert a zod validator, then normalize. Throws if zod cannot represent it. */+export function validatorToJsonSchema(validator: z.ZodType): JsonSchema {+ const raw = z.toJSONSchema(validator, CONVERT_OPTIONS) as JsonSchema;+ return normalizeJsonSchema(raw);+}++/**+ * Post-conversion cleanup, applied depth-first:+ *+ * 1. Drop `$schema` — the manifest embeds these as property schemas, not documents.+ * 2. Collapse the `zfd.checkbox()` shape to a plain boolean (see below).+ * 3. Inline `$ref`s against the schema's own `$defs`, then drop `$defs` — MCP+ * clients and the docs renderer both want a self-contained tree. A `$ref` that+ * cannot be resolved (a genuinely recursive validator) is left in place rather+ * than silently emptied; the caller's fallback reports it.+ * 4. Split a multi-type `type` array (beyond `[x, "null"]`) into `anyOf` — the+ * same JSON Schema, but the form strict generators (Go's oapi-codegen)+ * actually handle. `z.union([z.boolean(), z.string()])` emits+ * `type: ["boolean","string"]`, which such generators reject outright.+ */+export function normalizeJsonSchema(schema: JsonSchema): JsonSchema {+ const defs = (schema.$defs ?? schema.definitions) as+ | Record<string, JsonSchema>+ | undefined;++ const walk = (node: unknown, seenRefs: ReadonlySet<string>): unknown => {+ if (Array.isArray(node)) return node.map((item) => walk(item, seenRefs));+ if (typeof node !== "object" || node === null) return node;++ const obj = node as JsonSchema;++ // Inline a $ref against $defs. Guard on the ref path already being expanded in+ // this branch: a self-referential validator would otherwise recurse forever.+ const ref = obj.$ref;+ if (typeof ref === "string") {+ const name = ref.replace(/^#\/(?:\$defs|definitions)\//, "");+ const target = defs?.[name];+ if (!target || seenRefs.has(ref)) return obj;+ return walk(target, new Set(seenRefs).add(ref));+ }++ const checkbox = collapseCheckbox(obj);+ if (checkbox) return checkbox;++ const out: JsonSchema = {};+ for (const [key, value] of Object.entries(obj)) {+ if (key === "$schema" || key === "$defs" || key === "definitions") continue;+ out[key] = walk(value, seenRefs);+ }++ const type = out.type;+ if (+ Array.isArray(type) &&+ type.filter((t) => t !== "null").length > 1 &&+ !out.anyOf &&+ !out.oneOf+ ) {+ delete out.type;+ out.anyOf = type.map((t) => ({ type: t }));+ }+ return out;+ };++ return walk(schema, new Set()) as JsonSchema;+}++/**+ * `zfd.checkbox()` converts to `anyOf: [{const:"on"}, {}, {type:"boolean"}]` — an+ * honest description of what an HTML form posts, and useless to a JSON caller (the+ * bare `{}` member makes it read as "any"). JSON callers send a boolean, so publish+ * that. Returns null when the node is not that shape.+ */+function collapseCheckbox(node: JsonSchema): JsonSchema | null {+ const anyOf = node.anyOf;+ if (!Array.isArray(anyOf) || anyOf.length !== 3) return null;++ const members = anyOf as JsonSchema[];+ const hasOnConst = members.some(+ (m) => m && m.const === "on" && m.type === "string"+ );+ const hasBoolean = members.some((m) => m && m.type === "boolean");+ const hasEmpty = members.some((m) => m && Object.keys(m).length === 0);+ if (!hasOnConst || !hasBoolean || !hasEmpty) return null;++ const { anyOf: _dropped, ...rest } = node;+ return { ...rest, type: "boolean" };+}diff --git a/turbo.json b/turbo.jsonindex 7744c55340..c77b11745a 100644--- a/turbo.json+++ b/turbo.json@@ -2,7 +2,7 @@"$schema": "https://turborepo.org/schema.json","tasks": {"build": {- "dependsOn": ["^build", "//#lingui:compile"],+ "dependsOn": ["^build", "//#lingui:compile", "//#generate:mcp"],"outputs": ["dist/**","build/**",@@ -30,11 +30,11 @@},"test": {"cache": false,- "dependsOn": ["^build"]+ "dependsOn": ["^build", "//#generate:mcp"]},"typecheck": {"cache": false,- "dependsOn": []+ "dependsOn": ["//#generate:mcp"]},"lint": {"dependsOn": ["^build"],@@ -70,6 +70,20 @@"typegen": {"cache": false,"outputs": []+ },+ "//#generate:mcp": {+ "inputs": [+ "apps/erp/app/modules/*/*.service.ts",+ "apps/erp/app/modules/*/*.mcp.server.ts",+ "apps/erp/app/modules/*/*.models.ts",+ "apps/erp/app/routes/api+/mcp+/lib/mcp-blocked-tools.ts",+ "scripts/generate-mcp.ts",+ "scripts/lib/**"+ ],+ "outputs": [+ "apps/erp/app/routes/api+/mcp+/lib/tool-metadata.json",+ "apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json"+ ]}}}