Skip to content

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.

fix(api): derive tool contracts from the compiler, and sweep every read tool (#1826)

Sid89bdf0e27ee0
diff --git a/.ai/lessons.md b/.ai/lessons.md
index 33e3e5b11e..f8e8ac19f6 100644
--- a/.ai/lessons.md
+++ b/.ai/lessons.md
@@ -2889,3 +2889,14 @@ tag until proven otherwise.
**Rule:** A stub that exists to shrink the client bundle goes through `clientOnlyAlias` (`@carbon/dev/vite`), never `resolve.alias`. Verify a server-side dependency change against a bundle built with `ssr.noExternal: true`, not against the dev server.
**Applies to:** `apps/{erp,mes}/vite.config.ts`, `app/ssr-shims/`, `packages/dev/vite.js`.
+
+
+## A published schema default is a promise the server has to keep
+
+**Context:** API and MCP input schemas are generated from the form validators, whose `.default(0)` was written for a form that submits every field. The dispatcher applied none of them.
+
+**Problem:** A caller reading `taxPercent: default 0` leaves the field out and expects 0. On a read typed from a validator's output that crashed (`state: {}` on a pivot); on an update, filling it would overwrite a stored value the caller never mentioned. And a default that looked safe to fill was not: list reads published `limit: default 100`, but the service pages only when it is handed a limit, so filling it would have cut every unpaged list read to 100 rows.
+
+**Rule:** A default is filled or it is not published (`defaultsPolicy` / `publishDefaults`): always for a read, a create or an action, on create only for an upsert, never for an update. Before publishing or filling one, read what the service does when the field is absent, and compare with the column's own database default.
+
+**Applies to:** `scripts/lib/service-metadata.ts`, `apps/erp/app/routes/api+/v1+/lib/dispatch.server.ts`, any validator default that reaches an API schema.
diff --git a/.claude/rules/mcp-tools-reference.md b/.claude/rules/mcp-tools-reference.md
index aeb3d50fa9..0da4f202cf 100644
--- a/.claude/rules/mcp-tools-reference.md
+++ b/.claude/rules/mcp-tools-reference.md
@@ -266,9 +266,15 @@ dispatcher (`apps/erp/app/routes/api+/inngest.ts`). There is no separate
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 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
+ `["client", "args"]`), `contextParams` and `injectAuth`. The dispatch builds
+ the positional arg array from them: a param listed in `contextParams` is filled
+ with the context value the manifest names (`client`, `db` →
+ `getDatabaseClient()`, `userId`, `companyId`, `companyGroupId`), and the
+ dispatcher recognises NO parameter name itself. It used to keep its own list,
+ which lacked `createdBy`/`updatedBy` while the generator hid them from the
+ schema, so `updateJobOperationStatus(client, id, status, updatedBy)` was handed
+ the caller's value or the whole body and failed `jobOperation_updatedBy_fkey`.
+ Pinned by `dispatch-parity.test.ts` a3. Payload params are
stamped with auth fields via `enrichWithAuthContext` (now in
`dispatch.server.ts`) — including `userId` when the payload itself declares one
(the edge-function wrappers), which the manifest marks via `injectAuth` and the
@@ -350,9 +356,26 @@ dispatcher (`apps/erp/app/routes/api+/inngest.ts`). There is no separate
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
+ is what the service itself defaults it to): `POSITIONAL_CONTEXT` maps it to
+ `client`. Left out of the generator's list it became a required field a caller
+ cannot express — a
Supabase client — so the two consolidated-balance ops failed every call.
+- **A failure in the service's result is an error, whatever its shape.** A
+ service does not throw; `readServiceResult` (`dispatch.server.ts`) reads the
+ failure where the manifest's `resultShape` says it is. The generator takes that
+ off the declared return type with the checker (`scripts/lib/result-shape.ts`,
+ awaited, so a Promise and a builder returned without `await` read alike):
+ `envelope` — an object with an `error` member, PostgREST's response or a
+ hand-built `{ error }` with or without `data` (1,311 tools); `envelopes` — a
+ list of those, a `Promise.all` of writes (15); `flag` — `{ ok | success }`
+ with no `error` (2); `plain` (154). Only `{ data, error }` WITH a `data` key
+ used to be read, so a bare `{ error }`, one failed write in a `Promise.all`
+ and `{ ok: false }` all went back as a success. A truthy top-level `error` is
+ a failure under every shape, so a service must not return a bare row that has
+ an `error` column — wrap it in `{ data }`. A return type that mixes the two
+ signals, or a list whose items disagree, fails generation. The digest shows
+ `result` for `envelopes` and `flag`. Pinned by `dispatch-parity.test.ts` and
+ `apps/erp/test/mcp-service-ast.test.ts`.
- 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
@@ -405,7 +428,7 @@ functions that must import `*.server` modules — see the gotcha below — e.g.
`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 }`.
+`{ name, module, classification, description, paramCount, serviceParams, contextParams, injectAuth, resultShape, schema }`.
- **How the service files are read** (`scripts/lib/service-ast.ts`): ONE ts-morph
project, shared with the response-schema reflection. Which functions exist
@@ -481,6 +504,77 @@ exports into the same module namespace), and writes `apps/erp/app/routes/api+/mc
append a period — hence the normalization), and are NOT part of the digest,
so a description change is invisible in review by design. Pinned by
`apps/erp/test/mcp-jsdoc-description.test.ts`.
+- **The read-tool sweep** (`pnpm sweep:tools`, `apps/erp/test/sweep/`) is the
+ only place a tool is run for real: this branch's dispatcher and services, a
+ signed-in user's client, a seeded company on a running local stack. Arguments
+ are not guessed: `paramFilters` (`service-ast.ts`) reads which column each
+ parameter is compared to (`.eq("id", jobId)` on `job`), and a value that
+ exists is sampled as the user; a name the tool's own body does not tie to a
+ column falls back to what that name is compared to across every service, then
+ to the database's own tables and columns of that name. When the company has
+ no row to take a value from, the tool is still called, with a value of the
+ column's type that matches nothing (the report lists these under
+ `placeholder`). The few arguments nothing can answer (`targetCurrency`,
+ `timeZone`) are written down per tool in `read-tools.inputs.ts`. It records
+ `ok` / `failed` / `not-found` / `not-called`, refuses a stack that has not
+ applied this branch's migrations, and gates on `read-tools.baseline.json`,
+ which is empty and stays that way unless a failure is knowingly accepted.
+ Seed a demo dataset and run the planner first (`pnpm db:seed:dev`): on the
+ satellite dataset all 810 read tools are called. It has found three bugs no
+ unit test had:
+ - An omitted optional list or object argument was handed the whole request
+ body (`getActiveJobOperationsByLocation({ locationId })` sent it as
+ `workCenterIds`). `omittedNamedParam` now leaves such an argument
+ `undefined` when the service takes more than one payload param
+ (`dispatch-parity.test.ts` a5).
+ - A read did not get the defaults its schema publishes. A service typed from
+ a validator's output requires those fields, so `getPurchaseLinePivot` sent
+ `state: {}` crashed on `state.columnAxis.type`. `withSchemaDefaults` fills
+ them (a6); see "A published default is a promise" below for when.
+ - `companyGroupId` inside a payload object was hidden from the schema and
+ never filled, so every pivot report, and creating an account, order, quote
+ or invoice, ran with no group (see injectAuth below).
+
+ Not part of `pnpm test`: it needs the stack.
+- **A `read` tool may only call SQL functions that read**
+ (`assertReadCallsOnlyReads`). The generator sees every `.rpc("name")`
+ (`rpcCalls`, through casts) but not the SQL behind it, so the function's own
+ definition answers: `packages/database/src/sql-effects.ts` parses every
+ migration in timestamp order, then the managed function files, with Postgres's
+ parser (`libpg-query`), keeps each function's CURRENT definition (a later
+ `CREATE OR REPLACE` replaces, another signature is an overload, `DROP` removes)
+ and walks its body, following calls into other functions. It answers `reads`,
+ `writes` (with the statement) or `unknown` (with why): dynamic `EXECUTE`, a
+ language it does not read, an extension function absent from
+ `EXTERNAL_READS` / `EXTERNAL_WRITES`, or no definition at all. `writes` and
+ `unknown` both fail generation for a `read` tool. Dynamic SQL a person has
+ read goes in `REVIEWED_DYNAMIC_READS`, pinned to the migration that holds the
+ definition, so a later redefinition is `unknown` again. This is how
+ `settings_getNextSequence` (its rpc runs `UPDATE sequence`) was a READ gated
+ on `settings:view`; it is now `@mcp action`. Migrations are an input of
+ `//#generate:mcp` and of the pre-commit manifest check, so a function that
+ starts writing re-runs the check. Pinned by `sql-effects.test.ts` and
+ `apps/erp/test/mcp-service-ast.test.ts`.
+- **contextParams** (`contextParamsOf`) says which positional params the
+ dispatcher fills and with what, and is the only place that is decided. Two
+ sources: the positional contract `POSITIONAL_CONTEXT`
+ (`scripts/lib/validator-registry.ts`: `client`, `eliminationClient`, `db`,
+ `userId`, `companyId`, `companyGroupId` — a plain `string` carries nothing more
+ for the compiler to read), and the body. `auditParams` (`service-ast.ts`) finds
+ every parameter the function writes as the value of a `createdBy` / `updatedBy`
+ property, by shorthand or by name, through the compiler's own symbol
+ resolution; such a param is the acting user whatever it is called, and maps to
+ `userId`. A positional param NAMED `createdBy`/`updatedBy` that the body is not
+ seen writing to the column fails generation — published it would let a caller
+ name the author, hidden without a slot nobody would fill it. Context params are
+ left out of the published schema. The digest shows a mapping only where the
+ source differs from the name (`"context":"updatedBy=userId"`). Pinned by
+ `apps/erp/test/mcp-service-ast.test.ts`.
+- **A field whose type admits `undefined` is optional**, with or without `?`
+ (inline object types). `assignee: null | undefined` used to publish as a
+ required `null` on eight status tools, so every status change had to send
+ `assignee: null` and cleared it. `mcp-tool-metadata.test.ts` also refuses any
+ required property that can only be null, across the whole manifest.
- **injectAuth** starts from the verb's audit fields (table above) plus
`companyId`, then is checked against the schema (`withoutAbsentAuditColumns`):
when the function names exactly ONE relation and that relation has no
@@ -489,8 +583,75 @@ exports into the same module namespace), and writes `apps/erp/app/routes/api+/mc
would otherwise send a column that does not exist (PGRST204, how
`items_upsertItemCustomerPart` failed). Zero or several relations leaves the
set alone. `userId` is added when the payload's own type declares one
- (`withPayloadUserId`). `@mcp audit` replaces all of that for intent the schema
- cannot express.
+ (`withPayloadUserId`), and `companyGroupId` when any payload parameter's TYPE
+ has that property (`withPayloadCompanyGroup`, asked of the type checker, so a
+ named or inferred type counts). The dispatcher cannot tell the shapes of a
+ union apart and stamps all of them, so the generator refuses a union where
+ only some shapes declare it: declare it on each (optional where unused) and
+ destructure it out before the row is written, as `upsertPurchaseOrder` does.
+ `@mcp audit` replaces all of that for intent the schema cannot express.
+
+- **A write is confined to the caller's company, whatever the service filters
+ on.** The `client` a service is handed is `scopedToCompany(context.client, …)`
+ (`api+/v1+/lib/company-scope.server.ts`): every `.update()` and `.delete()` on
+ a table with a `companyId` column also gets `.eq("companyId", <caller's>)`.
+ Services match the row they write by its id, and a signed-in user's client
+ reaches every company they belong to, so an id from the user's other company
+ used to match — and because the dispatcher stamps the active `companyId` into
+ the payload, an update that spread it moved the row. With the filter a write
+ can only match a row already in the caller's company. The table list is
+ `companyTables` in `tool-metadata.json`, read from the generated database
+ types (`getDbTablesWithColumn`); generation fails if it comes back short.
+ Reads, inserts, RPCs and storage pass through; a Kysely `db` is not wrapped
+ (it is covered by the `no-unscoped-kysely-write` check). Pinned against real
+ request URLs in `company-scope.test.ts` and end to end in
+ `dispatch-parity.test.ts`.
+
+- **An argument is never published blank unless it is.** The input schema is
+ built from the signature's text and the validators. What neither resolves — a
+ named row type, a `ReturnType<…>`, an enum from another module — used to come
+ out as `{}`: an argument with no shape (`getDocumentTemplate`'s
+ `documentType`, one of eleven strings; 21 tools in all).
+ `describeUntypedArguments` now fills every blank node from the parameter's
+ own TYPE, with the reflection the response schemas use (`typeToJsonSchema` in
+ `response-schema.ts`, which reads a tuple or readonly array as a list). Only
+ `any`, `unknown` and `Json` stay blank — `Json` recognised by its members,
+ since `customFields?: Json` reaches the checker with the alias gone. The API
+ validates input against the schema, so a service that takes a whole row but
+ reads three fields now DEMANDS the whole row: type the parameter as what it
+ reads (`Pick<Job, "id" | "salesOrderLineId" | "quoteLineId">`).
+
+- **A published default is a promise, kept or not made.** `default` in JSON
+ Schema enforces nothing; a caller reading `taxPercent: default 0` leaves the
+ field out and expects 0. The defaults come from the form validators
+ (`.default(0)`), written for a form that submits every field, so the same
+ default sits on create and update alike — and over the API an update is
+ partial. The manifest entry's `defaults` (`defaultsPolicy`, in the digest)
+ says when the dispatcher fills them:
+ - `always` — `read`, `create`, `action`: the call supplies a whole value.
+ - `create` — an `upsert` with a rule, only when it resolves to a create. On
+ update a field left out keeps what is stored; the property's description
+ says so.
+ - absent — `update`, `delete`, and an upsert with no rule (nothing says
+ whether the call updates). `publishDefaults` REMOVES every default from
+ such a schema, and from any place the dispatcher's walk does not reach
+ (several object alternatives of a union, a record's values), so no schema
+ publishes one that is not applied.
+ A default is published only when leaving the field out really has that
+ effect. A list read's `limit` has none: `setGenericQueryFilters` pages only
+ when it is handed a limit, so the schema's old `default: 100` described a
+ page size no caller ever got, and filling it would have cut every unpaged
+ list read to 100 rows (`dispatch-parity.test.ts` a13). `offset` keeps its
+ `0`, which is what lets a `limit` sent alone page at all.
+ The dispatcher fills each ARGUMENT against its own schema after the body's
+ shape is known (`filled` in `dispatchOperation`), never the raw body: adding
+ keys beside a `{ args: {…} }` wrapper would change which shape it is read as.
+ `withSchemaDefaults` and `publishDefaults` are the same walk (`properties`,
+ `items`, a union's one object or array alternative), pinned against one
+ fixture in `dispatch-parity.test.ts`; `mcp-tool-metadata.test.ts` fails a
+ tool that publishes a default with no policy. When this landed every default
+ filled on a create equalled the column's own database default, except
+ `salesInvoiceLine.unitOfMeasureCode` ("EA", as the form sends).
- **Create vs update on an upsert is never the caller's question.** A service
that picks insert-vs-update by testing for an audit field on the payload
@@ -500,7 +661,12 @@ exports into the same module namespace), and writes `apps/erp/app/routes/api+/mc
the two stamped — stamp both and an `"updatedBy" in` service takes its UPDATE
branch on every create, matches zero rows and returns PGRST116. The generator
records how to decide in the manifest entry's `upsert` (also in the digest), and
- fails generation for a branching upsert it cannot give a rule to:
+ fails generation for a branching upsert it cannot give a rule to. An `upsert`
+ that branches some other way (`"id" in line`, twenty of them: invoice, order
+ and quote lines) gets the by-`id` rule too whenever its type makes `id`
+ decisive. Without one both audit fields were stamped on every call, and since
+ those services spread the payload into their UPDATE, editing a row through
+ the API rewrote its `createdBy` (`dispatch-parity.test.ts` a8):
- **By `id`** (`{ keys: ["id"] }`, most upserts) — read off the parameter's TYPE
(`idDistinguishesUpdate`, `service-ast.ts`): every union member that requires
`updatedBy` has an `id`, and no other member requires one. Sending `id` means
diff --git a/.husky/pre-commit b/.husky/pre-commit
index 6a29d94ce9..338d45deba 100755
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -74,7 +74,7 @@ fi
# worse than none, since it reads as "nothing changed". The file set is the
# //#generate:mcp inputs in turbo.json; keep the two in step.
# 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/.*\.ts|apps/erp/app/(types|utils)/.*|apps/erp/app/routes/api\+/mcp\+/lib/mcp-(blocked-tools|exposure)\.ts|packages/(api|database|documents|files|locale|logger|notifications|printing|utils)/src/.*|packages/database/supabase/functions/shared/.*|scripts/(generate-mcp|lib/.*)\.ts)$'; then
+if [ -z "$CARBON_SKIP_MANIFEST_CHECK" ] && git diff --cached --name-only | grep -qE '^(apps/erp/app/modules/.*\.ts|apps/erp/app/(types|utils)/.*|apps/erp/app/routes/api\+/mcp\+/lib/mcp-(blocked-tools|exposure)\.ts|packages/(api|database|documents|files|locale|logger|notifications|printing|utils)/src/.*|packages/database/supabase/functions/shared/.*|packages/database/supabase/migrations/.*|scripts/(generate-mcp|lib/.*)\.ts)$'; then
echo "Checking the API operation manifest digest..."
if ! pnpm --silent check:manifest; then
echo ""
diff --git a/apps/erp/app/modules/accounting/accounting.service.ts b/apps/erp/app/modules/accounting/accounting.service.ts
index bc59c01f32..c1ea059a3d 100644
--- a/apps/erp/app/modules/accounting/accounting.service.ts
+++ b/apps/erp/app/modules/accounting/accounting.service.ts
@@ -4091,6 +4091,7 @@ export async function upsertAccount(
})
| (Omit<z.infer<typeof accountValidator>, "id"> & {
id: string;
+ companyGroupId?: string;
updatedBy: string;
customFields?: Json;
})
@@ -4098,9 +4099,10 @@ export async function upsertAccount(
if ("createdBy" in account) {
return client.from("account").insert([account]).select("*").single();
}
+ const { companyGroupId: _companyGroupId, ...accountUpdate } = account;
return client
.from("account")
- .update(sanitize(account))
+ .update(sanitize(accountUpdate))
.eq("id", account.id)
.select("id")
.single();
@@ -4394,6 +4396,7 @@ export async function upsertDimension(
})
| (Omit<z.infer<typeof dimensionValidator>, "id" | "dimensionValues"> & {
id: string;
+ companyGroupId?: string;
updatedBy: string;
}),
dimensionValues?: string[]
@@ -4407,9 +4410,10 @@ export async function upsertDimension(
.select("id, companyGroupId")
.single();
} else {
+ const { companyGroupId: _companyGroupId, ...dimensionUpdate } = dimension;
dimensionResult = await client
.from("dimension")
- .update(sanitize(dimension))
+ .update(sanitize(dimensionUpdate))
.eq("id", dimension.id)
.select("id, companyGroupId")
.single();
diff --git a/apps/erp/app/modules/invoicing/invoicing.service.ts b/apps/erp/app/modules/invoicing/invoicing.service.ts
index 3ad61fb133..b0aad4f18c 100644
--- a/apps/erp/app/modules/invoicing/invoicing.service.ts
+++ b/apps/erp/app/modules/invoicing/invoicing.service.ts
@@ -948,32 +948,26 @@ export async function upsertPurchaseInvoice(
return invoice;
}
-/** @mcp upsert */
+/**
+ * Updates an invoice's delivery. The row is created with the invoice and
+ * shares its id, so there is nothing to insert here.
+ * @mcp update
+ */
export async function upsertPurchaseInvoiceDelivery(
client: SupabaseClient<Database>,
- purchaseInvoiceDelivery:
- | (z.infer<typeof purchaseInvoiceDeliveryValidator> & {
- companyId: string;
- createdBy: string;
- customFields?: Json;
- })
- | (z.infer<typeof purchaseInvoiceDeliveryValidator> & {
- id: string;
- updatedBy: string;
- customFields?: Json;
- })
-) {
- if ("id" in purchaseInvoiceDelivery) {
- return client
- .from("purchaseInvoiceDelivery")
- .update(sanitize(purchaseInvoiceDelivery))
- .eq("id", purchaseInvoiceDelivery.id)
- .select("id")
- .single();
+ purchaseInvoiceDelivery: z.infer<typeof purchaseInvoiceDeliveryValidator> & {
+ companyId: string;
+ updatedBy: string;
+ customFields?: Json;
}
+) {
+ // The company scopes the row; it is never written to it.
+ const { companyId, ...delivery } = purchaseInvoiceDelivery;
return client
.from("purchaseInvoiceDelivery")
- .insert([purchaseInvoiceDelivery])
+ .update(sanitize(delivery))
+ .eq("id", delivery.id)
+ .eq("companyId", companyId)
.select("id")
.single();
}
@@ -1336,32 +1330,26 @@ export async function upsertSalesInvoice(
return invoice;
}
-/** @mcp upsert */
+/**
+ * Updates an invoice's shipment. The row is created with the invoice and
+ * shares its id, so there is nothing to insert here.
+ * @mcp update
+ */
export async function upsertSalesInvoiceShipment(
client: SupabaseClient<Database>,
- salesInvoiceShipment:
- | (z.infer<typeof salesInvoiceShipmentValidator> & {
- companyId: string;
- createdBy: string;
- customFields?: Json;
- })
- | (z.infer<typeof salesInvoiceShipmentValidator> & {
- id: string;
- updatedBy: string;
- customFields?: Json;
- })
-) {
- if ("id" in salesInvoiceShipment) {
- return client
- .from("salesInvoiceShipment")
- .update(sanitize(salesInvoiceShipment))
- .eq("id", salesInvoiceShipment.id)
- .select("id")
- .single();
+ salesInvoiceShipment: z.infer<typeof salesInvoiceShipmentValidator> & {
+ companyId: string;
+ updatedBy: string;
+ customFields?: Json;
}
+) {
+ // The company scopes the row; it is never written to it.
+ const { companyId, ...shipment } = salesInvoiceShipment;
return client
.from("salesInvoiceShipment")
- .insert([salesInvoiceShipment])
+ .update(sanitize(shipment))
+ .eq("id", shipment.id)
+ .eq("companyId", companyId)
.select("id")
.single();
}
diff --git a/apps/erp/app/modules/items/items.service.ts b/apps/erp/app/modules/items/items.service.ts
index 01186fc435..f513445c56 100644
--- a/apps/erp/app/modules/items/items.service.ts
+++ b/apps/erp/app/modules/items/items.service.ts
@@ -221,7 +221,24 @@ export async function copyItemPostingGroup(
export async function createRevision(
client: SupabaseClient<Database>,
args: {
- item: NonNullable<Awaited<ReturnType<typeof getItem>>["data"]>;
+ // The source item's fields a revision copies, not the whole row.
+ item: Pick<
+ NonNullable<Awaited<ReturnType<typeof getItem>>["data"]>,
+ | "id"
+ | "companyId"
+ | "readableId"
+ | "name"
+ | "type"
+ | "replenishmentSystem"
+ | "defaultMethodType"
+ | "itemTrackingType"
+ | "unitOfMeasureCode"
+ | "description"
+ | "sourcingType"
+ | "thumbnailPath"
+ | "mpn"
+ | "modelUploadId"
+ >;
revision: string;
createdBy: string;
// Change-order draft revisions are created inactive so they don't surface
diff --git a/apps/erp/app/modules/production/production.service.ts b/apps/erp/app/modules/production/production.service.ts
index 6c7b9f0af4..3a4dd5f10f 100644
--- a/apps/erp/app/modules/production/production.service.ts
+++ b/apps/erp/app/modules/production/production.service.ts
@@ -960,7 +960,7 @@ export const getPartDocuments = async (
export async function getJobDocumentsWithItemId(
client: SupabaseClient<Database>,
companyId: string,
- job: Job,
+ job: Pick<Job, "id" | "salesOrderLineId" | "quoteLineId">,
itemId: string
): Promise<StorageItem[]> {
const itemFiles = await getPartDocuments(client, companyId, { itemId });
diff --git a/apps/erp/app/modules/purchasing/purchasing.service.ts b/apps/erp/app/modules/purchasing/purchasing.service.ts
index 45f879e717..a69a9038b7 100644
--- a/apps/erp/app/modules/purchasing/purchasing.service.ts
+++ b/apps/erp/app/modules/purchasing/purchasing.service.ts
@@ -1788,6 +1788,7 @@ export async function upsertPurchaseOrder(
> & {
id: string;
purchaseOrderId: string;
+ companyGroupId?: string;
updatedBy: string;
customFields?: Json;
}),
@@ -1795,9 +1796,11 @@ export async function upsertPurchaseOrder(
) {
if ("id" in purchaseOrder) {
// locationId belongs on the delivery record, as in the insert below, and
- // notes are stored as internalNotes/externalNotes.
+ // notes are stored as internalNotes/externalNotes. companyGroupId is not a
+ // column of the order at all.
const {
locationId: _locationId,
+ companyGroupId: _companyGroupId,
notes: _notes,
...orderUpdate
} = purchaseOrder;
diff --git a/apps/erp/app/modules/settings/settings.service.ts b/apps/erp/app/modules/settings/settings.service.ts
index ebe0cb6897..79da8041ff 100644
--- a/apps/erp/app/modules/settings/settings.service.ts
+++ b/apps/erp/app/modules/settings/settings.service.ts
@@ -51,7 +51,7 @@ export async function getAccountsPayableBillingAddress(
.from("companyAccountsPayableBillingAddress")
.select("*")
.eq("id", companyId)
- .single();
+ .maybeSingle();
}
/** @mcp read */
@@ -63,7 +63,7 @@ export async function getAccountsReceivableBillingAddress(
.from("companyAccountsReceivableBillingAddress")
.select("*")
.eq("id", companyId)
- .single();
+ .maybeSingle();
}
/** @mcp update */
@@ -256,7 +256,11 @@ export async function getCompanyPlan(
client: SupabaseClient,
companyId: string
) {
- return client.from("companyPlan").select("*").eq("id", companyId).single();
+ return client
+ .from("companyPlan")
+ .select("*")
+ .eq("id", companyId)
+ .maybeSingle();
}
/** @mcp read */
@@ -383,7 +387,10 @@ export async function getKanbanOutputSetting(
.single();
}
-/** @mcp read */
+/**
+ * Takes the next number of a sequence, which advances it.
+ * @mcp action
+ */
export async function getNextSequence(
client: SupabaseClient<Database>,
table: string,
diff --git a/apps/erp/app/routes/api+/mcp+/lib/describe-format.test.ts b/apps/erp/app/routes/api+/mcp+/lib/describe-format.test.ts
index 1e1fffc7e2..b63e2db950 100644
--- a/apps/erp/app/routes/api+/mcp+/lib/describe-format.test.ts
+++ b/apps/erp/app/routes/api+/mcp+/lib/describe-format.test.ts
@@ -21,7 +21,9 @@ const baseTool: ManifestEntry = {
description: "get customer",
paramCount: 1,
serviceParams: ["client", "id"],
+ contextParams: { client: "client" },
injectAuth: ["companyId"],
+ resultShape: "envelope",
permission: { module: "sales", actions: ["view"] },
paginates: true,
schema: {
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.json
index 717b1a2f7a..2ef5f627aa 100644
--- a/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json
+++ b/apps/erp/app/routes/api+/mcp+/lib/tool-manifest.digest.json
@@ -18,9 +18,9 @@
{"name":"accounting_closePeriodWithChecklist","classification":"WRITE","paramCount":1,"schema":"7e5905ac5974","response":"3797626bd17e","injectAuth":"companyId+updatedBy+userId","permission":"accounting:update","paginates":false},
{"name":"accounting_completeCloseTask","classification":"WRITE","paramCount":2,"schema":"5d2e9a90637b","response":"none","injectAuth":"companyId+userId","permission":"accounting:update","paginates":false},
{"name":"accounting_createFiscalYearPeriods","classification":"WRITE","paramCount":1,"schema":"de7d8726d5e4","response":"none","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"accounting:create","paginates":false},
- {"name":"accounting_createIntercompanyTransaction","classification":"WRITE","paramCount":8,"schema":"9c3c11f4059c","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"accounting:create","paginates":false},
+ {"name":"accounting_createIntercompanyTransaction","classification":"WRITE","paramCount":8,"schema":"9c3c11f4059c","response":"3797626bd17e","injectAuth":"companyGroupId+companyId+createdBy+updatedBy+userId","permission":"accounting:create","paginates":false},
{"name":"accounting_createJournalEntry","classification":"WRITE","paramCount":5,"schema":"fee52842e3f3","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create","paginates":false},
- {"name":"accounting_createOpeningBalanceJournal","classification":"DESTRUCTIVE","paramCount":2,"schema":"827e7a256f6c","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"accounting:create","paginates":false},
+ {"name":"accounting_createOpeningBalanceJournal","classification":"DESTRUCTIVE","paramCount":2,"schema":"827e7a256f6c","response":"3797626bd17e","injectAuth":"companyGroupId+companyId+createdBy+updatedBy+userId","permission":"accounting:create","paginates":false},
{"name":"accounting_deleteAccount","classification":"DESTRUCTIVE","paramCount":1,"schema":"ecb746f60913","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete","paginates":false},
{"name":"accounting_deleteAccountingPeriod","classification":"DESTRUCTIVE","paramCount":1,"schema":"7e5905ac5974","response":"none","injectAuth":"companyId","permission":"accounting:delete","paginates":false},
{"name":"accounting_deleteCostCenter","classification":"DESTRUCTIVE","paramCount":1,"schema":"f8a3e6fec03f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete","paginates":false},
@@ -31,7 +31,7 @@
{"name":"accounting_deleteFixedAssetClass","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete","paginates":false},
{"name":"accounting_deleteJournalEntry","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete","paginates":false},
{"name":"accounting_deletePaymentTerm","classification":"DESTRUCTIVE","paramCount":1,"schema":"5386fbcf056f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete","paginates":false},
- {"name":"accounting_deleteProject","classification":"DESTRUCTIVE","paramCount":1,"schema":"8e1d73142851","response":"3797626bd17e","injectAuth":"companyId","permission":"accounting:delete","paginates":false},
+ {"name":"accounting_deleteProject","classification":"DESTRUCTIVE","paramCount":1,"schema":"8e1d73142851","response":"3797626bd17e","injectAuth":"companyId","permission":"accounting:delete","paginates":false,"context":"updatedBy=userId"},
{"name":"accounting_deleteReportView","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:delete","paginates":false},
{"name":"accounting_generateEliminations","classification":"WRITE","paramCount":1,"schema":"6205bcefb9ed","response":"cddf8275afa1","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create","paginates":false},
{"name":"accounting_getAccount","classification":"READ","paramCount":1,"schema":"ecb746f60913","response":"9d6890743f52","injectAuth":"companyId","permission":"accounting:view","paginates":false},
@@ -42,7 +42,7 @@
{"name":"accounting_getAccountLedger","classification":"READ","paramCount":6,"schema":"8ad7f551d78b","response":"c4542e5ba373","injectAuth":"companyId","permission":"accounting:view","paginates":true},
{"name":"accounting_getAccountLedgerSummary","classification":"READ","paramCount":3,"schema":"aad65f7c3f63","response":"0a28a92b28ff","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getAccountPeriodSeries","classification":"READ","paramCount":2,"schema":"d5db2abee293","response":"2c75339d9fde","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getAccounts","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"84821cb96b68","injectAuth":"companyId","permission":"accounting:view","paginates":true},
+ {"name":"accounting_getAccounts","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"84821cb96b68","injectAuth":"companyId","permission":"accounting:view","paginates":true,"defaults":"always"},
{"name":"accounting_getAccountsInScope","classification":"READ","paramCount":2,"schema":"44ea072844d3","response":"4c52cef1b6ab","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getAccountsList","classification":"READ","paramCount":3,"schema":"7592bd05f71d","response":"05b2ffc4c3d4","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getActiveDimensionsWithValues","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"1bfc101ae1de","injectAuth":"companyId","permission":"accounting:view","paginates":false},
@@ -51,13 +51,13 @@
{"name":"accounting_getBaseCurrencyDecimalPlaces","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"cddf8275afa1","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getChartOfAccounts","classification":"READ","paramCount":3,"schema":"b3b2e96654e5","response":"f561243f144b","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getCompaniesInGroup","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"032bba337af7","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getConsolidatedBalances","classification":"READ","paramCount":4,"schema":"966a7b50605d","response":"a74dd3597c00","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getConsolidatedPeriodSeries","classification":"READ","paramCount":3,"schema":"5b547443efed","response":"5483e69d7515","injectAuth":"companyId","permission":"accounting:view","paginates":false},
+ {"name":"accounting_getConsolidatedBalances","classification":"READ","paramCount":4,"schema":"966a7b50605d","response":"a74dd3597c00","injectAuth":"companyId","permission":"accounting:view","paginates":false,"context":"eliminationClient=client"},
+ {"name":"accounting_getConsolidatedPeriodSeries","classification":"READ","paramCount":3,"schema":"2e20e5d2d7f5","response":"5483e69d7515","injectAuth":"companyId","permission":"accounting:view","paginates":false,"context":"eliminationClient=client"},
{"name":"accounting_getCostCenter","classification":"READ","paramCount":1,"schema":"f8a3e6fec03f","response":"f7b898d20847","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getCostCenters","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"a27593ffa2de","injectAuth":"companyId","permission":"accounting:view","paginates":true},
+ {"name":"accounting_getCostCenters","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"a27593ffa2de","injectAuth":"companyId","permission":"accounting:view","paginates":true,"defaults":"always"},
{"name":"accounting_getCostCentersList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getCostCentersTree","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"b4505b9334e6","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getCurrencies","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"1d6055ff487c","injectAuth":"companyId","permission":"accounting:view","paginates":false},
+ {"name":"accounting_getCurrencies","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"1d6055ff487c","injectAuth":"companyId","permission":"accounting:view","paginates":false,"defaults":"always"},
{"name":"accounting_getCurrenciesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"01628a6ebd21","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getCurrency","classification":"READ","paramCount":1,"schema":"0e98c276626d","response":"6d5bae3dafd5","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getCurrencyByCode","classification":"READ","paramCount":1,"schema":"cc2bce783cc5","response":"300e136d14d0","injectAuth":"companyId","permission":"accounting:view","paginates":false},
@@ -65,47 +65,47 @@
{"name":"accounting_getDefaultAccounts","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"d9ea69255093","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getDepreciationRun","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"22ccbb1556ab","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getDepreciationRunLines","classification":"READ","paramCount":1,"schema":"e83946bf5ea7","response":"b9642696fc4d","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getDepreciationRuns","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"829d729e81c9","injectAuth":"companyId","permission":"accounting:view","paginates":true},
+ {"name":"accounting_getDepreciationRuns","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"829d729e81c9","injectAuth":"companyId","permission":"accounting:view","paginates":true,"defaults":"always"},
{"name":"accounting_getDimension","classification":"READ","paramCount":1,"schema":"96e5d0fb89ae","response":"e869e1d37e76","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getDimensionPivot","classification":"READ","paramCount":6,"schema":"4dc617d84588","response":"c7069f830357","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getDimensionPivotLines","classification":"READ","paramCount":17,"schema":"0cfa28a6205b","response":"100f0689af3e","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getDimensions","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"9beb5210c60e","injectAuth":"companyId","permission":"accounting:view","paginates":true},
+ {"name":"accounting_getDimensionPivot","classification":"READ","paramCount":6,"schema":"4dc617d84588","response":"c7069f830357","injectAuth":"companyGroupId+companyId","permission":"accounting:view","paginates":false,"defaults":"always"},
+ {"name":"accounting_getDimensionPivotLines","classification":"READ","paramCount":17,"schema":"6f74597ffe85","response":"100f0689af3e","injectAuth":"companyGroupId+companyId","permission":"accounting:view","paginates":false},
+ {"name":"accounting_getDimensions","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"9beb5210c60e","injectAuth":"companyId","permission":"accounting:view","paginates":true,"defaults":"always"},
{"name":"accounting_getExchangeRate","classification":"READ","paramCount":1,"schema":"cc2bce783cc5","response":"cddf8275afa1","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getExchangeRateHistory","classification":"READ","paramCount":1,"schema":"cc2bce783cc5","response":"ab784d246338","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getExchangeRates","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"7089bfe7df7a","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getExistingOpeningBalanceEntry","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3797626bd17e","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getFinancialStatementBalances","classification":"READ","paramCount":3,"schema":"267691af8c66","response":"f561243f144b","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getFinancialStatementPeriodSeries","classification":"READ","paramCount":3,"schema":"fad550797360","response":"5483e69d7515","injectAuth":"companyId","permission":"accounting:view","paginates":false},
+ {"name":"accounting_getFinancialStatementPeriodSeries","classification":"READ","paramCount":3,"schema":"27a6e6386ed2","response":"5483e69d7515","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getFiscalCalendarCommitted","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"854b90f7a9d3","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getFiscalYearSettings","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3a18729ffcd7","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getFixedAsset","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"8fc3060e3b11","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getFixedAssetClass","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"c9303619cf96","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getFixedAssetClasses","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"03a52bf94953","injectAuth":"companyId","permission":"accounting:view","paginates":true},
+ {"name":"accounting_getFixedAssetClasses","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"03a52bf94953","injectAuth":"companyId","permission":"accounting:view","paginates":true,"defaults":"always"},
{"name":"accounting_getFixedAssetClassesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"123f9f4a60f8","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getFixedAssetDisposal","classification":"READ","paramCount":1,"schema":"91f483e6fee8","response":"a079c03cd910","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getFixedAssets","classification":"READ","paramCount":4,"schema":"1a5b0795639f","response":"c787a7af07fc","injectAuth":"companyId","permission":"accounting:view","paginates":true},
+ {"name":"accounting_getFixedAssets","classification":"READ","paramCount":4,"schema":"b747d393d58e","response":"c787a7af07fc","injectAuth":"companyId","permission":"accounting:view","paginates":true,"defaults":"always"},
{"name":"accounting_getFixedAssetsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0c62226f500a","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getFixedAssetsListForSale","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0c62226f500a","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getFixedAssetUsageLogs","classification":"READ","paramCount":1,"schema":"91f483e6fee8","response":"517f4c28c365","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getGroupAccounts","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"a9a2c5be8164","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getIntercompanyBalance","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f2f76b33a3df","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getIntercompanyEliminationLines","classification":"READ","paramCount":1,"schema":"b9efe4d053a7","response":"e23adccbd115","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getIntercompanyTransactions","classification":"READ","paramCount":3,"schema":"5ba9d4ce2300","response":"05e10eb50000","injectAuth":"companyId","permission":"accounting:view","paginates":true},
- {"name":"accounting_getJournalEntries","classification":"READ","paramCount":4,"schema":"099269e45600","response":"8e4e2a1e7612","injectAuth":"companyId","permission":"accounting:view","paginates":true},
+ {"name":"accounting_getIntercompanyTransactions","classification":"READ","paramCount":3,"schema":"db142abe3913","response":"05e10eb50000","injectAuth":"companyId","permission":"accounting:view","paginates":true,"defaults":"always"},
+ {"name":"accounting_getJournalEntries","classification":"READ","paramCount":4,"schema":"85098b9cb044","response":"8e4e2a1e7612","injectAuth":"companyId","permission":"accounting:view","paginates":true,"defaults":"always"},
{"name":"accounting_getJournalEntry","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"86eb1184c5df","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getJournalLineDimensions","classification":"READ","paramCount":1,"schema":"4a6413e2bb5a","response":"b731368c1d3c","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getJournalSyncCompleteness","classification":"READ","paramCount":3,"schema":"6eb0a36bbd4b","response":"58d45b19b00c","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getOrCreateAccountingPeriod","classification":"WRITE","paramCount":2,"schema":"6f30968ab39a","response":"00404e686415","injectAuth":"companyId","permission":"accounting:update","paginates":false},
+ {"name":"accounting_getOrCreateAccountingPeriod","classification":"WRITE","paramCount":2,"schema":"66b4745947ec","response":"00404e686415","injectAuth":"companyId","permission":"accounting:update","paginates":false},
{"name":"accounting_getPaymentTerm","classification":"READ","paramCount":1,"schema":"5386fbcf056f","response":"f7f39c0d662f","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getPaymentTerms","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7e3500d5e372","injectAuth":"companyId","permission":"accounting:view","paginates":true},
+ {"name":"accounting_getPaymentTerms","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"7e3500d5e372","injectAuth":"companyId","permission":"accounting:view","paginates":true,"defaults":"always"},
{"name":"accounting_getPaymentTermsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getPeriodCloseChecklist","classification":"WRITE","paramCount":1,"schema":"7e5905ac5974","response":"032d2a02eff5","injectAuth":"companyId","permission":"accounting:update","paginates":false},
{"name":"accounting_getPeriodCloseReadiness","classification":"READ","paramCount":1,"schema":"7e5905ac5974","response":"8d3446dc0828","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getPeriodCloseTaskDefinitions","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"273a27083497","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getPeriodExternalGlSyncReadiness","classification":"READ","paramCount":2,"schema":"265827be4a3e","response":"0963c785f5ca","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getProject","classification":"READ","paramCount":1,"schema":"8e1d73142851","response":"b9294ccc5a24","injectAuth":"companyId","permission":"accounting:view","paginates":false},
- {"name":"accounting_getProjects","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"48b654f2a9fa","injectAuth":"companyId","permission":"accounting:view","paginates":true},
- {"name":"accounting_getPurchaseLinePivot","classification":"READ","paramCount":4,"schema":"53729b2674ee","response":"c7069f830357","injectAuth":"companyId","permission":"accounting:view","paginates":false},
+ {"name":"accounting_getProjects","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"48b654f2a9fa","injectAuth":"companyId","permission":"accounting:view","paginates":true,"defaults":"always"},
+ {"name":"accounting_getPurchaseLinePivot","classification":"READ","paramCount":4,"schema":"53729b2674ee","response":"c7069f830357","injectAuth":"companyId","permission":"accounting:view","paginates":false,"defaults":"always"},
{"name":"accounting_getPurchaseLinePivotLines","classification":"READ","paramCount":10,"schema":"d23c9f2398a4","response":"a12b8efe2d62","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getReportPins","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3536c9c9a314","injectAuth":"companyId","permission":"accounting:view","paginates":false},
{"name":"accounting_getReportViews","classification":"READ","paramCount":1,"schema":"f60ae5d8a496","response":"7f6aad3009db","injectAuth":"companyId","permission":"accounting:view","paginates":false},
@@ -117,7 +117,7 @@
{"name":"accounting_postJournalEntry","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId","permission":"accounting:update","paginates":false},
{"name":"accounting_reverseJournalEntry","classification":"WRITE","paramCount":2,"schema":"d25804b3560c","response":"3797626bd17e","injectAuth":"companyId+userId","permission":"accounting:update","paginates":false},
{"name":"accounting_runIntercompanyMatching","classification":"WRITE","paramCount":0,"schema":"efddc7bd8bbc","response":"c07d47c6ac75","injectAuth":"companyId+updatedBy","permission":"accounting:update","paginates":false},
- {"name":"accounting_saveJournalEntryWithLines","classification":"DESTRUCTIVE","paramCount":4,"schema":"229dfb3214ba","response":"8394fbabd845","injectAuth":"companyId","permission":"accounting:update","paginates":false},
+ {"name":"accounting_saveJournalEntryWithLines","classification":"DESTRUCTIVE","paramCount":4,"schema":"229dfb3214ba","response":"8394fbabd845","injectAuth":"companyGroupId+companyId","permission":"accounting:update","paginates":false},
{"name":"accounting_saveJournalLineDimensions","classification":"DESTRUCTIVE","paramCount":2,"schema":"7982c7b53f63","response":"bcde375ebd4c","injectAuth":"companyId","permission":"accounting:update","paginates":false},
{"name":"accounting_skipCloseTask","classification":"WRITE","paramCount":2,"schema":"8d4ab2b60f5f","response":"none","injectAuth":"companyId+userId","permission":"accounting:update","paginates":false},
{"name":"accounting_translateCompanyBalances","classification":"WRITE","paramCount":4,"schema":"ba889d393571","response":"be5b093fb6e6","injectAuth":"companyId","permission":"accounting:update","paginates":false},
@@ -125,22 +125,22 @@
{"name":"accounting_updateDefaultAccounts","classification":"WRITE","paramCount":51,"schema":"e69493bf3220","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"accounting:update","paginates":false},
{"name":"accounting_updateFiscalYearSettings","classification":"WRITE","paramCount":2,"schema":"b13ac9bf329b","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"accounting:update","paginates":false},
{"name":"accounting_updateFixedAsset","classification":"WRITE","paramCount":16,"schema":"c5872851f04c","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"accounting:update","paginates":false},
- {"name":"accounting_upsertAccount","classification":"WRITE","paramCount":10,"schema":"0b4871d25164","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false,"upsert":"id"},
+ {"name":"accounting_upsertAccount","classification":"WRITE","paramCount":10,"schema":"0b4871d25164","response":"3797626bd17e","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false,"upsert":"id"},
{"name":"accounting_upsertCostCenter","classification":"WRITE","paramCount":5,"schema":"cb41a65d1346","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false,"upsert":"id"},
- {"name":"accounting_upsertCurrency","classification":"WRITE","paramCount":5,"schema":"8b35738390cc","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false,"upsert":"id"},
- {"name":"accounting_upsertDimension","classification":"DESTRUCTIVE","paramCount":2,"schema":"820eea627efe","response":"660c8bead643","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false,"upsert":"id"},
+ {"name":"accounting_upsertCurrency","classification":"WRITE","paramCount":5,"schema":"8b35738390cc","response":"3797626bd17e","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false,"upsert":"id"},
+ {"name":"accounting_upsertDimension","classification":"DESTRUCTIVE","paramCount":2,"schema":"820eea627efe","response":"660c8bead643","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false,"upsert":"id"},
{"name":"accounting_upsertExchangeRateOverride","classification":"WRITE","paramCount":2,"schema":"4576f689f2fa","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false},
{"name":"accounting_upsertFixedAssetClass","classification":"WRITE","paramCount":1,"schema":"1b7fede70b27","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false,"upsert":"id"},
{"name":"accounting_upsertPaymentTerm","classification":"WRITE","paramCount":7,"schema":"857007388d52","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false,"upsert":"id"},
{"name":"accounting_upsertProject","classification":"WRITE","paramCount":3,"schema":"8bcec28be313","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false,"upsert":"id"},
{"name":"accounting_upsertReportPin","classification":"WRITE","paramCount":2,"schema":"28ab82d5033e","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"accounting:create+update","paginates":false},
- {"name":"accounting_upsertReportView","classification":"WRITE","paramCount":1,"schema":"d91fde891b7f","response":"b8ded59f5c56","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false},
+ {"name":"accounting_upsertReportView","classification":"WRITE","paramCount":1,"schema":"394fe1eaa481","response":"b8ded59f5c56","injectAuth":"companyId+createdBy+updatedBy","permission":"accounting:create+update","paginates":false,"upsert":"id"},
{"name":"documents_createDocumentUploadUrl","classification":"WRITE","paramCount":3,"schema":"9034f525c97e","response":"4ad76afe0777","injectAuth":"companyId+createdBy+updatedBy","permission":"documents:create","paginates":false},
{"name":"documents_deleteDocument","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"documents:delete","paginates":false},
{"name":"documents_getDocument","classification":"READ","paramCount":1,"schema":"e7617eb689c8","response":"88539143f954","injectAuth":"companyId","permission":"documents:view","paginates":false},
{"name":"documents_getDocumentExtensions","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"a07a74ca3dd1","injectAuth":"companyId","permission":"documents:view","paginates":false},
{"name":"documents_getDocumentLabels","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"7e2eeb0066ab","injectAuth":"companyId","permission":"documents:view","paginates":false},
- {"name":"documents_getDocuments","classification":"READ","paramCount":6,"schema":"848cac7bea79","response":"806ff23e9acc","injectAuth":"companyId","permission":"documents:view","paginates":true},
+ {"name":"documents_getDocuments","classification":"READ","paramCount":6,"schema":"8f9f1309d9dd","response":"806ff23e9acc","injectAuth":"companyId","permission":"documents:view","paginates":true,"defaults":"always"},
{"name":"documents_insertDocumentExtraction","classification":"WRITE","paramCount":4,"schema":"790f2b883984","response":"d181256b2684","injectAuth":"companyId+createdBy+updatedBy","permission":"documents:create","paginates":false},
{"name":"documents_insertUploadedDocument","classification":"WRITE","paramCount":5,"schema":"d82e74374bd6","response":"697b262639cd","injectAuth":"companyId+createdBy+updatedBy","permission":"documents:create","paginates":false},
{"name":"documents_moveDocumentToTrash","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"documents:update","paginates":false},
@@ -177,26 +177,26 @@
{"name":"inventory_getDefaultStorageUnitOrStorageUnitWithHighestQuantity","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"174e29b899b9","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getEffectiveWorkCenterId","classification":"READ","paramCount":1,"schema":"c728bf7e5b37","response":"00404e686415","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getInventoryCount","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"b707251b11c4","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getInventoryCountLines","classification":"READ","paramCount":2,"schema":"05dd6f9fd306","response":"e4219573b12b","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getInventoryCountLines","classification":"READ","paramCount":2,"schema":"65abbb307e1c","response":"e4219573b12b","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getInventoryCountLineSummary","classification":"READ","paramCount":1,"schema":"e354150046fe","response":"7a06e37fcf2a","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getInventoryCountMovements","classification":"READ","paramCount":1,"schema":"e354150046fe","response":"8948b38be02b","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getInventoryCounts","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"43536f2bda72","injectAuth":"companyId","permission":"inventory:view","paginates":true},
- {"name":"inventory_getInventoryItems","classification":"READ","paramCount":2,"schema":"68cb4a73d5a9","response":"5baddb3a890c","injectAuth":"companyId","permission":"inventory:view","paginates":true},
- {"name":"inventory_getInventoryItemsCount","classification":"READ","paramCount":2,"schema":"68cb4a73d5a9","response":"8394fbabd845","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getInventoryCounts","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"43536f2bda72","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
+ {"name":"inventory_getInventoryItems","classification":"READ","paramCount":2,"schema":"c3aa3d6832b9","response":"5baddb3a890c","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
+ {"name":"inventory_getInventoryItemsCount","classification":"READ","paramCount":2,"schema":"c3aa3d6832b9","response":"8394fbabd845","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getInventoryValuation","classification":"READ","paramCount":2,"schema":"288f0d29701b","response":"4005e935f8f1","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getInventoryValuationTieOut","classification":"READ","paramCount":1,"schema":"cb789596bf56","response":"20aee38c95a3","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getItemLedgerActivity","classification":"READ","paramCount":5,"schema":"b898b72c5939","response":"8d500cb0a03f","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getItemLedgerBalance","classification":"READ","paramCount":3,"schema":"33e76470e057","response":"cddf8275afa1","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getItemLedgerPage","classification":"READ","paramCount":4,"schema":"7ef5489d0abf","response":"8d500cb0a03f","injectAuth":"companyId","permission":"inventory:view","paginates":true},
{"name":"inventory_getKanban","classification":"READ","paramCount":1,"schema":"369f807bc840","response":"c5aa7a081ed4","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getKanbans","classification":"READ","paramCount":2,"schema":"68cb4a73d5a9","response":"fa96e94d8dda","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getKanbans","classification":"READ","paramCount":2,"schema":"c3aa3d6832b9","response":"fa96e94d8dda","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getPickingList","classification":"READ","paramCount":1,"schema":"0a4ec3e7319b","response":"227255936b96","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getPickingListAvailability","classification":"READ","paramCount":1,"schema":"0a4ec3e7319b","response":"none","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getPickingListLine","classification":"READ","paramCount":1,"schema":"063a6777d378","response":"b51ad23d436f","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getPickingListLines","classification":"READ","paramCount":1,"schema":"0a4ec3e7319b","response":"b3ab0a2018d9","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getPickingListLineTrackedEntities","classification":"READ","paramCount":1,"schema":"063a6777d378","response":"51dd622ce168","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getPickingListRecommendations","classification":"READ","paramCount":1,"schema":"0a4ec3e7319b","response":"24283057a15d","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getPickingLists","classification":"READ","paramCount":6,"schema":"3599c50bdc36","response":"2112d9a1ea1d","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getPickingLists","classification":"READ","paramCount":6,"schema":"c17334a443b6","response":"2112d9a1ea1d","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getPickingSchedule","classification":"READ","paramCount":2,"schema":"b3a9deeaf0d0","response":"19467666efcd","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getPickOrder","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"7fa0311f0d0a","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getPicksByJobMaterial","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"b53992cb5f0c","injectAuth":"companyId","permission":"inventory:view","paginates":false},
@@ -204,7 +204,7 @@
{"name":"inventory_getReceiptFiles","classification":"READ","paramCount":1,"schema":"749e5d81384a","response":"5483e69d7515","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getReceiptLines","classification":"READ","paramCount":1,"schema":"e00a9764517d","response":"15b7b17f7652","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getReceiptLineTracking","classification":"READ","paramCount":1,"schema":"17337505bb69","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getReceipts","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"a19e9d631841","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getReceipts","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"a19e9d631841","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getReceiptTracking","classification":"READ","paramCount":1,"schema":"e00a9764517d","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getSerialNumbersForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getShelfLifeForItems","classification":"READ","paramCount":1,"schema":"c4ca22fd1816","response":"4c5d680d898e","injectAuth":"companyId","permission":"inventory:view","paginates":false},
@@ -214,35 +214,35 @@
{"name":"inventory_getShipmentLinesWithDetails","classification":"READ","paramCount":1,"schema":"2e39a760a5ca","response":"c158915aa9b9","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getShipmentLineTracking","classification":"READ","paramCount":1,"schema":"84320a09c1ac","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getShipmentRelatedItems","classification":"READ","paramCount":2,"schema":"f81a81d39efa","response":"0dffc8b505f6","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getShipments","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"b8b287b3a17f","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getShipments","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"b8b287b3a17f","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getShipmentTracking","classification":"READ","paramCount":1,"schema":"2e39a760a5ca","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getShippingMethod","classification":"READ","paramCount":1,"schema":"493e990b5f3d","response":"65413dd34c52","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getShippingMethods","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"104aa0df039d","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getShippingMethods","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"104aa0df039d","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getShippingMethodsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getShippingTermsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStockMovementEffectiveQuantity","classification":"READ","paramCount":1,"schema":"a40494d32d29","response":"2e1967d88231","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getStockMovements","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"8948b38be02b","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getStockMovements","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"8948b38be02b","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getStockTransfer","classification":"READ","paramCount":1,"schema":"38111ae0fa2a","response":"0f59b3fa09f8","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStockTransferLine","classification":"READ","paramCount":1,"schema":"0bbd6a946791","response":"a34287fc1477","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStockTransferLines","classification":"READ","paramCount":1,"schema":"38111ae0fa2a","response":"bcb01288cc29","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getStockTransfers","classification":"READ","paramCount":4,"schema":"88605456fa2d","response":"77ebb4ee443b","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getStockTransfers","classification":"READ","paramCount":4,"schema":"acb88488ed54","response":"77ebb4ee443b","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getStockTransferTracking","classification":"READ","paramCount":1,"schema":"38111ae0fa2a","response":"20f8627b948f","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStorageType","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"4bbb50609deb","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getStorageTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"28837d034643","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getStorageTypes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"28837d034643","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getStorageTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStorageTypeUsage","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStorageUnit","classification":"READ","paramCount":1,"schema":"c728bf7e5b37","response":"a5bf237a9aeb","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStorageUnitChildren","classification":"READ","paramCount":1,"schema":"06f6e8f8f9f5","response":"7eea15677f40","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStorageUnitDescendants","classification":"READ","paramCount":1,"schema":"c728bf7e5b37","response":"3bae190e2656","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStorageUnitParentIdsWithChildren","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"681004346c78","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getStorageUnitRoots","classification":"READ","paramCount":2,"schema":"68cb4a73d5a9","response":"7eea15677f40","injectAuth":"companyId","permission":"inventory:view","paginates":true},
- {"name":"inventory_getStorageUnits","classification":"READ","paramCount":2,"schema":"68cb4a73d5a9","response":"7eea15677f40","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getStorageUnitRoots","classification":"READ","paramCount":2,"schema":"c3aa3d6832b9","response":"7eea15677f40","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
+ {"name":"inventory_getStorageUnits","classification":"READ","paramCount":2,"schema":"c3aa3d6832b9","response":"7eea15677f40","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getStorageUnitsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStorageUnitsListForLocation","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"ce08332e0ce6","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStorageUnitsTreeForLocation","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"ecdf2c570468","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStorageUnitSubtrees","classification":"READ","paramCount":3,"schema":"c5258b49b1b9","response":"10e6a05f40e5","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getStorageUnitTree","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"3bae190e2656","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getTrackedEntities","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getTrackedEntities","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_getTrackedEntitiesByMakeMethodId","classification":"READ","paramCount":1,"schema":"c32158774ba3","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getTrackedEntitiesByOperationId","classification":"READ","paramCount":1,"schema":"c407a9edb930","response":"c20d7cb06756","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getTrackedEntity","classification":"READ","paramCount":1,"schema":"5d58d420052a","response":"d485710baf81","injectAuth":"companyId","permission":"inventory:view","paginates":false},
@@ -251,7 +251,7 @@
{"name":"inventory_getWarehouseTransfer","classification":"READ","paramCount":1,"schema":"d51f098ead24","response":"45af922ea324","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getWarehouseTransferLine","classification":"READ","paramCount":2,"schema":"31f24bda931b","response":"945dc2c1255f","injectAuth":"companyId","permission":"inventory:view","paginates":false},
{"name":"inventory_getWarehouseTransferLines","classification":"READ","paramCount":1,"schema":"d51f098ead24","response":"8a92aaed64aa","injectAuth":"companyId","permission":"inventory:view","paginates":false},
- {"name":"inventory_getWarehouseTransfers","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"66ec9f5f0ca8","injectAuth":"companyId","permission":"inventory:view","paginates":true},
+ {"name":"inventory_getWarehouseTransfers","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"66ec9f5f0ca8","injectAuth":"companyId","permission":"inventory:view","paginates":true,"defaults":"always"},
{"name":"inventory_insertInventoryCount","classification":"WRITE","paramCount":6,"schema":"f9ea90011f9a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create","paginates":false},
{"name":"inventory_insertManualInventoryAdjustment","classification":"WRITE","paramCount":12,"schema":"dc3fda774cf4","response":"3797626bd17e","injectAuth":"companyId+createdBy","permission":"inventory:create","paginates":false},
{"name":"inventory_insertStockTransfer","classification":"DESTRUCTIVE","paramCount":4,"schema":"623ca286b237","response":"910187eb9b58","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create","paginates":false},
@@ -264,13 +264,13 @@
{"name":"inventory_updateBatchPropertyOrder","classification":"WRITE","paramCount":3,"schema":"ed0f513719d1","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"inventory:update","paginates":false},
{"name":"inventory_updateInventoryCountLine","classification":"WRITE","paramCount":3,"schema":"d0dcc5796dc7","response":"ae8f99e1d130","injectAuth":"companyId+updatedBy","permission":"inventory:update","paginates":false},
{"name":"inventory_updateInventoryCountStatus","classification":"WRITE","paramCount":3,"schema":"7b6f2e6e7731","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"inventory:update","paginates":false},
- {"name":"inventory_updatePickingListStatus","classification":"WRITE","paramCount":2,"schema":"27fb9b18332a","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"inventory:update","paginates":false},
+ {"name":"inventory_updatePickingListStatus","classification":"WRITE","paramCount":2,"schema":"27fb9b18332a","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"inventory:update","paginates":false,"context":"updatedBy=userId"},
{"name":"inventory_updateStockTransferStatus","classification":"WRITE","paramCount":4,"schema":"e201e5617e35","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"inventory:update","paginates":false},
{"name":"inventory_updateTrackedEntityExpiry","classification":"WRITE","paramCount":4,"schema":"ebdc5286d20c","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy+userId","permission":"inventory:update","paginates":false},
{"name":"inventory_updateWarehouseTransfer","classification":"WRITE","paramCount":10,"schema":"a809aeb69e6d","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"inventory:update","paginates":false},
- {"name":"inventory_updateWarehouseTransferStatus","classification":"WRITE","paramCount":2,"schema":"70cb7f36b2a6","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"inventory:update","paginates":false},
+ {"name":"inventory_updateWarehouseTransferStatus","classification":"WRITE","paramCount":2,"schema":"70cb7f36b2a6","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"inventory:update","paginates":false,"context":"updatedBy=userId"},
{"name":"inventory_upsertBatchProperty","classification":"WRITE","paramCount":6,"schema":"6fcfef7093ed","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"inventory:create+update","paginates":false},
- {"name":"inventory_upsertKanban","classification":"WRITE","paramCount":14,"schema":"4b5b4cc14d79","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update","paginates":false,"upsert":"id"},
+ {"name":"inventory_upsertKanban","classification":"WRITE","paramCount":14,"schema":"9500a3f1264b","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update","paginates":false,"upsert":"id","defaults":"create"},
{"name":"inventory_upsertPickingList","classification":"WRITE","paramCount":7,"schema":"dbe65909f79e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update","paginates":false,"upsert":"id"},
{"name":"inventory_upsertReceipt","classification":"WRITE","paramCount":9,"schema":"a3061dfb8ce9","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update","paginates":false,"upsert":"id"},
{"name":"inventory_upsertShipment","classification":"WRITE","paramCount":10,"schema":"b672e5466228","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update","paginates":false,"upsert":"id"},
@@ -281,7 +281,7 @@
{"name":"inventory_upsertWarehouseTransferLine","classification":"WRITE","paramCount":1,"schema":"93538fae689b","response":"237082879d41","injectAuth":"companyId+createdBy+updatedBy","permission":"inventory:create+update","paginates":false},
{"name":"invoicing_applyCreditsToInvoices","classification":"DESTRUCTIVE","paramCount":4,"schema":"404db2e47d09","response":"none","injectAuth":"companyId+createdBy","permission":"invoicing:update","paginates":false},
{"name":"invoicing_computeEarlyPaymentDiscounts","classification":"READ","paramCount":3,"schema":"0069677fb034","response":"none","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
- {"name":"invoicing_computeInvoiceDateDue","classification":"READ","paramCount":2,"schema":"c07433aded5b","response":"174e29b899b9","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
+ {"name":"invoicing_computeInvoiceDateDue","classification":"READ","paramCount":2,"schema":"7e387955a4f8","response":"174e29b899b9","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_createPurchaseInvoiceFromPurchaseOrder","classification":"WRITE","paramCount":1,"schema":"28cffcd9d6e8","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create","paginates":false},
{"name":"invoicing_createSalesInvoiceFromSalesOrder","classification":"WRITE","paramCount":1,"schema":"d160a49d6787","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create","paginates":false},
{"name":"invoicing_createSalesInvoiceFromShipment","classification":"WRITE","paramCount":1,"schema":"2e39a760a5ca","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create","paginates":false},
@@ -291,62 +291,62 @@
{"name":"invoicing_deletePurchaseInvoiceLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"af656ed8709f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"invoicing:delete","paginates":false},
{"name":"invoicing_deleteSalesInvoice","classification":"DESTRUCTIVE","paramCount":1,"schema":"9e382a0affeb","response":"bcde375ebd4c","injectAuth":"companyId","permission":"invoicing:delete","paginates":false},
{"name":"invoicing_deleteSalesInvoiceLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"352db7d38a15","response":"bcde375ebd4c","injectAuth":"companyId","permission":"invoicing:delete","paginates":false},
- {"name":"invoicing_getApAging","classification":"READ","paramCount":2,"schema":"a0de641b20f5","response":"eca97da3238d","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
+ {"name":"invoicing_getApAging","classification":"READ","paramCount":2,"schema":"9db366ef805c","response":"eca97da3238d","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getApOpenBySupplier","classification":"READ","paramCount":1,"schema":"00e9099a963a","response":"cfaa2af435c0","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getApTieOut","classification":"READ","paramCount":1,"schema":"00e9099a963a","response":"194f80599d96","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
- {"name":"invoicing_getArAging","classification":"READ","paramCount":2,"schema":"a0de641b20f5","response":"10729e9f1c72","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
+ {"name":"invoicing_getArAging","classification":"READ","paramCount":2,"schema":"9db366ef805c","response":"10729e9f1c72","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getArOpenByCustomer","classification":"READ","paramCount":1,"schema":"00e9099a963a","response":"8cd731dddf0d","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getArTieOut","classification":"READ","paramCount":1,"schema":"00e9099a963a","response":"194f80599d96","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getAvailableCreditsForParty","classification":"READ","paramCount":3,"schema":"cc95c9088447","response":"f8e7a5443d43","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getAvailableOnAccountCredit","classification":"READ","paramCount":1,"schema":"2bfa7d907171","response":"cddf8275afa1","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getAvailableOnAccountCreditSources","classification":"READ","paramCount":2,"schema":"b09149f439eb","response":"bd1dd61e7055","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getCharge","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"4d45de90549b","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
- {"name":"invoicing_getCharges","classification":"READ","paramCount":5,"schema":"39305c3c8ba7","response":"a1c047af8dd8","injectAuth":"companyId","permission":"invoicing:view","paginates":true},
+ {"name":"invoicing_getCharges","classification":"READ","paramCount":5,"schema":"3b1a78f3ef00","response":"a1c047af8dd8","injectAuth":"companyId","permission":"invoicing:view","paginates":true,"defaults":"always"},
{"name":"invoicing_getCompanyHasOpenCredits","classification":"READ","paramCount":1,"schema":"ffed91643c1d","response":"7cb541e84f22","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getInvoiceSettlements","classification":"READ","paramCount":1,"schema":"bd163ca304cd","response":"5483e69d7515","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getInvoiceSettlementsForInvoice","classification":"READ","paramCount":2,"schema":"9d6509fa2229","response":"a334c4e05d56","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getMemo","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"cf9b5fc48d0d","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getMemoApplications","classification":"READ","paramCount":1,"schema":"188417093a55","response":"8b54c25de723","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
- {"name":"invoicing_getMemos","classification":"READ","paramCount":7,"schema":"90a1e818ba7d","response":"6248af912f0c","injectAuth":"companyId","permission":"invoicing:view","paginates":true},
+ {"name":"invoicing_getMemos","classification":"READ","paramCount":7,"schema":"8f6810d90c81","response":"6248af912f0c","injectAuth":"companyId","permission":"invoicing:view","paginates":true,"defaults":"always"},
{"name":"invoicing_getOpenPurchaseInvoicesForSupplier","classification":"READ","paramCount":2,"schema":"da8678ca28c2","response":"ee597165b5f5","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getOpenReimbursementsForEmployee","classification":"READ","paramCount":2,"schema":"8c83e701c013","response":"84fe5db303b4","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getOpenSalesInvoicesForCustomer","classification":"READ","paramCount":2,"schema":"2d555b8aaf06","response":"ee597165b5f5","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getPayment","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"c9e4f60b4eac","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getPaymentCurrencyConfiguration","classification":"READ","paramCount":1,"schema":"cc2bce783cc5","response":"35b15cbf37ce","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
- {"name":"invoicing_getPayments","classification":"READ","paramCount":8,"schema":"8294255666da","response":"efd3e2d505f4","injectAuth":"companyId","permission":"invoicing:view","paginates":true},
+ {"name":"invoicing_getPayments","classification":"READ","paramCount":8,"schema":"fc068ce64697","response":"efd3e2d505f4","injectAuth":"companyId","permission":"invoicing:view","paginates":true,"defaults":"always"},
{"name":"invoicing_getPurchaseInvoice","classification":"READ","paramCount":1,"schema":"9fcbb4e4e012","response":"656b64f44b73","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getPurchaseInvoiceDelivery","classification":"READ","paramCount":1,"schema":"9fcbb4e4e012","response":"57af27aeef3b","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getPurchaseInvoiceLine","classification":"READ","paramCount":1,"schema":"af656ed8709f","response":"3e8c9c34d057","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getPurchaseInvoiceLines","classification":"READ","paramCount":1,"schema":"9fcbb4e4e012","response":"d40f758d4c25","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
- {"name":"invoicing_getPurchaseInvoices","classification":"READ","paramCount":4,"schema":"53339fd228e4","response":"e14efcf49a89","injectAuth":"companyId","permission":"invoicing:view","paginates":true},
+ {"name":"invoicing_getPurchaseInvoices","classification":"READ","paramCount":4,"schema":"5571215d4362","response":"e14efcf49a89","injectAuth":"companyId","permission":"invoicing:view","paginates":true,"defaults":"always"},
{"name":"invoicing_getReimbursement","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"c1191896ef6c","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
- {"name":"invoicing_getReimbursements","classification":"READ","paramCount":5,"schema":"48162461f1e9","response":"9bad0fb8b063","injectAuth":"companyId","permission":"invoicing:view","paginates":true},
+ {"name":"invoicing_getReimbursements","classification":"READ","paramCount":5,"schema":"45f5b7cdee07","response":"9bad0fb8b063","injectAuth":"companyId","permission":"invoicing:view","paginates":true,"defaults":"always"},
{"name":"invoicing_getSalesInvoice","classification":"READ","paramCount":1,"schema":"9e382a0affeb","response":"9bd064b06b23","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getSalesInvoiceCustomerDetails","classification":"READ","paramCount":1,"schema":"9e382a0affeb","response":"d592e414f201","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getSalesInvoiceLine","classification":"READ","paramCount":1,"schema":"352db7d38a15","response":"05a4fb9e3bcf","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getSalesInvoiceLines","classification":"READ","paramCount":1,"schema":"9e382a0affeb","response":"b7f2e34a7b22","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
- {"name":"invoicing_getSalesInvoices","classification":"READ","paramCount":4,"schema":"f682a832527b","response":"d0445b461305","injectAuth":"companyId","permission":"invoicing:view","paginates":true},
+ {"name":"invoicing_getSalesInvoices","classification":"READ","paramCount":4,"schema":"03a6ebc93561","response":"d0445b461305","injectAuth":"companyId","permission":"invoicing:view","paginates":true,"defaults":"always"},
{"name":"invoicing_getSalesInvoiceShipment","classification":"READ","paramCount":1,"schema":"9e382a0affeb","response":"43114f5895a3","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
{"name":"invoicing_getStagedCreditsForPayment","classification":"READ","paramCount":2,"schema":"d67008f41829","response":"5a23b05562f4","injectAuth":"companyId","permission":"invoicing:view","paginates":false},
- {"name":"invoicing_insertPurchaseInvoice","classification":"DESTRUCTIVE","paramCount":15,"schema":"15dc8b208ca1","response":"24b4b1602470","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create","paginates":false},
- {"name":"invoicing_insertSalesInvoice","classification":"DESTRUCTIVE","paramCount":14,"schema":"56c402cfa5a8","response":"24b4b1602470","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create","paginates":false},
- {"name":"invoicing_replaceInvoiceSettlements","classification":"DESTRUCTIVE","paramCount":2,"schema":"66ab03790336","response":"none","injectAuth":"companyId+createdBy","permission":"invoicing:update","paginates":false},
+ {"name":"invoicing_insertPurchaseInvoice","classification":"DESTRUCTIVE","paramCount":15,"schema":"15dc8b208ca1","response":"24b4b1602470","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"invoicing:create","paginates":false},
+ {"name":"invoicing_insertSalesInvoice","classification":"DESTRUCTIVE","paramCount":14,"schema":"56c402cfa5a8","response":"24b4b1602470","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"invoicing:create","paginates":false},
+ {"name":"invoicing_replaceInvoiceSettlements","classification":"DESTRUCTIVE","paramCount":2,"schema":"66ab03790336","response":"none","injectAuth":"companyId+createdBy","permission":"invoicing:update","paginates":false,"defaults":"always"},
{"name":"invoicing_updatePurchaseInvoice","classification":"WRITE","paramCount":15,"schema":"304bf354aa67","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
{"name":"invoicing_updatePurchaseInvoiceExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
{"name":"invoicing_updatePurchaseInvoiceLineOrder","classification":"WRITE","paramCount":2,"schema":"a1679a3eb9b5","response":"none","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
- {"name":"invoicing_updatePurchaseInvoiceStatus","classification":"WRITE","paramCount":4,"schema":"f50dc1abbd65","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
- {"name":"invoicing_updateReimbursement","classification":"WRITE","paramCount":8,"schema":"0e154f37c18f","response":"def495be96e6","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
+ {"name":"invoicing_updatePurchaseInvoiceStatus","classification":"WRITE","paramCount":4,"schema":"8d7fbe05b680","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
+ {"name":"invoicing_updateReimbursement","classification":"WRITE","paramCount":8,"schema":"ff96110da3d7","response":"def495be96e6","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
{"name":"invoicing_updateSalesInvoice","classification":"WRITE","paramCount":15,"schema":"71a9939b9245","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
{"name":"invoicing_updateSalesInvoiceExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
{"name":"invoicing_updateSalesInvoiceLineOrder","classification":"WRITE","paramCount":2,"schema":"a1679a3eb9b5","response":"none","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
- {"name":"invoicing_updateSalesInvoiceStatus","classification":"WRITE","paramCount":4,"schema":"be5f9d03d216","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
- {"name":"invoicing_upsertMemo","classification":"WRITE","paramCount":12,"schema":"1e192982b199","response":"1e0d0fa1a854","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update","paginates":false,"upsert":"id"},
- {"name":"invoicing_upsertPayment","classification":"WRITE","paramCount":14,"schema":"7170f90a5e0f","response":"1a922c685a61","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update","paginates":false,"upsert":"id"},
- {"name":"invoicing_upsertPurchaseInvoiceDelivery","classification":"WRITE","paramCount":8,"schema":"b8c735d9fdc9","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"invoicing:create+update","paginates":false},
- {"name":"invoicing_upsertPurchaseInvoiceLine","classification":"WRITE","paramCount":23,"schema":"fcdedfb7917d","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update","paginates":false},
- {"name":"invoicing_upsertReimbursementLines","classification":"DESTRUCTIVE","paramCount":2,"schema":"bbd679fc02ea","response":"cddf8275afa1","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update","paginates":false},
- {"name":"invoicing_upsertSalesInvoiceLine","classification":"WRITE","paramCount":21,"schema":"269af72d8a49","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update","paginates":false},
- {"name":"invoicing_upsertSalesInvoiceShipment","classification":"WRITE","paramCount":8,"schema":"f7667f28735c","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update","paginates":false},
+ {"name":"invoicing_updateSalesInvoiceStatus","classification":"WRITE","paramCount":4,"schema":"ff25b3acf517","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
+ {"name":"invoicing_upsertMemo","classification":"WRITE","paramCount":12,"schema":"0369e0154c99","response":"1e0d0fa1a854","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update","paginates":false,"upsert":"id","defaults":"create"},
+ {"name":"invoicing_upsertPayment","classification":"WRITE","paramCount":14,"schema":"a4b752ede10d","response":"1a922c685a61","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update","paginates":false,"upsert":"id","defaults":"create"},
+ {"name":"invoicing_upsertPurchaseInvoiceDelivery","classification":"WRITE","paramCount":8,"schema":"02d98a1b8952","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
+ {"name":"invoicing_upsertPurchaseInvoiceLine","classification":"WRITE","paramCount":23,"schema":"7bf3569caf46","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update","paginates":false,"upsert":"id","defaults":"create"},
+ {"name":"invoicing_upsertReimbursementLines","classification":"DESTRUCTIVE","paramCount":2,"schema":"96f11ef83729","response":"cddf8275afa1","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update","paginates":false},
+ {"name":"invoicing_upsertSalesInvoiceLine","classification":"WRITE","paramCount":21,"schema":"0f6d90ffe364","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"invoicing:create+update","paginates":false,"upsert":"id","defaults":"create"},
+ {"name":"invoicing_upsertSalesInvoiceShipment","classification":"WRITE","paramCount":8,"schema":"c55c0878eacb","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"invoicing:update","paginates":false},
{"name":"items_activateMethodVersion","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"5cb338fa12e6","injectAuth":"companyId+userId","permission":"parts:update","paginates":false},
{"name":"items_addChangeNoticeAffectedItem","classification":"DESTRUCTIVE","paramCount":5,"schema":"183209667024","response":"3cc309ba4541","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"parts:create","paginates":false},
{"name":"items_assertMethodOperationIsDraft","classification":"WRITE","paramCount":1,"schema":"c407a9edb930","response":"none","injectAuth":"companyId","permission":"parts:update","paginates":false},
@@ -354,7 +354,7 @@
{"name":"items_copyItem","classification":"WRITE","paramCount":8,"schema":"9c8674273b59","response":"none","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"parts:create","paginates":false},
{"name":"items_copyMakeMethod","classification":"WRITE","paramCount":8,"schema":"9c8674273b59","response":"none","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"parts:create","paginates":false},
{"name":"items_createItemDocumentUploadUrl","classification":"WRITE","paramCount":2,"schema":"6dcd390c3681","response":"4ad76afe0777","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create","paginates":false},
- {"name":"items_createRevision","classification":"WRITE","paramCount":3,"schema":"6a0f8669f4a7","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create","paginates":false},
+ {"name":"items_createRevision","classification":"WRITE","paramCount":3,"schema":"59340adc1219","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create","paginates":false},
{"name":"items_deleteChangeNotice","classification":"DESTRUCTIVE","paramCount":1,"schema":"29578070edb2","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete","paginates":false},
{"name":"items_deleteChangeNoticeAction","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete","paginates":false},
{"name":"items_deleteChangeNoticeRequiredAction","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete","paginates":false},
@@ -378,7 +378,7 @@
{"name":"items_deleteMethodOperationTool","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete","paginates":false},
{"name":"items_deleteSupplierPart","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete","paginates":false},
{"name":"items_deleteUnitOfMeasure","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:delete","paginates":false},
- {"name":"items_diffMethod","classification":"READ","paramCount":1,"schema":"8e916e7918fd","response":"945cb97c37b8","injectAuth":"companyId","permission":"parts:view","paginates":false},
+ {"name":"items_diffMethod","classification":"READ","paramCount":1,"schema":"21d02b3dfd77","response":"945cb97c37b8","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_duplicateMethodOperationStep","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create","paginates":false},
{"name":"items_findChangeNoticesForItem","classification":"READ","paramCount":2,"schema":"10c8230a9f49","response":"e0196d4b0041","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_findOtherOpenChangeNoticesForItem","classification":"READ","paramCount":2,"schema":"8a1da983320d","response":"e0196d4b0041","injectAuth":"companyId","permission":"parts:view","paginates":false},
@@ -389,17 +389,17 @@
{"name":"items_getChangeNoticeAffectedItems","classification":"READ","paramCount":1,"schema":"29578070edb2","response":"5483e69d7515","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getChangeNoticeDiff","classification":"READ","paramCount":1,"schema":"29578070edb2","response":"4da0de080834","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getChangeNoticeRequiredAction","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a76ce814b1b8","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getChangeNoticeRequiredActions","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"4c8439fedd7e","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getChangeNoticeRequiredActions","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"4c8439fedd7e","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getChangeNoticeRequiredActionsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getChangeNotices","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"ef2c88bb20cc","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getChangeNotices","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"ef2c88bb20cc","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getChangeNoticesForNonConformance","classification":"READ","paramCount":1,"schema":"a78c6c21c084","response":"47b99abee3a5","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getChangeNoticeType","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"d15ce193a0df","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getChangeNoticeTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"4d341af72c49","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getChangeNoticeTypes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"4d341af72c49","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getChangeNoticeTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getConfigurationParameters","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"c36ad21b447b","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getConfigurationRules","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"530f6f787ce7","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getConsumable","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"105e334bcf5b","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getConsumables","classification":"READ","paramCount":4,"schema":"53339fd228e4","response":"9302fcd8ff2d","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getConsumables","classification":"READ","paramCount":4,"schema":"5571215d4362","response":"9302fcd8ff2d","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getConsumablesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f674f76b8278","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getDemandForecastSources","classification":"READ","paramCount":3,"schema":"ba3de97105ef","response":"2309abe0b767","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getItem","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"87a9b87208d5","injectAuth":"companyId","permission":"parts:view","paginates":false},
@@ -414,7 +414,7 @@
{"name":"items_getItemMpnsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3ff28fd20707","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getItemPlanning","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"dd5cfe4cf204","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getItemPostingGroup","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"d38ff3570b60","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getItemPostingGroups","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"5019b8dab137","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getItemPostingGroups","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"5019b8dab137","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getItemPostingGroupsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getItemQuantities","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"9fc7a6c9f2e3","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getItemReplenishment","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"f399bb7eda67","injectAuth":"companyId","permission":"parts:view","paginates":false},
@@ -432,29 +432,29 @@
{"name":"items_getMaterial","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"fce6ec47472d","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getMaterialDimension","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"5a634d31e2f3","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getMaterialDimensionList","classification":"READ","paramCount":2,"schema":"f614c4ca7d64","response":"b72364e0a391","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getMaterialDimensions","classification":"READ","paramCount":4,"schema":"184b995188c0","response":"98486ac80bcc","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getMaterialDimensions","classification":"READ","paramCount":4,"schema":"9136faf13c9c","response":"98486ac80bcc","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getMaterialFinish","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"07a225161151","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getMaterialFinishes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"04cf1f4f7909","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getMaterialFinishes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"04cf1f4f7909","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getMaterialFinishList","classification":"READ","paramCount":1,"schema":"069f6f1436cd","response":"b57774d02b4d","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getMaterialForm","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"f69bdbb31d76","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getMaterialForms","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"ca926bd97ca1","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getMaterialForms","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"ca926bd97ca1","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getMaterialFormsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"a59b0ccd150e","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getMaterialGrade","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"07a225161151","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getMaterialGradeList","classification":"READ","paramCount":1,"schema":"069f6f1436cd","response":"b57774d02b4d","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getMaterialGrades","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"04cf1f4f7909","injectAuth":"companyId","permission":"parts:view","paginates":true},
- {"name":"items_getMaterials","classification":"READ","paramCount":4,"schema":"53339fd228e4","response":"5a10e7f3c854","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getMaterialGrades","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"04cf1f4f7909","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
+ {"name":"items_getMaterials","classification":"READ","paramCount":4,"schema":"5571215d4362","response":"5a10e7f3c854","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getMaterialsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f674f76b8278","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getMaterialSubstance","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"f69bdbb31d76","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getMaterialSubstances","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"ca926bd97ca1","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getMaterialSubstances","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"ca926bd97ca1","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getMaterialSubstancesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"a59b0ccd150e","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getMaterialType","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"0cc848ca86e3","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getMaterialTypeList","classification":"READ","paramCount":2,"schema":"babec8528804","response":"c3dfbc0fdf89","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getMaterialTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"cbbbd5d9c38d","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getMaterialTypes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"cbbbd5d9c38d","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getMaterialUsedIn","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"6c20410ebbf7","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getMethodMaterial","classification":"READ","paramCount":1,"schema":"5aa329400da2","response":"4f986471aaee","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getMethodMaterials","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"16cb0357007c","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getMethodMaterials","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"16cb0357007c","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getMethodMaterialsByMakeMethod","classification":"READ","paramCount":1,"schema":"2796fbbcab70","response":"ed99eb62f33c","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getMethodOperations","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"44cb9313b74c","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getMethodOperations","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"44cb9313b74c","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getMethodOperationsByMakeMethodId","classification":"READ","paramCount":1,"schema":"2796fbbcab70","response":"4ec7d6bf5468","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getMethodTree","classification":"READ","paramCount":1,"schema":"2796fbbcab70","response":"18cc03a418b4","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getMethodTreeArray","classification":"READ","paramCount":1,"schema":"2796fbbcab70","response":"6481a47cef6d","injectAuth":"companyId","permission":"parts:view","paginates":false},
@@ -464,32 +464,32 @@
{"name":"items_getOpenPurchaseOrderLines","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"ee9244a3a03b","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getOpenSalesOrderLines","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"ee9244a3a03b","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getPart","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"85d85a501c26","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getParts","classification":"READ","paramCount":4,"schema":"53339fd228e4","response":"b134f22017b9","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getParts","classification":"READ","paramCount":4,"schema":"5571215d4362","response":"b134f22017b9","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getPartsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f674f76b8278","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getPartUsedIn","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"bc331becb999","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getPickMethod","classification":"READ","paramCount":2,"schema":"ade4704d7338","response":"781e7f3fc24f","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getPickMethods","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"f1260811ebd4","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getRecipeProcessIdsForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"681004346c78","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getService","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"85d85a501c26","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getServices","classification":"READ","paramCount":5,"schema":"6ed7babb59bc","response":"0bc4d668f038","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getServices","classification":"READ","paramCount":5,"schema":"4b3bc8e78cef","response":"0bc4d668f038","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getServicesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f674f76b8278","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getSupersessionChain","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"57cd7c34e332","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getSupplierPartPriceBreaks","classification":"READ","paramCount":1,"schema":"0b5fc4acf371","response":"87777c880401","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getSupplierParts","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"4089d780d70d","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getSupplierPriceBreaksForItems","classification":"READ","paramCount":1,"schema":"c4ca22fd1816","response":"dc0d300695e0","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getTool","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"85d85a501c26","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getTools","classification":"READ","paramCount":4,"schema":"53339fd228e4","response":"2b6244653ec7","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getTools","classification":"READ","paramCount":4,"schema":"5571215d4362","response":"2b6244653ec7","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getToolsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f674f76b8278","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getTopLevelProductsForItems","classification":"READ","paramCount":1,"schema":"c4ca22fd1816","response":"b56efd7a527e","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getUnitOfMeasure","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"124234df769c","injectAuth":"companyId","permission":"parts:view","paginates":false},
- {"name":"items_getUnitOfMeasures","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"e19fb7f07a6a","injectAuth":"companyId","permission":"parts:view","paginates":true},
+ {"name":"items_getUnitOfMeasures","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"e19fb7f07a6a","injectAuth":"companyId","permission":"parts:view","paginates":true,"defaults":"always"},
{"name":"items_getUnitOfMeasuresList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"1333b6f93ca5","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_getUnitOfMeasureUsage","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"bf91be568e5a","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_insertChangeNotice","classification":"WRITE","paramCount":12,"schema":"c534f032ec75","response":"9645fed81b3e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create","paginates":false},
{"name":"items_lookupBuyPrice","classification":"READ","paramCount":3,"schema":"c440ca0b7efc","response":"cddf8275afa1","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_matchItemIdByText","classification":"READ","paramCount":1,"schema":"f2e9aceb3e6b","response":"174e29b899b9","injectAuth":"companyId","permission":"parts:view","paginates":false},
{"name":"items_removeChangeNoticeAffectedItem","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:update","paginates":false},
- {"name":"items_resolveItemIdFromExtractedText","classification":"WRITE","paramCount":2,"schema":"19341b333045","response":"174e29b899b9","injectAuth":"companyId","permission":"parts:update","paginates":false},
+ {"name":"items_resolveItemIdFromExtractedText","classification":"WRITE","paramCount":2,"schema":"a36b576f2400","response":"174e29b899b9","injectAuth":"companyId","permission":"parts:update","paginates":false},
{"name":"items_setChangeNoticeActionTasks","classification":"DESTRUCTIVE","paramCount":2,"schema":"0a99ac2dd23d","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy+userId","permission":"parts:update","paginates":false},
{"name":"items_setMethodMaterialStepLink","classification":"DESTRUCTIVE","paramCount":4,"schema":"9a5230c97e72","response":"bcde375ebd4c","injectAuth":"companyId","permission":"parts:update","paginates":false},
{"name":"items_setMethodOperationToolStepLink","classification":"DESTRUCTIVE","paramCount":4,"schema":"3912df9a58b9","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update","paginates":false},
@@ -505,9 +505,9 @@
{"name":"items_updateItem","classification":"WRITE","paramCount":18,"schema":"f24ba73701ab","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update","paginates":false},
{"name":"items_updateItemCost","classification":"WRITE","paramCount":2,"schema":"c55de757a7e4","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update","paginates":false},
{"name":"items_updateItemMethodAndSourcing","classification":"WRITE","paramCount":3,"schema":"1165eb54378a","response":"none","injectAuth":"companyId+updatedBy+userId","permission":"parts:update","paginates":false},
- {"name":"items_updateMaterialOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"parts:update","paginates":false},
+ {"name":"items_updateMaterialOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"parts:update","paginates":false,"result":"envelopes"},
{"name":"items_updateMaterialProperties","classification":"WRITE","paramCount":7,"schema":"ba2c8db7ad05","response":"82322ed42796","injectAuth":"companyId+updatedBy","permission":"parts:update","paginates":false},
- {"name":"items_updateOperationOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"parts:update","paginates":false},
+ {"name":"items_updateOperationOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"parts:update","paginates":false,"result":"envelopes"},
{"name":"items_updateRevision","classification":"WRITE","paramCount":2,"schema":"25c295d358ea","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"parts:update","paginates":false},
{"name":"items_upsertChangeNoticeRequiredAction","classification":"WRITE","paramCount":3,"schema":"e790518da1ff","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"parts:create+update","paginates":false},
{"name":"items_upsertChangeNoticeType","classification":"WRITE","paramCount":1,"schema":"a91f73f30ea3","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"id"},
@@ -535,7 +535,7 @@
{"name":"items_upsertMethodOperation","classification":"WRITE","paramCount":22,"schema":"c1059df4fd9a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"methodOperation(id)"},
{"name":"items_upsertMethodOperationParameter","classification":"WRITE","paramCount":5,"schema":"e9784c2bfbc3","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"id"},
{"name":"items_upsertMethodOperationStep","classification":"WRITE","paramCount":11,"schema":"78721aa4be26","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"id"},
- {"name":"items_upsertMethodOperationStepSlide","classification":"WRITE","paramCount":9,"schema":"9ff3ddbe053a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"id"},
+ {"name":"items_upsertMethodOperationStepSlide","classification":"WRITE","paramCount":9,"schema":"6be3bd248d68","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"id"},
{"name":"items_upsertMethodOperationTool","classification":"WRITE","paramCount":5,"schema":"59266e6a790e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"id"},
{"name":"items_upsertPart","classification":"WRITE","paramCount":21,"schema":"121d76f81f4e","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"item(id)|item(readableId=id)"},
{"name":"items_upsertPickMethod","classification":"WRITE","paramCount":5,"schema":"0e196a6930be","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"pickMethod(itemId,locationId)"},
@@ -543,7 +543,7 @@
{"name":"items_upsertService","classification":"WRITE","paramCount":19,"schema":"3045c73336fc","response":"87c54a97c0fa","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"item(id)|item(readableId=id)"},
{"name":"items_upsertSupplierPart","classification":"WRITE","paramCount":10,"schema":"3f49bc187ea4","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"id"},
{"name":"items_upsertTool","classification":"WRITE","paramCount":21,"schema":"121d76f81f4e","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"item(id)|item(readableId=id)"},
- {"name":"items_upsertUnitOfMeasure","classification":"WRITE","paramCount":4,"schema":"e954af0763b4","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false},
+ {"name":"items_upsertUnitOfMeasure","classification":"WRITE","paramCount":4,"schema":"85315f99e855","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"parts:create+update","paginates":false,"upsert":"id"},
{"name":"people_clockIn","classification":"WRITE","paramCount":1,"schema":"3d90cb5d0437","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:update","paginates":false},
{"name":"people_clockOut","classification":"WRITE","paramCount":3,"schema":"f1fa7800aa59","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:update","paginates":false},
{"name":"people_createTimeCardEntry","classification":"WRITE","paramCount":4,"schema":"d88eff32bf40","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create","paginates":false},
@@ -554,13 +554,13 @@
{"name":"people_deleteShift","classification":"DESTRUCTIVE","paramCount":1,"schema":"fbdb1fa56a88","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:delete","paginates":false},
{"name":"people_deleteTimeCardEntry","classification":"DESTRUCTIVE","paramCount":1,"schema":"c53dc26677e4","response":"bcde375ebd4c","injectAuth":"companyId","permission":"people:delete","paginates":false},
{"name":"people_getAttribute","classification":"READ","paramCount":1,"schema":"437fb5c5c303","response":"9c635d811516","injectAuth":"companyId","permission":"people:view","paginates":false},
- {"name":"people_getAttributeCategories","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"64bbb296aaa1","injectAuth":"companyId","permission":"people:view","paginates":true},
+ {"name":"people_getAttributeCategories","classification":"READ","paramCount":1,"schema":"ed8b79d0644f","response":"64bbb296aaa1","injectAuth":"companyId","permission":"people:view","paginates":true,"defaults":"always"},
{"name":"people_getAttributeCategory","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a52b87433b3b","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getAttributeDataTypes","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"885ca485a3b9","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getClockedInEmployees","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"579660621675","injectAuth":"companyId","permission":"people:view","paginates":false},
- {"name":"people_getContacts","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"de41996ed14c","injectAuth":"companyId","permission":"people:view","paginates":true},
+ {"name":"people_getContacts","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"de41996ed14c","injectAuth":"companyId","permission":"people:view","paginates":true,"defaults":"always"},
{"name":"people_getDepartment","classification":"READ","paramCount":1,"schema":"01883d2055a5","response":"10600fcaa49e","injectAuth":"companyId","permission":"people:view","paginates":false},
- {"name":"people_getDepartments","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"f483d2bc2259","injectAuth":"companyId","permission":"people:view","paginates":true},
+ {"name":"people_getDepartments","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"f483d2bc2259","injectAuth":"companyId","permission":"people:view","paginates":true,"defaults":"always"},
{"name":"people_getDepartmentsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getDepartmentsTree","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"8476e48a3c04","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getEmployeeDepartments","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"94b797b98edf","injectAuth":"companyId","permission":"people:view","paginates":false},
@@ -568,17 +568,17 @@
{"name":"people_getEmployeeShifts","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"68279ed68276","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getEmployeeSummary","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"afd28b3efe9e","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getHoliday","classification":"READ","paramCount":1,"schema":"9189cc10f756","response":"8d2b62b6a13b","injectAuth":"companyId","permission":"people:view","paginates":false},
- {"name":"people_getHolidays","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"1fedcd5adb59","injectAuth":"companyId","permission":"people:view","paginates":true},
+ {"name":"people_getHolidays","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"1fedcd5adb59","injectAuth":"companyId","permission":"people:view","paginates":true,"defaults":"always"},
{"name":"people_getHolidayYears","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f3764070545e","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getOpenClockEntry","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"48d1ac3381b4","injectAuth":"companyId","permission":"people:view","paginates":false},
- {"name":"people_getPeople","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"5483e69d7515","injectAuth":"companyId","permission":"people:view","paginates":false},
+ {"name":"people_getPeople","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"5483e69d7515","injectAuth":"companyId","permission":"people:view","paginates":false,"defaults":"always"},
{"name":"people_getRecentTimecards","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"579660621675","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getScheduledEmployeesToday","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"c429622c953e","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getShift","classification":"READ","paramCount":1,"schema":"fbdb1fa56a88","response":"86e4039d95bd","injectAuth":"companyId","permission":"people:view","paginates":false},
- {"name":"people_getShifts","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"92fec9db1b7e","injectAuth":"companyId","permission":"people:view","paginates":true},
+ {"name":"people_getShifts","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"92fec9db1b7e","injectAuth":"companyId","permission":"people:view","paginates":true,"defaults":"always"},
{"name":"people_getShiftsList","classification":"READ","paramCount":1,"schema":"b76e1039273f","response":"ce08332e0ce6","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getShiftsWithTimes","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"5b99e0634dc7","injectAuth":"companyId","permission":"people:view","paginates":false},
- {"name":"people_getTimecardEntries","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"579660621675","injectAuth":"companyId","permission":"people:view","paginates":true},
+ {"name":"people_getTimecardEntries","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"579660621675","injectAuth":"companyId","permission":"people:view","paginates":true,"defaults":"always"},
{"name":"people_getTimeCardEntries","classification":"READ","paramCount":3,"schema":"bcbe153859d6","response":"f6358cdc55d3","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getTimeCardEntry","classification":"READ","paramCount":1,"schema":"c53dc26677e4","response":"48d1ac3381b4","injectAuth":"companyId","permission":"people:view","paginates":false},
{"name":"people_getWeeklyHoursForEmployees","classification":"READ","paramCount":1,"schema":"392d5681b870","response":"96915ea19193","injectAuth":"companyId","permission":"people:view","paginates":false},
@@ -587,10 +587,10 @@
{"name":"people_insertEmployeeJob","classification":"WRITE","paramCount":2,"schema":"8518dfd7feec","response":"4a3b9b98079b","injectAuth":"companyId+updatedBy","permission":"people:create","paginates":false},
{"name":"people_updateAttribute","classification":"WRITE","paramCount":4,"schema":"f66dbb270538","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"people:update","paginates":false},
{"name":"people_updateAttributeCategory","classification":"WRITE","paramCount":4,"schema":"7bf8c03306de","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"people:update","paginates":false},
- {"name":"people_updateAttributeSortOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"people:update","paginates":false},
+ {"name":"people_updateAttributeSortOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"people:update","paginates":false,"result":"envelopes"},
{"name":"people_updateEmployeeJob","classification":"DESTRUCTIVE","paramCount":2,"schema":"fd3a2eef5bc2","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"people:update","paginates":false},
{"name":"people_updateTimeCardEntry","classification":"WRITE","paramCount":4,"schema":"486c249ce3fa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"people:update","paginates":false},
- {"name":"people_upsertDepartment","classification":"WRITE","paramCount":4,"schema":"0008ef42654d","response":"10600fcaa49e","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create+update","paginates":false},
+ {"name":"people_upsertDepartment","classification":"WRITE","paramCount":4,"schema":"3d8ae1409b6a","response":"10600fcaa49e","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create+update","paginates":false,"upsert":"id"},
{"name":"people_upsertHoliday","classification":"WRITE","paramCount":4,"schema":"8c7f86c0ca61","response":"8d2b62b6a13b","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create+update","paginates":false,"upsert":"id"},
{"name":"people_upsertShift","classification":"WRITE","paramCount":13,"schema":"0c60da442fe7","response":"4cc67c58f3c9","injectAuth":"companyId+createdBy+updatedBy","permission":"people:create+update","paginates":false,"upsert":"id"},
{"name":"production_activateAssemblyInstructionVersion","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId+userId","permission":"production:update","paginates":false},
@@ -633,7 +633,7 @@
{"name":"production_deleteProductionQuantity","classification":"DESTRUCTIVE","paramCount":1,"schema":"6b2dd7541ea3","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete","paginates":false},
{"name":"production_deleteScrapReason","classification":"DESTRUCTIVE","paramCount":1,"schema":"a5f822fb0806","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:delete","paginates":false},
{"name":"production_duplicateJobOperationStep","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create","paginates":false},
- {"name":"production_generateAssemblyStepsFromPlan","classification":"DESTRUCTIVE","paramCount":2,"schema":"80eeb7b6dd7c","response":"6a32a10b17d9","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"production:create","paginates":false},
+ {"name":"production_generateAssemblyStepsFromPlan","classification":"DESTRUCTIVE","paramCount":2,"schema":"80eeb7b6dd7c","response":"6a32a10b17d9","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"production:create","paginates":false,"result":"flag"},
{"name":"production_getActiveEmployeeAbilities","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"123f68c94eac","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getActiveJobOperationByJobId","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"ebe9a86ba8b7","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getActiveJobOperationsByLocation","classification":"READ","paramCount":2,"schema":"e1b255975233","response":"4440776603ed","injectAuth":"companyId","permission":"production:view","paginates":false},
@@ -647,7 +647,7 @@
{"name":"production_getAssemblyInstructionStepSlides","classification":"READ","paramCount":1,"schema":"0f56299d6859","response":"60aa9b57a118","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getAssemblyInstructionStepTools","classification":"READ","paramCount":1,"schema":"0f56299d6859","response":"d771814f7578","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getAssemblyInstructionVersions","classification":"READ","paramCount":2,"schema":"0c21424ecd86","response":"81c6e04c54bd","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getAssemblyPlanJson","classification":"READ","paramCount":1,"schema":"277f7d872d8c","response":"b4083e6fbe8b","injectAuth":"companyId","permission":"production:view","paginates":false},
+ {"name":"production_getAssemblyPlanJson","classification":"READ","paramCount":1,"schema":"277f7d872d8c","response":"9e6f9653f3fd","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getAssemblyUnits","classification":"READ","paramCount":1,"schema":"277f7d872d8c","response":"7224ef8546c1","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getBatchableOperations","classification":"READ","paramCount":2,"schema":"4cebb10b56d4","response":"62622425cf9e","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getBatchableProcesses","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"b0ab8957f96e","injectAuth":"companyId","permission":"production:view","paginates":false},
@@ -658,13 +658,13 @@
{"name":"production_getDemandForecasts","classification":"READ","paramCount":3,"schema":"c24ad31f1eaa","response":"21892ee9e3b8","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getDemandProjections","classification":"READ","paramCount":3,"schema":"c24ad31f1eaa","response":"3f9a097c510e","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getFailureMode","classification":"READ","paramCount":1,"schema":"4a3e0384d72f","response":"2f49c8d39495","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getFailureModes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"6fe6b1e0f957","injectAuth":"companyId","permission":"production:view","paginates":true},
+ {"name":"production_getFailureModes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"6fe6b1e0f957","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
{"name":"production_getFailureModesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getFlattenedBomMaterials","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"7f3fb0d1aeb3","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJob","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"3067c24178e5","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobByOperationId","classification":"READ","paramCount":1,"schema":"c407a9edb930","response":"07382c86b3b8","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobDocuments","classification":"READ","paramCount":4,"schema":"f41144061088","response":"5483e69d7515","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getJobDocumentsWithItemId","classification":"READ","paramCount":2,"schema":"046fecc650c6","response":"5483e69d7515","injectAuth":"companyId","permission":"production:view","paginates":false},
+ {"name":"production_getJobDocumentsWithItemId","classification":"READ","paramCount":2,"schema":"337cb78c5606","response":"5483e69d7515","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobExpediteForecast","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"d377dc3a1fd5","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobMakeMethodById","classification":"READ","paramCount":1,"schema":"c32158774ba3","response":"96389acf0c72","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobMaterial","classification":"READ","paramCount":1,"schema":"5aa329400da2","response":"7cdf48a49d7f","injectAuth":"companyId","permission":"production:view","paginates":false},
@@ -673,29 +673,29 @@
{"name":"production_getJobMaterialsByMethodId","classification":"READ","paramCount":1,"schema":"c32158774ba3","response":"562cd876b859","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobMaterialShortfallByItem","classification":"READ","paramCount":4,"schema":"644b4df6515a","response":"8a62dcc3c7f9","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobMaterialSupplyJobLines","classification":"READ","paramCount":2,"schema":"a396a00de3b2","response":"8e048b6a60ce","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getJobMaterialsWithQuantityOnHand","classification":"READ","paramCount":3,"schema":"0e9e6edbd779","response":"be0a4b3c547b","injectAuth":"companyId","permission":"production:view","paginates":false},
+ {"name":"production_getJobMaterialsWithQuantityOnHand","classification":"READ","paramCount":3,"schema":"ef9bf176c913","response":"be0a4b3c547b","injectAuth":"companyId","permission":"production:view","paginates":false,"defaults":"always"},
{"name":"production_getJobMethodTree","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"a0e7ca5d166e","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobMethodTreeArray","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"74f0f766ca05","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobOperation","classification":"READ","paramCount":1,"schema":"6889e2589fdc","response":"ac4a3201b981","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobOperationAttachments","classification":"READ","paramCount":1,"schema":"0715cdbaa5fb","response":"9a8b9c571a6b","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getJobOperationBatches","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"e4a233e30c55","injectAuth":"companyId","permission":"production:view","paginates":true},
+ {"name":"production_getJobOperationBatches","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"e4a233e30c55","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
{"name":"production_getJobOperationBatchEvents","classification":"READ","paramCount":1,"schema":"979f64cb9229","response":"8feaefdf02c8","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobOperationBatchMembers","classification":"READ","paramCount":1,"schema":"9bbe23a57535","response":"66bcdc105c00","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobOperationBatchMemberStats","classification":"READ","paramCount":1,"schema":"9bbe23a57535","response":"03aaee65a70b","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobOperationBatchWithMembers","classification":"READ","paramCount":1,"schema":"979f64cb9229","response":"4a805fcbf28d","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobOperationDependencies","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"9214ed6d51dd","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getJobOperations","classification":"READ","paramCount":2,"schema":"d772b12a956e","response":"720a58fe2501","injectAuth":"companyId","permission":"production:view","paginates":true},
+ {"name":"production_getJobOperations","classification":"READ","paramCount":2,"schema":"05cbfcbf7494","response":"720a58fe2501","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
{"name":"production_getJobOperationsAssignedToEmployee","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"20f7748935c7","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobOperationsByMethodId","classification":"READ","paramCount":1,"schema":"c32158774ba3","response":"3c7b7b51dac3","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobOperationsForTimeline","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"6f0169823721","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobOperationsList","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"4e5425835530","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getJobOperationStepRecords","classification":"READ","paramCount":2,"schema":"2e4f0768fe43","response":"272548978b28","injectAuth":"companyId","permission":"production:view","paginates":true},
- {"name":"production_getJobOrderStatusMap","classification":"READ","paramCount":5,"schema":"6158637094f4","response":"4437cc40ad52","injectAuth":"companyId","permission":"production:view","paginates":false},
+ {"name":"production_getJobOperationStepRecords","classification":"READ","paramCount":2,"schema":"08f98a38ea9d","response":"272548978b28","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
+ {"name":"production_getJobOrderStatusMap","classification":"READ","paramCount":5,"schema":"2b87b9cde70f","response":"4437cc40ad52","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobPromiseDate","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"f6521bc077a4","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobPurchaseOrderLines","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"309dea2a265c","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobReceiptSnapshot","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"af63ddd51939","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobReleaseReadiness","classification":"READ","paramCount":1,"schema":"267b4780c1d3","response":"e79774d3c8e8","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getJobs","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"630059095fdc","injectAuth":"companyId","permission":"production:view","paginates":true},
+ {"name":"production_getJobs","classification":"READ","paramCount":1,"schema":"ed8b79d0644f","response":"630059095fdc","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
{"name":"production_getJobsByDateRange","classification":"READ","paramCount":3,"schema":"00794c516592","response":"737259a0d747","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobsBySalesOrderLine","classification":"READ","paramCount":1,"schema":"58e3c9762923","response":"630059095fdc","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getJobsList","classification":"READ","paramCount":1,"schema":"6168fc8fbdbe","response":"232ee7305e73","injectAuth":"companyId","permission":"production:view","paginates":false},
@@ -704,14 +704,14 @@
{"name":"production_getLocationEmployees","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"72ccccdcfc21","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getMaintenanceDispatch","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"f0addd41ad4e","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getMaintenanceDispatchComments","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"7df6d6b7ba88","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getMaintenanceDispatches","classification":"READ","paramCount":4,"schema":"06e82ba1a75a","response":"8cdb79a1ff07","injectAuth":"companyId","permission":"production:view","paginates":true},
+ {"name":"production_getMaintenanceDispatches","classification":"READ","paramCount":4,"schema":"c19d6a6c007b","response":"8cdb79a1ff07","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
{"name":"production_getMaintenanceDispatchEvents","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"fc0af15629d8","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getMaintenanceDispatchItems","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"7d22c1b8235d","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getMaintenanceDispatchWorkCenters","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"245d61ef36d3","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getMaintenanceDowntimeForResources","classification":"READ","paramCount":1,"schema":"935cc20961b6","response":"c9ce440846e1","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getMaintenanceSchedule","classification":"READ","paramCount":1,"schema":"c61245800a33","response":"d794f5e4efb7","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getMaintenanceScheduleItems","classification":"READ","paramCount":1,"schema":"c61245800a33","response":"6e7c564b202a","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getMaintenanceSchedules","classification":"READ","paramCount":4,"schema":"b48b875ac337","response":"80c9953d43e5","injectAuth":"companyId","permission":"production:view","paginates":true},
+ {"name":"production_getMaintenanceSchedules","classification":"READ","paramCount":4,"schema":"d55eeae51beb","response":"80c9953d43e5","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
{"name":"production_getModelForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"a64658053ae5","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getOutsideOperationsByJobId","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"b75ab9ed0211","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getPeopleAbsences","classification":"READ","paramCount":1,"schema":"2f19cae7bae1","response":"f98df1954626","injectAuth":"companyId","permission":"production:view","paginates":false},
@@ -721,23 +721,23 @@
{"name":"production_getPeopleCapacityOperations","classification":"READ","paramCount":3,"schema":"19f229146b3b","response":"9bbc101347c4","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getProcedure","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"54f86be1acc6","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getProcedureParameters","classification":"READ","paramCount":1,"schema":"0611728fa5e0","response":"07629bf64853","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getProcedures","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"ba57bd0be81d","injectAuth":"companyId","permission":"production:view","paginates":true},
+ {"name":"production_getProcedures","classification":"READ","paramCount":1,"schema":"ed8b79d0644f","response":"ba57bd0be81d","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
{"name":"production_getProceduresList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"fe6a24448aaa","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getProcedureSteps","classification":"READ","paramCount":1,"schema":"0611728fa5e0","response":"fd4f59b40560","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getProcedureVersions","classification":"READ","paramCount":2,"schema":"89111eab017d","response":"f97efca67bd3","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getProductionDataByOperations","classification":"READ","paramCount":1,"schema":"0715cdbaa5fb","response":"9664edfb7c53","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getProductionEvent","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"b1799639bb8d","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getProductionEvents","classification":"READ","paramCount":2,"schema":"304bd714250f","response":"acc5e1d1e2c9","injectAuth":"companyId","permission":"production:view","paginates":true},
+ {"name":"production_getProductionEvents","classification":"READ","paramCount":2,"schema":"91c6f90c1d2d","response":"acc5e1d1e2c9","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
{"name":"production_getProductionEventsByJob","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"0c36813c32a1","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getProductionEventsByOperations","classification":"READ","paramCount":1,"schema":"0715cdbaa5fb","response":"acc5e1d1e2c9","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getProductionEventsPage","classification":"READ","paramCount":3,"schema":"d3ce152358d0","response":"d82d26b306e9","injectAuth":"companyId","permission":"production:view","paginates":true},
- {"name":"production_getProductionPlanning","classification":"READ","paramCount":3,"schema":"d561f840242a","response":"684c3b20f68c","injectAuth":"companyId","permission":"production:view","paginates":true},
- {"name":"production_getProductionProjections","classification":"READ","paramCount":3,"schema":"d561f840242a","response":"4973a62dfd1b","injectAuth":"companyId","permission":"production:view","paginates":true},
- {"name":"production_getProductionQuantities","classification":"READ","paramCount":2,"schema":"304bd714250f","response":"3b4cf7a6bc87","injectAuth":"companyId","permission":"production:view","paginates":true},
+ {"name":"production_getProductionPlanning","classification":"READ","paramCount":3,"schema":"c3afb01f3040","response":"684c3b20f68c","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
+ {"name":"production_getProductionProjections","classification":"READ","paramCount":3,"schema":"c3afb01f3040","response":"4973a62dfd1b","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
+ {"name":"production_getProductionQuantities","classification":"READ","paramCount":2,"schema":"91c6f90c1d2d","response":"3b4cf7a6bc87","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
{"name":"production_getProductionQuantity","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"c506c8c71d8f","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getRootMakeMethod","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"96389acf0c72","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getScrapReason","classification":"READ","paramCount":1,"schema":"a5f822fb0806","response":"4bbb50609deb","injectAuth":"companyId","permission":"production:view","paginates":false},
- {"name":"production_getScrapReasons","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"a5e736373756","injectAuth":"companyId","permission":"production:view","paginates":true},
+ {"name":"production_getScrapReasons","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"a5e736373756","injectAuth":"companyId","permission":"production:view","paginates":true,"defaults":"always"},
{"name":"production_getScrapReasonsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getTrackedEntitiesByJobId","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"c20d7cb06756","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getTrackedEntityByJobId","classification":"READ","paramCount":1,"schema":"4999bd4be598","response":"d485710baf81","injectAuth":"companyId","permission":"production:view","paginates":false},
@@ -747,7 +747,7 @@
{"name":"production_getWorkCenterReservationsRange","classification":"READ","paramCount":2,"schema":"99ea73b8e7a1","response":"a7e9bc09d2ab","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_getWorkCenterShifts","classification":"READ","paramCount":1,"schema":"e94892850934","response":"2b4835f80e6c","injectAuth":"companyId","permission":"production:view","paginates":false},
{"name":"production_insertAssemblyInstructionStep","classification":"WRITE","paramCount":1,"schema":"432e9ed9373b","response":"00404e686415","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"production:create","paginates":false},
- {"name":"production_insertJob","classification":"WRITE","paramCount":2,"schema":"6a0dadd45560","response":"ad63dfd9d877","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create","paginates":false},
+ {"name":"production_insertJob","classification":"WRITE","paramCount":2,"schema":"a98a2b0a8eac","response":"ad63dfd9d877","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create","paginates":false},
{"name":"production_invalidateAssemblyModelCache","classification":"DESTRUCTIVE","paramCount":1,"schema":"277f7d872d8c","response":"bcde375ebd4c","injectAuth":"companyId","permission":"production:update","paginates":false},
{"name":"production_makeAssemblySubAssembly","classification":"WRITE","paramCount":2,"schema":"e39572ccf46c","response":"00404e686415","injectAuth":"companyId+userId","permission":"production:update","paginates":false},
{"name":"production_maxToolQuantityByItem","classification":"READ","paramCount":1,"schema":"8b9e90037b9a","response":"none","injectAuth":"companyId","permission":"production:view","paginates":false},
@@ -771,7 +771,7 @@
{"name":"production_setPeopleOvertimeBulk","classification":"WRITE","paramCount":6,"schema":"8f082483561d","response":"577d7088b794","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
{"name":"production_syncAssemblyInstructionToOperation","classification":"DESTRUCTIVE","paramCount":2,"schema":"8160f8d92b1b","response":"4348d3bad80b","injectAuth":"companyId+updatedBy+userId","permission":"production:update","paginates":false},
{"name":"production_syncAssemblyStepMaterialsFromMappings","classification":"WRITE","paramCount":4,"schema":"7f7346bb3bd0","response":"5815c4dbf43d","injectAuth":"companyId+updatedBy+userId","permission":"production:update","paginates":false},
- {"name":"production_toViewerStep","classification":"WRITE","paramCount":1,"schema":"3f809a44cba0","response":"8d1c3851225e","injectAuth":"companyId","permission":"production:update","paginates":false},
+ {"name":"production_toViewerStep","classification":"WRITE","paramCount":1,"schema":"79b0e8edd0b6","response":"e3a6f6608ca6","injectAuth":"companyId","permission":"production:update","paginates":false},
{"name":"production_unassignPeopleWeek","classification":"DESTRUCTIVE","paramCount":4,"schema":"06ead5d3d9ce","response":"9658926b2cd2","injectAuth":"companyId","permission":"production:update","paginates":false},
{"name":"production_ungroupAssemblySubAssembly","classification":"DESTRUCTIVE","paramCount":2,"schema":"4bb5885b787b","response":"none","injectAuth":"companyId+userId","permission":"production:update","paginates":false},
{"name":"production_unreleaseJobOperationBatch","classification":"WRITE","paramCount":1,"schema":"979f64cb9229","response":"none","injectAuth":"companyId+userId","permission":"production:update","paginates":false},
@@ -785,22 +785,22 @@
{"name":"production_updateAssemblySubAssembly","classification":"WRITE","paramCount":4,"schema":"0f0cbf9e32e1","response":"none","injectAuth":"companyId+updatedBy+userId","permission":"production:update","paginates":false},
{"name":"production_updateJob","classification":"WRITE","paramCount":20,"schema":"769ff9d7f4ac","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
{"name":"production_updateJobBatchNumber","classification":"WRITE","paramCount":2,"schema":"a4c2a31bb8a6","response":"f7a40899c090","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
- {"name":"production_updateJobMaterialOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
+ {"name":"production_updateJobMaterialOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false,"result":"envelopes"},
{"name":"production_updateJobOperationBatch","classification":"WRITE","paramCount":4,"schema":"6aa26c8c9567","response":"none","injectAuth":"companyId+updatedBy+userId","permission":"production:update","paginates":false},
- {"name":"production_updateJobOperationDueDate","classification":"WRITE","paramCount":2,"schema":"e04478fc58f7","response":"ac4a3201b981","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
- {"name":"production_updateJobOperationOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
- {"name":"production_updateJobOperationStatus","classification":"WRITE","paramCount":2,"schema":"b22654081076","response":"ac4a3201b981","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
- {"name":"production_updateJobOperationStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
+ {"name":"production_updateJobOperationDueDate","classification":"WRITE","paramCount":2,"schema":"e04478fc58f7","response":"ac4a3201b981","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false,"context":"updatedBy=userId"},
+ {"name":"production_updateJobOperationOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false,"result":"envelopes"},
+ {"name":"production_updateJobOperationStatus","classification":"WRITE","paramCount":2,"schema":"b22654081076","response":"ac4a3201b981","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false,"context":"updatedBy=userId"},
+ {"name":"production_updateJobOperationStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false,"result":"envelopes"},
{"name":"production_updateJobStatus","classification":"WRITE","paramCount":3,"schema":"bb0874693c4d","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
{"name":"production_updateKanbanJob","classification":"WRITE","paramCount":2,"schema":"2c22838be2d2","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy+userId","permission":"production:update","paginates":false},
- {"name":"production_updateMethodOperationStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
- {"name":"production_updateProcedureStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
- {"name":"production_updateQuoteOperationStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false},
+ {"name":"production_updateMethodOperationStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false,"result":"envelopes"},
+ {"name":"production_updateProcedureStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false,"result":"envelopes"},
+ {"name":"production_updateQuoteOperationStepOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"production:update","paginates":false,"result":"envelopes"},
{"name":"production_upsertAssemblyComponentMapping","classification":"WRITE","paramCount":4,"schema":"9ed1f38ce764","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false},
{"name":"production_upsertAssemblyInstruction","classification":"WRITE","paramCount":4,"schema":"a1796f1bd347","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false},
{"name":"production_upsertAssemblyInstructionStep","classification":"WRITE","paramCount":1,"schema":"224cc2443995","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false},
{"name":"production_upsertAssemblyInstructionStepMaterial","classification":"WRITE","paramCount":5,"schema":"a21b4fac4b90","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false},
- {"name":"production_upsertAssemblyInstructionStepSlide","classification":"WRITE","paramCount":9,"schema":"9ff3ddbe053a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
+ {"name":"production_upsertAssemblyInstructionStepSlide","classification":"WRITE","paramCount":9,"schema":"6be3bd248d68","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
{"name":"production_upsertAssemblyInstructionStepTool","classification":"WRITE","paramCount":5,"schema":"d64500fd5c94","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false},
{"name":"production_upsertAssemblyUnit","classification":"WRITE","paramCount":5,"schema":"74497d782594","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false},
{"name":"production_upsertFailureMode","classification":"WRITE","paramCount":3,"schema":"fbdc294966b9","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
@@ -811,7 +811,7 @@
{"name":"production_upsertJobOperation","classification":"WRITE","paramCount":26,"schema":"46e4f69aa1f7","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"jobOperation(id)"},
{"name":"production_upsertJobOperationParameter","classification":"WRITE","paramCount":5,"schema":"e9784c2bfbc3","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
{"name":"production_upsertJobOperationStep","classification":"WRITE","paramCount":11,"schema":"78721aa4be26","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
- {"name":"production_upsertJobOperationStepSlide","classification":"WRITE","paramCount":9,"schema":"9ff3ddbe053a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
+ {"name":"production_upsertJobOperationStepSlide","classification":"WRITE","paramCount":9,"schema":"6be3bd248d68","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
{"name":"production_upsertJobOperationTool","classification":"WRITE","paramCount":5,"schema":"59266e6a790e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
{"name":"production_upsertMaintenanceDispatchComment","classification":"WRITE","paramCount":3,"schema":"15129a94d57d","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
{"name":"production_upsertMaintenanceDispatchEvent","classification":"WRITE","paramCount":7,"schema":"a98569352969","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
@@ -820,17 +820,17 @@
{"name":"production_upsertMakeMethodFromJob","classification":"WRITE","paramCount":3,"schema":"32b3a0f5efa0","response":"none","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"production:create+update","paginates":false},
{"name":"production_upsertMakeMethodFromJobMethod","classification":"WRITE","paramCount":3,"schema":"32b3a0f5efa0","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"production:create+update","paginates":false},
{"name":"production_upsertPeopleAssignment","classification":"DESTRUCTIVE","paramCount":7,"schema":"1ec71dfcea20","response":"a726aa587ccc","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false},
- {"name":"production_upsertProcedure","classification":"WRITE","paramCount":6,"schema":"1956f23f1d21","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false},
- {"name":"production_upsertProcedureParameter","classification":"WRITE","paramCount":4,"schema":"d58a41fa9f2f","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false},
- {"name":"production_upsertProcedureStep","classification":"WRITE","paramCount":10,"schema":"e0352a783337","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false},
+ {"name":"production_upsertProcedure","classification":"WRITE","paramCount":6,"schema":"d4a8e99e0523","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
+ {"name":"production_upsertProcedureParameter","classification":"WRITE","paramCount":4,"schema":"3ec6c5dece78","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
+ {"name":"production_upsertProcedureStep","classification":"WRITE","paramCount":10,"schema":"af47a3cf4652","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
{"name":"production_upsertProductionEvent","classification":"WRITE","paramCount":8,"schema":"05b066cee802","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
{"name":"production_upsertProductionQuantity","classification":"WRITE","paramCount":6,"schema":"24b2fd6be216","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
{"name":"production_upsertScrapReason","classification":"WRITE","paramCount":3,"schema":"fbdc294966b9","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"production:create+update","paginates":false,"upsert":"id"},
{"name":"purchasing_cancelPurchaseReturnOrder","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId+userId","permission":"purchasing:update","paginates":false},
{"name":"purchasing_confirmPurchaseReturnOrder","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId","permission":"purchasing:update","paginates":false},
- {"name":"purchasing_convertSupplierQuoteToOrder","classification":"WRITE","paramCount":2,"schema":"03ce7e291c3c","response":"5cb338fa12e6","injectAuth":"companyId+updatedBy+userId","permission":"purchasing:update","paginates":false},
+ {"name":"purchasing_convertSupplierQuoteToOrder","classification":"WRITE","paramCount":2,"schema":"16be78b08a8f","response":"5cb338fa12e6","injectAuth":"companyId+updatedBy+userId","permission":"purchasing:update","paginates":false},
{"name":"purchasing_createPurchaseReturnOrderCredit","classification":"WRITE","paramCount":3,"schema":"806d15ac58ff","response":"00404e686415","injectAuth":"companyGroupId+companyId+createdBy+updatedBy+userId","permission":"purchasing:create","paginates":false},
- {"name":"purchasing_createReplacementPurchaseOrder","classification":"WRITE","paramCount":1,"schema":"11b028f16d94","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"purchasing:create","paginates":false},
+ {"name":"purchasing_createReplacementPurchaseOrder","classification":"WRITE","paramCount":1,"schema":"11b028f16d94","response":"3797626bd17e","injectAuth":"companyGroupId+companyId+createdBy+updatedBy+userId","permission":"purchasing:create","paginates":false},
{"name":"purchasing_createSupplierInteractionDocumentUploadUrl","classification":"WRITE","paramCount":2,"schema":"a424256cbe29","response":"4ad76afe0777","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
{"name":"purchasing_createSupplierInteractionLineDocumentUploadUrl","classification":"WRITE","paramCount":2,"schema":"27cead9c6af9","response":"4ad76afe0777","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
{"name":"purchasing_deletePurchaseOrder","classification":"DESTRUCTIVE","paramCount":1,"schema":"28cffcd9d6e8","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete","paginates":false},
@@ -847,7 +847,7 @@
{"name":"purchasing_deleteSupplierQuote","classification":"DESTRUCTIVE","paramCount":1,"schema":"5db39f9abf41","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete","paginates":false},
{"name":"purchasing_deleteSupplierQuoteLine","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete","paginates":false},
{"name":"purchasing_deleteSupplierType","classification":"DESTRUCTIVE","paramCount":1,"schema":"900045091850","response":"bcde375ebd4c","injectAuth":"companyId","permission":"purchasing:delete","paginates":false},
- {"name":"purchasing_duplicatePurchaseOrder","classification":"WRITE","paramCount":1,"schema":"b6bf3abf506d","response":"f5212679d580","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"purchasing:create","paginates":false},
+ {"name":"purchasing_duplicatePurchaseOrder","classification":"WRITE","paramCount":1,"schema":"b6bf3abf506d","response":"f5212679d580","injectAuth":"companyGroupId+companyId+createdBy+updatedBy+userId","permission":"purchasing:create","paginates":false},
{"name":"purchasing_finalizePurchaseOrder","classification":"WRITE","paramCount":1,"schema":"28cffcd9d6e8","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
{"name":"purchasing_finalizeSupplierQuote","classification":"WRITE","paramCount":1,"schema":"5db39f9abf41","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
{"name":"purchasing_getCreditableQuantitiesForPurchaseReturn","classification":"READ","paramCount":1,"schema":"11b028f16d94","response":"1e97e6c72b1d","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
@@ -862,7 +862,7 @@
{"name":"purchasing_getPurchaseOrderLines","classification":"READ","paramCount":1,"schema":"28cffcd9d6e8","response":"4e2a81139b3b","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getPurchaseOrderLocations","classification":"READ","paramCount":1,"schema":"28cffcd9d6e8","response":"d4d4c42eb761","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getPurchaseOrderPayment","classification":"READ","paramCount":1,"schema":"28cffcd9d6e8","response":"c7a62e53e09b","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
- {"name":"purchasing_getPurchaseOrders","classification":"READ","paramCount":5,"schema":"9d3e5d4db447","response":"fbaa9ca23142","injectAuth":"companyId","permission":"purchasing:view","paginates":true},
+ {"name":"purchasing_getPurchaseOrders","classification":"READ","paramCount":5,"schema":"f3468ea9b0a6","response":"fbaa9ca23142","injectAuth":"companyId","permission":"purchasing:view","paginates":true,"defaults":"always"},
{"name":"purchasing_getPurchaseOrderSuppliers","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"fc7a0345fc53","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getPurchaseReturnOrder","classification":"READ","paramCount":1,"schema":"11b028f16d94","response":"8cb2133c047e","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getPurchaseReturnOrderCredits","classification":"READ","paramCount":1,"schema":"11b028f16d94","response":"49639d091139","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
@@ -870,14 +870,14 @@
{"name":"purchasing_getPurchaseReturnOrderLine","classification":"READ","paramCount":1,"schema":"063a6777d378","response":"6e3bf67c7a97","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getPurchaseReturnOrderLines","classification":"READ","paramCount":1,"schema":"11b028f16d94","response":"1f58312907d8","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getPurchaseReturnOrderLineTrackedEntities","classification":"READ","paramCount":1,"schema":"749e5d81384a","response":"75ed48edf5c1","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
- {"name":"purchasing_getPurchaseReturnOrders","classification":"READ","paramCount":5,"schema":"9d3e5d4db447","response":"de438833d869","injectAuth":"companyId","permission":"purchasing:view","paginates":true},
+ {"name":"purchasing_getPurchaseReturnOrders","classification":"READ","paramCount":5,"schema":"f3468ea9b0a6","response":"de438833d869","injectAuth":"companyId","permission":"purchasing:view","paginates":true,"defaults":"always"},
{"name":"purchasing_getPurchaseReturnOrderShipments","classification":"READ","paramCount":1,"schema":"11b028f16d94","response":"08e1b6f03862","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getPurchasingDocumentsAssignedToMe","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0f0173c85a86","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
- {"name":"purchasing_getPurchasingPlanning","classification":"READ","paramCount":3,"schema":"d561f840242a","response":"0cd4f8e33cdc","injectAuth":"companyId","permission":"purchasing:view","paginates":true},
+ {"name":"purchasing_getPurchasingPlanning","classification":"READ","paramCount":3,"schema":"c3afb01f3040","response":"0cd4f8e33cdc","injectAuth":"companyId","permission":"purchasing:view","paginates":true,"defaults":"always"},
{"name":"purchasing_getPurchasingRFQ","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"08cb90c207da","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getPurchasingRFQLine","classification":"READ","paramCount":1,"schema":"063a6777d378","response":"045f66457f11","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getPurchasingRFQLines","classification":"READ","paramCount":1,"schema":"4e16cef99961","response":"24a761144b4a","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
- {"name":"purchasing_getPurchasingRFQs","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"a2661a189775","injectAuth":"companyId","permission":"purchasing:view","paginates":true},
+ {"name":"purchasing_getPurchasingRFQs","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"a2661a189775","injectAuth":"companyId","permission":"purchasing:view","paginates":true,"defaults":"always"},
{"name":"purchasing_getPurchasingRFQSuppliers","classification":"READ","paramCount":1,"schema":"4e16cef99961","response":"5483e69d7515","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getPurchasingRFQSuppliersWithLinks","classification":"READ","paramCount":1,"schema":"4e16cef99961","response":"5483e69d7515","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getPurchasingTerms","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"91b7924d48bd","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
@@ -905,24 +905,24 @@
{"name":"purchasing_getSupplierQuoteLinePrices","classification":"READ","paramCount":1,"schema":"88823065a537","response":"22abc40c4789","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getSupplierQuoteLinePricesByQuoteId","classification":"READ","paramCount":1,"schema":"5db39f9abf41","response":"22abc40c4789","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getSupplierQuoteLines","classification":"READ","paramCount":1,"schema":"5db39f9abf41","response":"50759a9c2b79","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
- {"name":"purchasing_getSupplierQuotes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"9e311e59b82e","injectAuth":"companyId","permission":"purchasing:view","paginates":true},
+ {"name":"purchasing_getSupplierQuotes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"9e311e59b82e","injectAuth":"companyId","permission":"purchasing:view","paginates":true,"defaults":"always"},
{"name":"purchasing_getSupplierQuotesForComparison","classification":"READ","paramCount":1,"schema":"4e16cef99961","response":"540207b2c74e","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getSupplierQuotesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"967dcad15168","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
- {"name":"purchasing_getSupplierReportContacts","classification":"READ","paramCount":1,"schema":"f6d6276b4996","response":"40779b8d3971","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
- {"name":"purchasing_getSuppliers","classification":"READ","paramCount":5,"schema":"3fbb04d0ef7e","response":"947b627d845e","injectAuth":"companyId","permission":"purchasing:view","paginates":true},
+ {"name":"purchasing_getSupplierReportContacts","classification":"READ","paramCount":1,"schema":"f6d6276b4996","response":"5adbc4c5e67c","injectAuth":"companyId","permission":"purchasing:view","paginates":false,"result":"envelopes"},
+ {"name":"purchasing_getSuppliers","classification":"READ","paramCount":5,"schema":"fe4524096cbe","response":"947b627d845e","injectAuth":"companyId","permission":"purchasing:view","paginates":true,"defaults":"always"},
{"name":"purchasing_getSupplierShipping","classification":"READ","paramCount":1,"schema":"67043a31b1b5","response":"17117a952d24","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getSuppliersList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getSupplierTax","classification":"READ","paramCount":1,"schema":"67043a31b1b5","response":"303387b4fc28","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
{"name":"purchasing_getSupplierType","classification":"READ","paramCount":1,"schema":"900045091850","response":"8b3eca34dbfd","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
- {"name":"purchasing_getSupplierTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7c6550dea5b1","injectAuth":"companyId","permission":"purchasing:view","paginates":true},
+ {"name":"purchasing_getSupplierTypes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"7c6550dea5b1","injectAuth":"companyId","permission":"purchasing:view","paginates":true,"defaults":"always"},
{"name":"purchasing_getSupplierTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"purchasing:view","paginates":false},
- {"name":"purchasing_insertPurchaseOrder","classification":"WRITE","paramCount":15,"schema":"27513cc48e8d","response":"f5212679d580","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
- {"name":"purchasing_insertPurchaseReturnOrder","classification":"WRITE","paramCount":12,"schema":"d3253380f7e2","response":"d53d13c89312","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
+ {"name":"purchasing_insertPurchaseOrder","classification":"WRITE","paramCount":15,"schema":"27513cc48e8d","response":"f5212679d580","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
+ {"name":"purchasing_insertPurchaseReturnOrder","classification":"WRITE","paramCount":12,"schema":"d3253380f7e2","response":"d53d13c89312","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
{"name":"purchasing_insertPurchasingRFQ","classification":"WRITE","paramCount":8,"schema":"cb4ec49c926e","response":"0c1a1b93cca3","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
{"name":"purchasing_insertSupplier","classification":"WRITE","paramCount":9,"schema":"05cf2198c6ac","response":"9d2416e8ad75","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
{"name":"purchasing_insertSupplierContact","classification":"WRITE","paramCount":4,"schema":"987f8dd2f02d","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
{"name":"purchasing_insertSupplierLocation","classification":"WRITE","paramCount":4,"schema":"c903cae736f0","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
- {"name":"purchasing_insertSupplierQuote","classification":"WRITE","paramCount":13,"schema":"aa8560bfb767","response":"77e21c1e2e32","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
+ {"name":"purchasing_insertSupplierQuote","classification":"WRITE","paramCount":13,"schema":"aa8560bfb767","response":"77e21c1e2e32","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"purchasing:create","paginates":false},
{"name":"purchasing_reopenPurchaseOrderAsRevision","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"cddf8275afa1","injectAuth":"companyId","permission":"purchasing:update","paginates":false},
{"name":"purchasing_reopenPurchaseReturnOrder","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId+userId","permission":"purchasing:update","paginates":false},
{"name":"purchasing_sendSupplierQuote","classification":"WRITE","paramCount":1,"schema":"5db39f9abf41","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
@@ -933,7 +933,7 @@
{"name":"purchasing_updatePurchaseOrderExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
{"name":"purchasing_updatePurchaseOrderFavorite","classification":"DESTRUCTIVE","paramCount":2,"schema":"85769b943e30","response":"bcde375ebd4c","injectAuth":"companyId+userId","permission":"purchasing:update","paginates":false},
{"name":"purchasing_updatePurchaseOrderLineOrder","classification":"WRITE","paramCount":2,"schema":"744101d1c67c","response":"none","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
- {"name":"purchasing_updatePurchaseOrderStatus","classification":"WRITE","paramCount":3,"schema":"da4b3835e841","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
+ {"name":"purchasing_updatePurchaseOrderStatus","classification":"WRITE","paramCount":3,"schema":"d55cadd232ef","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
{"name":"purchasing_updatePurchasingRFQLineOrder","classification":"WRITE","paramCount":2,"schema":"3be259f3e887","response":"none","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
{"name":"purchasing_updatePurchasingRFQStatus","classification":"WRITE","paramCount":3,"schema":"8dc0490a9402","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
{"name":"purchasing_updateSupplierContact","classification":"WRITE","paramCount":4,"schema":"f6b4a36788e6","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
@@ -942,21 +942,21 @@
{"name":"purchasing_updateSupplierQuote","classification":"WRITE","paramCount":8,"schema":"64e0b2d29d98","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
{"name":"purchasing_updateSupplierQuoteExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
{"name":"purchasing_updateSupplierQuoteLineOrder","classification":"WRITE","paramCount":2,"schema":"7bf10894875d","response":"none","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
- {"name":"purchasing_updateSupplierQuoteStatus","classification":"WRITE","paramCount":3,"schema":"a89efeaa1348","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
+ {"name":"purchasing_updateSupplierQuoteStatus","classification":"WRITE","paramCount":3,"schema":"856b61886f1f","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
{"name":"purchasing_updateSupplierShipping","classification":"WRITE","paramCount":8,"schema":"ac0c2133e800","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
- {"name":"purchasing_updateSupplierTax","classification":"WRITE","paramCount":8,"schema":"9467cd226e93","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
- {"name":"purchasing_upsertPurchaseOrder","classification":"WRITE","paramCount":2,"schema":"9fe37a5a07e3","response":"1b33aad6f934","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false},
+ {"name":"purchasing_updateSupplierTax","classification":"WRITE","paramCount":8,"schema":"7e31a89af103","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"purchasing:update","paginates":false},
+ {"name":"purchasing_upsertPurchaseOrder","classification":"WRITE","paramCount":2,"schema":"d458b7f2c10f","response":"1b33aad6f934","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false,"upsert":"id"},
{"name":"purchasing_upsertPurchaseOrderDelivery","classification":"WRITE","paramCount":15,"schema":"5fb9d54c12e7","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:create+update","paginates":false},
- {"name":"purchasing_upsertPurchaseOrderLine","classification":"WRITE","paramCount":25,"schema":"adfb0bd2408c","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false},
+ {"name":"purchasing_upsertPurchaseOrderLine","classification":"WRITE","paramCount":25,"schema":"ca0929113e1d","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false,"upsert":"id","defaults":"create"},
{"name":"purchasing_upsertPurchaseOrderPayment","classification":"WRITE","paramCount":6,"schema":"1e1be871f655","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"purchasing:create+update","paginates":false},
{"name":"purchasing_upsertPurchaseReturnOrderLine","classification":"WRITE","paramCount":12,"schema":"9272c7cdfeaf","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false,"upsert":"id"},
{"name":"purchasing_upsertPurchasingRFQ","classification":"WRITE","paramCount":8,"schema":"fdd694519621","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false},
- {"name":"purchasing_upsertPurchasingRFQLine","classification":"WRITE","paramCount":1,"schema":"60751ccac2a4","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false},
- {"name":"purchasing_upsertPurchasingRFQSuppliers","classification":"DESTRUCTIVE","paramCount":2,"schema":"fa459fc25bca","response":"5c9ba5bee3f1","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false},
+ {"name":"purchasing_upsertPurchasingRFQLine","classification":"WRITE","paramCount":1,"schema":"66adf4b67af2","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false,"upsert":"id"},
+ {"name":"purchasing_upsertPurchasingRFQSuppliers","classification":"DESTRUCTIVE","paramCount":2,"schema":"fa459fc25bca","response":"5c9ba5bee3f1","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false,"context":"createdBy=userId"},
{"name":"purchasing_upsertSupplier","classification":"WRITE","paramCount":10,"schema":"999cedb57790","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false,"upsert":"id"},
{"name":"purchasing_upsertSupplierBankAccount","classification":"WRITE","paramCount":13,"schema":"cde0d3ca4444","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false,"upsert":"id"},
{"name":"purchasing_upsertSupplierProcess","classification":"WRITE","paramCount":6,"schema":"26d15056f196","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false,"upsert":"id"},
- {"name":"purchasing_upsertSupplierQuoteLine","classification":"WRITE","paramCount":14,"schema":"903d170d2231","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false},
+ {"name":"purchasing_upsertSupplierQuoteLine","classification":"WRITE","paramCount":14,"schema":"3c9810ea1df4","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false,"upsert":"id"},
{"name":"purchasing_upsertSupplierType","classification":"WRITE","paramCount":3,"schema":"fbdc294966b9","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"purchasing:create+update","paginates":false,"upsert":"id"},
{"name":"quality_activateGauge","classification":"WRITE","paramCount":1,"schema":"f65da45a1155","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:update","paginates":false},
{"name":"quality_deactivateGauge","classification":"WRITE","paramCount":1,"schema":"f65da45a1155","response":"bcde375ebd4c","injectAuth":"companyId","permission":"quality:update","paginates":false},
@@ -974,22 +974,22 @@
{"name":"quality_getBalloons","classification":"READ","paramCount":1,"schema":"c25fe011e891","response":"3fec0abbc97d","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getGauge","classification":"READ","paramCount":1,"schema":"f65da45a1155","response":"19d84b9bffdb","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getGaugeCalibrationRecord","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"90fb86d6af14","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getGaugeCalibrationRecords","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7ed9f83a9f0f","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getGaugeCalibrationRecords","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"7ed9f83a9f0f","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_getGaugeCalibrationRecordsByGaugeId","classification":"READ","paramCount":1,"schema":"f65da45a1155","response":"7ed9f83a9f0f","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getGauges","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7d2b6ae79d59","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getGauges","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"7d2b6ae79d59","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_getGaugesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"34b9a5801676","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getGaugeType","classification":"READ","paramCount":1,"schema":"24fb90489cd4","response":"63b5b3f8f143","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getGaugeTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"95195653f3fc","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getGaugeTypes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"95195653f3fc","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_getGaugeTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getInspection","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getInspectionDocument","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a82889f583de","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getInspectionDocuments","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"0daf2106401c","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getInspectionDocuments","classification":"READ","paramCount":1,"schema":"ed8b79d0644f","response":"0daf2106401c","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_getInspectionDocumentsForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"cfa5f1f7b8aa","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getInspectionFeatures","classification":"READ","paramCount":1,"schema":"c25fe011e891","response":"1e8d8f002f21","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getInspectionGauges","classification":"READ","paramCount":1,"schema":"d88996520fca","response":"d5c3ebb5ddd2","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getInspectionMeasurements","classification":"READ","paramCount":1,"schema":"d88996520fca","response":"c6a90b70c17b","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getInspectionPlan","classification":"READ","paramCount":1,"schema":"c25fe011e891","response":"83a9b3640e41","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getInspections","classification":"READ","paramCount":5,"schema":"ab64e3131c2d","response":"b942685a303b","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getInspections","classification":"READ","paramCount":5,"schema":"81ca1d9d2144","response":"b942685a303b","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_getInspectionSamplingPlans","classification":"READ","paramCount":1,"schema":"d88996520fca","response":"5b3237ad5668","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getInspectionTrackedEntities","classification":"READ","paramCount":1,"schema":"17337505bb69","response":"c20d7cb06756","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getIssue","classification":"READ","paramCount":1,"schema":"a78c6c21c084","response":"1a2ca8014c88","injectAuth":"companyId","permission":"quality:view","paginates":false},
@@ -999,30 +999,30 @@
{"name":"quality_getIssueFromExternalLink","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"81ecd90279ab","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getIssueItems","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"ca2b3990f2f7","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getIssueReviewers","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"fa7631f38515","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getIssues","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"e08ce0758580","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getIssues","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"e08ce0758580","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_getIssueSuppliers","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"2a7e42e2f8c2","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getIssueTasks","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"1071578b0d70","injectAuth":"companyId","permission":"quality:view","paginates":false},
+ {"name":"quality_getIssueTasks","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"28fce89961bd","injectAuth":"companyId","permission":"quality:view","paginates":false,"result":"envelopes"},
{"name":"quality_getIssueType","classification":"READ","paramCount":1,"schema":"bb6b04f68710","response":"63b5b3f8f143","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getIssueTypeByName","classification":"READ","paramCount":2,"schema":"858a6cb73bbb","response":"3797626bd17e","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getIssueTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"95195653f3fc","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getIssueTypes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"95195653f3fc","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_getIssueTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getIssueWorkflow","classification":"READ","paramCount":1,"schema":"15a80db054e6","response":"3272b87b8442","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getIssueWorkflows","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"38608ae87f0d","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getIssueWorkflows","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"38608ae87f0d","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_getIssueWorkflowsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"38608ae87f0d","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getItemInspectionDocumentAssignments","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"9bedeef9a12b","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getQualityActions","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"76d10ad61a21","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getQualityActions","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"76d10ad61a21","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_getQualityDocument","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a8b2d87af029","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getQualityDocuments","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"8bb4ab685129","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getQualityDocuments","classification":"READ","paramCount":1,"schema":"ed8b79d0644f","response":"8bb4ab685129","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_getQualityDocumentsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"f0df86b695e6","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getQualityDocumentSteps","classification":"READ","paramCount":1,"schema":"6d79e6870690","response":"55202747c3b2","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getQualityDocumentVersions","classification":"READ","paramCount":2,"schema":"89111eab017d","response":"63e52c70cbef","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getQualityFiles","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"ffefd03548aa","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getReceiptInspections","classification":"READ","paramCount":1,"schema":"e00a9764517d","response":"e30d015c0242","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getRequiredAction","classification":"READ","paramCount":1,"schema":"cca3bf9f3ebb","response":"00f7e228e469","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getRequiredActions","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"477e4aa9ac3b","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getRequiredActions","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"477e4aa9ac3b","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_getRequiredActionsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"quality:view","paginates":false},
{"name":"quality_getRisk","classification":"READ","paramCount":1,"schema":"7002f7ae1c58","response":"f0e54ff68cc5","injectAuth":"companyId","permission":"quality:view","paginates":false},
- {"name":"quality_getRisks","classification":"READ","paramCount":6,"schema":"1014eebba2f1","response":"72f8ffc765cc","injectAuth":"companyId","permission":"quality:view","paginates":true},
+ {"name":"quality_getRisks","classification":"READ","paramCount":6,"schema":"edf9ecb3ea7f","response":"72f8ffc765cc","injectAuth":"companyId","permission":"quality:view","paginates":true,"defaults":"always"},
{"name":"quality_insertGauge","classification":"WRITE","paramCount":15,"schema":"f067ee95ad2f","response":"3269d4609ad2","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create","paginates":false},
{"name":"quality_insertIssue","classification":"WRITE","paramCount":20,"schema":"308033845426","response":"bf12cbd0f560","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create","paginates":false},
{"name":"quality_insertIssueReviewer","classification":"WRITE","paramCount":2,"schema":"fdfb09172931","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create","paginates":false},
@@ -1031,8 +1031,8 @@
{"name":"quality_updateInspectionDocumentSampling","classification":"WRITE","paramCount":7,"schema":"e85058fba971","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy+userId","permission":"quality:update","paginates":false},
{"name":"quality_updateIssue","classification":"WRITE","paramCount":16,"schema":"93bb71a6bcdc","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"quality:update","paginates":false},
{"name":"quality_updateIssueActionProcesses","classification":"DESTRUCTIVE","paramCount":2,"schema":"9dbd38e74ee8","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"quality:update","paginates":false},
- {"name":"quality_updateIssueStatus","classification":"WRITE","paramCount":4,"schema":"57b4fe5217e7","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"quality:update","paginates":false},
- {"name":"quality_updateIssueTaskContent","classification":"WRITE","paramCount":3,"schema":"dcd51db087bc","response":"a78c6c21c084","injectAuth":"companyId+updatedBy","permission":"quality:update","paginates":false},
+ {"name":"quality_updateIssueStatus","classification":"WRITE","paramCount":4,"schema":"71469c92601d","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"quality:update","paginates":false},
+ {"name":"quality_updateIssueTaskContent","classification":"WRITE","paramCount":3,"schema":"4475ba505172","response":"a78c6c21c084","injectAuth":"companyId+updatedBy","permission":"quality:update","paginates":false},
{"name":"quality_updateIssueTaskStatus","classification":"WRITE","paramCount":4,"schema":"cd763f773f42","response":"a78c6c21c084","injectAuth":"companyId+updatedBy+userId","permission":"quality:update","paginates":false},
{"name":"quality_upsertGaugeCalibrationRecord","classification":"WRITE","paramCount":15,"schema":"edcab69c8c1a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update","paginates":false,"upsert":"id"},
{"name":"quality_upsertGaugeType","classification":"WRITE","paramCount":3,"schema":"fbdc294966b9","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update","paginates":false,"upsert":"id"},
@@ -1040,9 +1040,9 @@
{"name":"quality_upsertIssueType","classification":"WRITE","paramCount":3,"schema":"fbdc294966b9","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update","paginates":false,"upsert":"id"},
{"name":"quality_upsertIssueWorkflow","classification":"WRITE","paramCount":7,"schema":"e1638767f6ac","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update","paginates":false,"upsert":"id"},
{"name":"quality_upsertItemInspectionDocumentAssignment","classification":"DESTRUCTIVE","paramCount":3,"schema":"3e4ebfc49e2a","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"quality:create+update","paginates":false},
- {"name":"quality_upsertQualityDocument","classification":"WRITE","paramCount":5,"schema":"6ddca1e4a601","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update","paginates":false},
+ {"name":"quality_upsertQualityDocument","classification":"WRITE","paramCount":5,"schema":"acd2ed0af051","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update","paginates":false,"upsert":"id"},
{"name":"quality_upsertRequiredAction","classification":"WRITE","paramCount":3,"schema":"f0cd89df8f83","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update","paginates":false,"upsert":"id"},
- {"name":"quality_upsertRisk","classification":"WRITE","paramCount":12,"schema":"6cdac0001c75","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update","paginates":false},
+ {"name":"quality_upsertRisk","classification":"WRITE","paramCount":12,"schema":"980470d15320","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"quality:create+update","paginates":false,"upsert":"id"},
{"name":"resources_activateProcess","classification":"WRITE","paramCount":1,"schema":"01edb53077b2","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:update","paginates":false},
{"name":"resources_activateWorkCenter","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:update","paginates":false},
{"name":"resources_deleteAbility","classification":"DESTRUCTIVE","paramCount":2,"schema":"f642be0f483d","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete","paginates":false},
@@ -1063,41 +1063,41 @@
{"name":"resources_deleteTrainingQuestion","classification":"DESTRUCTIVE","paramCount":1,"schema":"b4f48c09ba9f","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete","paginates":false},
{"name":"resources_deleteWorkCenter","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:delete","paginates":false},
{"name":"resources_ensureProcessAbility","classification":"WRITE","paramCount":2,"schema":"6381d05a75ce","response":"3797626bd17e","injectAuth":"companyId+userId","permission":"resources:update","paginates":false},
- {"name":"resources_getAbilities","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"53c80a9d1965","injectAuth":"companyId","permission":"resources:view","paginates":true},
+ {"name":"resources_getAbilities","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"53c80a9d1965","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
{"name":"resources_getAbilitiesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"fc7a0345fc53","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getAbility","classification":"READ","paramCount":1,"schema":"5133c0e3b586","response":"d98eac986c97","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getContractor","classification":"READ","paramCount":1,"schema":"c178e4a4c21e","response":"995cb2d28a3e","injectAuth":"companyId","permission":"resources:view","paginates":false},
- {"name":"resources_getContractors","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"155b783e2512","injectAuth":"companyId","permission":"resources:view","paginates":true},
+ {"name":"resources_getContractors","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"155b783e2512","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
{"name":"resources_getEmployeeAbilities","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"328aa0024967","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getEmployeeAbility","classification":"READ","paramCount":1,"schema":"5ccac46fc41e","response":"f0d72cd0ea38","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getFailureMode","classification":"READ","paramCount":1,"schema":"4a3e0384d72f","response":"2f49c8d39495","injectAuth":"companyId","permission":"resources:view","paginates":false},
- {"name":"resources_getFailureModes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"6fe6b1e0f957","injectAuth":"companyId","permission":"resources:view","paginates":true},
+ {"name":"resources_getFailureModes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"6fe6b1e0f957","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
{"name":"resources_getFailureModesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getLocation","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"5fe568931f57","injectAuth":"companyId","permission":"resources:view","paginates":false},
- {"name":"resources_getLocations","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7df90335f683","injectAuth":"companyId","permission":"resources:view","paginates":true},
+ {"name":"resources_getLocations","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"7df90335f683","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
{"name":"resources_getLocationsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"e19c89c1e8a0","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getMaintenanceDispatch","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"5547ae49213e","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getMaintenanceDispatchComments","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"7df6d6b7ba88","injectAuth":"companyId","permission":"resources:view","paginates":false},
- {"name":"resources_getMaintenanceDispatches","classification":"READ","paramCount":4,"schema":"06e82ba1a75a","response":"8cdb79a1ff07","injectAuth":"companyId","permission":"resources:view","paginates":true},
- {"name":"resources_getMaintenanceDispatchesByLocation","classification":"READ","paramCount":2,"schema":"802416175b36","response":"774cad94afc0","injectAuth":"companyId","permission":"resources:view","paginates":true},
+ {"name":"resources_getMaintenanceDispatches","classification":"READ","paramCount":4,"schema":"c19d6a6c007b","response":"8cdb79a1ff07","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
+ {"name":"resources_getMaintenanceDispatchesByLocation","classification":"READ","paramCount":2,"schema":"5ccae51b79d8","response":"774cad94afc0","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
{"name":"resources_getMaintenanceDispatchEvents","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"fc0af15629d8","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getMaintenanceDispatchItems","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"595d666b79ec","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getMaintenanceDispatchItemTrackedEntities","classification":"READ","paramCount":1,"schema":"63ddd4fe05c0","response":"0ae53e4d5350","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getMaintenanceDispatchWorkCenters","classification":"READ","paramCount":1,"schema":"34cb412f1fae","response":"245d61ef36d3","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getMaintenanceSchedule","classification":"READ","paramCount":1,"schema":"c61245800a33","response":"d794f5e4efb7","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getMaintenanceScheduleItems","classification":"READ","paramCount":1,"schema":"c61245800a33","response":"6e7c564b202a","injectAuth":"companyId","permission":"resources:view","paginates":false},
- {"name":"resources_getMaintenanceSchedules","classification":"READ","paramCount":4,"schema":"b48b875ac337","response":"80c9953d43e5","injectAuth":"companyId","permission":"resources:view","paginates":true},
- {"name":"resources_getMaintenanceSchedulesByLocation","classification":"READ","paramCount":2,"schema":"f360e7c8e35a","response":"8a3485dcbdc1","injectAuth":"companyId","permission":"resources:view","paginates":true},
+ {"name":"resources_getMaintenanceSchedules","classification":"READ","paramCount":4,"schema":"d55eeae51beb","response":"80c9953d43e5","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
+ {"name":"resources_getMaintenanceSchedulesByLocation","classification":"READ","paramCount":2,"schema":"68aa9154c497","response":"8a3485dcbdc1","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
{"name":"resources_getOutstandingTrainingsForUser","classification":"READ","paramCount":1,"schema":"3d90cb5d0437","response":"2b901764b425","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getPartner","classification":"READ","paramCount":2,"schema":"7a4efbb751fd","response":"690aa589fb9c","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getPartnerBySupplierId","classification":"READ","paramCount":1,"schema":"74d289586b4f","response":"690aa589fb9c","injectAuth":"companyId","permission":"resources:view","paginates":false},
- {"name":"resources_getPartners","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"f1a7446bd053","injectAuth":"companyId","permission":"resources:view","paginates":true},
+ {"name":"resources_getPartners","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"f1a7446bd053","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
{"name":"resources_getProcess","classification":"READ","paramCount":1,"schema":"01edb53077b2","response":"d981fcf79885","injectAuth":"companyId","permission":"resources:view","paginates":false},
- {"name":"resources_getProcesses","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"e2daca4791c0","injectAuth":"companyId","permission":"resources:view","paginates":true},
+ {"name":"resources_getProcesses","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"e2daca4791c0","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
{"name":"resources_getProcessesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getProcessesWithoutAbility","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getSuggestion","classification":"READ","paramCount":1,"schema":"3a7f44ccb395","response":"77bb66a1249a","injectAuth":"companyId","permission":"resources:view","paginates":false},
- {"name":"resources_getSuggestions","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"9e90aae0404b","injectAuth":"companyId","permission":"resources:view","paginates":true},
+ {"name":"resources_getSuggestions","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"9e90aae0404b","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
{"name":"resources_getTraining","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"84c264919a14","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getTrainingAssignment","classification":"READ","paramCount":1,"schema":"7d3fe60cc8ed","response":"cb917b5ce4eb","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getTrainingAssignmentForCompletion","classification":"READ","paramCount":1,"schema":"7d3fe60cc8ed","response":"41a2c00f121a","injectAuth":"companyId","permission":"resources:view","paginates":false},
@@ -1107,10 +1107,10 @@
{"name":"resources_getTrainingAssignmentSummary","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"c3f55a28a4ac","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getTrainingGrantedAbilityId","classification":"READ","paramCount":1,"schema":"fbebd108a3c4","response":"174e29b899b9","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getTrainingQuestions","classification":"READ","paramCount":1,"schema":"3f6f0a410b0f","response":"cbc84076fe3b","injectAuth":"companyId","permission":"resources:view","paginates":false},
- {"name":"resources_getTrainings","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"cc28f2dfe36f","injectAuth":"companyId","permission":"resources:view","paginates":true},
+ {"name":"resources_getTrainings","classification":"READ","paramCount":1,"schema":"ed8b79d0644f","response":"cc28f2dfe36f","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
{"name":"resources_getTrainingsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"8a9d99ad8810","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getWorkCenter","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"e5193d0e2978","injectAuth":"companyId","permission":"resources:view","paginates":false},
- {"name":"resources_getWorkCenters","classification":"READ","paramCount":1,"schema":"75e0e9e0be40","response":"0340d99e8700","injectAuth":"companyId","permission":"resources:view","paginates":true},
+ {"name":"resources_getWorkCenters","classification":"READ","paramCount":1,"schema":"ed8b79d0644f","response":"0340d99e8700","injectAuth":"companyId","permission":"resources:view","paginates":true,"defaults":"always"},
{"name":"resources_getWorkCentersByLocation","classification":"READ","paramCount":1,"schema":"de371a276a58","response":"f602591e2bf5","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getWorkCentersList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0340d99e8700","injectAuth":"companyId","permission":"resources:view","paginates":false},
{"name":"resources_getWorkCentersListWithBlockingStatus","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"63fcba641f9a","injectAuth":"companyId","permission":"resources:view","paginates":false},
@@ -1120,26 +1120,26 @@
{"name":"resources_updateAbility","classification":"WRITE","paramCount":2,"schema":"331c98a989f9","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"resources:update","paginates":false},
{"name":"resources_updateMaintenanceDispatch","classification":"WRITE","paramCount":18,"schema":"02877e9f1f8d","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"resources:update","paginates":false},
{"name":"resources_updateSuggestionEmoji","classification":"WRITE","paramCount":2,"schema":"dc61bce0f764","response":"bcde375ebd4c","injectAuth":"companyId","permission":"resources:update","paginates":false},
- {"name":"resources_updateTrainingQuestionOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"resources:update","paginates":false},
+ {"name":"resources_updateTrainingQuestionOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"resources:update","paginates":false,"result":"envelopes"},
{"name":"resources_upsertContractor","classification":"DESTRUCTIVE","paramCount":1,"schema":"6630f8761e37","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"contractor(id)"},
{"name":"resources_upsertEmployeeAbilityCell","classification":"WRITE","paramCount":4,"schema":"800b78f5bbae","response":"3797626bd17e","injectAuth":"companyId","permission":"resources:create+update","paginates":false},
{"name":"resources_upsertFailureMode","classification":"WRITE","paramCount":4,"schema":"e4d170d8f468","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"id"},
- {"name":"resources_upsertLocation","classification":"WRITE","paramCount":13,"schema":"28b97eeddff1","response":"5fe568931f57","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false},
+ {"name":"resources_upsertLocation","classification":"WRITE","paramCount":13,"schema":"5771361986b6","response":"5fe568931f57","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"id"},
{"name":"resources_upsertMaintenanceDispatchComment","classification":"WRITE","paramCount":3,"schema":"15129a94d57d","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"id"},
{"name":"resources_upsertMaintenanceDispatchEvent","classification":"WRITE","paramCount":7,"schema":"a98569352969","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"id"},
{"name":"resources_upsertMaintenanceDispatchItem","classification":"WRITE","paramCount":6,"schema":"41c857266e1d","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"id"},
{"name":"resources_upsertMaintenanceSchedule","classification":"WRITE","paramCount":20,"schema":"f0980197b765","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"id"},
{"name":"resources_upsertPartner","classification":"WRITE","paramCount":3,"schema":"bcf9a7c682d9","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"partner(id)"},
- {"name":"resources_upsertProcess","classification":"DESTRUCTIVE","paramCount":17,"schema":"adaba2327d43","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"id"},
- {"name":"resources_upsertTraining","classification":"WRITE","paramCount":4,"schema":"be53f09f9856","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false},
+ {"name":"resources_upsertProcess","classification":"DESTRUCTIVE","paramCount":17,"schema":"bfa604f1eeb7","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"id","defaults":"create"},
+ {"name":"resources_upsertTraining","classification":"WRITE","paramCount":4,"schema":"385fb9c5d8d1","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"id"},
{"name":"resources_upsertTrainingAssignment","classification":"WRITE","paramCount":3,"schema":"9f8996544bb7","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false},
- {"name":"resources_upsertTrainingQuestion","classification":"WRITE","paramCount":12,"schema":"f27342252292","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false},
+ {"name":"resources_upsertTrainingQuestion","classification":"WRITE","paramCount":12,"schema":"1c336cac9dc8","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"id"},
{"name":"resources_upsertWorkCenter","classification":"DESTRUCTIVE","paramCount":15,"schema":"cbbc99da1ba7","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"resources:create+update","paginates":false,"upsert":"id"},
{"name":"sales_buildMakeToOrderPriceRows","classification":"WRITE","paramCount":4,"schema":"9ca94f5219fe","response":"10ba10c1ac60","injectAuth":"companyId","permission":"sales:update","paginates":false},
{"name":"sales_buildPullFromInventoryPriceRows","classification":"WRITE","paramCount":4,"schema":"9ca94f5219fe","response":"10ba10c1ac60","injectAuth":"companyId","permission":"sales:update","paginates":false},
{"name":"sales_buildPurchaseToOrderPriceRows","classification":"WRITE","paramCount":4,"schema":"9ca94f5219fe","response":"10ba10c1ac60","injectAuth":"companyId","permission":"sales:update","paginates":false},
{"name":"sales_calculatePricesForQuantities","classification":"WRITE","paramCount":3,"schema":"160e0d2cf116","response":"af602e7b257e","injectAuth":"companyId","permission":"sales:update","paginates":false},
- {"name":"sales_cancelSalesOrder","classification":"WRITE","paramCount":2,"schema":"745d2b9e6ebc","response":"903bb804a4ff","injectAuth":"companyId+userId","permission":"sales:update","paginates":false},
+ {"name":"sales_cancelSalesOrder","classification":"WRITE","paramCount":2,"schema":"745d2b9e6ebc","response":"903bb804a4ff","injectAuth":"companyId+userId","permission":"sales:update","paginates":false,"result":"flag"},
{"name":"sales_cancelSalesReturnOrder","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId+userId","permission":"sales:update","paginates":false},
{"name":"sales_confirmSalesReturnOrder","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId","permission":"sales:update","paginates":false},
{"name":"sales_convertQuoteToOrder","classification":"WRITE","paramCount":5,"schema":"fc53803a89ca","response":"5cb338fa12e6","injectAuth":"companyId+updatedBy+userId","permission":"sales:update","paginates":false},
@@ -1148,8 +1148,8 @@
{"name":"sales_copyQuoteLine","classification":"WRITE","paramCount":9,"schema":"692ceb74fe3d","response":"24c3c39326f6","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"sales:create","paginates":false},
{"name":"sales_createOpportunityDocumentUploadUrl","classification":"WRITE","paramCount":2,"schema":"45722937a7bb","response":"4ad76afe0777","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
{"name":"sales_createOpportunityLineDocumentUploadUrl","classification":"WRITE","paramCount":2,"schema":"27cead9c6af9","response":"4ad76afe0777","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
- {"name":"sales_createPricingRule","classification":"WRITE","paramCount":17,"schema":"8a6a210cb492","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
- {"name":"sales_createReplacementSalesOrder","classification":"WRITE","paramCount":1,"schema":"f41daa12b05a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"sales:create","paginates":false},
+ {"name":"sales_createPricingRule","classification":"WRITE","paramCount":17,"schema":"8a6a210cb492","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create","paginates":false,"defaults":"always"},
+ {"name":"sales_createReplacementSalesOrder","classification":"WRITE","paramCount":1,"schema":"f41daa12b05a","response":"3797626bd17e","injectAuth":"companyGroupId+companyId+createdBy+updatedBy+userId","permission":"sales:create","paginates":false},
{"name":"sales_createSalesReturnOrderCredit","classification":"WRITE","paramCount":3,"schema":"b73e7908d9de","response":"00404e686415","injectAuth":"companyGroupId+companyId+createdBy+updatedBy+userId","permission":"sales:create","paginates":false},
{"name":"sales_deleteCustomer","classification":"DESTRUCTIVE","paramCount":1,"schema":"09e48c79fb16","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete","paginates":false},
{"name":"sales_deleteCustomerBankAccount","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:delete","paginates":false},
@@ -1176,7 +1176,7 @@
{"name":"sales_duplicatePricingRule","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
{"name":"sales_finalizeQuote","classification":"WRITE","paramCount":1,"schema":"c726ae407913","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_getAllCustomersItemPriceOverride","classification":"READ","paramCount":3,"schema":"746e975d6c8f","response":"2dfcd06e591d","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getBaseCatalog","classification":"READ","paramCount":3,"schema":"cae7e7e05408","response":"7da40016b67c","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getBaseCatalog","classification":"READ","paramCount":3,"schema":"b00172859bab","response":"7da40016b67c","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getConfigurationParametersByQuoteLineId","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"c36ad21b447b","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getCreditableQuantities","classification":"READ","paramCount":1,"schema":"f41daa12b05a","response":"da2f02c5bdac","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getCustomer","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"8642159293c2","injectAuth":"companyId","permission":"sales:view","paginates":false},
@@ -1185,32 +1185,32 @@
{"name":"sales_getCustomerContacts","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"acc29dbe9746","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getCustomerItemPriceOverride","classification":"READ","paramCount":4,"schema":"3f17d1d3bb22","response":"2dfcd06e591d","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getCustomerItemPriceOverrideById","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getCustomerItemPriceOverridesList","classification":"READ","paramCount":6,"schema":"d5065f366ab1","response":"bae32978787b","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getCustomerItemPriceOverridesList","classification":"READ","paramCount":6,"schema":"1e549e10e0a2","response":"bae32978787b","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getCustomerLocation","classification":"READ","paramCount":1,"schema":"339ac15c3167","response":"be52ec9b4436","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getCustomerLocations","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"bcf222d6d73a","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getCustomerPayment","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"4357e4e42177","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getCustomers","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"07fbe06b66b8","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getCustomers","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"07fbe06b66b8","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getCustomerShipping","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"68f579c7eb78","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getCustomersList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getCustomerStatus","classification":"READ","paramCount":1,"schema":"d9fee396ed8f","response":"9203566a8ab4","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getCustomerStatuses","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"a5e736373756","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getCustomerStatuses","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"a5e736373756","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getCustomerStatusesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getCustomerTax","classification":"READ","paramCount":1,"schema":"09e48c79fb16","response":"35cfe732826b","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getCustomerType","classification":"READ","paramCount":1,"schema":"b79bc02c5595","response":"8b3eca34dbfd","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getCustomerTypeItemPriceOverride","classification":"READ","paramCount":4,"schema":"e4596e241f82","response":"2dfcd06e591d","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getCustomerTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"7c6550dea5b1","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getCustomerTypes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"7c6550dea5b1","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getCustomerTypesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getExternalSalesOrderLines","classification":"READ","paramCount":2,"schema":"dbfcdb73551d","response":"3279b7b05d49","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getExternalSalesOrderLines","classification":"READ","paramCount":2,"schema":"ddc644088147","response":"3279b7b05d49","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getModelByQuoteLineId","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"none","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getNoQuoteReason","classification":"READ","paramCount":1,"schema":"a37352ef51ef","response":"4bbb50609deb","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getNoQuoteReasons","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"28837d034643","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getNoQuoteReasons","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"28837d034643","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getNoQuoteReasonsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ce08332e0ce6","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getOpenSalesOrderLinesForItem","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"334d8429d21a","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getOpportunity","classification":"READ","paramCount":1,"schema":"5e54451f6705","response":"cdaf9ce57087","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getOpportunityDocuments","classification":"READ","paramCount":1,"schema":"a4fcfa20a027","response":"95c1c04c0566","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getOpportunityLineDocuments","classification":"READ","paramCount":2,"schema":"067400ea63f8","response":"95c1c04c0566","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getPricingRule","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"2a1e20313f8b","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getPricingRules","classification":"READ","paramCount":3,"schema":"cae7e7e05408","response":"f3613d31804a","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getPricingRules","classification":"READ","paramCount":3,"schema":"b00172859bab","response":"f3613d31804a","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getQuote","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"ee5f623bf074","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getQuoteAssemblies","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"9807da529af1","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getQuoteAssembliesByLine","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"9807da529af1","injectAuth":"companyId","permission":"sales:view","paginates":false},
@@ -1237,13 +1237,13 @@
{"name":"sales_getQuoteOperationsByLine","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"9e17db1d5582","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getQuoteOperationsByMethodId","classification":"READ","paramCount":1,"schema":"899e2f637661","response":"0ee46500fe67","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getQuotePayment","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"c94b5d1f2b47","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getQuotes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"dea28b562b72","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getQuotes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"dea28b562b72","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getQuoteShipment","classification":"READ","paramCount":1,"schema":"c726ae407913","response":"ee2ac29cff92","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getQuotesList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0ff25946068c","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getRelatedPricesForQuoteLine","classification":"READ","paramCount":2,"schema":"71f31780bb98","response":"11d3b5e78712","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getReturnableLinesForCustomer","classification":"READ","paramCount":2,"schema":"e9ef772b4706","response":"8b3d2e7917fd","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getReturnReason","classification":"READ","paramCount":1,"schema":"937e7a95a060","response":"784c9ecc581f","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getReturnReasons","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"1367348aaf16","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getReturnReasons","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"1367348aaf16","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getReturnReasonsList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"152e0efd7e28","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getRootQuoteMakeMethod","classification":"READ","paramCount":1,"schema":"e0050938a2c8","response":"9bc4f5e58344","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getSalesDocumentsAssignedToMe","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"c8a79f6cebde","injectAuth":"companyId","permission":"sales:view","paginates":false},
@@ -1260,7 +1260,7 @@
{"name":"sales_getSalesOrderLineShipments","classification":"READ","paramCount":1,"schema":"58e3c9762923","response":"131473831fc0","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getSalesOrderPayment","classification":"READ","paramCount":1,"schema":"d160a49d6787","response":"e52a6a8beddf","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getSalesOrderRelatedItems","classification":"READ","paramCount":2,"schema":"651e9f51b36d","response":"a1a189394634","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getSalesOrders","classification":"READ","paramCount":5,"schema":"3999756dbbb5","response":"465fb4beb496","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getSalesOrders","classification":"READ","paramCount":5,"schema":"ef4d06fef47e","response":"465fb4beb496","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getSalesOrdersByIds","classification":"READ","paramCount":1,"schema":"0eb0c2be01ed","response":"5cc20a44d4fe","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getSalesOrderShipment","classification":"READ","paramCount":1,"schema":"d160a49d6787","response":"0f0a39ddefae","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getSalesOrdersList","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"5cc20a44d4fe","injectAuth":"companyId","permission":"sales:view","paginates":false},
@@ -1271,25 +1271,25 @@
{"name":"sales_getSalesReturnOrderLines","classification":"READ","paramCount":1,"schema":"f41daa12b05a","response":"580ee4dec9d4","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getSalesReturnOrderLineTrackedEntities","classification":"READ","paramCount":1,"schema":"749e5d81384a","response":"71f9ff6abcae","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getSalesReturnOrderReceipts","classification":"READ","paramCount":1,"schema":"f41daa12b05a","response":"71de851646a8","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getSalesReturnOrders","classification":"READ","paramCount":5,"schema":"3999756dbbb5","response":"31090a014afa","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getSalesReturnOrders","classification":"READ","paramCount":5,"schema":"ef4d06fef47e","response":"31090a014afa","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getSalesRFQ","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"be949b1d682b","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getSalesRFQLine","classification":"READ","paramCount":1,"schema":"063a6777d378","response":"a53064f9e7fe","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getSalesRFQLines","classification":"READ","paramCount":1,"schema":"1f7e47a99145","response":"17f5b7f57e4c","injectAuth":"companyId","permission":"sales:view","paginates":false},
- {"name":"sales_getSalesRFQs","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"cb436531316b","injectAuth":"companyId","permission":"sales:view","paginates":true},
+ {"name":"sales_getSalesRFQs","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"cb436531316b","injectAuth":"companyId","permission":"sales:view","paginates":true,"defaults":"always"},
{"name":"sales_getSalesTerms","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"9819ae68df9b","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_getShippedTrackedEntitiesForCustomer","classification":"READ","paramCount":2,"schema":"03d6f7a5e605","response":"1eabdd9a5634","injectAuth":"companyId","permission":"sales:view","paginates":false},
{"name":"sales_insertCustomerContact","classification":"WRITE","paramCount":4,"schema":"c5775e935035","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
{"name":"sales_insertCustomerLocation","classification":"WRITE","paramCount":4,"schema":"c30fcaea26e0","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
- {"name":"sales_insertQuote","classification":"WRITE","paramCount":16,"schema":"a6c40455c9f1","response":"9e29b49e1dc8","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
- {"name":"sales_insertSalesOrder","classification":"WRITE","paramCount":17,"schema":"b76b79d52d88","response":"dbfc22813350","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
- {"name":"sales_insertSalesReturnOrder","classification":"WRITE","paramCount":12,"schema":"307356313ba5","response":"c32485518acd","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
+ {"name":"sales_insertQuote","classification":"WRITE","paramCount":16,"schema":"a6c40455c9f1","response":"9e29b49e1dc8","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
+ {"name":"sales_insertSalesOrder","classification":"WRITE","paramCount":17,"schema":"b76b79d52d88","response":"dbfc22813350","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
+ {"name":"sales_insertSalesReturnOrder","classification":"WRITE","paramCount":12,"schema":"307356313ba5","response":"c32485518acd","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
{"name":"sales_insertSalesRFQ","classification":"WRITE","paramCount":13,"schema":"5a54a12e500f","response":"0c1a1b93cca3","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create","paginates":false},
{"name":"sales_recalculateQuoteLinePrices","classification":"WRITE","paramCount":2,"schema":"55ee981d3d94","response":"bef3efeea4ce","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_releaseSalesOrder","classification":"WRITE","paramCount":1,"schema":"d160a49d6787","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_reopenSalesReturnOrder","classification":"WRITE","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId+userId","permission":"sales:update","paginates":false},
{"name":"sales_repriceQuoteLineFromRules","classification":"WRITE","paramCount":2,"schema":"55ee981d3d94","response":"bcde375ebd4c","injectAuth":"companyId","permission":"sales:update","paginates":false},
{"name":"sales_resolvePrice","classification":"WRITE","paramCount":1,"schema":"e21d9e9b3005","response":"eb12029769da","injectAuth":"companyId","permission":"sales:update","paginates":false},
- {"name":"sales_resolvePriceList","classification":"WRITE","paramCount":6,"schema":"2ee3c5668f0c","response":"7da40016b67c","injectAuth":"companyId","permission":"sales:update","paginates":true},
+ {"name":"sales_resolvePriceList","classification":"WRITE","paramCount":6,"schema":"aa4cc3b4c9e6","response":"7da40016b67c","injectAuth":"companyId","permission":"sales:update","paginates":true,"defaults":"always"},
{"name":"sales_resolvePurchaseToOrderPrices","classification":"WRITE","paramCount":3,"schema":"160e0d2cf116","response":"af602e7b257e","injectAuth":"companyId","permission":"sales:update","paginates":false},
{"name":"sales_resolveQuoteLinePrices","classification":"WRITE","paramCount":3,"schema":"160e0d2cf116","response":"af602e7b257e","injectAuth":"companyId","permission":"sales:update","paginates":false},
{"name":"sales_setSalesReturnOrderLineDisposition","classification":"WRITE","paramCount":2,"schema":"a8526e566c94","response":"3797626bd17e","injectAuth":"companyId+updatedBy+userId","permission":"sales:update","paginates":false},
@@ -1298,21 +1298,21 @@
{"name":"sales_updateCustomerLocation","classification":"WRITE","paramCount":4,"schema":"9d205b68ee4f","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_updateCustomerPayment","classification":"WRITE","paramCount":5,"schema":"f4b0bf1f4ec1","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_updateCustomerShipping","classification":"WRITE","paramCount":7,"schema":"1c4be8a465fb","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
- {"name":"sales_updateCustomerTax","classification":"WRITE","paramCount":8,"schema":"8f85c7bd9801","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
- {"name":"sales_updatePricingRule","classification":"WRITE","paramCount":2,"schema":"62b6cf1b50c2","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
+ {"name":"sales_updateCustomerTax","classification":"WRITE","paramCount":8,"schema":"adc033566bc5","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
+ {"name":"sales_updatePricingRule","classification":"WRITE","paramCount":2,"schema":"d8ff12f7ca7a","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_updateQuote","classification":"WRITE","paramCount":17,"schema":"ad5fc3f2a158","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_updateQuoteExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_updateQuoteLineOrder","classification":"WRITE","paramCount":2,"schema":"fce9a5d72ad3","response":"none","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_updateQuoteLinePrecision","classification":"WRITE","paramCount":3,"schema":"90f52ec96806","response":"none","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
- {"name":"sales_updateQuoteMaterialOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
- {"name":"sales_updateQuoteOperationOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
- {"name":"sales_updateQuoteStatus","classification":"WRITE","paramCount":3,"schema":"35467c4f9528","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
+ {"name":"sales_updateQuoteMaterialOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false,"result":"envelopes"},
+ {"name":"sales_updateQuoteOperationOrder","classification":"WRITE","paramCount":1,"schema":"c822495a7892","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false,"result":"envelopes"},
+ {"name":"sales_updateQuoteStatus","classification":"WRITE","paramCount":3,"schema":"db2529b2f9b5","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_updateSalesOrder","classification":"WRITE","paramCount":9,"schema":"d9b815fe7f4c","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_updateSalesOrderExchangeRate","classification":"WRITE","paramCount":2,"schema":"bca4d06461aa","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_updateSalesOrderLineOrder","classification":"WRITE","paramCount":2,"schema":"fc73ab432ad8","response":"none","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
- {"name":"sales_updateSalesOrderStatus","classification":"WRITE","paramCount":3,"schema":"ba9f86dc4f78","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
+ {"name":"sales_updateSalesOrderStatus","classification":"WRITE","paramCount":3,"schema":"4d2e908ca09f","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_updateSalesRFQLineOrder","classification":"WRITE","paramCount":2,"schema":"7a17ee77c8c5","response":"none","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
- {"name":"sales_updateSalesRFQStatus","classification":"WRITE","paramCount":4,"schema":"987b1b266fe8","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
+ {"name":"sales_updateSalesRFQStatus","classification":"WRITE","paramCount":4,"schema":"edf30d1c08da","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"sales:update","paginates":false},
{"name":"sales_upsertCustomer","classification":"WRITE","paramCount":11,"schema":"27fc0d9d8eb0","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false,"upsert":"id"},
{"name":"sales_upsertCustomerBankAccount","classification":"WRITE","paramCount":13,"schema":"71b1f32160c0","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false,"upsert":"id"},
{"name":"sales_upsertCustomerItemPriceOverride","classification":"DESTRUCTIVE","paramCount":10,"schema":"6f67d6ad287a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false},
@@ -1321,9 +1321,9 @@
{"name":"sales_upsertMakeMethodFromQuoteLine","classification":"WRITE","paramCount":4,"schema":"ca78a9869ff2","response":"none","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertMakeMethodFromQuoteMethod","classification":"WRITE","paramCount":3,"schema":"32b3a0f5efa0","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertNoQuoteReason","classification":"WRITE","paramCount":3,"schema":"fbdc294966b9","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false,"upsert":"id"},
- {"name":"sales_upsertQuote","classification":"WRITE","paramCount":21,"schema":"0c5ee8c52242","response":"3acbb53b8c04","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false,"upsert":"id"},
- {"name":"sales_upsertQuoteLine","classification":"WRITE","paramCount":19,"schema":"d3c525861e1c","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false},
- {"name":"sales_upsertQuoteLineAdditionalCharges","classification":"WRITE","paramCount":2,"schema":"483aa73b0c32","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false},
+ {"name":"sales_upsertQuote","classification":"WRITE","paramCount":21,"schema":"0c5ee8c52242","response":"3acbb53b8c04","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false,"upsert":"id"},
+ {"name":"sales_upsertQuoteLine","classification":"WRITE","paramCount":19,"schema":"0418d6bec04a","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false,"upsert":"id"},
+ {"name":"sales_upsertQuoteLineAdditionalCharges","classification":"WRITE","paramCount":2,"schema":"af3d9c81e1c3","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertQuoteLineMethod","classification":"WRITE","paramCount":5,"schema":"5f94e8a4cbf6","response":"none","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertQuoteLinePrices","classification":"DESTRUCTIVE","paramCount":3,"schema":"03bc74906afb","response":"none","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertQuoteMaterial","classification":"WRITE","paramCount":17,"schema":"ab28a6a008f4","response":"af9af3838934","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false,"upsert":"quoteMaterial(id)"},
@@ -1335,8 +1335,8 @@
{"name":"sales_upsertQuotePayment","classification":"WRITE","paramCount":6,"schema":"36ca53e35fa3","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertQuoteShipment","classification":"WRITE","paramCount":7,"schema":"b67f297e5398","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertReturnReason","classification":"WRITE","paramCount":4,"schema":"85bdd818fbab","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false,"upsert":"id"},
- {"name":"sales_upsertSalesOrder","classification":"WRITE","paramCount":19,"schema":"c7fa1aa49c04","response":"5cc20a44d4fe","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false},
- {"name":"sales_upsertSalesOrderLine","classification":"WRITE","paramCount":25,"schema":"f36171418dd8","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false},
+ {"name":"sales_upsertSalesOrder","classification":"WRITE","paramCount":19,"schema":"9d987dd63daf","response":"5cc20a44d4fe","injectAuth":"companyGroupId+companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false,"upsert":"id"},
+ {"name":"sales_upsertSalesOrderLine","classification":"WRITE","paramCount":25,"schema":"ebc3b5ab74f2","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false,"upsert":"id"},
{"name":"sales_upsertSalesOrderPayment","classification":"WRITE","paramCount":8,"schema":"310037cea6c3","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertSalesOrderShipment","classification":"WRITE","paramCount":17,"schema":"a1ab551afe2a","response":"3797626bd17e","injectAuth":"companyId+updatedBy","permission":"sales:create+update","paginates":false},
{"name":"sales_upsertSalesReturnOrderLine","classification":"WRITE","paramCount":12,"schema":"2715ff7be34d","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"sales:create+update","paginates":false,"upsert":"id"},
@@ -1346,7 +1346,7 @@
{"name":"settings_deleteItemSerialSequence","classification":"DESTRUCTIVE","paramCount":1,"schema":"3797626bd17e","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:delete","paginates":false},
{"name":"settings_getAccountsPayableBillingAddress","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"7c0b9dc6d441","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getAccountsReceivableBillingAddress","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"7c0b9dc6d441","injectAuth":"companyId","permission":"settings:view","paginates":false},
- {"name":"settings_getApiKeys","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"eec810be5b96","injectAuth":"companyId","permission":"users:update","paginates":true},
+ {"name":"settings_getApiKeys","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"eec810be5b96","injectAuth":"companyId","permission":"users:update","paginates":true,"defaults":"always"},
{"name":"settings_getCompanies","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"207f0b849926","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getCompany","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"8abc93835023","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getCompanyIntegrations","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3a98b34db51d","injectAuth":"companyId","permission":"settings:view","paginates":false},
@@ -1356,38 +1356,38 @@
{"name":"settings_getCurrentSequence","classification":"READ","paramCount":1,"schema":"f55836d6d401","response":"00404e686415","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getCustomField","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"a533a796c094","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getCustomFields","classification":"READ","paramCount":1,"schema":"f55836d6d401","response":"4dd4a7dca597","injectAuth":"companyId","permission":"settings:view","paginates":false},
- {"name":"settings_getCustomFieldsTables","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"4d68a1d346ce","injectAuth":"companyId","permission":"settings:view","paginates":true},
+ {"name":"settings_getCustomFieldsTables","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"4d68a1d346ce","injectAuth":"companyId","permission":"settings:view","paginates":true,"defaults":"always"},
{"name":"settings_getDocumentSection","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"955f14940530","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getDocumentSections","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"d8b65982e0d9","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getDocumentSectionsByIds","classification":"READ","paramCount":1,"schema":"0eb0c2be01ed","response":"d8b65982e0d9","injectAuth":"companyId","permission":"settings:view","paginates":false},
- {"name":"settings_getDocumentTemplate","classification":"READ","paramCount":1,"schema":"aeac292b00cb","response":"99cae633d7cb","injectAuth":"companyId","permission":"settings:view","paginates":false},
- {"name":"settings_getDocumentTemplateConfig","classification":"READ","paramCount":1,"schema":"aeac292b00cb","response":"3adb0f240f97","injectAuth":"companyId","permission":"settings:view","paginates":false},
+ {"name":"settings_getDocumentTemplate","classification":"READ","paramCount":1,"schema":"2b03a3fd1fa5","response":"99cae633d7cb","injectAuth":"companyId","permission":"settings:view","paginates":false},
+ {"name":"settings_getDocumentTemplateConfig","classification":"READ","paramCount":1,"schema":"2b03a3fd1fa5","response":"3adb0f240f97","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getEmployeeCompanies","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"207f0b849926","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getIndustries","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"5dcce0f224dd","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getIntegration","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"099545249106","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getIntegrations","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"66d5dad6d7fc","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getItemSerialSequence","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"16afb36e5f82","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getItemSerialSequenceByItemId","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"1a875b64a77f","injectAuth":"companyId","permission":"settings:view","paginates":false},
- {"name":"settings_getItemSerialSequences","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"ef60889e0cf5","injectAuth":"companyId","permission":"settings:view","paginates":true},
+ {"name":"settings_getItemSerialSequences","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"ef60889e0cf5","injectAuth":"companyId","permission":"settings:view","paginates":true,"defaults":"always"},
{"name":"settings_getKanbanOutputSetting","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"ca53dc098fc8","injectAuth":"companyId","permission":"settings:view","paginates":false},
- {"name":"settings_getNextSequence","classification":"READ","paramCount":1,"schema":"f55836d6d401","response":"00404e686415","injectAuth":"companyId","permission":"settings:view","paginates":false},
+ {"name":"settings_getNextSequence","classification":"WRITE","paramCount":1,"schema":"f55836d6d401","response":"00404e686415","injectAuth":"companyId","permission":"settings:update","paginates":false},
{"name":"settings_getPlanById","classification":"READ","paramCount":1,"schema":"a77c6a03353f","response":"none","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getPlans","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"5483e69d7515","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getSequence","classification":"READ","paramCount":1,"schema":"f55836d6d401","response":"ef17e2453ded","injectAuth":"companyId","permission":"settings:view","paginates":false},
- {"name":"settings_getSequences","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"395e5a595aba","injectAuth":"companyId","permission":"settings:view","paginates":true},
+ {"name":"settings_getSequences","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"395e5a595aba","injectAuth":"companyId","permission":"settings:view","paginates":true,"defaults":"always"},
{"name":"settings_getSequencesList","classification":"READ","paramCount":1,"schema":"f55836d6d401","response":"8394fbabd845","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getSubsidiaries","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"577bb278c46e","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getSubsidiary","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"9a8cb2196df7","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getTerms","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"deb82bb77180","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_getWebhook","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"cb2b17a3252e","injectAuth":"companyId","permission":"settings:view","paginates":false},
- {"name":"settings_getWebhooks","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"f236afae1a37","injectAuth":"companyId","permission":"settings:view","paginates":true},
+ {"name":"settings_getWebhooks","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"f236afae1a37","injectAuth":"companyId","permission":"settings:view","paginates":true,"defaults":"always"},
{"name":"settings_getWebhookTables","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"633f9f3bffc6","injectAuth":"companyId","permission":"settings:view","paginates":false},
{"name":"settings_resolveSections","classification":"WRITE","paramCount":1,"schema":"0eb0c2be01ed","response":"9cf53d9645e3","injectAuth":"companyId","permission":"settings:update","paginates":false},
{"name":"settings_updateAccountingEnabledSetting","classification":"WRITE","paramCount":1,"schema":"82d5e14a67e0","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
{"name":"settings_updateAccountsPayableAddressSetting","classification":"WRITE","paramCount":1,"schema":"7a679bb0d746","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
- {"name":"settings_updateAccountsPayableBillingAddress","classification":"WRITE","paramCount":10,"schema":"1d9ef8425567","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update","paginates":false},
+ {"name":"settings_updateAccountsPayableBillingAddress","classification":"WRITE","paramCount":10,"schema":"1d9ef8425567","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update","paginates":false,"context":"updatedBy=userId"},
{"name":"settings_updateAccountsReceivableAddressSetting","classification":"WRITE","paramCount":1,"schema":"aee1361e5321","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
- {"name":"settings_updateAccountsReceivableBillingAddress","classification":"WRITE","paramCount":10,"schema":"1d9ef8425567","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update","paginates":false},
+ {"name":"settings_updateAccountsReceivableBillingAddress","classification":"WRITE","paramCount":10,"schema":"1d9ef8425567","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update","paginates":false,"context":"updatedBy=userId"},
{"name":"settings_updateAllowLowercaseItemIdsSetting","classification":"WRITE","paramCount":1,"schema":"4bfa8b2e5538","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
{"name":"settings_updateAssetTaxDepreciationSettings","classification":"WRITE","paramCount":2,"schema":"6decaad55e9c","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
{"name":"settings_updateAutoSelectMaterialWithoutPickingListSetting","classification":"WRITE","paramCount":1,"schema":"c8c780d1ee3a","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
@@ -1419,7 +1419,7 @@
{"name":"settings_updateRfqReadySetting","classification":"WRITE","paramCount":1,"schema":"8828dbf1724d","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
{"name":"settings_updateSalesRuleNotificationSetting","classification":"WRITE","paramCount":1,"schema":"fcb0888da832","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
{"name":"settings_updateSequence","classification":"WRITE","paramCount":2,"schema":"c28f12fe484d","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update","paginates":false},
- {"name":"settings_updateShelfLifeSettings","classification":"WRITE","paramCount":4,"schema":"a6f593fa5702","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
+ {"name":"settings_updateShelfLifeSettings","classification":"WRITE","paramCount":4,"schema":"64b05764105a","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
{"name":"settings_updateShowCurrencyTrailingZerosSetting","classification":"WRITE","paramCount":1,"schema":"42d586011b23","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
{"name":"settings_updateShowCustomerReadableIdSetting","classification":"WRITE","paramCount":1,"schema":"8b384c0bd6a0","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
{"name":"settings_updateShowSupplierReadableIdSetting","classification":"WRITE","paramCount":1,"schema":"e28a3e070640","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
@@ -1427,17 +1427,17 @@
{"name":"settings_updateSuggestionNotificationSetting","classification":"WRITE","paramCount":1,"schema":"ac461e36d464","response":"bcde375ebd4c","injectAuth":"companyId+updatedBy","permission":"settings:update","paginates":false},
{"name":"settings_updateSupplierQuoteNotificationSetting","classification":"WRITE","paramCount":1,"schema":"56a6d061d358","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
{"name":"settings_updateTimeCardSetting","classification":"WRITE","paramCount":1,"schema":"9389085b800b","response":"bcde375ebd4c","injectAuth":"companyId","permission":"settings:update","paginates":false},
- {"name":"settings_upsertDocumentSection","classification":"WRITE","paramCount":5,"schema":"d837b8b65103","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"settings:create+update","paginates":false,"upsert":"documentSection(id)"},
- {"name":"settings_upsertDocumentTemplate","classification":"WRITE","paramCount":6,"schema":"5d28da0e0ad6","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"settings:create+update","paginates":false},
+ {"name":"settings_upsertDocumentSection","classification":"WRITE","paramCount":5,"schema":"3dd0c8f150ea","response":"8394fbabd845","injectAuth":"companyId+createdBy+updatedBy","permission":"settings:create+update","paginates":false,"upsert":"documentSection(id)"},
+ {"name":"settings_upsertDocumentTemplate","classification":"WRITE","paramCount":6,"schema":"5914e39c695f","response":"bcde375ebd4c","injectAuth":"companyId+createdBy+updatedBy","permission":"settings:create+update","paginates":false},
{"name":"settings_upsertItemSerialSequence","classification":"WRITE","paramCount":7,"schema":"ddbb6ec42577","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy","permission":"settings:create+update","paginates":false,"upsert":"id"},
{"name":"shared_deleteSavedView","classification":"DESTRUCTIVE","paramCount":1,"schema":"1fbe3d41dab0","response":"bcde375ebd4c","injectAuth":"companyId","permission":"none","paginates":false},
{"name":"shared_getBase64ImageFromSupabase","classification":"READ","paramCount":1,"schema":"923b083c9bca","response":"174e29b899b9","injectAuth":"companyId","permission":"none","paginates":false},
{"name":"shared_getCountries","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"0e8a11b4e81c","injectAuth":"companyId","permission":"none","paginates":false},
{"name":"shared_getCustomerPortal","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"none","injectAuth":"companyId","permission":"none","paginates":false},
- {"name":"shared_getCustomerPortals","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"fbffc4ca5fac","injectAuth":"companyId","permission":"none","paginates":true},
+ {"name":"shared_getCustomerPortals","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"fbffc4ca5fac","injectAuth":"companyId","permission":"none","paginates":true,"defaults":"always"},
{"name":"shared_getEnforcementRule","classification":"READ","paramCount":2,"schema":"fa9ceafd871f","response":"55286a46f24b","injectAuth":"companyId","permission":"none","paginates":false},
{"name":"shared_getEnforcementRuleAssignmentCounts","classification":"READ","paramCount":1,"schema":"47af2b550d52","response":"ab5d5774b961","injectAuth":"companyId","permission":"none","paginates":false},
- {"name":"shared_getEnforcementRules","classification":"READ","paramCount":2,"schema":"fa46224dbc18","response":"a58a59f02a18","injectAuth":"companyId","permission":"none","paginates":true},
+ {"name":"shared_getEnforcementRules","classification":"READ","paramCount":2,"schema":"f7fab064142e","response":"a58a59f02a18","injectAuth":"companyId","permission":"none","paginates":true,"defaults":"always"},
{"name":"shared_getExternalLink","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"0f7860db4299","injectAuth":"companyId","permission":"none","paginates":false},
{"name":"shared_getModelByItemId","classification":"READ","paramCount":1,"schema":"623ca47a6c74","response":"none","injectAuth":"companyId","permission":"none","paginates":false},
{"name":"shared_getNotes","classification":"READ","paramCount":1,"schema":"e7617eb689c8","response":"1a052a4417b5","injectAuth":"companyId","permission":"none","paginates":false},
@@ -1452,28 +1452,28 @@
{"name":"shared_lookupPriceFromBreaks","classification":"READ","paramCount":3,"schema":"14f107043636","response":"cddf8275afa1","injectAuth":"companyId","permission":"none","paginates":false},
{"name":"shared_resolveBuyUnitCost","classification":"WRITE","paramCount":3,"schema":"4c58915f44dd","response":"cddf8275afa1","injectAuth":"companyId","permission":"none","paginates":false},
{"name":"shared_resolveSupplierPrice","classification":"READ","paramCount":4,"schema":"c92834c91ef5","response":"cddf8275afa1","injectAuth":"companyId","permission":"none","paginates":false},
- {"name":"shared_updateSavedViewOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"none","paginates":false},
+ {"name":"shared_updateSavedViewOrder","classification":"WRITE","paramCount":1,"schema":"d19d08f2d129","response":"646de62ab761","injectAuth":"companyId+updatedBy","permission":"none","paginates":false,"result":"envelopes"},
{"name":"shared_upsertExternalLink","classification":"WRITE","paramCount":1,"schema":"33e54e07795a","response":"3797626bd17e","injectAuth":"companyId","permission":"none","paginates":false},
{"name":"shared_upsertSavedView","classification":"WRITE","paramCount":10,"schema":"88a0b7dfec62","response":"3797626bd17e","injectAuth":"companyId+createdBy+updatedBy+userId","permission":"none","paginates":false},
{"name":"users_deleteGroup","classification":"DESTRUCTIVE","paramCount":1,"schema":"c4dcdfdf8647","response":"bcde375ebd4c","injectAuth":"companyId","permission":"users:delete","paginates":false},
{"name":"users_getCompaniesForUser","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"681004346c78","injectAuth":"companyId","permission":"users:view","paginates":false},
- {"name":"users_getConsoleOperators","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"42c3353a5284","injectAuth":"companyId","permission":"users:view","paginates":true},
- {"name":"users_getCustomers","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"79cad34eb92a","injectAuth":"companyId","permission":"users:view","paginates":true},
+ {"name":"users_getConsoleOperators","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"42c3353a5284","injectAuth":"companyId","permission":"users:view","paginates":true,"defaults":"always"},
+ {"name":"users_getCustomers","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"79cad34eb92a","injectAuth":"companyId","permission":"users:view","paginates":true,"defaults":"always"},
{"name":"users_getEmployee","classification":"READ","paramCount":1,"schema":"3797626bd17e","response":"fddbdf17260d","injectAuth":"companyId","permission":"users:view","paginates":false},
- {"name":"users_getEmployees","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"42c3353a5284","injectAuth":"companyId","permission":"users:view","paginates":true},
+ {"name":"users_getEmployees","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"42c3353a5284","injectAuth":"companyId","permission":"users:view","paginates":true,"defaults":"always"},
{"name":"users_getEmployeeType","classification":"READ","paramCount":1,"schema":"dba2936b2a4e","response":"02c4f766f388","injectAuth":"companyId","permission":"users:view","paginates":false},
- {"name":"users_getEmployeeTypes","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"2851c6c5b230","injectAuth":"companyId","permission":"users:view","paginates":true},
+ {"name":"users_getEmployeeTypes","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"2851c6c5b230","injectAuth":"companyId","permission":"users:view","paginates":true,"defaults":"always"},
{"name":"users_getGroup","classification":"READ","paramCount":1,"schema":"c4dcdfdf8647","response":"f06d2d858884","injectAuth":"companyId","permission":"users:view","paginates":false},
{"name":"users_getGroupEmails","classification":"READ","paramCount":1,"schema":"ab09ef9264af","response":"681004346c78","injectAuth":"companyId","permission":"users:view","paginates":false},
{"name":"users_getGroupMembers","classification":"READ","paramCount":1,"schema":"c4dcdfdf8647","response":"f218e882144b","injectAuth":"companyId","permission":"users:view","paginates":false},
- {"name":"users_getGroups","classification":"READ","paramCount":4,"schema":"7d58cdeaf0dc","response":"878696d68be4","injectAuth":"companyId","permission":"users:view","paginates":true},
+ {"name":"users_getGroups","classification":"READ","paramCount":4,"schema":"f382292e4c25","response":"878696d68be4","injectAuth":"companyId","permission":"users:view","paginates":true,"defaults":"always"},
{"name":"users_getInvitable","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3173c3a99146","injectAuth":"companyId","permission":"users:view","paginates":false},
{"name":"users_getItarCertificationReport","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"203ea6eb1a16","injectAuth":"companyId","permission":"users:view","paginates":false},
{"name":"users_getItarCertificationStatus","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"6afd62a22e82","injectAuth":"companyId","permission":"users:view","paginates":false},
{"name":"users_getItarEntityCertification","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"c5ae95ca48db","injectAuth":"companyId","permission":"users:view","paginates":false},
{"name":"users_getModules","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"3f7ca035e170","injectAuth":"companyId","permission":"users:view","paginates":false},
{"name":"users_getPermissionsByEmployeeType","classification":"READ","paramCount":1,"schema":"dba2936b2a4e","response":"9b77a39f3bec","injectAuth":"companyId","permission":"users:view","paginates":false},
- {"name":"users_getSuppliers","classification":"READ","paramCount":3,"schema":"04eded31eebb","response":"c096e3fa1fac","injectAuth":"companyId","permission":"users:view","paginates":true},
+ {"name":"users_getSuppliers","classification":"READ","paramCount":3,"schema":"c61cae75d189","response":"c096e3fa1fac","injectAuth":"companyId","permission":"users:view","paginates":true,"defaults":"always"},
{"name":"users_getUnrevokedInviteEmails","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"a6b0124b4410","injectAuth":"companyId","permission":"users:view","paginates":false},
{"name":"users_getUserEmails","classification":"READ","paramCount":1,"schema":"e0b0d488de80","response":"681004346c78","injectAuth":"companyId","permission":"users:view","paginates":false},
{"name":"users_getUsers","classification":"READ","paramCount":0,"schema":"efddc7bd8bbc","response":"e2e6268ff023","injectAuth":"companyId","permission":"users:view","paginates":false},
diff --git a/apps/erp/app/routes/api+/v1+/lib/company-scope.server.ts b/apps/erp/app/routes/api+/v1+/lib/company-scope.server.ts
new file mode 100644
index 0000000000..1189ca269f
--- /dev/null
+++ b/apps/erp/app/routes/api+/v1+/lib/company-scope.server.ts
@@ -0,0 +1,60 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+/**
+ * The client a service is handed by the dispatcher: the caller's own, with
+ * every `update` and `delete` on a table that has a `companyId` column also
+ * filtered by the caller's company.
+ *
+ * Services match the row they write by its id (`.update(row).eq("id", id)`),
+ * and row-level security lets a signed-in user reach every company they
+ * belong to. So a user with company A active could change or delete a row of
+ * their company B by sending its id — and since the dispatcher stamps the
+ * active `companyId` into the payload, an update that spread it moved the row
+ * to A. Filtering here closes that for every tool at once: a write can only
+ * match a row that is already in the caller's company, whatever the service
+ * filters on. A service that filters on `companyId` itself is unaffected.
+ *
+ * Reads, inserts, RPCs, storage and auth pass through untouched.
+ */
+export function scopedToCompany<Client extends object>(
+ client: Client,
+ companyId: string,
+ companyTables: ReadonlySet<string>
+): Client {
+ // Methods are read off the real object and bound to it: supabase-js keeps
+ // its state on `this`, which a proxy as receiver would not carry.
+ const member = (target: object, property: string | symbol) => {
+ const value = Reflect.get(target, property, target);
+ return typeof value === "function" ? value.bind(target) : value;
+ };
+
+ return new Proxy(client, {
+ get(target, property) {
+ if (property !== "from") return member(target, property);
+ return (table: string) => {
+ const query = (target as { from(table: string): object }).from(table);
+ if (!companyTables.has(table)) return query;
+ return new Proxy(query, {
+ get(builder, method) {
+ if (method !== "update" && method !== "delete") {
+ return member(builder, method);
+ }
+ return (...args: unknown[]) =>
+ (
+ builder as Record<
+ string,
+ (...args: unknown[]) => {
+ eq(column: string, value: string): unknown;
+ }
+ >
+ )
+ [method](...args)
+ .eq("companyId", companyId);
+ }
+ });
+ };
+ }
+ });
+}
diff --git a/apps/erp/app/routes/api+/v1+/lib/company-scope.test.ts b/apps/erp/app/routes/api+/v1+/lib/company-scope.test.ts
new file mode 100644
index 0000000000..d7e0f4e693
--- /dev/null
+++ b/apps/erp/app/routes/api+/v1+/lib/company-scope.test.ts
@@ -0,0 +1,121 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { createClient } from "@supabase/supabase-js";
+import { describe, expect, it } from "vitest";
+import raw from "../../mcp+/lib/tool-metadata.json";
+import { scopedToCompany } from "./company-scope.server";
+
+// The real supabase-js client, with only the network replaced: what is
+// asserted is the request PostgREST would receive.
+function recordingClient() {
+ const requests: Array<{
+ method: string;
+ path: string;
+ query: URLSearchParams;
+ }> = [];
+ const client = createClient("http://localhost:54321", "anon-key", {
+ auth: { persistSession: false, autoRefreshToken: false },
+ global: {
+ fetch: async (input, init) => {
+ const url = new URL(String(input));
+ requests.push({
+ method: init?.method ?? "GET",
+ path: url.pathname,
+ query: url.searchParams
+ });
+ return new Response("[]", {
+ status: 200,
+ headers: { "content-type": "application/json" }
+ });
+ }
+ }
+ });
+ return { client, requests };
+}
+
+const tables = new Set(["customer", "job"]);
+
+describe("the client a service is handed", () => {
+ it("filters an update by the caller's company, whatever the service filters on", async () => {
+ const { client, requests } = recordingClient();
+ await scopedToCompany(client, "c1", tables)
+ .from("customer")
+ .update({ name: "Acme" })
+ .eq("id", "cust-of-another-company")
+ .select("id");
+
+ expect(requests).toHaveLength(1);
+ expect(requests[0]?.method).toBe("PATCH");
+ expect(requests[0]?.query.get("id")).toBe("eq.cust-of-another-company");
+ expect(requests[0]?.query.get("companyId")).toBe("eq.c1");
+ });
+
+ it("filters a delete the same way", async () => {
+ const { client, requests } = recordingClient();
+ await scopedToCompany(client, "c1", tables)
+ .from("job")
+ .delete()
+ .eq("id", "job1");
+
+ expect(requests[0]?.method).toBe("DELETE");
+ expect(requests[0]?.query.get("companyId")).toBe("eq.c1");
+ });
+
+ it("leaves a service's own company filter standing beside it", async () => {
+ const { client, requests } = recordingClient();
+ await scopedToCompany(client, "c1", tables)
+ .from("job")
+ .update({ status: "Ready" })
+ .eq("id", "job1")
+ .eq("companyId", "c1");
+
+ expect(requests[0]?.query.getAll("companyId")).toEqual(["eq.c1", "eq.c1"]);
+ });
+
+ it("does not touch a read or an insert", async () => {
+ const { client, requests } = recordingClient();
+ const scoped = scopedToCompany(client, "c1", tables);
+ await scoped.from("customer").select("*").eq("id", "cust1");
+ await scoped.from("customer").insert({ name: "Acme" });
+
+ expect(requests.map((request) => request.method)).toEqual(["GET", "POST"]);
+ expect(requests[0]?.query.has("companyId")).toBe(false);
+ expect(requests[1]?.query.has("companyId")).toBe(false);
+ });
+
+ it("does not filter a table that has no companyId column", async () => {
+ const { client, requests } = recordingClient();
+ await scopedToCompany(client, "c1", tables)
+ .from("company")
+ .update({ name: "Acme" })
+ .eq("id", "c1");
+
+ expect(requests[0]?.query.has("companyId")).toBe(false);
+ });
+
+ it("passes everything else through to the real client", async () => {
+ const { client, requests } = recordingClient();
+ await scopedToCompany(client, "c1", tables).rpc("get_claims", {
+ uid: "u1"
+ });
+
+ expect(requests[0]?.path).toBe("/rest/v1/rpc/get_claims");
+ });
+
+ it("knows the tables from the generated database types", () => {
+ const companyTables = (raw as { companyTables: string[] }).companyTables;
+ expect(companyTables).toEqual(
+ expect.arrayContaining([
+ "customer",
+ "job",
+ "salesOrder",
+ "purchaseInvoice"
+ ])
+ );
+ // Not tenant rows: the company itself, and the user it is not scoped to.
+ expect(companyTables).not.toContain("company");
+ expect(companyTables).not.toContain("user");
+ });
+});
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.ts
index 49774d00c9..20da3c575d 100644
--- a/apps/erp/app/routes/api+/v1+/lib/dispatch-parity.test.ts
+++ b/apps/erp/app/routes/api+/v1+/lib/dispatch-parity.test.ts
@@ -11,6 +11,7 @@
// here is a behavior change for MCP, the agent, the workflow engine and HTTP at once.
import { ORPCError } from "@orpc/server";
+import { createClient } from "@supabase/supabase-js";
import { beforeEach, describe, expect, it, vi } from "vitest";
const spies = vi.hoisted(() => ({
@@ -21,9 +22,19 @@ const spies = vi.hoisted(() => ({
upsertMethodMaterial: vi.fn(),
upsertQuoteLinePrices: vi.fn(),
updateQuoteLineOrder: vi.fn(),
+ recalculateQuoteLinePrices: vi.fn(),
+ updateQuoteMaterialOrder: vi.fn(),
+ cancelSalesOrder: vi.fn(),
generateInventoryCountLines: vi.fn(),
upsertNotificationPreference: vi.fn(),
insertJob: vi.fn(),
+ updateJobOperationStatus: vi.fn(),
+ getActiveJobOperationsByLocation: vi.fn(),
+ getPurchaseLinePivot: vi.fn(),
+ deleteCustomer: vi.fn(),
+ upsertPurchaseOrderLine: vi.fn(),
+ updateSupplierTax: vi.fn(),
+ upsertPurchasingRFQSuppliers: vi.fn(),
insertIssue: vi.fn(),
getInspectionDocument: vi.fn(),
insertPurchaseOrder: vi.fn(),
@@ -43,6 +54,7 @@ vi.mock("~/modules/account/account.service", () => ({
vi.mock("~/modules/accounting/accounting.service", () => ({
getAccountLedger: spies.getAccountLedger,
getTrialBalance: spies.getTrialBalance,
+ getPurchaseLinePivot: spies.getPurchaseLinePivot,
upsertAccount: spies.upsertAccount
}));
vi.mock("~/modules/documents/documents.service", () => ({}));
@@ -60,10 +72,15 @@ vi.mock("~/modules/people/people.service", () => ({}));
vi.mock("~/modules/production/production.mcp.server", () => ({}));
vi.mock("~/modules/production/production.service", () => ({
insertJob: spies.insertJob,
+ updateJobOperationStatus: spies.updateJobOperationStatus,
+ getActiveJobOperationsByLocation: spies.getActiveJobOperationsByLocation,
upsertJobMaterial: spies.upsertJobMaterial
}));
vi.mock("~/modules/purchasing/purchasing.service", () => ({
- insertPurchaseOrder: spies.insertPurchaseOrder
+ insertPurchaseOrder: spies.insertPurchaseOrder,
+ upsertPurchaseOrderLine: spies.upsertPurchaseOrderLine,
+ updateSupplierTax: spies.updateSupplierTax,
+ upsertPurchasingRFQSuppliers: spies.upsertPurchasingRFQSuppliers
}));
vi.mock("~/modules/quality/quality.service", () => ({
insertIssue: spies.insertIssue,
@@ -73,6 +90,10 @@ vi.mock("~/modules/resources/resources.service", () => ({}));
vi.mock("~/modules/sales/sales.service", () => ({
upsertQuoteLinePrices: spies.upsertQuoteLinePrices,
updateQuoteLineOrder: spies.updateQuoteLineOrder,
+ recalculateQuoteLinePrices: spies.recalculateQuoteLinePrices,
+ updateQuoteMaterialOrder: spies.updateQuoteMaterialOrder,
+ cancelSalesOrder: spies.cancelSalesOrder,
+ deleteCustomer: spies.deleteCustomer,
insertSalesOrder: spies.insertSalesOrder
}));
vi.mock("~/modules/settings/settings.service", () => ({}));
@@ -99,6 +120,7 @@ vi.mock("@carbon/logger", () => ({
import { CarbonJsonSchemaConverter } from "@carbon/api/schema";
import { OpenAPIGenerator } from "@orpc/openapi";
+import { publishDefaults } from "../../../../../../../scripts/lib/service-metadata";
import { MCP_BLOCKED_TOOL_NAMES } from "../../mcp+/lib/mcp-blocked-tools";
import type { AuthedContext } from "./base.server";
import { callOperation } from "./call.server";
@@ -107,13 +129,15 @@ import {
type DispatchResult,
dispatchOperation,
enrichWithAuthContext,
- resolveUpsertOperation
+ resolveUpsertOperation,
+ withSchemaDefaults
} from "./dispatch.server";
import { openApiHandler } from "./handler.server";
import {
liveOperationAliases,
OPERATION_ALIASES,
OPERATIONS,
+ operationId,
operationsByName
} from "./operations.server";
import { router } from "./router.server";
@@ -165,15 +189,24 @@ const allSpies = [
spies.upsertMethodMaterial,
spies.upsertQuoteLinePrices,
spies.updateQuoteLineOrder,
+ spies.recalculateQuoteLinePrices,
+ spies.updateQuoteMaterialOrder,
+ spies.cancelSalesOrder,
spies.generateInventoryCountLines,
spies.upsertNotificationPreference,
spies.insertJob,
+ spies.updateJobOperationStatus,
+ spies.getActiveJobOperationsByLocation,
+ spies.upsertPurchasingRFQSuppliers,
spies.insertIssue,
spies.getInspectionDocument,
spies.insertPurchaseOrder,
spies.insertSalesOrder,
spies.replaceInvoiceSettlements,
- spies.applyCreditsToInvoices
+ spies.applyCreditsToInvoices,
+ spies.upsertPurchaseOrderLine,
+ spies.updateSupplierTax,
+ spies.deleteCustomer
];
beforeEach(() => {
@@ -337,6 +370,383 @@ describe("dispatchOperation service-call contract (golden, ex-executeFunction pa
]);
});
+ // A service that takes the acting user as its own positional argument. The
+ // generator sees the body write it to an audit column and records the slot
+ // (`contextParams`); before that the whole body was passed in its place and
+ // the write failed on the `updatedBy` foreign key.
+ it("a3. fills a positional updatedBy / createdBy from context, never from the body", async () => {
+ const status = await runDispatch(
+ "production_updateJobOperationStatus",
+ spies.updateJobOperationStatus,
+ { id: "op1", status: "Done", updatedBy: "forged" }
+ );
+ expect(status.calls).toEqual([[spies.FAKE_CLIENT, "op1", "Done", "u1"]]);
+
+ const omitted = await runDispatch(
+ "production_updateJobOperationStatus",
+ spies.updateJobOperationStatus,
+ { id: "op1", status: "Done" }
+ );
+ expect(omitted.calls).toEqual([[spies.FAKE_CLIENT, "op1", "Done", "u1"]]);
+
+ const suppliers = await runDispatch(
+ "purchasing_upsertPurchasingRFQSuppliers",
+ spies.upsertPurchasingRFQSuppliers,
+ { purchasingRfqId: "rfq1", supplierIds: ["s1"] }
+ );
+ expect(suppliers.calls).toEqual([
+ [spies.FAKE_CLIENT, "rfq1", ["s1"], "c1", "u1"]
+ ]);
+ });
+
+ // Found by the read-tool sweep: the omitted optional list was handed the
+ // whole body, and Postgres answered "expected JSON array".
+ it("a5. leaves an omitted optional list or object undefined, never the body", async () => {
+ const omitted = await runDispatch(
+ "production_getActiveJobOperationsByLocation",
+ spies.getActiveJobOperationsByLocation,
+ { locationId: "loc1" }
+ );
+ expect(omitted.calls).toEqual([[spies.FAKE_CLIENT, "loc1", undefined]]);
+
+ const sent = await runDispatch(
+ "production_getActiveJobOperationsByLocation",
+ spies.getActiveJobOperationsByLocation,
+ { locationId: "loc1", workCenterIds: ["wc1"] }
+ );
+ expect(sent.calls).toEqual([[spies.FAKE_CLIENT, "loc1", ["wc1"]]]);
+ });
+
+ // Found by the read-tool sweep: `state: {}` is valid by the published schema,
+ // and the service crashed reading `state.columnAxis.type`.
+ it("a6. a read gets the defaults its schema publishes, and keeps what was sent", async () => {
+ const r = await runDispatch(
+ "accounting_getPurchaseLinePivot",
+ spies.getPurchaseLinePivot,
+ {
+ startDate: "2026-01-01",
+ endDate: "2026-01-31",
+ state: { rows: ["d1"] }
+ }
+ );
+ expect(r.calls).toEqual([
+ [
+ spies.FAKE_CLIENT,
+ {
+ companyId: "c1",
+ startDate: "2026-01-01",
+ endDate: "2026-01-31",
+ state: {
+ rows: ["d1"],
+ columnAxis: { type: "period", bucket: "month" },
+ measure: "amount",
+ percentOfTotal: false,
+ sort: null,
+ filters: [],
+ accountIds: []
+ }
+ }
+ ]
+ ]);
+ });
+
+ // A default says "leave this out and you get X". That holds for a new row
+ // and never for an update, where a field left out keeps what is stored.
+ describe("published defaults", () => {
+ const line = { purchaseOrderId: "po1", purchaseOrderLineType: "Part" };
+
+ it("a7. an upsert that creates is filled, and stamped as a create", async () => {
+ const r = await runDispatch(
+ "purchasing_upsertPurchaseOrderLine",
+ spies.upsertPurchaseOrderLine,
+ line
+ );
+ expect(r.calls).toEqual([
+ [
+ spies.FAKE_CLIENT,
+ { ...line, taxPercent: 0, companyId: "c1", createdBy: "u1" }
+ ]
+ ]);
+ });
+
+ it("a8. the same upsert updating is not filled, and keeps the row's createdBy", async () => {
+ const r = await runDispatch(
+ "purchasing_upsertPurchaseOrderLine",
+ spies.upsertPurchaseOrderLine,
+ { id: "l1", ...line, purchaseQuantity: 3 }
+ );
+ // No taxPercent: 0 to overwrite the stored rate. No createdBy either —
+ // the service spreads the payload into its UPDATE, so before this the
+ // row's creator was rewritten to whoever edited it.
+ expect(r.calls).toEqual([
+ [
+ spies.FAKE_CLIENT,
+ {
+ id: "l1",
+ ...line,
+ purchaseQuantity: 3,
+ companyId: "c1",
+ updatedBy: "u1"
+ }
+ ]
+ ]);
+ });
+
+ it("a9. what the caller sent wins, null included", async () => {
+ const r = await runDispatch(
+ "purchasing_upsertPurchaseOrderLine",
+ spies.upsertPurchaseOrderLine,
+ { ...line, taxPercent: 0.2 }
+ );
+ expect((r.calls[0]?.[1] as { taxPercent: number }).taxPercent).toBe(0.2);
+ });
+
+ it("a10. a wrapped payload is filled inside the wrapper, not beside it", async () => {
+ const r = await runDispatch(
+ "purchasing_upsertPurchaseOrderLine",
+ spies.upsertPurchaseOrderLine,
+ { purchaseOrderLine: line }
+ );
+ expect(r.calls).toEqual([
+ [
+ spies.FAKE_CLIENT,
+ { ...line, taxPercent: 0, companyId: "c1", createdBy: "u1" }
+ ]
+ ]);
+ });
+
+ it("a11. every element of a list is filled", async () => {
+ const application = {
+ targetSalesInvoiceId: "si1",
+ targetExchangeRate: 1,
+ sourceExchangeRate: 1,
+ appliedDate: "2026-09-09"
+ };
+ const r = await runDispatch(
+ "invoicing_replaceInvoiceSettlements",
+ spies.replaceInvoiceSettlements,
+ {
+ paymentId: "p1",
+ applications: [application, { ...application, appliedAmount: 40 }]
+ }
+ );
+ const zeros = { discountAmount: 0, writeOffAmount: 0 };
+ expect(
+ (r.calls[0]?.[1] as { applications: unknown[] }).applications
+ ).toEqual([
+ { ...application, appliedAmount: 0, ...zeros },
+ { ...application, appliedAmount: 40, ...zeros }
+ ]);
+ });
+
+ // One schema, asked of both sides: what the generator keeps is exactly what
+ // the dispatcher fills.
+ const fixture = () => ({
+ type: "object",
+ properties: {
+ plain: { type: "number", default: 1 },
+ nested: {
+ type: "object",
+ properties: { inner: { type: "string", default: "x" } }
+ },
+ rows: {
+ type: "array",
+ items: {
+ type: "object",
+ properties: { amount: { type: "number", default: 0 } }
+ }
+ },
+ // One object alternative: an object value can only be that one.
+ paged: {
+ anyOf: [
+ { type: "string" },
+ {
+ type: "object",
+ properties: { limit: { type: "integer", default: 25 } }
+ }
+ ]
+ },
+ // Two: which one the caller meant cannot be told.
+ party: {
+ anyOf: [
+ {
+ type: "object",
+ properties: { a: { type: "number", default: 1 } }
+ },
+ {
+ type: "object",
+ properties: { b: { type: "number", default: 2 } }
+ }
+ ]
+ },
+ // A record's values are not reached.
+ charges: {
+ type: "object",
+ additionalProperties: {
+ type: "object",
+ properties: { taxable: { type: "boolean", default: true } }
+ }
+ },
+ // A field that happens to be called `default` is not a keyword.
+ flags: {
+ type: "object",
+ properties: { default: { type: "boolean" } }
+ }
+ }
+ });
+ const sent = {
+ nested: {},
+ rows: [{}, { amount: 5 }],
+ paged: {},
+ party: {},
+ charges: { freight: {} },
+ flags: {}
+ };
+
+ it("are kept only where the dispatcher reaches them", () => {
+ const schema = fixture();
+ expect(publishDefaults(schema, "always")).toBe(true);
+ expect(schema.properties.plain.default).toBe(1);
+ expect(schema.properties.nested.properties.inner.default).toBe("x");
+ expect(schema.properties.rows.items.properties.amount.default).toBe(0);
+ expect(schema.properties.paged.anyOf[1]?.properties?.limit.default).toBe(
+ 25
+ );
+ expect(JSON.stringify(schema.properties.party)).not.toContain("default");
+ expect(JSON.stringify(schema.properties.charges)).not.toContain(
+ "default"
+ );
+ expect(schema.properties.flags.properties.default).toEqual({
+ type: "boolean"
+ });
+
+ expect(withSchemaDefaults(schema, sent)).toEqual({
+ plain: 1,
+ nested: { inner: "x" },
+ rows: [{ amount: 0 }, { amount: 5 }],
+ paged: { limit: 25 },
+ party: {},
+ charges: { freight: {} },
+ flags: {}
+ });
+ });
+
+ it("are all removed when nothing fills them, and marked when only a create does", () => {
+ const none = fixture();
+ expect(publishDefaults(none, undefined)).toBe(false);
+ expect(JSON.stringify(none)).not.toContain('"default":1');
+ expect(none.properties.flags.properties.default).toEqual({
+ type: "boolean"
+ });
+
+ const onCreate = fixture();
+ publishDefaults(onCreate, "create");
+ expect(
+ (onCreate.properties.plain as { description?: string }).description
+ ).toContain("Applied when creating");
+ });
+
+ // The service pages only when it is handed a limit. A page size filled
+ // in for the caller would cut every unpaged list read to that many rows.
+ it("a13. a list read is not given a page size, only the offset a limit needs", () => {
+ const customers = operationsByName.get("sales_getCustomers");
+ const args = (
+ customers?.schema as { properties?: Record<string, unknown> }
+ ).properties?.args;
+ expect(withSchemaDefaults(args, {})).toEqual({ offset: 0 });
+ expect(withSchemaDefaults(args, { limit: 10 })).toEqual({
+ limit: 10,
+ offset: 0
+ });
+ });
+
+ it("a12. an update tool publishes none and is handed none", async () => {
+ const meta = operationsByName.get("purchasing_updateSupplierTax");
+ expect(meta?.defaults).toBeUndefined();
+ expect(JSON.stringify(meta?.schema)).not.toContain('"default"');
+ });
+ });
+
+ // A service reports failure in what it returns. Each of these used to reach
+ // the caller as a success, because only `{ data, error }` was read.
+ describe("a failure in the service's result is an error, whatever its shape", () => {
+ const pgError = { code: "23503", message: "violates foreign key" };
+
+ it("a bare { error } with no data", async () => {
+ spies.recalculateQuoteLinePrices.mockResolvedValue({ error: pgError });
+ const r = await runDispatch(
+ "sales_recalculateQuoteLinePrices",
+ spies.recalculateQuoteLinePrices,
+ { quoteId: "q1", quoteLineId: "ql1" }
+ );
+ expect(r.dispatch).toBeUndefined();
+ expect(r.dispatchError).toMatchObject({
+ message: "violates foreign key",
+ data: { supabase: pgError }
+ });
+ });
+
+ it("a bare { error: null } is still the result", async () => {
+ spies.recalculateQuoteLinePrices.mockResolvedValue({ error: null });
+ const r = await runDispatch(
+ "sales_recalculateQuoteLinePrices",
+ spies.recalculateQuoteLinePrices,
+ { quoteId: "q1", quoteLineId: "ql1" }
+ );
+ expect(r.dispatchError).toBeUndefined();
+ expect(r.dispatch).toEqual({ data: { error: null } });
+ });
+
+ it("one failed write in a Promise.all of writes", async () => {
+ const ok = { data: null, error: null, status: 204 };
+ spies.updateQuoteMaterialOrder.mockResolvedValue([
+ ok,
+ { data: null, error: pgError, status: 409 }
+ ]);
+ const failed = await runDispatch(
+ "sales_updateQuoteMaterialOrder",
+ spies.updateQuoteMaterialOrder,
+ { updates: [{ id: "a", order: 1 }] }
+ );
+ expect(failed.dispatchError).toMatchObject({
+ data: { supabase: pgError }
+ });
+
+ spies.updateQuoteMaterialOrder.mockResolvedValue([ok, ok]);
+ const passed = await runDispatch(
+ "sales_updateQuoteMaterialOrder",
+ spies.updateQuoteMaterialOrder,
+ { updates: [{ id: "a", order: 1 }] }
+ );
+ expect(passed.dispatch).toEqual({ data: [ok, ok] });
+ });
+
+ it("a { success: false } flag", async () => {
+ spies.cancelSalesOrder.mockResolvedValue({
+ success: false,
+ message: "Order has posted shipments",
+ cancelledJobIds: []
+ });
+ const refused = await runDispatch(
+ "sales_cancelSalesOrder",
+ spies.cancelSalesOrder,
+ { salesOrderId: "so1" }
+ );
+ expect(refused.dispatchError).toMatchObject({
+ message: "Order has posted shipments"
+ });
+
+ const done = { success: true, message: "Cancelled", cancelledJobIds: [] };
+ spies.cancelSalesOrder.mockResolvedValue(done);
+ const cancelled = await runDispatch(
+ "sales_cancelSalesOrder",
+ spies.cancelSalesOrder,
+ { salesOrderId: "so1" }
+ );
+ expect(cancelled.dispatch).toEqual({ data: done });
+ });
+ });
+
it("b. _operation create at top level: stripped, createdBy + companyId stamped, updatedBy NOT stamped (matches the create-variant service type / UI insert path)", async () => {
const r = await runDispatch(
"accounting_upsertAccount",
@@ -353,7 +763,8 @@ describe("dispatchOperation service-call contract (golden, ex-executeFunction pa
name: "Cash",
number: "1000",
createdBy: "u1",
- companyId: "c1"
+ companyId: "c1",
+ companyGroupId: "g1"
}
]
]);
@@ -374,7 +785,8 @@ describe("dispatchOperation service-call contract (golden, ex-executeFunction pa
id: "a1",
name: "Cash",
updatedBy: "u1",
- companyId: "c1"
+ companyId: "c1",
+ companyGroupId: "g1"
});
expect("createdBy" in payload).toBe(false);
});
@@ -705,7 +1117,8 @@ describe("dispatchOperation service-call contract (golden, ex-executeFunction pa
name: "Cash",
number: "1000",
createdBy: "u1",
- companyId: "c1"
+ companyId: "c1",
+ companyGroupId: "g1"
}
]
]);
@@ -1148,3 +1561,91 @@ describe("renamed operations (deprecated aliases)", () => {
expect(post("/quality/getInspectionDocument")?.deprecated).toBeUndefined();
});
});
+
+// One manifest feeds everything a caller can see or reach: the OpenAPI spec,
+// MCP's describe_tool, and the procedure both HTTP and MCP calls run. These
+// pin that, so the spec and the tools cannot describe different contracts.
+describe("the HTTP spec and the MCP tools are one contract", () => {
+ it("the spec publishes every operation, with the manifest's own input schema", async () => {
+ const spec = await new OpenAPIGenerator({
+ schemaConverters: [new CarbonJsonSchemaConverter()]
+ }).generate(router, specOptions());
+ type Post = {
+ requestBody?: { content?: Record<string, { schema?: unknown }> };
+ };
+ const paths = (spec.paths ?? {}) as Record<string, { post?: Post }>;
+
+ const differing: string[] = [];
+ let withBody = 0;
+ for (const op of OPERATIONS) {
+ const post = paths[`/${op.module}/${operationId(op)}`]?.post;
+ const published =
+ post?.requestBody?.content?.["application/json"]?.schema;
+ if (published !== undefined) withBody++;
+ // An operation with no arguments publishes no request body.
+ const expected =
+ Object.keys((op.schema as { properties?: object }).properties ?? {})
+ .length === 0 && published === undefined
+ ? undefined
+ : op.schema;
+ if (JSON.stringify(published) !== JSON.stringify(expected)) {
+ differing.push(op.name);
+ }
+ }
+ expect(differing).toEqual([]);
+ // Not vacuous: nearly every operation takes arguments.
+ expect(withBody).toBeGreaterThan(OPERATIONS.length * 0.9);
+
+ // And nothing else: every path is an operation or a deprecated alias.
+ expect(Object.keys(paths).length).toBe(
+ OPERATIONS.length + liveOperationAliases.length
+ );
+ });
+
+ it("an MCP call runs the HTTP procedure, input validation included", async () => {
+ // documentType is an enum in the manifest; the same refusal either way.
+ const result = await callOperation("settings_getDocumentTemplate", ctx, {
+ documentType: "not-a-document"
+ });
+ expect(result.success).toBe(false);
+ });
+});
+
+// Services match the row they write by its id, and a signed-in user's client
+// reaches every company they belong to. The client the dispatcher hands over
+// adds the caller's company to the write.
+describe("a write is confined to the caller's company", () => {
+ it("a service that deletes by id alone cannot reach another company's row", async () => {
+ const queries: URLSearchParams[] = [];
+ const client = createClient("http://localhost:54321", "anon-key", {
+ auth: { persistSession: false, autoRefreshToken: false },
+ global: {
+ fetch: async (input) => {
+ queries.push(new URL(String(input)).searchParams);
+ return new Response("[]", {
+ status: 200,
+ headers: { "content-type": "application/json" }
+ });
+ }
+ }
+ });
+ // The real service, in miniature: `.delete().eq("id", customerId)`.
+ spies.deleteCustomer.mockImplementation(
+ (handed: typeof client, customerId: string) =>
+ handed.from("customer").delete().eq("id", customerId)
+ );
+
+ const meta = operationsByName.get("sales_deleteCustomer");
+ if (!meta)
+ throw new Error("sales_deleteCustomer missing from the manifest");
+ await dispatchOperation(
+ meta,
+ { ...ctx, client: client as unknown as AuthedContext["client"] },
+ { customerId: "customer-of-company-b" }
+ );
+
+ expect(queries).toHaveLength(1);
+ expect(queries[0]?.get("id")).toBe("eq.customer-of-company-b");
+ expect(queries[0]?.get("companyId")).toBe("eq.c1");
+ });
+});
diff --git a/apps/erp/app/routes/api+/v1+/lib/dispatch.server.ts b/apps/erp/app/routes/api+/v1+/lib/dispatch.server.ts
index c723958884..ccffb01f6a 100644
--- a/apps/erp/app/routes/api+/v1+/lib/dispatch.server.ts
+++ b/apps/erp/app/routes/api+/v1+/lib/dispatch.server.ts
@@ -12,10 +12,12 @@
// 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 type { AuthField, ContextSource, ManifestEntry } from "@carbon/api";
import { ORPCError } from "@orpc/server";
import { getDatabaseClient } from "~/services/database.server";
import type { AuthedContext } from "./base.server";
+import { scopedToCompany } from "./company-scope.server";
+import { COMPANY_TABLES } from "./operations.server";
import { functionRegistry } from "./registry.server";
import { checkSalesRulesForOperation } from "./sales-rules-gate.server";
@@ -195,15 +197,29 @@ export function extractOperation(args: Record<string, any> | undefined): {
type UpsertRule = NonNullable<ManifestEntry["upsert"]>;
-/** Service params the dispatcher fills itself; the rest carry the payload. */
-const UPSERT_CONTEXT_PARAMS = new Set([
- "client",
- "db",
- "userId",
- "companyId",
- "companyGroupId",
- "eliminationClient"
-]);
+/**
+ * Whether the manifest says the dispatcher fills this positional param. The
+ * generator decides that from the service's signature and body
+ * (`contextParamsOf`), so no parameter name is recognised here.
+ */
+function isContextParam(meta: ManifestEntry, paramName: string): boolean {
+ return Object.hasOwn(meta.contextParams, paramName);
+}
+
+function contextValue(source: ContextSource, context: AuthedContext): unknown {
+ switch (source) {
+ case "client":
+ return scopedToCompany(context.client, context.companyId, COMPANY_TABLES);
+ case "db":
+ return getDatabaseClient();
+ case "userId":
+ return context.userId;
+ case "companyId":
+ return context.companyId;
+ case "companyGroupId":
+ return context.companyGroupId;
+ }
+}
/**
* A field of the RECORD the call is about: at the top level of the body, or
@@ -298,17 +314,6 @@ function declaredScalarParam(
: 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
@@ -331,7 +336,7 @@ function addressesWholeParam(meta: ManifestEntry, paramName: string): boolean {
if (!properties || !(paramName in properties)) return true;
const payloadParams = meta.serviceParams.filter(
- (p) => !CONTEXT_PARAM_NAMES.has(p)
+ (p) => !isContextParam(meta, p) && p !== "args"
);
if (payloadParams.length !== 1 || payloadParams[0] !== paramName) return true;
@@ -341,6 +346,66 @@ function addressesWholeParam(meta: ManifestEntry, paramName: string): boolean {
return own.length === 1 && own[0] === paramName;
}
+/**
+ * Whether the schema declares `paramName` as an argument of its own that a
+ * caller may leave out — as opposed to the one payload param the body IS. A
+ * scalar is always its own argument. An object or a list is too when the
+ * service takes more than one payload param; when it is the only one, a caller
+ * may send its contents flat and the whole body is that param.
+ */
+function omittedNamedParam(meta: ManifestEntry, paramName: string): boolean {
+ if (declaredScalarParam(meta, paramName)) return true;
+ const properties = (meta.schema as { properties?: Record<string, unknown> })
+ ?.properties;
+ if (!properties || !(paramName in properties)) return false;
+ const payloadParams = meta.serviceParams.filter(
+ (p) => !isContextParam(meta, p) && p !== "args"
+ );
+ return payloadParams.length > 1;
+}
+
+/**
+ * The value with every default its schema publishes filled in, wherever the
+ * object holding the field was sent: through `properties`, each element of a
+ * list, and a union with exactly one alternative of the value's kind (a
+ * nullable object; `string | { limit, offset }`). A default is a promise to
+ * the caller, and a service typed from a validator's OUTPUT requires the
+ * field: a pivot sent `state: {}` crashed reading `state.columnAxis.type`. The
+ * generator publishes a default only where this walk reaches it
+ * (`publishDefaults`).
+ */
+export function withSchemaDefaults(schema: unknown, value: unknown): unknown {
+ if (!isRecord(schema)) return value;
+ const alternatives = schema.anyOf ?? schema.oneOf;
+ if (Array.isArray(alternatives)) {
+ const kind = Array.isArray(value)
+ ? "array"
+ : isRecord(value)
+ ? "object"
+ : "";
+ const fitting = alternatives.filter(
+ (alternative) => isRecord(alternative) && alternative.type === kind
+ );
+ return fitting.length === 1 ? withSchemaDefaults(fitting[0], value) : value;
+ }
+ if (Array.isArray(value)) {
+ return isRecord(schema.items)
+ ? value.map((element) => withSchemaDefaults(schema.items, element))
+ : value;
+ }
+ if (!isRecord(schema.properties) || !isRecord(value)) return value;
+ const filled: Record<string, unknown> = { ...value };
+ for (const [name, property] of Object.entries(schema.properties)) {
+ if (!isRecord(property)) continue;
+ if (filled[name] !== undefined) {
+ filled[name] = withSchemaDefaults(property, filled[name]);
+ } else if ("default" in property) {
+ filled[name] = structuredClone(property.default);
+ }
+ }
+ return filled;
+}
+
function supabaseErrorMessage(error: unknown): string {
if (typeof error === "string") return error;
if (error && typeof error === "object" && "message" in error) {
@@ -396,7 +461,7 @@ export async function dispatchOperation(
(await resolveUpsertOperation(
meta.upsert,
normalizedArgs,
- meta.serviceParams.filter((name) => !UPSERT_CONTEXT_PARAMS.has(name)),
+ meta.serviceParams.filter((name) => !isContextParam(meta, name)),
async (table, filter) => {
// Scoped to the caller's company on top of RLS: a user-scoped client
// can see every company the user belongs to.
@@ -416,22 +481,23 @@ export async function dispatchOperation(
}
)));
+ // Published defaults are filled where the call supplies a whole value, and
+ // never on an update: there a field left out keeps what is stored. Each
+ // argument is filled against ITS schema once the body's shape is known —
+ // filling the raw body first would add keys beside a wrapper and change
+ // which shape it is read as.
+ const fills =
+ meta.defaults === "always" ||
+ (meta.defaults === "create" && operation === "create");
+ const filled = (schema: unknown, value: unknown) =>
+ fills ? withSchemaDefaults(schema, value) : value;
+ const declared = (meta.schema as { properties?: Record<string, unknown> })
+ ?.properties;
+
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);
+ if (isContextParam(meta, paramName)) {
+ functionArgs.push(contextValue(meta.contextParams[paramName], context));
} 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
@@ -440,41 +506,59 @@ export async function dispatchOperation(
// inert, since setGenericQueryFilters reads only filters/sorts/offset/limit.
const wrapped = normalizedArgs?.args;
const value =
- (meta.schema as { properties?: Record<string, unknown> })?.properties
- ?.args &&
+ declared?.args &&
wrapped &&
typeof wrapped === "object" &&
!Array.isArray(wrapped)
? wrapped
: normalizedArgs || {};
functionArgs.push(
- enrichWithAuthContext(value, context, meta.injectAuth, operation)
+ enrichWithAuthContext(
+ filled(declared?.args ?? meta.schema, value),
+ context,
+ meta.injectAuth,
+ operation
+ )
);
} else if (
normalizedArgs &&
paramName in normalizedArgs &&
addressesWholeParam(meta, paramName)
) {
+ // The param's own schema when it is published as an argument; the whole
+ // schema when the caller wrapped a flat payload in the param's name.
functionArgs.push(
enrichWithAuthContext(
- normalizedArgs[paramName],
+ filled(
+ declared?.[paramName] ?? meta.schema,
+ normalizedArgs[paramName]
+ ),
context,
meta.injectAuth,
operation
)
);
} else if (
- declaredScalarParam(meta, paramName) &&
+ omittedNamedParam(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
+ // A param the caller addresses by name, with no matching key: it was
+ // left out. The object fallbacks below would hand the service the whole
+ // payload in its place — as an id (`.eq("id", { apiKeyId })` matches
+ // nothing and reports success), or as a list
+ // (`getActiveJobOperationsByLocation({ locationId })` sent the body as
+ // `workCenterIds` and Postgres answered "expected JSON array").
+ // `undefined` keeps the positional arity intact and lets the service's
+ // own default apply. A missing REQUIRED param 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);
+ const own = declared?.[paramName];
+ functionArgs.push(
+ fills && isRecord(own) && "default" in own
+ ? structuredClone(own.default)
+ : undefined
+ );
} else if (
normalizedArgs &&
Object.keys(normalizedArgs).length === 1 &&
@@ -486,7 +570,7 @@ export async function dispatchOperation(
// positionally (the documented `{ args: {...} }` wrapper, or a guessed key).
functionArgs.push(
enrichWithAuthContext(
- Object.values(normalizedArgs)[0],
+ filled(meta.schema, Object.values(normalizedArgs)[0]),
context,
meta.injectAuth,
operation
@@ -497,7 +581,7 @@ export async function dispatchOperation(
// like upsertPart(client, part)).
functionArgs.push(
enrichWithAuthContext(
- { ...normalizedArgs },
+ filled(meta.schema, { ...normalizedArgs }),
context,
meta.injectAuth,
operation
@@ -530,16 +614,61 @@ export async function dispatchOperation(
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) {
- throw new ORPCError("BAD_REQUEST", {
- message: supabaseErrorMessage(r.error),
- data: { supabase: r.error }
- });
- }
- return { data: r.data, count: r.count ?? undefined };
+ return readServiceResult(meta, result);
+}
+
+function isRecord(value: unknown): value is Record<string, unknown> {
+ return value !== null && typeof value === "object" && !Array.isArray(value);
+}
+
+function serviceFailure(error: unknown): ORPCError<"BAD_REQUEST", unknown> {
+ return new ORPCError("BAD_REQUEST", {
+ message: supabaseErrorMessage(error),
+ data: { supabase: error }
+ });
+}
+
+/**
+ * Turn what the service returned into the operation's result, or throw when the
+ * service said it failed. A service does not throw, and where it puts the
+ * failure is read off its return type by the generator (`resultShape`).
+ *
+ * Only `{ data, error }` used to be read, and only when `data` was present, so
+ * a bare `{ error }`, a failed write inside a `Promise.all`, and `{ ok: false }`
+ * all went back to the caller as a success.
+ */
+function readServiceResult(
+ meta: ManifestEntry,
+ result: unknown
+): DispatchResult {
+ if (meta.resultShape === "envelopes" && Array.isArray(result)) {
+ const failed = result.find((item) => isRecord(item) && item.error);
+ if (failed) throw serviceFailure((failed as { error: unknown }).error);
+ return { data: result };
+ }
+
+ if (!isRecord(result)) return { data: result };
+
+ // Read whatever the manifest says: a truthy `error` on the result object is a
+ // failure under every shape, including a return type the checker saw as `any`.
+ if (result.error) throw serviceFailure(result.error);
+
+ if (
+ meta.resultShape === "flag" &&
+ (result.ok === false || result.success === false)
+ ) {
+ const reason = result.reason ?? result.message;
+ throw new ORPCError("BAD_REQUEST", {
+ message:
+ typeof reason === "string" ? reason : "The operation did not succeed."
+ });
+ }
+
+ if ("data" in result) {
+ return {
+ data: result.data,
+ count: (result.count as number | null | undefined) ?? undefined
+ };
}
return { data: result };
}
diff --git a/apps/erp/app/routes/api+/v1+/lib/operations.server.ts b/apps/erp/app/routes/api+/v1+/lib/operations.server.ts
index 27b5cf117e..25eeff4cc0 100644
--- a/apps/erp/app/routes/api+/v1+/lib/operations.server.ts
+++ b/apps/erp/app/routes/api+/v1+/lib/operations.server.ts
@@ -14,6 +14,19 @@ import raw from "../../mcp+/lib/tool-metadata.json";
export const OPERATIONS = (raw as { tools: ManifestEntry[] }).tools;
+const companyTables = (raw as { companyTables?: string[] }).companyTables;
+// The dispatcher confines every write to the caller's company by this list
+// (`scopedToCompany`). An empty one would switch that off without a sound, so
+// a manifest generated before the list existed stops the module loading.
+if (!Array.isArray(companyTables) || companyTables.length === 0) {
+ throw new Error(
+ "tool-metadata.json has no companyTables. Regenerate it: pnpm run generate:mcp"
+ );
+}
+
+/** Every table with a `companyId` column, from the generated database types. */
+export const COMPANY_TABLES: ReadonlySet<string> = new Set(companyTables);
+
/**
* Deprecated operation names → the operation that replaced them. An operation's
* name is derived from the module its service lives in, so moving a function
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.ts
index 816414ca04..63100b3878 100644
--- a/apps/erp/app/routes/api+/v1+/lib/orpc-mechanics.test.ts
+++ b/apps/erp/app/routes/api+/v1+/lib/orpc-mechanics.test.ts
@@ -28,7 +28,9 @@ function meta(overrides: Partial<ManifestEntry>): ManifestEntry {
description: "demo ping",
paramCount: 1,
serviceParams: ["client", "args"],
+ contextParams: { client: "client" },
injectAuth: [],
+ resultShape: "plain",
permission: { module: null, actions: [] },
paginates: false,
schema: { type: "object", properties: { name: { type: "string" } } },
diff --git a/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.delivery.tsx b/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.delivery.tsx
index 98012f9a72..b50a455d95 100644
--- a/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.delivery.tsx
+++ b/apps/erp/app/routes/x+/purchase-invoice+/$invoiceId.delivery.tsx
@@ -47,7 +47,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
message: "Cannot modify a confirmed purchase invoice."
});
- const { client, userId } = await requirePermissions(request, {
+ const { client, companyId, userId } = await requirePermissions(request, {
update: "invoicing"
});
@@ -60,12 +60,12 @@ export async function action({ request, params }: ActionFunctionArgs) {
return validationError(validation.error);
}
- // Note: Need to add upsertPurchaseInvoiceDelivery to invoicing.service.ts
const updatePurchaseInvoiceDelivery = await upsertPurchaseInvoiceDelivery(
client,
{
...validation.data,
id: invoiceId,
+ companyId,
updatedBy: userId,
customFields: setCustomFields(formData)
}
diff --git a/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.shipment.tsx b/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.shipment.tsx
index 2fecc72818..e824fe42c6 100644
--- a/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.shipment.tsx
+++ b/apps/erp/app/routes/x+/sales-invoice+/$invoiceId.shipment.tsx
@@ -44,7 +44,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
message: "Cannot modify a locked sales invoice. Reopen it first."
});
- const { client, userId } = await requirePermissions(request, {
+ const { client, companyId, userId } = await requirePermissions(request, {
update: "invoicing"
});
@@ -60,6 +60,7 @@ export async function action({ request, params }: ActionFunctionArgs) {
const updateSalesInvoiceShipment = await upsertSalesInvoiceShipment(client, {
...validation.data,
id: invoiceId,
+ companyId,
updatedBy: userId,
customFields: setCustomFields(formData)
});
diff --git a/apps/erp/test/mcp-service-ast.test.ts b/apps/erp/test/mcp-service-ast.test.ts
index 23e6159c97..0c0ad1ab5b 100644
--- a/apps/erp/test/mcp-service-ast.test.ts
+++ b/apps/erp/test/mcp-service-ast.test.ts
@@ -3,17 +3,25 @@
// including ports, remain AGPLv3; serving them over a network requires releasing their source.
import { describe, expect, it } from "vitest";
+import { sqlFunctionEffects } from "../../../packages/database/src/sql-effects";
+import { resultShapeOf } from "../../../scripts/lib/result-shape";
import {
+ auditParams,
branchesOnKeyPresence,
dbWrites,
namedTables,
paginates,
- parseServiceSource
+ parseServiceSource,
+ rpcCalls
} from "../../../scripts/lib/service-ast";
import {
+ assertReadCallsOnlyReads,
+ contextParamsOf,
declarationOf,
+ describeUntypedArguments,
upsertRule,
- withoutAbsentAuditColumns
+ withoutAbsentAuditColumns,
+ withPayloadCompanyGroup
} from "../../../scripts/lib/service-metadata";
// The generator's questions about a service function, asked of real source
@@ -397,3 +405,343 @@ describe("audit fields the table does not have", () => {
});
});
+describe("positional params the dispatcher fills", () => {
+ const fns = parse(`
+ export async function updateStatus(
+ client: Client, id: string, status: string, updatedBy: string
+ ) {
+ return client.from("job").update({ status, updatedBy }).eq("id", id);
+ }
+ export async function approve(client: Client, id: string, approver: string) {
+ return client
+ .from("job")
+ .update({ status: "Approved", "updatedBy": approver as string })
+ .eq("id", id);
+ }
+ export async function addSuppliers(
+ client: Client, rfqId: string, supplierIds: string[],
+ companyId: string, createdBy: string
+ ) {
+ return client.from("rfqSupplier").insert(
+ supplierIds.map((supplierId) => ({ rfqId, supplierId, companyId, createdBy }))
+ );
+ }
+ export async function reorder(
+ db: Db, companyId: string, userId: string, updates: { id: string }[]
+ ) {
+ return db.updateTable("line").set({ updatedBy: userId }).execute();
+ }
+ export async function upsertRow(
+ client: Client, row: { id: string; updatedBy: string }
+ ) {
+ return client.from("job").update({ ...row }).eq("id", row.id);
+ }
+ export async function shadowed(client: Client, updatedBy: string) {
+ return [1].map((updatedBy) => ({ updatedBy }));
+ }
+ export async function viaRpc(client: Client, id: string, updatedBy: string) {
+ return client.rpc("touch", { p_id: id, p_user: updatedBy });
+ }
+ `);
+
+ it("reads the acting user off the audit column a param is written to", () => {
+ expect(auditParams(fns.updateStatus.node)).toEqual(["updatedBy"]);
+ expect(auditParams(fns.addSuppliers.node)).toEqual(["createdBy"]);
+ // Whatever the param is called, and through a cast and a quoted key.
+ expect(auditParams(fns.approve.node)).toEqual(["approver"]);
+ // A field of a payload object is not a positional param.
+ expect(auditParams(fns.upsertRow.node)).toEqual([]);
+ });
+
+ it("maps each filled param to its context value and leaves the payload out", () => {
+ expect(contextParamsOf(fns.updateStatus)).toEqual({
+ client: "client",
+ updatedBy: "userId"
+ });
+ expect(contextParamsOf(fns.approve)).toEqual({
+ client: "client",
+ approver: "userId"
+ });
+ expect(contextParamsOf(fns.addSuppliers)).toEqual({
+ client: "client",
+ companyId: "companyId",
+ createdBy: "userId"
+ });
+ expect(contextParamsOf(fns.reorder)).toEqual({
+ db: "db",
+ companyId: "companyId",
+ userId: "userId"
+ });
+ expect(contextParamsOf(fns.upsertRow)).toEqual({ client: "client" });
+ });
+
+ it("refuses a positional audit param it cannot see written to the column", () => {
+ // Passed on to something else: the body never names the column.
+ expect(() => contextParamsOf(fns.viaRpc)).toThrow(/positional `updatedBy`/);
+ // An inner binding of the same name is not the function's own parameter.
+ expect(() => contextParamsOf(fns.shadowed)).toThrow(/positional `updatedBy`/);
+ });
+});
+
+describe("how a service reports failure in its result", () => {
+ const fns = parse(`
+ type Failure = { message: string };
+ type Row = { id: string };
+ export async function read(): Promise<{ data: Row | null; error: Failure | null }> {
+ return { data: null, error: null };
+ }
+ export async function bareError(): Promise<{ error: Failure | null }> {
+ return { error: null };
+ }
+ export async function errorOnOnePath(): Promise<Row | { error: string }> {
+ return { id: "a" };
+ }
+ export async function manyWrites() {
+ const one: { data: null; error: Failure | null } = { data: null, error: null };
+ return Promise.all([one, one]);
+ }
+ export async function flagged(): Promise<
+ { ok: true; created: number } | { ok: false; reason: string }
+ > {
+ return { ok: true, created: 1 };
+ }
+ export async function rows(): Promise<Row[]> {
+ return [];
+ }
+ export async function nothing(): Promise<void> {}
+ export async function mixedList(): Promise<Array<Row | { error: Failure }>> {
+ return [];
+ }
+ export async function twoSignals(): Promise<
+ { error: Failure | null } | { success: boolean }
+ > {
+ return { success: true };
+ }
+ `);
+ const shape = (name: string) =>
+ resultShapeOf(
+ fns[name].node.getProject().getTypeChecker().compilerObject,
+ fns[name]
+ );
+
+ it("reads the shape off the awaited return type", () => {
+ expect(shape("read")).toBe("envelope");
+ // No \`data\`: the result dispatch used to hand back as a success.
+ expect(shape("bareError")).toBe("envelope");
+ expect(shape("errorOnOnePath")).toBe("envelope");
+ expect(shape("manyWrites")).toBe("envelopes");
+ expect(shape("flagged")).toBe("flag");
+ expect(shape("rows")).toBe("plain");
+ expect(shape("nothing")).toBe("plain");
+ });
+
+ it("refuses a result dispatch could not read one way", () => {
+ expect(() => shape("mixedList")).toThrow(/list whose items/);
+ expect(() => shape("twoSignals")).toThrow(/cannot tell which reports failure/);
+ });
+});
+
+describe("a read tool and the SQL functions it calls", () => {
+ const fns = parse(`
+ export async function getDetails(client: Client, id: string) {
+ return client.rpc("get_details", { item_id: id });
+ }
+ export async function getCast(client: Client, id: string) {
+ return client.rpc("get_details" as unknown as "other", { item_id: id });
+ }
+ export async function getNextNumber(client: Client, table: string) {
+ return client.rpc("take_number", { sequence_name: table });
+ }
+ export async function getUsage(client: Client) {
+ return client.rpc("usage_by_table");
+ }
+ export async function getAnything(client: Client, name: string) {
+ return client.rpc(name);
+ }
+ export async function getRows(client: Client) {
+ return client.from("job").select("*");
+ }
+ `);
+
+ const effects = sqlFunctionEffects([
+ {
+ name: "functions.sql",
+ sql: `
+ CREATE FUNCTION get_details(item_id text) RETURNS text LANGUAGE sql AS $$
+ SELECT name FROM item WHERE id = item_id;
+ $$;
+ CREATE FUNCTION take_number(sequence_name text) RETURNS int LANGUAGE sql AS $$
+ UPDATE sequence SET next = next + 1 WHERE "table" = sequence_name RETURNING next;
+ $$;
+ CREATE FUNCTION usage_by_table() RETURNS void LANGUAGE plpgsql AS $$
+ BEGIN
+ EXECUTE format('SELECT count(*) FROM %I', 'job');
+ END $$;`
+ }
+ ]);
+
+ it("reads the function name, through a cast, and reports one it cannot read", () => {
+ expect(rpcCalls(fns.getDetails.node)).toEqual(["get_details"]);
+ expect(rpcCalls(fns.getCast.node)).toEqual(["get_details"]);
+ expect(rpcCalls(fns.getAnything.node)).toEqual([null]);
+ expect(rpcCalls(fns.getRows.node)).toEqual([]);
+ });
+
+ it("lets a read call functions that only read", async () => {
+ const sql = await effects;
+ expect(() => assertReadCallsOnlyReads(fns.getDetails, sql)).not.toThrow();
+ expect(() => assertReadCallsOnlyReads(fns.getRows, sql)).not.toThrow();
+ });
+
+ it("refuses a read that writes through a function, or that cannot be told", async () => {
+ const sql = await effects;
+ // settings_getNextSequence, in miniature.
+ expect(() => assertReadCallsOnlyReads(fns.getNextNumber, sql)).toThrow(
+ /calls the SQL function take_number, which writes \(public\.take_number: UPDATE sequence\)/
+ );
+ expect(() => assertReadCallsOnlyReads(fns.getUsage, sql)).toThrow(
+ /cannot be told: public\.usage_by_table has dynamic SQL/
+ );
+ expect(() => assertReadCallsOnlyReads(fns.getAnything, sql)).toThrow(
+ /not a string literal/
+ );
+ });
+});
+
+describe("a payload that declares companyGroupId", () => {
+ const fns = parse(`
+ type Report = { companyId: string; companyGroupId: string; key: string };
+ export async function getPivot(client: Client, args: Report) {}
+ export async function getRows(client: Client, args: { companyId: string }) {}
+ export async function getBalances(client: Client, companyGroupId: string) {}
+ export async function upsertOrder(
+ client: Client,
+ order:
+ | { companyGroupId: string; createdBy: string }
+ | { id: string; companyGroupId?: string; updatedBy: string }
+ ) {}
+ export async function upsertAccount(
+ client: Client,
+ account:
+ | { companyGroupId: string; createdBy: string }
+ | { id: string; updatedBy: string }
+ ) {}
+ `);
+
+ it("is filled from the session, whether the type is inline or named", () => {
+ // accounting_getDimensionPivot: the SQL function was called with no group.
+ expect(withPayloadCompanyGroup(["companyId"], fns.getPivot)).toEqual([
+ "companyId",
+ "companyGroupId"
+ ]);
+ expect(withPayloadCompanyGroup(["companyId"], fns.upsertOrder)).toEqual([
+ "companyId",
+ "companyGroupId"
+ ]);
+ });
+
+ it("is left alone when no payload declares it", () => {
+ expect(withPayloadCompanyGroup(["companyId"], fns.getRows)).toEqual([
+ "companyId"
+ ]);
+ // A positional companyGroupId is a context param, not a payload field.
+ expect(withPayloadCompanyGroup(["companyId"], fns.getBalances)).toEqual([
+ "companyId"
+ ]);
+ });
+
+ it("refuses a union where only some shapes declare it", () => {
+ // upsertPurchaseOrder: the update spread it into a table with no such column.
+ expect(() => withPayloadCompanyGroup(["companyId"], fns.upsertAccount)).toThrow(
+ /upsertAccount: only some shapes of `account` declare companyGroupId/
+ );
+ });
+});
+
+describe("an argument the schema left blank", () => {
+ const fns = parse(`
+ const statuses = ["Open", "Closed"] as const;
+ type Json = string | number | boolean | null | { [key: string]: Json | undefined } | Json[];
+ type Row = { id: string; quoteLineId: string | null; notes: Json };
+ export async function getTemplate(client: Client, kind: "quote" | "invoice", companyId: string) {}
+ export async function getRisks(
+ client: Client,
+ args: { status?: typeof statuses; bucketDays?: [number, number]; search: string }
+ ) {}
+ export async function getDocuments(client: Client, job: Pick<Row, "id" | "quoteLineId">, itemId: string) {}
+ export async function upsertThing(
+ client: Client,
+ thing: { name: string; customFields?: Json; payload: unknown; extra: any }
+ ) {}
+ `);
+ const context = { client: "client", companyId: "companyId" };
+
+ it("is described from the parameter's type", () => {
+ // settings_getDocumentTemplate: the caller could only guess at documentType.
+ const template = { type: "object", properties: { kind: {} } };
+ describeUntypedArguments(template, fns.getTemplate, context);
+ expect(template.properties.kind).toEqual({
+ type: "string",
+ enum: ["quote", "invoice"]
+ });
+
+ // A named row narrowed to what the function reads, among other params.
+ const documents = {
+ type: "object",
+ properties: { job: {}, itemId: { type: "string" } }
+ };
+ describeUntypedArguments(documents, fns.getDocuments, context);
+ expect(documents.properties).toEqual({
+ job: {
+ type: "object",
+ properties: {
+ id: { type: "string" },
+ quoteLineId: { type: ["string", "null"] }
+ },
+ required: ["id", "quoteLineId"]
+ },
+ itemId: { type: "string" }
+ });
+ });
+
+ it("reaches a blank field of a flat payload, and reads a tuple as a list", () => {
+ const risks = {
+ type: "object",
+ properties: {
+ status: { description: "Filter." },
+ bucketDays: {},
+ search: { type: "string" }
+ }
+ };
+ describeUntypedArguments(risks, fns.getRisks, context);
+ expect(risks.properties).toEqual({
+ // quality_getRisks: an \`as const\` list came out as a map of statuses.
+ status: {
+ type: ["array", "null"],
+ items: { type: "string", enum: ["Open", "Closed"] },
+ description: "Filter."
+ },
+ bucketDays: { type: ["array", "null"], items: { type: "number" } },
+ search: { type: "string" }
+ });
+ });
+
+ it("stays blank where the type really is anything", () => {
+ const thing = {
+ type: "object",
+ properties: {
+ name: { type: "string" },
+ customFields: {},
+ payload: {},
+ extra: {}
+ }
+ };
+ describeUntypedArguments(thing, fns.upsertThing, context);
+ expect(thing.properties).toEqual({
+ name: { type: "string" },
+ customFields: {},
+ payload: {},
+ extra: {}
+ });
+ });
+});
diff --git a/apps/erp/test/mcp-tool-metadata.test.ts b/apps/erp/test/mcp-tool-metadata.test.ts
index 6fb420636c..cb9bf796b4 100644
--- a/apps/erp/test/mcp-tool-metadata.test.ts
+++ b/apps/erp/test/mcp-tool-metadata.test.ts
@@ -4,6 +4,7 @@
import { describe, expect, it } from "vitest";
import metadata from "../app/routes/api+/mcp+/lib/tool-metadata.json";
+import { defaultsPolicy } from "../../../scripts/lib/service-metadata";
// Regression guards for the MCP tool-metadata generator (scripts/generate-mcp.ts).
// These encode the shape bugs reported against the quote-setup tools AND the
@@ -18,6 +19,7 @@ type Tool = {
keys: string[];
lookups?: { table: string; match: Record<string, string> }[];
};
+ defaults?: "always" | "create";
schema: {
type?: string;
properties?: Record<string, any>;
@@ -302,6 +304,48 @@ describe("mcp tool-metadata generator", () => {
// always stamped updatedBy and every create was forced down the UPDATE branch
// (0 rows → PGRST116, silent no-op). The rule is what lets the dispatcher stamp
// exactly one audit field without the caller saying which.
+ // `assignee: null | undefined` published as a REQUIRED null on the status
+ // tools, so every status change had to send `assignee: null` and cleared it.
+ it("does not require a field whose type admits undefined", () => {
+ expect(get("sales_updateQuoteStatus").schema.required).toEqual([
+ "id",
+ "status"
+ ]);
+ expect(get("quality_updateIssueStatus").schema.required).toEqual([
+ "id",
+ "status"
+ ]);
+ });
+
+ // The rpc advances `sequence.next`, so calling it consumes a document number.
+ // It was published as a READ gated on `settings:view`.
+ it("publishes getNextSequence as a write gated on settings:update", () => {
+ const t = get("settings_getNextSequence") as Tool & {
+ permission: { module: string; actions: string[] };
+ };
+ expect(t.classification).toBe("WRITE");
+ expect(t.permission).toEqual({ module: "settings", actions: ["update"] });
+ });
+
+ it("never requires a property that can only be null", () => {
+ const offenders: string[] = [];
+ const walk = (name: string, schema: any, path: string) => {
+ if (!schema || typeof schema !== "object") return;
+ const properties = schema.properties ?? {};
+ for (const required of schema.required ?? []) {
+ if (properties[required]?.type === "null") {
+ offenders.push(`${name}: ${path}${required}`);
+ }
+ }
+ for (const [key, value] of Object.entries(properties)) {
+ walk(name, value, `${path}${key}.`);
+ }
+ walk(name, schema.items, `${path}[].`);
+ };
+ for (const t of tools) walk(t.name, t.schema, "");
+ expect(offenders).toEqual([]);
+ });
+
it("gives an upsert rule to `\"updatedBy\" in` upserts, not only `\"createdBy\" in` ones", () => {
// Inverted (`"updatedBy" in`), id decides.
expect(get("production_upsertJob").upsert).toEqual({ keys: ["id"] });
@@ -331,3 +375,63 @@ describe("mcp tool-metadata generator", () => {
);
});
});
+
+// A default in a schema is a promise: leave the field out and you get it. The
+// generator publishes one only where the dispatcher keeps the promise.
+describe("published defaults", () => {
+ const publishes = (tool: Tool) => JSON.stringify(tool.schema).includes('"default":');
+
+ it("are filled always for a whole value, on create for an upsert, never on update", () => {
+ const rule = { keys: ["id"] };
+ expect(defaultsPolicy("read", undefined)).toBe("always");
+ expect(defaultsPolicy("create", undefined)).toBe("always");
+ expect(defaultsPolicy("action", undefined)).toBe("always");
+ expect(defaultsPolicy("upsert", rule)).toBe("create");
+ // No rule: the dispatcher cannot tell whether the call updates.
+ expect(defaultsPolicy("upsert", undefined)).toBeUndefined();
+ expect(defaultsPolicy("update", undefined)).toBeUndefined();
+ expect(defaultsPolicy("delete", undefined)).toBeUndefined();
+ });
+
+ it("no tool publishes a default without saying when it is filled", () => {
+ const silent = tools.filter((tool) => publishes(tool) && !tool.defaults);
+ expect(silent.map((tool) => tool.name)).toEqual([]);
+ const empty = tools.filter((tool) => tool.defaults && !publishes(tool));
+ expect(empty.map((tool) => tool.name)).toEqual([]);
+ });
+
+ it("a create-only default needs a rule that says what a create is", () => {
+ const unruled = tools.filter(
+ (tool) => tool.defaults === "create" && !tool.upsert
+ );
+ expect(unruled.map((tool) => tool.name)).toEqual([]);
+ });
+
+ it("an update never publishes one", () => {
+ for (const name of [
+ "purchasing_updateSupplierTax",
+ "sales_updateCustomerTax",
+ "sales_updatePricingRule",
+ "invoicing_updateReimbursement"
+ ]) {
+ expect(publishes(get(name)), name).toBe(false);
+ }
+ // An upsert keeps it, for its create.
+ expect(get("purchasing_upsertPurchaseOrderLine").defaults).toBe("create");
+ expect(props(get("purchasing_upsertPurchaseOrderLine")).taxPercent).toMatchObject({
+ default: 0
+ });
+ });
+
+ it("an upsert that branches on its id has a rule, like one that branches on an audit field", () => {
+ // `"id" in line`: without a rule both audit fields were stamped on every call.
+ expect(get("purchasing_upsertPurchaseOrderLine").upsert).toEqual({ keys: ["id"] });
+ expect(get("invoicing_upsertSalesInvoiceLine").upsert).toEqual({ keys: ["id"] });
+ // Its row is made with the invoice and shares its id: `id` was required in
+ // both shapes, so the insert branch never ran. It is an update, and says so.
+ const delivery = get("invoicing_upsertPurchaseInvoiceDelivery");
+ expect(delivery.upsert).toBeUndefined();
+ expect(delivery.schema.required).toContain("id");
+ expect(publishes(delivery)).toBe(false);
+ });
+});
diff --git a/apps/erp/test/sweep/.gitignore b/apps/erp/test/sweep/.gitignore
new file mode 100644
index 0000000000..6a36bd31e7
--- /dev/null
+++ b/apps/erp/test/sweep/.gitignore
@@ -0,0 +1 @@
+.report/
diff --git a/apps/erp/test/sweep/README.md b/apps/erp/test/sweep/README.md
new file mode 100644
index 0000000000..ec4bc2ab2d
--- /dev/null
+++ b/apps/erp/test/sweep/README.md
@@ -0,0 +1,58 @@
+# Tool sweep
+
+Calls every READ tool for real: this branch's dispatcher and services, as a
+signed-in user (row-level security applies), against the data of a seeded
+company on a running local stack. The unit tests stand services in; this is
+where a tool is actually run.
+
+```bash
+pnpm sweep:tools
+```
+
+It needs a stack that is up (`crbn up`), migrated (`pnpm db:migrate`) and seeded
+(`pnpm db:seed:dev -- --email <you> --dataset satellite`, which also runs the
+planner). A thin company still sweeps, but more tools are asked for a row that
+does not exist. It is not part of `pnpm test`.
+
+## What it does
+
+1. Refuses to run when the stack has not applied a migration this branch has —
+ a tool that calls a function the database lacks fails for a reason that is
+ not the tool's. `CARBON_SWEEP_ALLOW_DRIFT=1` sweeps anyway.
+2. Works out each tool's arguments (`inputs.ts`). A parameter the service
+ compares to a column (`.eq("id", jobId)` on `job`, read off the body by
+ `paramFilters`) gets a value that exists, sampled as the user. Failing that,
+ the column a parameter of that NAME is compared to across every service,
+ then the database's own table or column of that name. Several real values
+ are tried before "no row matches" stands: the first item may not be a tool.
+ When the company has no row at all, the tool is called with a value of the
+ column's type that matches nothing, and the report lists the argument under
+ `placeholder`. What nothing can answer is written down per tool in
+ `read-tools.inputs.ts`; a required argument still unanswered leaves the tool
+ not called.
+3. Calls the tool and records one of: `ok`, `failed`, `not-found` (it ran and
+ no row matched what it was given), `not-called` (with the reason). A tool
+ that was not called fails the sweep: it was not checked. Give its argument a
+ value in `read-tools.inputs.ts`.
+4. Writes `.report/read-tools.json` and compares the failures with
+ `read-tools.baseline.json`.
+
+## The baseline
+
+`read-tools.baseline.json` lists the tools known to fail, with the error. It is
+empty: a tool that fails is fixed, not listed. A failure under
+`CARBON_SWEEP_ALLOW_DRIFT=1` that names a function or column the stack lacks is
+the drift, not the tool. The
+sweep fails on a tool that fails and is not listed, and on a listed tool that
+now passes — so the list only shrinks. After fixing one, delete its entry.
+`CARBON_SWEEP_UPDATE=1` rewrites the file from the current run; read the diff
+before committing it.
+
+## Choosing the company
+
+`SWEEP_COMPANY_ID` and `SWEEP_USER_ID`, or by default the `DEV_BYPASS_EMAIL`
+user in whichever of its companies has the most items. `CARBON_SWEEP_ENV` points
+the sweep at another checkout's stack (`<checkout>/.env:<checkout>/.env.local`).
+
+Only READ tools are called. The generator refuses to publish a read that writes,
+in TypeScript or through a SQL function, so the sweep cannot change data.
diff --git a/apps/erp/test/sweep/inputs.ts b/apps/erp/test/sweep/inputs.ts
new file mode 100644
index 0000000000..76a70f949f
--- /dev/null
+++ b/apps/erp/test/sweep/inputs.ts
@@ -0,0 +1,278 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+/**
+ * Arguments for calling a tool against real data, worked out without guessing
+ * at what its parameters mean.
+ *
+ * In order, for each required argument:
+ *
+ * 1. The column the service itself compares it to (`.eq("id", jobId)` on
+ * `job`, read off the body by `paramFilters`): a value of that column.
+ * 2. What its type alone settles: an enum, a boolean, a number, a date, the
+ * first alternative of a union.
+ * 3. What the REST of the codebase compares a parameter of that name to.
+ * 4. What the database says the name is: `shipmentId` is `shipment.id` when
+ * there is a `shipment` table, else any column called `shipmentId`.
+ *
+ * 5. `null`, when the argument is required but may be null.
+ *
+ * The plan records which it used (`column` for 1, `name` for 3 and 4). An
+ * argument none of them answers is left missing, and the tool is reported as
+ * not called rather than called with something invented. The few that need a
+ * value only a person knows are written down in `read-tools.inputs.ts`.
+ */
+
+export interface Column {
+ table: string;
+ column: string;
+}
+
+export type Planned =
+ | { kind: "value"; value: unknown; source: "type" | "name" }
+ | {
+ kind: "sample";
+ /** Columns to take a value from, most trusted first. */
+ from: Column[];
+ many: boolean;
+ source: "column" | "name";
+ }
+ | { kind: "object"; fields: Record<string, Planned> };
+
+export interface InputPlan {
+ /** Top-level argument → how its value is obtained. */
+ args: Record<string, Planned>;
+ /** Required arguments nothing could supply, as a path (`args.report`). */
+ missing: string[];
+}
+
+export interface Knowledge {
+ /** A parameter name → the column the codebase compares it to (`consensusByName`). */
+ consensus: Map<string, Column>;
+ /** Every table and view of the database → its columns. */
+ tables: Map<string, Set<string>>;
+}
+
+interface Property {
+ type?: string | string[];
+ enum?: unknown[];
+ format?: string;
+ items?: Property;
+ anyOf?: Property[];
+ oneOf?: Property[];
+ properties?: Record<string, Property>;
+ required?: string[];
+}
+
+interface ToolSchema {
+ properties?: Record<string, Property>;
+ required?: string[];
+}
+
+/** `args.jobId` and `jobId` both name the argument `jobId`. */
+const fieldOf = (path: string) => path.slice(path.lastIndexOf(".") + 1);
+
+/**
+ * A filter on a plain column. PostgREST also filters on an embedded table's
+ * column (`job.status`) and on a JSON path (`attributes->>Receipt`); neither
+ * is a column a value can be sampled from.
+ */
+const isPlainColumn = (filter: Column) => /^[A-Za-z_]\w*$/.test(filter.column);
+
+/** One column per argument name, preferring a comparison to a table's own `id`. */
+export function columnsByArgument(
+ filters: ReadonlyArray<{ path: string } & Column>
+): Map<string, Column> {
+ const columns = new Map<string, Column>();
+ for (const { path, table, column } of filters.filter(isPlainColumn)) {
+ const field = fieldOf(path);
+ if (!columns.has(field) || column === "id") {
+ columns.set(field, { table, column });
+ }
+ }
+ return columns;
+}
+
+/**
+ * What a parameter name means across every service. A name compared to exactly
+ * one table's own `id` is that table's record id, whatever else it is compared
+ * to (the rest are foreign keys holding the same ids). Otherwise the column it
+ * is compared to most often; a name used two ways equally is left out.
+ */
+export function consensusByName(
+ everyFilter: ReadonlyArray<{ path: string } & Column>
+): Map<string, Column> {
+ const counts = new Map<string, Map<string, number>>();
+ for (const { path, table, column } of everyFilter.filter(isPlainColumn)) {
+ const field = fieldOf(path);
+ const key = `${table}.${column}`;
+ const forField = counts.get(field) ?? new Map<string, number>();
+ forField.set(key, (forField.get(key) ?? 0) + 1);
+ counts.set(field, forField);
+ }
+
+ const consensus = new Map<string, Column>();
+ const toColumn = (key: string): Column | undefined => {
+ const [table, column] = key.split(".");
+ return table && column ? { table, column } : undefined;
+ };
+ for (const [field, forField] of counts) {
+ const ids = [...forField.keys()].filter((key) => key.endsWith(".id"));
+ const ranked = [...forField].sort((a, b) => b[1] - a[1]);
+ const [best, second] = ranked;
+ const chosen =
+ ids.length === 1
+ ? ids[0]
+ : best && !(second && second[1] === best[1])
+ ? best[0]
+ : undefined;
+ const column = chosen ? toColumn(chosen) : undefined;
+ if (column) consensus.set(field, column);
+ }
+ return consensus;
+}
+
+/** `shipmentId` → `shipment.id`, then every table with a `shipmentId` column. */
+function columnsNamedFor(
+ name: string,
+ tables: Map<string, Set<string>>
+): Column[] {
+ const columns: Column[] = [];
+ if (name.endsWith("Id")) {
+ const table = name.slice(0, -2);
+ if (tables.get(table)?.has("id")) columns.push({ table, column: "id" });
+ }
+ for (const table of [...tables.keys()].sort()) {
+ if (tables.get(table)?.has(name)) columns.push({ table, column: name });
+ }
+ return columns;
+}
+
+const typeOf = (property: Property) =>
+ Array.isArray(property.type)
+ ? property.type.find((type) => type !== "null")
+ : property.type;
+
+const NULL: Planned = { kind: "value", value: null, source: "type" };
+
+function planProperty(
+ path: string,
+ property: Property,
+ own: Map<string, Column>,
+ knowledge: Knowledge,
+ today: string,
+ missing: string[]
+): Planned | undefined {
+ const name = fieldOf(path);
+ const type = typeOf(property);
+ const many = type === "array";
+
+ const compared = own.get(name);
+ if (compared) {
+ return { kind: "sample", from: [compared], many, source: "column" };
+ }
+
+ // A union: its first alternative that is not null, else null when allowed.
+ const alternatives = property.anyOf ?? property.oneOf;
+ if (alternatives) {
+ const nullable = alternatives.some((branch) => branch.type === "null");
+ const first = alternatives.find((branch) => branch.type !== "null");
+ if (!first) return NULL;
+ const unanswered: string[] = [];
+ const planned = planProperty(path, first, own, knowledge, today, unanswered);
+ if (planned && unanswered.length === 0) return planned;
+ if (nullable) return NULL;
+ missing.push(...unanswered);
+ return planned;
+ }
+
+ if (property.enum && property.enum.length > 0) {
+ return { kind: "value", value: property.enum[0], source: "type" };
+ }
+ if (many && property.items?.enum && property.items.enum.length > 0) {
+ return { kind: "value", value: [property.items.enum[0]], source: "type" };
+ }
+ if (type === "boolean") return { kind: "value", value: false, source: "type" };
+ if (type === "number" || type === "integer") {
+ // The first page: an offset past the end is PostgREST's 416, not a list.
+ return { kind: "value", value: name === "offset" ? 0 : 1, source: "type" };
+ }
+ if (property.format === "date" || property.format === "date-time") {
+ return { kind: "value", value: today, source: "type" };
+ }
+
+ if (type === "object") {
+ const fields: Record<string, Planned> = {};
+ for (const required of property.required ?? []) {
+ const planned = planProperty(
+ `${path}.${required}`,
+ property.properties?.[required] ?? {},
+ own,
+ knowledge,
+ today,
+ missing
+ );
+ if (planned) fields[required] = planned;
+ }
+ return { kind: "object", fields };
+ }
+
+ const byName = knowledge.consensus.get(name);
+ const named = [
+ ...(byName ? [byName] : []),
+ ...columnsNamedFor(name, knowledge.tables)
+ ];
+ if (named.length > 0) {
+ return { kind: "sample", from: named, many, source: "name" };
+ }
+
+ if (many) return { kind: "value", value: [], source: "type" };
+ if (/date$/i.test(name)) return { kind: "value", value: today, source: "name" };
+ // A search term that is required but empty means "do not search".
+ if (name === "search" || name === "q") {
+ return { kind: "value", value: "", source: "name" };
+ }
+ if (Array.isArray(property.type) && property.type.includes("null")) {
+ return NULL;
+ }
+ missing.push(path);
+ return undefined;
+}
+
+export function planInputs(
+ schema: ToolSchema,
+ filters: ReadonlyArray<{ path: string } & Column>,
+ knowledge: Knowledge,
+ today: string
+): InputPlan {
+ const own = columnsByArgument(filters);
+ const properties = schema.properties ?? {};
+ const plan: InputPlan = { args: {}, missing: [] };
+
+ for (const name of schema.required ?? []) {
+ const planned = planProperty(
+ name,
+ properties[name] ?? {},
+ own,
+ knowledge,
+ today,
+ plan.missing
+ );
+ if (planned) plan.args[name] = planned;
+ }
+
+ // A list read is bounded so the sweep stays quick; nothing else optional is sent.
+ if (properties.limit && !plan.args.limit) {
+ plan.args.limit = { kind: "value", value: 5, source: "type" };
+ }
+ return plan;
+}
+
+/** Whether any part of the plan takes its value from a parameter name. */
+export function usesNames(planned: Planned): boolean {
+ if (planned.kind === "object") {
+ return Object.values(planned.fields).some(usesNames);
+ }
+ return planned.source === "name";
+}
diff --git a/apps/erp/test/sweep/read-tools.baseline.json b/apps/erp/test/sweep/read-tools.baseline.json
new file mode 100644
index 0000000000..0967ef424b
--- /dev/null
+++ b/apps/erp/test/sweep/read-tools.baseline.json
@@ -0,0 +1 @@
+{}
diff --git a/apps/erp/test/sweep/read-tools.inputs.ts b/apps/erp/test/sweep/read-tools.inputs.ts
new file mode 100644
index 0000000000..e3508fdf4c
--- /dev/null
+++ b/apps/erp/test/sweep/read-tools.inputs.ts
@@ -0,0 +1,50 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import type { Planned } from "./inputs";
+
+const value = (given: unknown): Planned => ({
+ kind: "value",
+ value: given,
+ source: "type"
+});
+const from = (table: string, column = "id"): Planned => ({
+ kind: "sample",
+ from: [{ table, column }],
+ many: false,
+ source: "column"
+});
+
+/**
+ * Arguments the planner cannot work out from the tool's body, its schema or
+ * the database, written down per tool. Each one replaces the planned argument
+ * of that name. Keep it short: an entry here is something the published tool
+ * does not say about itself.
+ */
+export function givenInputs(today: string): Record<string, Record<string, Planned>> {
+ return {
+ accounting_getAccountPeriodSeries: {
+ start: value(today),
+ periodEnds: value([today])
+ },
+ accounting_getDimensionPivotLines: { filters: value([]) },
+ accounting_getConsolidatedBalances: {
+ targetCurrency: from("company", "baseCurrencyCode")
+ },
+ accounting_getConsolidatedPeriodSeries: {
+ targetCurrency: from("company", "baseCurrencyCode")
+ },
+ // The details come from a SQL function, so the body names no table.
+ items_getConsumable: { itemId: from("consumables") },
+ items_getService: { itemId: from("services") },
+ items_getTool: { itemId: from("tools") },
+ items_getNextRevision: { maxRevision: value("A") },
+ items_findOtherOpenChangeNoticesForItem: {
+ excludeChangeNoticeId: from("changeOrder")
+ },
+ production_getCompletionJobs: { timeZone: value("UTC") },
+ sales_getQuoteLinePricesByItemId: { currentQuoteId: from("quote") },
+ sales_getQuoteLinePricesByItemIds: { currentQuoteId: from("quote") }
+ };
+}
diff --git a/apps/erp/test/sweep/read-tools.sweep.ts b/apps/erp/test/sweep/read-tools.sweep.ts
new file mode 100644
index 0000000000..3241f0aad6
--- /dev/null
+++ b/apps/erp/test/sweep/read-tools.sweep.ts
@@ -0,0 +1,505 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+/**
+ * Calls every READ tool for real: this branch's dispatcher and services, a
+ * signed-in user's client (so row-level security applies), and the data of a
+ * seeded company on a running local stack. Unit tests stand services in; this
+ * is the only place a tool is actually run end to end.
+ *
+ * Only READ tools are called. The generator refuses to publish one that writes,
+ * in TypeScript or through a SQL function, so the sweep cannot change data.
+ *
+ * Run it with `pnpm sweep:tools` (see `test/sweep/README.md`). It writes a
+ * report and fails when a tool errors that the baseline does not list, when a
+ * tool it lists now passes, or when a tool could not be called at all.
+ */
+
+import {
+ existsSync,
+ mkdirSync,
+ readdirSync,
+ readFileSync,
+ writeFileSync
+} from "node:fs";
+import path from "node:path";
+import { getUserScopedClient } from "@carbon/auth/client.server";
+import { today } from "@internationalized/date";
+import type { SupabaseClient } from "@supabase/supabase-js";
+import { sql } from "kysely";
+import { describe, expect, it } from "vitest";
+import { dispatchOperation } from "~/routes/api+/v1+/lib/dispatch.server";
+import { OPERATIONS } from "~/routes/api+/v1+/lib/operations.server";
+import { getDatabaseClient } from "~/services/database.server";
+import {
+ buildServiceAst,
+ type ParamFilter,
+ paramFilters
+} from "../../../../scripts/lib/service-ast";
+import {
+ type Column,
+ consensusByName,
+ type Planned,
+ planInputs,
+ usesNames
+} from "./inputs";
+import { givenInputs } from "./read-tools.inputs";
+
+const HERE = path.dirname(new URL(import.meta.url).pathname);
+const BASELINE = path.join(HERE, "read-tools.baseline.json");
+const MIGRATIONS = path.join(
+ HERE,
+ "../../../../packages/database/supabase/migrations"
+);
+const REPORT =
+ process.env.CARBON_SWEEP_REPORT ?? path.join(HERE, ".report/read-tools.json");
+const CALL_TIMEOUT_MS = 30_000;
+/** How many real values of an argument are tried before "no row matches" stands. */
+const CANDIDATES = 12;
+
+type Outcome =
+ | { status: "ok"; rows: number | null; ms: number }
+ | { status: "failed"; error: string; ms: number }
+ /** The tool ran and said no row matches what it was given — an item that is
+ * not a tool, for `getTool`; a date no period covers. A tool that takes no
+ * arguments has nothing to blame, so the same answer there is `failed`. */
+ | { status: "not-found"; ms: number }
+ | { status: "not-called"; reason: string };
+
+interface Entry {
+ tool: string;
+ args: Record<string, unknown>;
+ /** Arguments taken from a parameter NAME, not from the tool's own body. */
+ byName: string[];
+ /** Arguments that name no real row: the company has none to take one from,
+ * so the tool was asked for a row that does not exist. */
+ placeholder: string[];
+ outcome: Outcome;
+}
+
+const db = getDatabaseClient();
+
+async function target() {
+ const companyId = process.env.SWEEP_COMPANY_ID;
+ const userId = process.env.SWEEP_USER_ID;
+ if (companyId && userId) return { companyId, userId };
+
+ // The dev seed's own user, in whichever of its companies has the most data.
+ const email = process.env.DEV_BYPASS_EMAIL;
+ if (!email) {
+ throw new Error(
+ "Set SWEEP_COMPANY_ID and SWEEP_USER_ID, or DEV_BYPASS_EMAIL for a seeded stack."
+ );
+ }
+ const found = await sql<{ userId: string; companyId: string }>`
+ select u."id" as "userId", m."companyId"
+ from "user" u
+ join "userToCompany" m on m."userId" = u."id" and m."role" = 'employee'
+ where u."email" = ${email}
+ order by (select count(*) from "item" i where i."companyId" = m."companyId") desc
+ limit 1`.execute(db);
+ const row = found.rows[0];
+ if (!row) throw new Error(`No employee membership found for ${email}.`);
+ return row;
+}
+
+/**
+ * Existing values of a column, read as the user: ids the caller could really
+ * have got from a list, so row-level security cannot be why a call by one
+ * finds nothing. Several, because the first may not fit the tool — an item
+ * that is not a tool, for `getTool`.
+ */
+function sampler(client: SupabaseClient, companyId: string) {
+ const cache = new Map<string, Promise<unknown[]>>();
+ const read = async ({ table, column }: Column): Promise<unknown[]> => {
+ const query = () =>
+ client
+ .from(table)
+ .select(column)
+ .not(column, "is", null)
+ .limit(CANDIDATES * 8);
+ let found = await query().eq("companyId", companyId);
+ // 42703: no companyId column — a table shared across companies.
+ if (found.error?.code === "42703") found = await query();
+ if (found.error) throw new Error(found.error.message);
+ const rows = found.data as unknown as Array<Record<string, unknown>> | null;
+ const distinct = new Map<string, unknown>();
+ for (const row of rows ?? []) {
+ distinct.set(JSON.stringify(row[column]), row[column]);
+ }
+ return [...distinct.values()].slice(0, CANDIDATES);
+ };
+ return (from: Column) => {
+ const key = `${from.table}.${from.column}`;
+ const cached = cache.get(key) ?? read(from);
+ cache.set(key, cached);
+ return cached;
+ };
+}
+
+/** A planned argument that could not be given a value, and why. */
+class NoValue extends Error {}
+
+/**
+ * A value of the column's type that matches no row, for a company that has no
+ * row to take a real one from. The tool still runs its query — the wrong
+ * column or a missing function shows — and answers with nothing.
+ */
+function placeholders(
+ types: Map<string, string>,
+ enums: Map<string, string>,
+ day: string
+) {
+ return ({ table, column }: Column): unknown => {
+ const type = types.get(`${table}.${column}`);
+ switch (type) {
+ case "text":
+ case "varchar":
+ case "bpchar":
+ case "citext":
+ return "sweep-no-such-row";
+ case "uuid":
+ return "00000000-0000-0000-0000-000000000000";
+ case "bool":
+ return false;
+ case "date":
+ return day;
+ case "timestamp":
+ case "timestamptz":
+ return `${day}T00:00:00+00:00`;
+ case "int2":
+ case "int4":
+ case "int8":
+ case "numeric":
+ case "float4":
+ case "float8":
+ return 0;
+ default:
+ return type ? enums.get(type) : undefined;
+ }
+ };
+}
+
+/**
+ * The plan's arguments as real values, one set per candidate: set `n` uses the
+ * `n`th value of every sampled column (the last one when a column has fewer).
+ */
+async function resolve(
+ plan: Record<string, Planned>,
+ sample: (from: Column) => Promise<unknown[]>,
+ placeholder: (from: Column) => unknown
+): Promise<{ candidates: Array<Record<string, unknown>>; placeholder: string[] }> {
+ let sets = 1;
+ const unmatched: string[] = [];
+ const sampled = new Map<Planned, unknown[]>();
+ // Lists with nothing to sample and no single value to stand in: sent empty.
+ const empty = new Set<Planned>();
+ const collect = async (name: string, planned: Planned): Promise<void> => {
+ if (planned.kind === "object") {
+ for (const [field, inner] of Object.entries(planned.fields)) {
+ await collect(`${name}.${field}`, inner);
+ }
+ return;
+ }
+ if (planned.kind !== "sample") return;
+ for (const from of planned.from) {
+ let values: unknown[];
+ try {
+ values = await sample(from);
+ } catch {
+ // Not a column this user can read, or not a column at all: try the next.
+ continue;
+ }
+ if (values.length > 0) {
+ sampled.set(planned, values);
+ sets = Math.max(sets, values.length);
+ return;
+ }
+ }
+ for (const from of planned.from) {
+ const none = placeholder(from);
+ if (none !== undefined) {
+ sampled.set(planned, [none]);
+ unmatched.push(name);
+ return;
+ }
+ }
+ if (planned.many) {
+ empty.add(planned);
+ unmatched.push(name);
+ return;
+ }
+ const tried = planned.from.map((from) => `${from.table}.${from.column}`);
+ throw new NoValue(`no rows to take ${name} from (${tried.join(", ")})`);
+ };
+ for (const [name, planned] of Object.entries(plan)) {
+ await collect(name, planned);
+ }
+
+ const build = (planned: Planned, index: number): unknown => {
+ if (planned.kind === "value") return planned.value;
+ if (planned.kind === "object") {
+ return Object.fromEntries(
+ Object.entries(planned.fields).map(([field, inner]) => [
+ field,
+ build(inner, index)
+ ])
+ );
+ }
+ if (empty.has(planned)) return [];
+ const values = sampled.get(planned) as unknown[];
+ const value = values[Math.min(index, values.length - 1)];
+ return planned.many ? [value] : value;
+ };
+ const candidates = Array.from({ length: sets }, (_, index) =>
+ Object.fromEntries(
+ Object.entries(plan).map(([name, planned]) => [name, build(planned, index)])
+ )
+ );
+ return { candidates, placeholder: unmatched };
+}
+
+function rowsOf(data: unknown): number | null {
+ if (Array.isArray(data)) return data.length;
+ return data === null || data === undefined ? 0 : null;
+}
+
+const errorCode = (error: unknown) =>
+ (error as { data?: { supabase?: { code?: string } } })?.data?.supabase?.code;
+
+function describeError(error: unknown): string {
+ const code = errorCode(error);
+ const message = error instanceof Error ? error.message : String(error);
+ return code ? `${code}: ${message}` : message;
+}
+
+async function withTimeout<T>(work: Promise<T>): Promise<T> {
+ let timer: ReturnType<typeof setTimeout> | undefined;
+ const expired = new Promise<never>((_, reject) => {
+ timer = setTimeout(
+ () => reject(new Error(`no answer after ${CALL_TIMEOUT_MS / 1000} s`)),
+ CALL_TIMEOUT_MS
+ );
+ });
+ try {
+ return await Promise.race([work, expired]);
+ } finally {
+ clearTimeout(timer);
+ }
+}
+
+/**
+ * Migrations on this branch that the stack has not applied, and the reverse.
+ * A tool that calls a function the database does not have yet fails for a
+ * reason that is not the tool's, so the sweep refuses to run on a stack that is
+ * behind unless told the drift is known.
+ */
+async function schemaDrift() {
+ const applied = await sql<{ version: string }>`
+ select version from supabase_migrations.schema_migrations`.execute(db);
+ const inDatabase = new Set(applied.rows.map((row) => row.version));
+ const onBranch = readdirSync(MIGRATIONS)
+ .filter((file) => file.endsWith(".sql"))
+ .map((file) => file.slice(0, file.indexOf("_")));
+ const branch = new Set(onBranch);
+ return {
+ notApplied: onBranch.filter((version) => !inDatabase.has(version)),
+ notOnBranch: [...inDatabase].filter((version) => !branch.has(version))
+ };
+}
+
+describe("every read tool, against real data", () => {
+ it("answers without an error", async () => {
+ const drift = await schemaDrift();
+ if (drift.notApplied.length > 0 && process.env.CARBON_SWEEP_ALLOW_DRIFT !== "1") {
+ throw new Error(
+ `The stack has not applied ${drift.notApplied.length} migration(s) on this branch (${drift.notApplied.join(", ")}). Run pnpm db:migrate, or set CARBON_SWEEP_ALLOW_DRIFT=1 to sweep anyway.`
+ );
+ }
+ const { companyId, userId } = await target();
+ const company = await sql<{ companyGroupId: string }>`
+ select "companyGroupId" from "company" where "id" = ${companyId}`.execute(db);
+ const companyGroupId = company.rows[0]?.companyGroupId;
+ if (!companyGroupId) {
+ // Dispatching with no group would fail the group-scoped tools for a
+ // reason that is the setup's, and a person could then baseline them.
+ throw new Error(`Company ${companyId} not found, or it has no company group.`);
+ }
+
+ const reads = OPERATIONS.filter((tool) => tool.classification === "READ");
+ const ast = buildServiceAst([...new Set(reads.map((tool) => tool.module))]);
+ const filtersByTool = new Map<string, ParamFilter[]>();
+ for (const module of ast.modules.values()) {
+ for (const fn of module.functions) {
+ filtersByTool.set(fn.toolName, paramFilters(fn.node));
+ }
+ }
+ const columns = await sql<{ table: string; column: string; type: string }>`
+ select table_name as "table", column_name as "column", udt_name as "type"
+ from information_schema.columns where table_schema = 'public'`.execute(db);
+ const tables = new Map<string, Set<string>>();
+ const types = new Map<string, string>();
+ for (const { table, column, type } of columns.rows) {
+ tables.set(table, (tables.get(table) ?? new Set()).add(column));
+ types.set(`${table}.${column}`, type);
+ }
+ const labels = await sql<{ type: string; label: string }>`
+ select distinct on (t.typname) t.typname as "type", e.enumlabel as "label"
+ from pg_enum e join pg_type t on t.oid = e.enumtypid
+ order by t.typname, e.enumsortorder`.execute(db);
+ const enums = new Map(labels.rows.map(({ type, label }) => [type, label]));
+ const knowledge = {
+ consensus: consensusByName([...filtersByTool.values()].flat()),
+ tables
+ };
+ const sample = sampler(await getUserScopedClient(userId), companyId);
+ const day = today("UTC").toString();
+ const placeholder = placeholders(types, enums, day);
+ const given = givenInputs(day);
+
+ const entries: Entry[] = [];
+ for (const tool of reads) {
+ const plan = planInputs(
+ tool.schema as Parameters<typeof planInputs>[0],
+ filtersByTool.get(tool.name) ?? [],
+ knowledge,
+ day
+ );
+ const stated = given[tool.name] ?? {};
+ Object.assign(plan.args, stated);
+ plan.missing = plan.missing.filter(
+ (missing) => !((missing.split(".")[0] ?? "") in stated)
+ );
+ const entry: Entry = {
+ tool: tool.name,
+ args: {},
+ byName: Object.entries(plan.args)
+ .filter(([, planned]) => usesNames(planned))
+ .map(([name]) => name),
+ placeholder: [],
+ outcome: { status: "not-called", reason: "" }
+ };
+ entries.push(entry);
+
+ if (plan.missing.length > 0) {
+ entry.outcome = {
+ status: "not-called",
+ reason: `no value for ${plan.missing.join(", ")}`
+ };
+ continue;
+ }
+
+ let candidates: Array<Record<string, unknown>>;
+ try {
+ const resolved = await resolve(plan.args, sample, placeholder);
+ candidates = resolved.candidates;
+ entry.placeholder = resolved.placeholder;
+ } catch (error) {
+ if (!(error instanceof NoValue)) throw error;
+ entry.outcome = { status: "not-called", reason: error.message };
+ continue;
+ }
+
+ // "No row matches" with one real id may only mean the id does not fit, so
+ // the next is tried; any other answer, good or bad, is the tool's answer.
+ for (const args of candidates) {
+ entry.args = args;
+ const started = performance.now();
+ try {
+ // A fresh token per call: the sweep outlives a user token's five minutes.
+ const client = await getUserScopedClient(userId);
+ const result = await withTimeout(
+ dispatchOperation(
+ tool,
+ {
+ client,
+ userId,
+ companyId,
+ companyGroupId,
+ authKind: "session",
+ scopes: {}
+ },
+ args
+ )
+ );
+ entry.outcome = {
+ status: "ok",
+ rows: rowsOf(result.data),
+ ms: Math.round(performance.now() - started)
+ };
+ break;
+ } catch (error) {
+ const ms = Math.round(performance.now() - started);
+ // PGRST116: a single-row read matched no row.
+ if (errorCode(error) === "PGRST116" && Object.keys(args).length > 0) {
+ entry.outcome = { status: "not-found", ms };
+ continue;
+ }
+ entry.outcome = { status: "failed", error: describeError(error), ms };
+ break;
+ }
+ }
+ }
+
+ const failed = entries.filter((entry) => entry.outcome.status === "failed");
+ const summary = {
+ company: companyId,
+ drift,
+ tools: entries.length,
+ ok: entries.filter((entry) => entry.outcome.status === "ok").length,
+ // Of those, the ones asked for a row that does not exist.
+ okWithoutARow: entries.filter(
+ (entry) => entry.outcome.status === "ok" && entry.placeholder.length > 0
+ ).length,
+ failed: failed.length,
+ notFound: entries.filter((entry) => entry.outcome.status === "not-found")
+ .length,
+ notCalled: entries.filter((entry) => entry.outcome.status === "not-called")
+ .length
+ };
+ mkdirSync(path.dirname(REPORT), { recursive: true });
+ writeFileSync(REPORT, `${JSON.stringify({ summary, entries }, null, 1)}\n`);
+ console.log("read-tool sweep:", JSON.stringify(summary), "→", REPORT);
+
+ const failures = Object.fromEntries(
+ failed.map((entry) => [
+ entry.tool,
+ (entry.outcome as { error: string }).error
+ ])
+ );
+ if (process.env.CARBON_SWEEP_UPDATE === "1") {
+ writeFileSync(BASELINE, `${JSON.stringify(failures, null, 2)}\n`);
+ return;
+ }
+
+ const known: Record<string, string> = existsSync(BASELINE)
+ ? JSON.parse(readFileSync(BASELINE, "utf8"))
+ : {};
+ const called = new Set(
+ entries
+ .filter((entry) => entry.outcome.status !== "not-called")
+ .map((entry) => entry.tool)
+ );
+ // A tool that was not called was not checked, and would pass by being
+ // skipped: an argument that stops being plannable must not go unnoticed.
+ expect(
+ entries
+ .filter((entry) => entry.outcome.status === "not-called")
+ .map(
+ (entry) =>
+ `${entry.tool}: ${(entry.outcome as { reason: string }).reason}`
+ ),
+ "read tools that were not called — give the argument a value in read-tools.inputs.ts"
+ ).toEqual([]);
+ // New: failing now, not known to. Fixed: known to fail, called, and passing.
+ expect(
+ Object.keys(failures).filter((tool) => !(tool in known)),
+ "tools that fail now and are not in the baseline"
+ ).toEqual([]);
+ expect(
+ Object.keys(known).filter((tool) => called.has(tool) && !(tool in failures)),
+ "tools the baseline lists as failing that now pass — remove them from it"
+ ).toEqual([]);
+ });
+});
diff --git a/apps/erp/test/tool-sweep-inputs.test.ts b/apps/erp/test/tool-sweep-inputs.test.ts
new file mode 100644
index 0000000000..df59f0f9b5
--- /dev/null
+++ b/apps/erp/test/tool-sweep-inputs.test.ts
@@ -0,0 +1,250 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { describe, expect, it } from "vitest";
+import { paramFilters, parseServiceSource } from "../../../scripts/lib/service-ast";
+import { consensusByName, planInputs } from "./sweep/inputs";
+
+function filtersOf(source: string) {
+ return Object.fromEntries(
+ parseServiceSource("mod", source).map((fn) => [fn.name, paramFilters(fn.node)])
+ );
+}
+
+describe("what a parameter is, read off the body", () => {
+ const filters = filtersOf(`
+ export async function getJob(client: Client, jobId: string) {
+ return client.from("job").select("*").eq("id", jobId).single();
+ }
+ export async function getLines(client: Client, args: { orderId: string; status: string }) {
+ const { orderId } = args;
+ return client.from("orderLine").select("*").eq("orderId", orderId).eq("status", args.status);
+ }
+ export async function getMany(client: Client, { ids }: { ids: string[] }) {
+ const query = client.from("item").select("*");
+ return query.in("id", ids);
+ }
+ export async function getPeriod(client: Client, date: string) {
+ return client.from("period").select("*").lte("startDate", date).gte("endDate", date);
+ }
+ export async function viaRpc(client: Client, itemId: string) {
+ return client.rpc("details", { item_id: itemId });
+ }
+ export async function notMine(client: Client, id: string) {
+ const other = "x";
+ return client.from("job").select("*").eq("id", other);
+ }
+ `);
+
+ it("ties a parameter to the column it is compared with", () => {
+ expect(filters.getJob).toEqual([{ path: "jobId", table: "job", column: "id" }]);
+ // Reported outermost call first; the order carries no meaning.
+ expect(filters.getLines).toHaveLength(2);
+ expect(filters.getLines).toContainEqual({
+ path: "args.orderId",
+ table: "orderLine",
+ column: "orderId"
+ });
+ expect(filters.getLines).toContainEqual({
+ path: "args.status",
+ table: "orderLine",
+ column: "status"
+ });
+ expect(filters.getMany).toEqual([
+ { path: "destructured.ids", table: "item", column: "id" }
+ ]);
+ });
+
+ it("counts a range test: the column holds values the parameter is comparable with", () => {
+ expect(filters.getPeriod).toContainEqual({
+ path: "date",
+ table: "period",
+ column: "startDate"
+ });
+ });
+
+ it("says nothing when the body does not compare it to a column", () => {
+ expect(filters.viaRpc).toEqual([]);
+ expect(filters.notMine).toEqual([]);
+ });
+});
+
+describe("planning a tool's arguments", () => {
+ const today = "2026-01-15";
+ const knowledge = {
+ consensus: consensusByName([
+ { path: "itemId", table: "item", column: "id" },
+ { path: "args.itemId", table: "itemCost", column: "itemId" },
+ { path: "itemId", table: "itemCost", column: "itemId" },
+ { path: "code", table: "currency", column: "code" },
+ { path: "code", table: "uom", column: "code" }
+ ]),
+ tables: new Map([
+ ["shipment", new Set(["id", "companyId"])],
+ ["shipmentLine", new Set(["id", "shipmentId"])],
+ ["receiptLine", new Set(["id", "locationId"])]
+ ])
+ };
+
+ it("samples what the body compares the argument to, before anything else", () => {
+ const plan = planInputs(
+ { properties: { jobId: { type: "string" } }, required: ["jobId"] },
+ [
+ { path: "jobId", table: "jobMaterial", column: "jobId" },
+ { path: "jobId", table: "job", column: "id" }
+ ],
+ knowledge,
+ today
+ );
+ expect(plan).toEqual({
+ args: {
+ jobId: {
+ kind: "sample",
+ from: [{ table: "job", column: "id" }],
+ many: false,
+ source: "column"
+ }
+ },
+ missing: []
+ });
+ });
+
+ it("reads a name as the one table whose id it is compared to, however rarely", () => {
+ // Compared to itemCost.itemId twice and item.id once: it is still an item's id.
+ expect(knowledge.consensus.get("itemId")).toEqual({
+ table: "item",
+ column: "id"
+ });
+ // Two different tables, equally often, neither an id: no answer.
+ expect(knowledge.consensus.has("code")).toBe(false);
+ });
+
+ it("falls back to the name: other services first, then the database", () => {
+ const plan = planInputs(
+ {
+ properties: {
+ itemId: { type: "string" },
+ shipmentId: { type: "string" },
+ locationId: { type: "string" }
+ },
+ required: ["itemId", "shipmentId", "locationId"]
+ },
+ [],
+ knowledge,
+ today
+ );
+ expect(plan.missing).toEqual([]);
+ expect(plan.args.itemId).toMatchObject({
+ from: [{ table: "item", column: "id" }],
+ source: "name"
+ });
+ // A table named for it, then every table with a column of that name.
+ expect(plan.args.shipmentId).toMatchObject({
+ from: [
+ { table: "shipment", column: "id" },
+ { table: "shipmentLine", column: "shipmentId" }
+ ],
+ source: "name"
+ });
+ expect(plan.args.locationId).toMatchObject({
+ from: [{ table: "receiptLine", column: "locationId" }],
+ source: "name"
+ });
+ });
+
+ it("leaves out what nothing answers, by its path", () => {
+ const plan = planInputs(
+ {
+ properties: {
+ code: { type: "string" },
+ args: {
+ type: "object",
+ properties: { report: { type: "string" }, active: { type: "boolean" } },
+ required: ["report", "active"]
+ }
+ },
+ required: ["code", "args"]
+ },
+ [],
+ knowledge,
+ today
+ );
+ expect(plan.missing).toEqual(["code", "args.report"]);
+ });
+
+ it("plans the required fields of a nested object", () => {
+ const plan = planInputs(
+ {
+ properties: {
+ args: {
+ type: "object",
+ properties: { active: { type: "boolean" }, search: { type: "string" } },
+ required: ["active"]
+ }
+ },
+ required: ["args"]
+ },
+ [{ path: "args.active", table: "documents", column: "active" }],
+ knowledge,
+ today
+ );
+ expect(plan).toEqual({
+ args: {
+ args: {
+ kind: "object",
+ fields: {
+ active: {
+ kind: "sample",
+ from: [{ table: "documents", column: "active" }],
+ many: false,
+ source: "column"
+ }
+ }
+ }
+ },
+ missing: []
+ });
+ });
+
+ it("does not sample from a filter that is not a plain column", () => {
+ const plan = planInputs(
+ { properties: { kind: { type: "string" } }, required: ["kind"] },
+ [
+ { path: "kind", table: "job", column: "attributes->>kind" },
+ { path: "kind", table: "job", column: "process.name" }
+ ],
+ knowledge,
+ today
+ );
+ expect(plan).toEqual({ args: {}, missing: ["kind"] });
+ });
+
+ it("fills simple types, and bounds a list read from its first page", () => {
+ const plan = planInputs(
+ {
+ properties: {
+ status: { type: "string", enum: ["Draft", "Posted"] },
+ includeInactive: { type: "boolean" },
+ asOfDate: { type: "string" },
+ search: { type: "string" },
+ offset: { type: "integer" },
+ limit: { type: "number" }
+ },
+ required: ["status", "includeInactive", "asOfDate", "search", "offset"]
+ },
+ [],
+ knowledge,
+ today
+ );
+ expect(plan.missing).toEqual([]);
+ expect(plan.args).toEqual({
+ status: { kind: "value", value: "Draft", source: "type" },
+ includeInactive: { kind: "value", value: false, source: "type" },
+ asOfDate: { kind: "value", value: today, source: "name" },
+ search: { kind: "value", value: "", source: "name" },
+ offset: { kind: "value", value: 0, source: "type" },
+ limit: { kind: "value", value: 5, source: "type" }
+ });
+ });
+});
diff --git a/apps/erp/vitest.sweep.config.ts b/apps/erp/vitest.sweep.config.ts
new file mode 100644
index 0000000000..1af3616786
--- /dev/null
+++ b/apps/erp/vitest.sweep.config.ts
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { existsSync, readFileSync } from "node:fs";
+import { lingui } from "@lingui/vite-plugin";
+import babelMacros from "vite-plugin-babel-macros";
+import { defineConfig } from "vitest/config";
+
+/**
+ * The tool sweep runs the REAL services against a running local stack, so it
+ * needs that stack's real environment — unlike the unit tests, whose config
+ * stubs every variable. By default that is this app's own `.env` then
+ * `.env.local` (what `crbn up` wrote). `CARBON_SWEEP_ENV` names other files, in
+ * order (later wins), to sweep a stack another checkout is running:
+ * `<checkout>/.env:<checkout>/.env.local`.
+ */
+function readEnvFiles(spec: string | undefined): Record<string, string> {
+ const env: Record<string, string> = {};
+ const files = spec
+ ? spec.split(":").filter(Boolean)
+ : [".env", ".env.local"].filter((file) => existsSync(file));
+ for (const file of files) {
+ for (const line of readFileSync(file, "utf8").split("\n")) {
+ const match = line.match(/^\s*([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);
+ if (!match) continue;
+ env[match[1]] = match[2]
+ .replace(/\s+#force\s*$/, "")
+ .trim()
+ .replace(/^(['"])(.*)\1$/, "$2");
+ }
+ }
+ return env;
+}
+
+export default defineConfig({
+ // The services import the glossary, whose strings are Lingui macros: without
+ // the app's own transform `msg` is not a function.
+ plugins: [babelMacros(), lingui()],
+ resolve: { tsconfigPaths: true },
+ test: {
+ include: ["test/sweep/**/*.sweep.ts"],
+ env: readEnvFiles(process.env.CARBON_SWEEP_ENV),
+ testTimeout: 600_000,
+ hookTimeout: 120_000,
+ // One process, in order: the sweep shares one database connection pool.
+ fileParallelism: false
+ }
+});
diff --git a/package.json b/package.json
index 0d122cab9f..9d315a0c17 100755
--- a/package.json
+++ b/package.json
@@ -58,6 +58,7 @@
"dev:starter": "turbo run dev --filter=./apps/starter --filter=./packages/",
"format": "biome format --write",
"generate:mcp": "tsx scripts/generate-mcp.ts",
+ "sweep:tools": "pnpm --filter erp exec vitest run --config vitest.sweep.config.ts",
"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/ee/src/workflows/catalog/",
diff --git a/packages/api/src/manifest-types.ts b/packages/api/src/manifest-types.ts
index 138c1ffdac..29f9e7b530 100644
--- a/packages/api/src/manifest-types.ts
+++ b/packages/api/src/manifest-types.ts
@@ -18,6 +18,20 @@ export type AuthField =
| "updatedBy"
| "userId";
+/** What the dispatcher fills a positional service parameter with. */
+export type ContextSource =
+ | "client"
+ | "db"
+ | "userId"
+ | "companyId"
+ | "companyGroupId";
+
+/**
+ * How the service reports failure in the value it returns, read off its return
+ * type by the generator (`scripts/lib/result-shape.ts`).
+ */
+export type ResultShape = "envelope" | "envelopes" | "flag" | "plain";
+
export type PermissionAction = "view" | "create" | "update" | "delete";
/**
@@ -38,7 +52,14 @@ export interface ManifestEntry {
description: string;
paramCount: number;
serviceParams: string[];
+ /** The positional params the dispatcher fills from the authenticated context,
+ * and with what. The generator decides this from the service's signature and
+ * body; the dispatcher keeps no list of its own. A param absent here carries
+ * the caller's payload. */
+ contextParams: Record<string, ContextSource>;
injectAuth: AuthField[];
+ /** Where dispatch looks for a failure in the service's result. */
+ resultShape: ResultShape;
permission: ToolPermission;
/** Whether the service itself applies limit/offset (`setGenericQueryFilters`
* or a direct `.range(`). A list operation with `paginates: false` is a
@@ -56,6 +77,12 @@ export interface ManifestEntry {
keys: string[];
lookups?: Array<{ table: string; match: Record<string, string> }>;
};
+ /** When the dispatcher fills the defaults the schema publishes: on every
+ * call (`always` — a read, a create, an action), or only when an upsert
+ * resolves to a create (`create` — an update that leaves a field out keeps
+ * the stored value). Absent when the schema publishes none; the generator
+ * strips a default nothing would apply. */
+ defaults?: "always" | "create";
/** The JSON Schema for the operation's input. */
schema: Record<string, unknown>;
/** The JSON Schema for the operation's RESPONSE `data`, reflected from the
diff --git a/packages/database/AGENTS.md b/packages/database/AGENTS.md
index 5647995ab1..1f4bf59563 100644
--- a/packages/database/AGENTS.md
+++ b/packages/database/AGENTS.md
@@ -64,6 +64,7 @@ pnpm --filter @carbon/database authz migration <name> # ship unshipped rules/h
| `./supersession-pick` | Node re-export of `supabase/functions/lib/supersession-pick.ts` (`buildSupersessionRedirectMap`, `buildConsumeFirstHops`, `settleConsumeFirstLine`, `resolveMadeLinePull`, `consumableInWholeAssemblies`, …) |
| `./picked-consumption` | Node re-export of `supabase/functions/lib/picked-consumption.ts` (`linesideCredit`, `getPickedBudgets`, `allocateAcrossBudgets`, …) — the one definition of usable lineside stock shared by the pick-list generator and the `issue` backflush |
| *(no subpath)* | `supabase/functions/shared/image-pipeline.ts` — the codebase-wide image pipeline (decode HEIC/JPEG/PNG/WebP → shape → encode), re-exported by `@carbon/files/media` (NOT by this package). Unlike `precision.ts` it has npm deps (`libheif-js`, `@jsquash/*`) which are pinned in BOTH this package.json and `functions/deno.json` `imports` — keep the versions identical. Its `.d.ts` sits beside it (`wasm-codecs.d.ts`, triple-slash referenced). Consumed by the `process-image`, `logo-resizer` and `thumbnail` edge functions |
+| *(no subpath)* | `src/sql-effects.ts` — `sqlFunctionEffects(sources)` / `loadSqlFunctionEffects()`: whether a SQL function writes, reads or cannot be told, read off its current definition with `libpg-query` (every migration, then the managed function files). The API generator imports it by path to refuse a `read` tool that calls a writing function. An extension function it meets must be added to `EXTERNAL_READS` or `EXTERNAL_WRITES`; reviewed dynamic SQL to `REVIEWED_DYNAMIC_READS` |
| `./event` | `QueueMessage`, `EventSchema`, `createEventSystemSubscription`, `deleteEventSystemSubscription` |
| `./quality` | Inspection execution engine shared by ERP + MES (`upsertInspectionSample`, `upsertInspectionMeasurement`, `dispositionInspection` — optional one-shot `requireOpen`, `reconcileInspectionSamplingPlans`, `changeInspectionDocument`, `getOrCreateJobOperationInspection`, pure `valuateMeasurement`, re-exported from `supabase/functions/shared/inspection-verdict.ts`, which the dataset seed shares); Passed/Failed/Partial are all hard-terminal and samples linked from `productionQuantity.inspectionSampleId` are locked; every fn takes a `Kysely<KyselyDatabase>` first arg — authorize at the route, see `.claude/rules/inspection-system.md` |
| `./sampling` | Node-side re-export of `supabase/functions/shared/sampling-engine.ts` (Z1.4 / ISO 2859-1 resolvers) |
diff --git a/packages/database/src/sql-effects.test.ts b/packages/database/src/sql-effects.test.ts
new file mode 100644
index 0000000000..45b70c454d
--- /dev/null
+++ b/packages/database/src/sql-effects.test.ts
@@ -0,0 +1,181 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+import { describe, expect, it } from "vitest";
+import { loadSqlFunctionEffects, sqlFunctionEffects } from "./sql-effects";
+
+// Real SQL through Postgres's own parser — nothing stubbed.
+const effectsOf = (...sql: string[]) =>
+ sqlFunctionEffects(
+ sql.map((text, index) => ({ name: `${index}.sql`, sql: text }))
+ );
+
+const plpgsql = (name: string, body: string, args = "") => `
+ CREATE OR REPLACE FUNCTION ${name}(${args}) RETURNS void LANGUAGE plpgsql AS $$
+ BEGIN
+ ${body}
+ END $$;`;
+
+describe("what a SQL function does", () => {
+ it("sees a write in a plpgsql body, and none in a body that only reads", async () => {
+ const effects = await effectsOf(
+ plpgsql("bump", `UPDATE sequence SET next = next + 1 WHERE id = 1;`),
+ plpgsql("peek", `PERFORM 1 FROM sequence WHERE id = 1;`)
+ );
+ expect(effects.effectOf("bump")).toEqual({
+ kind: "writes",
+ reason: "public.bump: UPDATE sequence"
+ });
+ expect(effects.effectOf("peek")).toEqual({ kind: "reads" });
+ });
+
+ it("reads a sql-language body and a data-modifying CTE", async () => {
+ const effects = await effectsOf(`
+ CREATE FUNCTION log_it(msg text) RETURNS void LANGUAGE sql AS $$
+ INSERT INTO log (message) VALUES (msg);
+ $$;
+ CREATE FUNCTION archive() RETURNS bigint LANGUAGE sql AS $$
+ WITH gone AS (DELETE FROM job WHERE closed RETURNING id)
+ SELECT count(*) FROM gone;
+ $$;`);
+ expect(effects.effectOf("log_it").kind).toBe("writes");
+ expect(effects.effectOf("archive")).toEqual({
+ kind: "writes",
+ reason: "public.archive: DELETE job"
+ });
+ });
+
+ it("is not fooled by a write that is only text", async () => {
+ const effects = await effectsOf(
+ plpgsql(
+ "describe_it",
+ `-- UPDATE job SET status = 'x';
+ RAISE NOTICE 'run DELETE FROM job to reset';
+ PERFORM 'INSERT INTO job'::text;`
+ )
+ );
+ expect(effects.effectOf("describe_it")).toEqual({ kind: "reads" });
+ });
+
+ it("follows a call into a function that writes, through an assignment", async () => {
+ const effects = await effectsOf(
+ `CREATE FUNCTION next_number() RETURNS int LANGUAGE sql AS $$
+ UPDATE sequence SET next = next + 1 RETURNING next;
+ $$;`,
+ `CREATE FUNCTION label() RETURNS text LANGUAGE plpgsql AS $$
+ DECLARE n int;
+ BEGIN
+ n := next_number();
+ RETURN 'J' || n;
+ END $$;`
+ );
+ expect(effects.effectOf("label")).toEqual({
+ kind: "writes",
+ reason: "public.label calls public.next_number: UPDATE sequence"
+ });
+ });
+
+ it("uses the definition that is current: a later source replaces, a drop removes", async () => {
+ const effects = await effectsOf(
+ plpgsql("f", `DELETE FROM job;`),
+ plpgsql("f", `PERFORM 1;`),
+ plpgsql("g", `PERFORM 1;`),
+ `DROP FUNCTION g();`
+ );
+ expect(effects.effectOf("f")).toEqual({ kind: "reads" });
+ expect(effects.effectOf("g")).toEqual({
+ kind: "unknown",
+ reason: "public.g is not defined by any source"
+ });
+ });
+
+ it("answers for every overload a caller could reach by name", async () => {
+ const effects = await effectsOf(
+ plpgsql("touch", `PERFORM 1;`, "a text"),
+ plpgsql("touch", `DELETE FROM job;`, "a text, b int")
+ );
+ expect(effects.effectOf("touch").kind).toBe("writes");
+ });
+
+ it("treats built-ins that change state as writes", async () => {
+ const effects = await effectsOf(
+ `CREATE FUNCTION take() RETURNS bigint LANGUAGE sql AS $$ SELECT nextval('s') $$;`,
+ `CREATE FUNCTION now_text() RETURNS text LANGUAGE sql AS $$ SELECT now()::text $$;`
+ );
+ expect(effects.effectOf("take")).toEqual({
+ kind: "writes",
+ reason: "public.take: nextval()"
+ });
+ expect(effects.effectOf("now_text")).toEqual({ kind: "reads" });
+ });
+
+ it("says it cannot tell, and why, rather than guess", async () => {
+ const effects = await effectsOf(
+ plpgsql("dynamic", `EXECUTE format('SELECT 1 FROM %I', 'job');`),
+ plpgsql("outside", `PERFORM mystery.do_something();`),
+ plpgsql("queued", `PERFORM pgmq.send('q', '{}'::jsonb);`),
+ `CREATE FUNCTION native() RETURNS int LANGUAGE c AS 'lib', 'sym';`
+ );
+ expect(effects.effectOf("dynamic")).toMatchObject({
+ kind: "unknown",
+ reason: expect.stringContaining("dynamic SQL")
+ });
+ expect(effects.effectOf("outside")).toMatchObject({
+ kind: "unknown",
+ reason: expect.stringContaining("mystery.do_something()")
+ });
+ // An extension function that is classified is not a guess.
+ expect(effects.effectOf("queued").kind).toBe("writes");
+ expect(effects.effectOf("native")).toMatchObject({
+ kind: "unknown",
+ reason: expect.stringContaining("written in c")
+ });
+ });
+
+ it("keeps a write certain even when another part could not be read", async () => {
+ const effects = await effectsOf(
+ plpgsql("mixed", `EXECUTE 'SELECT 1'; DELETE FROM job;`)
+ );
+ expect(effects.effectOf("mixed").kind).toBe("writes");
+ });
+});
+
+describe("functions that call each other in a circle", () => {
+ it("does not keep an answer worked out while its caller was unfinished", async () => {
+ // a calls b, b calls a, and a then writes. Asked about a first, b is seen
+ // from inside a — where a still looks like a read.
+ const effects = await effectsOf(
+ plpgsql("a", `PERFORM b(); UPDATE job SET status = 'x';`),
+ plpgsql("b", `PERFORM a();`)
+ );
+ expect(effects.effectOf("a").kind).toBe("writes");
+ expect(effects.effectOf("b").kind).toBe("writes");
+ });
+
+ it("still reads a circle that never writes as a read", async () => {
+ const effects = await effectsOf(
+ plpgsql("ping", `PERFORM pong();`),
+ plpgsql("pong", `PERFORM ping();`)
+ );
+ expect(effects.effectOf("ping")).toEqual({ kind: "reads" });
+ expect(effects.effectOf("pong")).toEqual({ kind: "reads" });
+ });
+});
+
+describe("the repo's own functions", () => {
+ it("reads every migration and finds the sequence function's write", async () => {
+ const effects = await loadSqlFunctionEffects();
+ expect(effects.stats.unparsed).toEqual([]);
+ expect(effects.effectOf("get_next_sequence")).toEqual({
+ kind: "writes",
+ reason: "public.get_next_sequence: UPDATE sequence"
+ });
+ // Dynamic SQL a person has read, pinned to the definition that was read.
+ expect(effects.effectOf("get_unit_of_measure_usage")).toEqual({
+ kind: "reads"
+ });
+ // It parses over a thousand migration files; a CI runner needs more than
+ // vitest's five seconds.
+ }, 60_000);
+});
diff --git a/packages/database/src/sql-effects.ts b/packages/database/src/sql-effects.ts
new file mode 100644
index 0000000000..caebfd20dd
--- /dev/null
+++ b/packages/database/src/sql-effects.ts
@@ -0,0 +1,519 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+/**
+ * Whether a SQL function writes — read off its definition with Postgres's own
+ * parser, never off its name or its text.
+ *
+ * The API generator sees every `.rpc("name")` a service makes, but a function's
+ * body is SQL, which the TypeScript compiler cannot read. `settings_getNextSequence`
+ * was published as a READ gated on `settings:view` for that reason: its rpc runs
+ * `UPDATE sequence SET next = next + step`.
+ *
+ * `sqlFunctionEffects` takes SQL sources in the order they are applied
+ * (migrations by timestamp, then the managed function files), keeps the current
+ * definition of every function, and answers one question about a name: does a
+ * call to it write, only read, or can that not be told? The last is an answer,
+ * not a default — dynamic SQL, a language the parser does not read, a call into
+ * an extension nobody has classified, or a definition the parser could not read
+ * all come back `unknown` with the reason, so a caller can refuse rather than
+ * guess.
+ */
+
+import { readdirSync, readFileSync } from "node:fs";
+import path from "node:path";
+import { fileURLToPath } from "node:url";
+import { parse, parsePlPgSQL } from "libpg-query";
+
+/** libpg-query's AST is untyped JSON. */
+type Ast = any;
+
+export type SqlEffect =
+ | { kind: "reads" }
+ | { kind: "writes"; reason: string }
+ | { kind: "unknown"; reason: string };
+
+export interface SqlSource {
+ /** Shown in a reason, so a reader can find the definition. */
+ name: string;
+ sql: string;
+}
+
+export interface SqlFunctionEffects {
+ /** The effect of calling `name` (`public` unless qualified), over every overload. */
+ effectOf(name: string): SqlEffect;
+ readonly stats: {
+ sources: number;
+ functions: number;
+ /** Sources the parser refused, with its message. */
+ unparsed: Array<{ name: string; error: string }>;
+ };
+}
+
+interface Definition {
+ key: string;
+ signature: string;
+ language: string;
+ /** The `CREATE FUNCTION` statement's own text. */
+ statement: string;
+ /** The body, for a function whose body is a SQL string. */
+ body?: string;
+ /** The body, for a `BEGIN ATOMIC` function: already a tree. */
+ bodyTree?: Ast;
+ source: string;
+}
+
+interface DirectEffects {
+ writes: string[];
+ calls: string[];
+ unknown: string[];
+}
+
+/** Statements that change the database, by the parser's node name. */
+const WRITE_STATEMENTS: Record<string, string> = {
+ InsertStmt: "INSERT",
+ UpdateStmt: "UPDATE",
+ DeleteStmt: "DELETE",
+ MergeStmt: "MERGE",
+ TruncateStmt: "TRUNCATE",
+ CopyStmt: "COPY",
+ CreateStmt: "CREATE TABLE",
+ CreateTableAsStmt: "CREATE TABLE AS",
+ AlterTableStmt: "ALTER TABLE",
+ DropStmt: "DROP",
+ IndexStmt: "CREATE INDEX",
+ RefreshMatViewStmt: "REFRESH MATERIALIZED VIEW",
+ NotifyStmt: "NOTIFY"
+};
+
+/** Built-in functions that change state. Every other built-in only computes. */
+const WRITING_BUILTINS = new Set(["nextval", "setval", "pg_notify"]);
+
+/**
+ * Functions defined outside the repo's own SQL (extensions, Supabase's schemas),
+ * classified by hand because their definitions are not here to read. A qualified
+ * call to anything absent from both lists is `unknown`.
+ */
+const EXTERNAL_READS = new Set([
+ "auth.uid",
+ "auth.role",
+ "auth.jwt",
+ "auth.email",
+ "extensions.uuid_generate_v4",
+ "extensions.gen_random_uuid",
+ "extensions.gen_random_bytes",
+ "extensions.digest",
+ "extensions.similarity",
+ "extensions.word_similarity",
+ "storage.foldername",
+ "storage.filename",
+ "storage.extension"
+]);
+const EXTERNAL_WRITES = new Set([
+ "pgmq.send",
+ "pgmq.send_batch",
+ "pgmq.read",
+ "pgmq.pop",
+ "pgmq.delete",
+ "pgmq.archive",
+ "net.http_post",
+ "net.http_get",
+ "net.http_delete",
+ "cron.schedule",
+ "cron.unschedule",
+ "vault.create_secret",
+ "vault.update_secret",
+ "supabase_functions.http_request"
+]);
+
+/**
+ * Functions whose dynamic SQL a person has read and found to only read, each
+ * with the source that holds the definition that was read. A later source that
+ * redefines the function is a different body, so the review stops applying and
+ * the function is `unknown` again until it is read again.
+ */
+const REVIEWED_DYNAMIC_READS: Readonly<Record<string, string>> = {
+ // EXECUTE format('SELECT count(*) FROM %I WHERE "companyId" = $2 AND (%s)', …)
+ "util.unit_of_measure_usage":
+ "20260814061809_prevent-unit-of-measure-deletion-in-use.sql"
+};
+
+const HERE = path.dirname(fileURLToPath(import.meta.url));
+const MIGRATIONS_DIR = path.join(HERE, "../supabase/migrations");
+/** One `CREATE OR REPLACE FUNCTION` per file; applied after every migration. */
+const MANAGED_DIRS = [
+ path.join(HERE, "authz/helpers"),
+ path.join(HERE, "event-system/functions")
+];
+
+function nameParts(names: Ast[] | undefined): string[] {
+ return (names ?? [])
+ .map((part) => part.String?.sval as string | undefined)
+ .filter((part): part is string => part !== undefined);
+}
+
+/** `name` → `public.name`; an already qualified name is kept. */
+function qualify(parts: string[]): string {
+ return parts.length === 1 ? `public.${parts[0]}` : parts.join(".");
+}
+
+function typeName(node: Ast): string {
+ const type = node?.TypeName ?? node;
+ const names = nameParts(type?.names);
+ const base = names[names.length - 1] ?? "?";
+ return type?.arrayBounds ? `${base}[]` : base;
+}
+
+/** The types that identify an overload: every parameter a caller passes. */
+function signatureOf(parameters: Ast[] | undefined): string {
+ return (parameters ?? [])
+ .map((parameter) => parameter.FunctionParameter)
+ .filter(
+ (parameter) =>
+ parameter &&
+ parameter.mode !== "FUNC_PARAM_OUT" &&
+ parameter.mode !== "FUNC_PARAM_TABLE"
+ )
+ .map((parameter) => typeName(parameter.argType))
+ .join(",");
+}
+
+function option(statement: Ast, name: string): Ast | undefined {
+ return (statement.options ?? []).find(
+ (entry: Ast) => entry.DefElem?.defname === name
+ )?.DefElem;
+}
+
+/** Every node of a parsed SQL tree, depth first. */
+function walk(node: Ast, visit: (kind: string, value: Ast) => void): void {
+ if (Array.isArray(node)) {
+ for (const item of node) walk(item, visit);
+ return;
+ }
+ if (!node || typeof node !== "object") return;
+ for (const [key, value] of Object.entries(node)) {
+ visit(key, value);
+ walk(value, visit);
+ }
+}
+
+function collect(tree: Ast, into: DirectEffects): void {
+ walk(tree, (kind, value) => {
+ const write = WRITE_STATEMENTS[kind];
+ if (write) {
+ const relation =
+ value?.relation?.relname ?? value?.relation?.RangeVar?.relname;
+ into.writes.push(relation ? `${write} ${relation}` : write);
+ }
+ if (kind === "FuncCall") {
+ const parts = nameParts(value?.funcname);
+ if (parts.length > 0) into.calls.push(parts.join("."));
+ }
+ });
+}
+
+/**
+ * A PL/pgSQL statement carries its SQL as text: a whole statement, a bare
+ * expression, or an assignment (`total := a + b`). Each is turned into
+ * something the SQL parser reads; what still does not parse is reported.
+ */
+async function collectFragment(
+ fragment: string,
+ into: DirectEffects
+): Promise<void> {
+ const assigned = fragment.match(/^\s*[\w."[\]]+\s*:=\s*([\s\S]*)$/);
+ const candidates = assigned
+ ? [`SELECT ${assigned[1]}`]
+ : [fragment, `SELECT ${fragment}`];
+ for (const candidate of candidates) {
+ try {
+ collect(await parse(candidate), into);
+ return;
+ } catch {
+ // try the next reading
+ }
+ }
+ into.unknown.push(
+ `a statement the parser could not read: ${fragment.replace(/\s+/g, " ").slice(0, 80)}`
+ );
+}
+
+async function directEffects(definition: Definition): Promise<DirectEffects> {
+ const effects: DirectEffects = { writes: [], calls: [], unknown: [] };
+
+ if (definition.bodyTree) {
+ collect(definition.bodyTree, effects);
+ return effects;
+ }
+
+ if (definition.language === "sql") {
+ try {
+ collect(await parse(definition.body ?? ""), effects);
+ } catch (error) {
+ effects.unknown.push(
+ `a body the parser could not read (${String(error)})`
+ );
+ }
+ return effects;
+ }
+
+ if (definition.language !== "plpgsql") {
+ effects.unknown.push(`a body written in ${definition.language}`);
+ return effects;
+ }
+
+ let tree: Ast;
+ try {
+ tree = await parsePlPgSQL(definition.statement);
+ } catch (error) {
+ effects.unknown.push(`a body the parser could not read (${String(error)})`);
+ return effects;
+ }
+
+ const reviewed = REVIEWED_DYNAMIC_READS[definition.key] === definition.source;
+ const fragments: string[] = [];
+ walk(tree, (kind, value) => {
+ if (
+ !reviewed &&
+ (kind === "PLpgSQL_stmt_dynexecute" || kind === "PLpgSQL_stmt_dynfors")
+ ) {
+ effects.unknown.push(
+ "dynamic SQL (EXECUTE), which has to be read by a person and listed in REVIEWED_DYNAMIC_READS"
+ );
+ }
+ if (kind === "PLpgSQL_expr" && typeof value?.query === "string") {
+ fragments.push(value.query);
+ }
+ });
+ for (const fragment of fragments) await collectFragment(fragment, effects);
+ return effects;
+}
+
+/**
+ * The effect of every function defined by `sources`, applied in order. A later
+ * `CREATE OR REPLACE` of the same signature replaces the earlier one, another
+ * signature adds an overload, and `DROP FUNCTION` removes what it names.
+ */
+export async function sqlFunctionEffects(
+ sources: readonly SqlSource[]
+): Promise<SqlFunctionEffects> {
+ const definitions = new Map<string, Map<string, Definition>>();
+ const unparsed: Array<{ name: string; error: string; sql: string }> = [];
+
+ for (const source of sources) {
+ // Most migrations define no function; parsing them would be wasted work.
+ if (!/\bfunction\b/i.test(source.sql)) continue;
+
+ const bytes = Buffer.from(source.sql, "utf8");
+ let tree: Ast;
+ try {
+ tree = await parse(source.sql);
+ } catch (error) {
+ unparsed.push({
+ name: source.name,
+ error: String(error),
+ sql: source.sql
+ });
+ continue;
+ }
+
+ for (const entry of tree.stmts ?? []) {
+ const create = entry.stmt?.CreateFunctionStmt;
+ if (create) {
+ const key = qualify(nameParts(create.funcname));
+ const signature = signatureOf(create.parameters);
+ // Statement positions are byte offsets, not character offsets.
+ const start = entry.stmt_location ?? 0;
+ const end = entry.stmt_len ? start + entry.stmt_len : bytes.length;
+ const body = option(create, "as")?.arg?.List?.items?.[0]?.String?.sval;
+ const overloads = definitions.get(key) ?? new Map();
+ overloads.set(signature, {
+ key,
+ signature,
+ language: (
+ option(create, "language")?.arg?.String?.sval ?? "sql"
+ ).toLowerCase(),
+ statement: bytes.subarray(start, end).toString("utf8"),
+ body,
+ bodyTree: create.sql_body,
+ source: source.name
+ });
+ definitions.set(key, overloads);
+ continue;
+ }
+
+ const drop = entry.stmt?.DropStmt;
+ if (
+ drop &&
+ ["OBJECT_FUNCTION", "OBJECT_ROUTINE", "OBJECT_PROCEDURE"].includes(
+ drop.removeType
+ )
+ ) {
+ for (const object of drop.objects ?? []) {
+ const target = object.ObjectWithArgs;
+ if (!target) continue;
+ const key = qualify(nameParts(target.objname));
+ const overloads = definitions.get(key);
+ if (!overloads) continue;
+ if (target.args_unspecified) overloads.clear();
+ else overloads.delete((target.objargs ?? []).map(typeName).join(","));
+ if (overloads.size === 0) definitions.delete(key);
+ }
+ }
+ }
+ }
+
+ const direct = new Map<Definition, DirectEffects>();
+ for (const overloads of definitions.values()) {
+ for (const definition of overloads.values()) {
+ direct.set(definition, await directEffects(definition));
+ }
+ }
+
+ const userSchemas = new Set(
+ [...definitions.keys()].map((key) => key.slice(0, key.indexOf(".")))
+ );
+
+ /** A call as written → the function it names, or how to treat it. */
+ function resolveCall(call: string): { key?: string; effect?: SqlEffect } {
+ const parts = call.split(".");
+ const schema = parts[0] ?? "";
+ const name = parts[parts.length - 1] ?? "";
+ if (parts.length === 1) {
+ const key = `public.${call}`;
+ if (definitions.has(key)) return { key };
+ return WRITING_BUILTINS.has(call)
+ ? { effect: { kind: "writes", reason: `${call}()` } }
+ : { effect: { kind: "reads" } };
+ }
+ if (definitions.has(call)) return { key: call };
+ if (schema === "pg_catalog") {
+ return WRITING_BUILTINS.has(name)
+ ? { effect: { kind: "writes", reason: `${name}()` } }
+ : { effect: { kind: "reads" } };
+ }
+ if (EXTERNAL_WRITES.has(call)) {
+ return { effect: { kind: "writes", reason: `${call}()` } };
+ }
+ if (EXTERNAL_READS.has(call)) return { effect: { kind: "reads" } };
+ // A schema the repo defines functions in, but not this one: it was dropped,
+ // or never defined. A schema it defines nothing in: an extension.
+ return {
+ effect: {
+ kind: "unknown",
+ reason: userSchemas.has(schema)
+ ? `${call}(), which no source defines`
+ : `${call}(), an external function that is not classified in sql-effects.ts`
+ }
+ };
+ }
+
+ const memo = new Map<string, SqlEffect>();
+ // How often a call led back to a function still being worked out.
+ let cycleHits = 0;
+
+ function effectOfKey(key: string, visiting: Set<string>): SqlEffect {
+ const known = memo.get(key);
+ if (known) return known;
+ // A function reached again while it is being worked out adds nothing new.
+ if (visiting.has(key)) {
+ cycleHits++;
+ return { kind: "reads" };
+ }
+ const hitsBefore = cycleHits;
+
+ const overloads = definitions.get(key);
+ if (!overloads) {
+ const mentioned = unparsed.find((entry) =>
+ new RegExp(`\\b${key.slice(key.indexOf(".") + 1)}\\b`).test(entry.sql)
+ );
+ return {
+ kind: "unknown",
+ reason: mentioned
+ ? `${key} is named in ${mentioned.name}, which the parser could not read`
+ : `${key} is not defined by any source`
+ };
+ }
+
+ visiting.add(key);
+ let unknown: SqlEffect | undefined;
+ let result: SqlEffect = { kind: "reads" };
+ for (const definition of overloads.values()) {
+ const own = direct.get(definition) as DirectEffects;
+ if (own.writes.length > 0) {
+ result = { kind: "writes", reason: `${key}: ${own.writes[0]}` };
+ break;
+ }
+ for (const call of own.calls) {
+ const resolved = resolveCall(call);
+ const effect = resolved.key
+ ? effectOfKey(resolved.key, visiting)
+ : (resolved.effect as SqlEffect);
+ if (effect.kind === "writes") {
+ result = {
+ kind: "writes",
+ reason: resolved.key
+ ? `${key} calls ${effect.reason}`
+ : `${key}: ${effect.reason}`
+ };
+ break;
+ }
+ if (effect.kind === "unknown" && !unknown) {
+ unknown = {
+ kind: "unknown",
+ reason: `${key} calls ${effect.reason}`
+ };
+ }
+ }
+ if (result.kind === "writes") break;
+ if (own.unknown.length > 0 && !unknown) {
+ unknown = { kind: "unknown", reason: `${key} has ${own.unknown[0]}` };
+ }
+ }
+ visiting.delete(key);
+
+ // A write is certain whatever else could not be read; otherwise one part
+ // that could not be read makes the whole answer unknown.
+ const effect = result.kind === "writes" ? result : (unknown ?? result);
+ // An answer that leaned on a caller not yet worked out is provisional: A
+ // calls B, B calls A, A then writes — B looked like a read from inside A.
+ // Keeping it would let a read tool call B. A write is certain either way.
+ if (effect.kind === "writes" || cycleHits === hitsBefore) {
+ memo.set(key, effect);
+ }
+ return effect;
+ }
+
+ return {
+ effectOf(name) {
+ return effectOfKey(qualify(name.split(".")), new Set());
+ },
+ stats: {
+ sources: sources.length,
+ functions: [...definitions.values()].reduce(
+ (count, overloads) => count + overloads.size,
+ 0
+ ),
+ unparsed: unparsed.map(({ name, error }) => ({ name, error }))
+ }
+ };
+}
+
+function sqlFiles(directory: string): SqlSource[] {
+ return readdirSync(directory)
+ .filter((file) => file.endsWith(".sql"))
+ .sort()
+ .map((file) => ({
+ name: file,
+ sql: readFileSync(path.join(directory, file), "utf8")
+ }));
+}
+
+/** The effects of the repo's own functions: every migration, then the managed files. */
+export function loadSqlFunctionEffects(): Promise<SqlFunctionEffects> {
+ return sqlFunctionEffects([
+ ...sqlFiles(MIGRATIONS_DIR),
+ ...MANAGED_DIRS.flatMap(sqlFiles)
+ ]);
+}
diff --git a/scripts/generate-mcp.ts b/scripts/generate-mcp.ts
index 78248de5a2..743430b6f6 100644
--- a/scripts/generate-mcp.ts
+++ b/scripts/generate-mcp.ts
@@ -12,6 +12,7 @@
*/
import * as fs from "fs";
+import { getDbTablesWithColumn } from "./lib/db-types";
import * as path from "path";
import {
@@ -91,9 +92,20 @@ export async function generateToolMetadata(): Promise<void> {
// No timestamp: the file must be a pure function of the sources so repeated
// runs on an unchanged tree are byte-identical.
+ // The tables a tenant's rows live in. The dispatcher filters every update
+ // and delete on one of them by the caller's company (`scopedToCompany`), so
+ // a list that came back empty would switch that off without a sound.
+ const companyTables = getDbTablesWithColumn("companyId");
+ if (!companyTables.includes("customer") || companyTables.length < 100) {
+ throw new Error(
+ `generate:mcp found only ${companyTables.length} tables with a companyId column in the generated database types; the dispatcher's company filter depends on that list. Nothing was written.`
+ );
+ }
+
const metadata = {
totalTools: allTools.length,
modules: [...new Set(allTools.map((t) => t.module))].length,
+ companyTables,
tools: allTools,
};
diff --git a/scripts/lib/db-types.ts b/scripts/lib/db-types.ts
index c3137068f8..5919fb9574 100644
--- a/scripts/lib/db-types.ts
+++ b/scripts/lib/db-types.ts
@@ -116,3 +116,25 @@ export function getDbTableTypeFields(
}
return fields.length > 0 ? fields : null;
}
+
+/**
+ * The tables of the generated types that have `column`. Tables only: a view is
+ * not written through. Empty when the generated file is missing.
+ */
+export function getDbTablesWithColumn(column: string): string[] {
+ const content = typesContent();
+ if (!content) return [];
+ // The `public` schema's own tables: `graphql_public` comes first in the file
+ // and has none.
+ const schema = content.indexOf("\n public: {");
+ const start = schema < 0 ? -1 : content.indexOf(" Tables: {", schema);
+ if (start < 0) return [];
+ const end = content.indexOf("\n Views: {", start);
+ const section = content.slice(start, end < 0 ? undefined : end);
+ return [...section.matchAll(/\n (\w+): \{/g)]
+ .map((match) => match[1])
+ .filter((table) =>
+ getDbTableTypeFields(table, "Row")?.some((field) => field.name === column)
+ )
+ .sort();
+}
diff --git a/scripts/lib/manifest-digest.ts b/scripts/lib/manifest-digest.ts
index 4fd40caf7f..9c8e128a78 100644
--- a/scripts/lib/manifest-digest.ts
+++ b/scripts/lib/manifest-digest.ts
@@ -35,9 +35,17 @@ export interface DigestEntry {
permission: string;
/** Whether the service pages itself — decides who applies limit/offset. */
paginates: boolean;
+ /** How the result reports failure, when it is not PostgREST's `{ data, error }`
+ * (`envelope`) or a plain value. */
+ result?: string;
+ /** Positional params filled from a context value of a different name
+ * (`updatedBy=userId`). Absent when every context param is its own source. */
+ context?: string;
/** How create is told from update: the key fields, or `table(columns)` for
* each row the dispatcher looks up. Absent when the service does not branch. */
upsert?: string;
+ /** When published defaults are filled: `always`, or `create` for an upsert. */
+ defaults?: string;
}
export interface ManifestDigest {
@@ -102,6 +110,16 @@ function describeUpsert(upsert: NonNullable<ManifestEntry["upsert"]>): string {
.join("|");
}
+function describeContext(tool: ManifestEntry): string {
+ return tool.serviceParams
+ .filter((name) => {
+ const source = tool.contextParams[name];
+ return source !== undefined && source !== name;
+ })
+ .map((name) => `${name}=${tool.contextParams[name]}`)
+ .join(",");
+}
+
export function buildManifestDigest(tools: ManifestEntry[]): ManifestDigest {
return {
totalTools: tools.length,
@@ -121,7 +139,12 @@ export function buildManifestDigest(tools: ManifestEntry[]): ManifestDigest {
? `${t.permission.module}:${[...t.permission.actions].sort().join("+")}`
: "none",
paginates: t.paginates,
- ...(t.upsert ? { upsert: describeUpsert(t.upsert) } : {})
+ ...(t.resultShape === "envelopes" || t.resultShape === "flag"
+ ? { result: t.resultShape }
+ : {}),
+ ...(describeContext(t) ? { context: describeContext(t) } : {}),
+ ...(t.upsert ? { upsert: describeUpsert(t.upsert) } : {}),
+ ...(t.defaults ? { defaults: t.defaults } : {})
}))
};
}
@@ -180,6 +203,11 @@ export function formatDigestDiff(diff: DigestDiff): string {
if (before.upsert !== after.upsert) {
parts.push(`upsert ${before.upsert ?? "none"} → ${after.upsert ?? "none"}`);
}
+ if (before.defaults !== after.defaults) {
+ parts.push(
+ `defaults ${before.defaults ?? "none"} → ${after.defaults ?? "none"}`
+ );
+ }
if (before.schema !== after.schema) parts.push("input schema changed");
if (before.response !== after.response) {
if (before.response === "none") parts.push("response added");
diff --git a/scripts/lib/response-schema.ts b/scripts/lib/response-schema.ts
index 1b35596467..9852afb81a 100644
--- a/scripts/lib/response-schema.ts
+++ b/scripts/lib/response-schema.ts
@@ -16,7 +16,10 @@
* schema, ~10s to walk. The manifest grows 1.3 -> 1.6 MB, and it is gitignored.
*/
+import type { ResultShape } from "@carbon/api";
import { Node, type Type } from "ts-morph";
+import { MCP_EXPOSURE_TAG } from "../../apps/erp/app/routes/api+/mcp+/lib/mcp-exposure";
+import { resultShapeOf } from "./result-shape";
import type { ServiceAst } from "./service-ast";
export type JsonSchema = Record<string, unknown>;
@@ -126,6 +129,16 @@ export function typeToJsonSchema(
items: element ? typeToJsonSchema(element, at, depth + 1, seen) : {}
};
}
+ // A tuple or a readonly array is a list on the wire too. Neither is
+ // `isArray()`, so both fell through to the object walk and came out as a map
+ // (`typeof riskStatus`, an `as const` list, read as `Record<string, status>`).
+ if (type.isTuple() || type.isReadonlyArray()) {
+ const element = type.getNumberIndexType();
+ return {
+ type: "array",
+ items: element ? typeToJsonSchema(element, at, depth + 1, seen) : {}
+ };
+ }
if (type.isUnion()) return unionToJsonSchema(type, at, depth, seen);
@@ -258,6 +271,8 @@ function dedupe(schemas: JsonSchema[]): JsonSchema[] {
export interface ResponseSchemaIndex {
/** `{module}_{fn}` → response schema, absent when nothing useful was derived. */
get(module: string, functionName: string): JsonSchema | null;
+ /** How the function reports failure in its result (`resultShapeOf`). */
+ shape(module: string, functionName: string): ResultShape;
readonly stats: { functions: number; derived: number; empty: number };
}
@@ -279,11 +294,18 @@ export function buildResponseSchemaIndex(ast: ServiceAst): ResponseSchemaIndex {
ast.project.resolveSourceFileDependencies();
const schemas = new Map<string, JsonSchema>();
+ const shapes = new Map<string, ResultShape>();
const stats = { functions: 0, derived: 0, empty: 0 };
+ const checker = ast.project.getTypeChecker().compilerObject;
for (const mod of ast.modules.values()) {
for (const fn of mod.functions) {
stats.functions++;
+ // Only a tool's result is read by dispatch; an unpublished helper may
+ // return whatever it likes.
+ if (fn.tags.some((tag) => `@${tag.name}` === MCP_EXPOSURE_TAG)) {
+ shapes.set(fn.toolName, resultShapeOf(checker, fn));
+ }
let schema: JsonSchema;
try {
schema = typeToJsonSchema(
@@ -307,6 +329,9 @@ export function buildResponseSchemaIndex(ast: ServiceAst): ResponseSchemaIndex {
get(module, functionName) {
return schemas.get(`${module}_${functionName}`) ?? null;
},
+ shape(module, functionName) {
+ return shapes.get(`${module}_${functionName}`) ?? "plain";
+ },
stats
};
}
diff --git a/scripts/lib/result-shape.ts b/scripts/lib/result-shape.ts
new file mode 100644
index 0000000000..5f658b70dd
--- /dev/null
+++ b/scripts/lib/result-shape.ts
@@ -0,0 +1,80 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Carbon (github.com/crbnos/carbon). Modified or adapted versions of this file,
+// including ports, remain AGPLv3; serving them over a network requires releasing their source.
+
+/**
+ * How a service reports failure in the value it returns.
+ *
+ * A service does not throw: it returns what happened, and dispatch has to read
+ * it. Dispatch used to read exactly one shape, `{ data, error }`, so a result
+ * that carried its `error` any other way went back to the caller as a success
+ * with the error inside it. The shape is read here off the declared return type
+ * by the checker, recorded in the manifest, and followed by `dispatchOperation`:
+ *
+ * - `envelope` an object with an `error` member — PostgREST's response, or a
+ * hand-built `{ error }` with or without `data`.
+ * - `envelopes` a list of those — a `Promise.all` of writes.
+ * - `flag` an object that says `ok` / `success` and carries no `error`.
+ * - `plain` none of the above: the value is the result.
+ *
+ * A return type dispatch could not read unambiguously fails generation.
+ */
+import { ts } from "ts-morph";
+import type { ResultShape } from "@carbon/api";
+import type { ServiceFunction } from "./service-ast";
+
+type MemberKind = "envelope" | "flag" | "plain";
+
+const NULLISH =
+ ts.TypeFlags.Null | ts.TypeFlags.Undefined | ts.TypeFlags.Void;
+
+function members(type: ts.Type): ts.Type[] {
+ const all = type.isUnion() ? type.types : [type];
+ return all.filter((member) => !(member.flags & NULLISH));
+}
+
+function memberKind(checker: ts.TypeChecker, type: ts.Type): MemberKind {
+ if (!(type.flags & ts.TypeFlags.Object)) return "plain";
+ const names = new Set(
+ checker.getPropertiesOfType(type).map((property) => property.getName())
+ );
+ // PostgREST's response has both `error` and `success`; `error` decides.
+ if (names.has("error")) return "envelope";
+ if (names.has("ok") || names.has("success")) return "flag";
+ return "plain";
+}
+
+export function resultShapeOf(
+ checker: ts.TypeChecker,
+ fn: Pick<ServiceFunction, "node" | "toolName">
+): ResultShape {
+ const declared = fn.node.getReturnType().compilerType;
+ // Resolves a Promise and a query builder returned without `await` alike.
+ const awaited = checker.getAwaitedType(declared) ?? declared;
+ const top = members(awaited);
+
+ const isList =
+ top.length === 1 &&
+ (checker.isArrayType(top[0]) || checker.isTupleType(top[0]));
+ const parts = isList
+ ? checker.getTypeArguments(top[0] as ts.TypeReference).flatMap(members)
+ : top;
+ const kinds = new Set(parts.map((part) => memberKind(checker, part)));
+
+ if (kinds.has("envelope") && kinds.has("flag")) {
+ throw new Error(
+ `${fn.toolName} returns both a result with an \`error\` member and one that says \`ok\`/\`success\` without it, so dispatch cannot tell which reports failure. Return one shape.`
+ );
+ }
+ if (isList) {
+ if (kinds.size > 1 || kinds.has("flag")) {
+ throw new Error(
+ `${fn.toolName} returns a list whose items do not all report failure the same way, so dispatch cannot read it. Return a list of \`{ data, error }\` results or a list of plain values.`
+ );
+ }
+ return kinds.has("envelope") ? "envelopes" : "plain";
+ }
+ if (kinds.has("envelope")) return "envelope";
+ if (kinds.has("flag")) return "flag";
+ return "plain";
+}
diff --git a/scripts/lib/service-ast.ts b/scripts/lib/service-ast.ts
index c045e837e5..065a46c416 100644
--- a/scripts/lib/service-ast.ts
+++ b/scripts/lib/service-ast.ts
@@ -34,6 +34,7 @@ import {
type ParameterDeclaration,
Project,
type SourceFile,
+ type Symbol as MorphSymbol,
SymbolFlags,
SyntaxKind
} from "ts-morph";
@@ -383,7 +384,8 @@ function memberName(call: CallExpression): string | undefined {
}
function stringArgument(call: CallExpression): string | undefined {
- const arg = call.getArguments()[0];
+ // `.from("accountingSyncTieOut" as any)`: a cast does not change the name.
+ const arg = unwrap(call.getArguments()[0]);
if (
arg &&
(Node.isStringLiteral(arg) || Node.isNoSubstitutionTemplateLiteral(arg))
@@ -466,6 +468,155 @@ export function dbWrites(fn: ServiceFunctionNode): DbWrite[] {
return writes;
}
+/**
+ * The SQL functions a body calls through `.rpc("name", …)`. A name that is not a
+ * string literal is reported as `null`: the call is there, but which function
+ * it reaches cannot be read.
+ */
+export function rpcCalls(fn: ServiceFunctionNode): Array<string | null> {
+ const names: Array<string | null> = [];
+ for (const call of fn.getDescendantsOfKind(SyntaxKind.CallExpression)) {
+ if (memberName(call) !== "rpc") continue;
+ const callee = unwrap(call.getExpression());
+ if (!callee || !Node.isPropertyAccessExpression(callee)) continue;
+ // The name may sit under a cast: `.rpc("a" as unknown as "b", …)`.
+ const name = unwrap(call.getArguments()[0]);
+ names.push(
+ name &&
+ (Node.isStringLiteral(name) ||
+ Node.isNoSubstitutionTemplateLiteral(name))
+ ? name.getLiteralText()
+ : null
+ );
+ }
+ return names;
+}
+
+export interface ParamFilter {
+ /** The parameter, or a field of it: `jobId`, `args.jobId`. */
+ path: string;
+ table: string;
+ column: string;
+}
+
+/** `jobId` → "jobId", `args.jobId` → "args.jobId", when rooted in one of the function's own parameters. */
+function parameterPath(
+ node: Node | undefined,
+ own: ReadonlySet<Node>
+): string | undefined {
+ const value = unwrap(node);
+ if (!value) return undefined;
+
+ if (Node.isPropertyAccessExpression(value)) {
+ const root = parameterPath(value.getExpression(), own);
+ return root ? `${root}.${value.getName()}` : undefined;
+ }
+ if (!Node.isIdentifier(value)) return undefined;
+
+ const declaration = value.getSymbol()?.getValueDeclaration();
+ if (!declaration) return undefined;
+ if (Node.isParameterDeclaration(declaration)) {
+ return own.has(declaration) ? declaration.getName() : undefined;
+ }
+ // `const { jobId } = args`, or a destructured parameter `({ jobId }: Args)`.
+ if (Node.isBindingElement(declaration)) {
+ const pattern = declaration.getParent();
+ const holder = pattern.getParent();
+ const field = declaration.getPropertyNameNode()?.getText() ?? declaration.getName();
+ if (Node.isParameterDeclaration(holder)) {
+ return own.has(holder) ? `${serviceParamName(holder)}.${field}` : undefined;
+ }
+ if (Node.isVariableDeclaration(holder)) {
+ const root = parameterPath(holder.getInitializer(), own);
+ return root ? `${root}.${field}` : undefined;
+ }
+ }
+ return undefined;
+}
+
+function serviceParamName(param: ParameterDeclaration): string {
+ const nameNode = param.getNameNode();
+ return Node.isObjectBindingPattern(nameNode) ||
+ Node.isArrayBindingPattern(nameNode)
+ ? "destructured"
+ : nameNode.getText();
+}
+
+/** Filters whose column holds values the parameter is comparable with. */
+const COMPARISONS = new Set(["eq", "in", "lte", "gte", "lt", "gt"]);
+
+/**
+ * Where the function compares one of its parameters to a column: a supabase
+ * `.eq("col", param)` / `.in("col", param)`, or a range test
+ * (`.lte("startDate", date)`), on a `.from("table")` chain. It says
+ * what a parameter IS — `jobId` compared to `job.id` is a job's record id — so
+ * a caller (or a test) can supply a value that exists.
+ */
+export function paramFilters(fn: ServiceFunctionNode): ParamFilter[] {
+ const own = new Set<Node>(fn.getParameters());
+ const filters: ParamFilter[] = [];
+ for (const call of fn.getDescendantsOfKind(SyntaxKind.CallExpression)) {
+ const name = memberName(call);
+ if (!name || !COMPARISONS.has(name)) continue;
+ const callee = unwrap(call.getExpression());
+ if (!callee || !Node.isPropertyAccessExpression(callee)) continue;
+ const column = stringArgument(call);
+ const root = queryRoot(callee.getExpression());
+ const table = root ? stringArgument(root) : undefined;
+ const path = parameterPath(call.getArguments()[1], own);
+ if (column && table && path) filters.push({ path, table, column });
+ }
+ return filters;
+}
+
+/** Columns that record who wrote a row. */
+const AUDIT_COLUMNS = new Set(["createdBy", "updatedBy"]);
+
+function propertyKey(node: Node): string | undefined {
+ if (Node.isIdentifier(node)) return node.getText();
+ if (Node.isStringLiteral(node) || Node.isNoSubstitutionTemplateLiteral(node)) {
+ return node.getLiteralText();
+ }
+ return undefined;
+}
+
+/**
+ * The function's own parameters that it writes into an audit column: the value
+ * of a `createdBy` / `updatedBy` property, by shorthand (`{ updatedBy }`) or by
+ * name (`{ createdBy: actor }`). Whatever such a parameter is called, the row
+ * says it is who made the write, so the caller is never the one to supply it.
+ */
+export function auditParams(fn: ServiceFunctionNode): string[] {
+ const own = new Set<Node>(fn.getParameters());
+ const found = new Set<string>();
+
+ const record = (symbol: MorphSymbol | undefined) => {
+ const declaration = symbol?.getValueDeclaration();
+ if (
+ declaration &&
+ Node.isParameterDeclaration(declaration) &&
+ own.has(declaration)
+ ) {
+ found.add(declaration.getName());
+ }
+ };
+
+ for (const node of fn.getDescendants()) {
+ if (Node.isShorthandPropertyAssignment(node)) {
+ if (AUDIT_COLUMNS.has(node.getName())) record(node.getValueSymbol());
+ } else if (Node.isPropertyAssignment(node)) {
+ const key = propertyKey(node.getNameNode());
+ if (!key || !AUDIT_COLUMNS.has(key)) continue;
+ const value = unwrap(node.getInitializer());
+ if (value && Node.isIdentifier(value)) record(value.getSymbol());
+ }
+ }
+ return fn
+ .getParameters()
+ .map((p) => p.getName())
+ .filter((name) => found.has(name));
+}
+
/**
* Relations the function names — `.from("t")`, `insertInto("t")`,
* `updateTable("t")`. Reads count: a function that reads one table and writes
diff --git a/scripts/lib/service-metadata.ts b/scripts/lib/service-metadata.ts
index 066782dd3c..a0f9206ba3 100644
--- a/scripts/lib/service-metadata.ts
+++ b/scripts/lib/service-metadata.ts
@@ -24,6 +24,7 @@ import * as path from "path";
import type {
AuthField,
Classification,
+ ContextSource,
ManifestEntry,
PermissionAction,
ToolPermission,
@@ -37,24 +38,34 @@ import {
MCP_VERBS,
type McpVerb
} from "../../apps/erp/app/routes/api+/mcp+/lib/mcp-exposure";
+import type { Node, Type } from "ts-morph";
import {
buildResponseSchemaIndex,
type ResponseSchemaIndex,
+ typeToJsonSchema as reflectType,
} from "./response-schema";
+import {
+ loadSqlFunctionEffects,
+ type SqlFunctionEffects
+} from "../../packages/database/src/sql-effects";
import { getDbEnumValues, getDbTableTypeFields } from "./db-types";
import {
+ auditParams,
branchesOnKeyPresence,
buildServiceAst,
dbWrites,
idDistinguishesUpdate,
namedTables,
+ rpcCalls,
paginates as bodyPaginates,
type ServiceAst,
type ServiceFunction
} from "./service-ast";
import {
+ AUDIT_FIELDS,
buildValidatorRegistry,
CONTEXT_PARAMS,
+ POSITIONAL_CONTEXT,
type ValidatorRegistry,
} from "./validator-registry";
@@ -460,7 +471,13 @@ function typeToJsonSchema(
const base: Record<string, unknown> = {
type: "object",
properties: {
- limit: { type: "integer", default: 100 },
+ // No default: setGenericQueryFilters pages only when it is given a
+ // limit, so one left out means the whole result, as it always has.
+ // Publishing `default: 100` claimed a page size no caller ever got.
+ limit: {
+ type: "integer",
+ description: "Rows per page. Left out, the read is not paged.",
+ },
offset: { type: "integer", default: 0 },
},
};
@@ -473,6 +490,21 @@ function typeToJsonSchema(
...(extra.properties as Record<string, unknown>),
};
}
+ // What the service cannot run without stays required. `getDocuments`
+ // filters on `active` unconditionally, and with it published as optional
+ // a call without it sent `active = undefined` to Postgres. A field that
+ // admits null (`search: string | null`) is left optional: omitting it
+ // says the same thing, and every caller already does.
+ const properties = extra.properties as
+ | Record<string, { type?: unknown }>
+ | undefined;
+ const required = ((extra.required as string[] | undefined) ?? []).filter(
+ (name) => {
+ const type = properties?.[name]?.type;
+ return !(Array.isArray(type) && type.includes("null"));
+ }
+ );
+ if (required.length > 0) base.required = required;
}
return base;
}
@@ -667,11 +699,18 @@ function parseInlineObjectType(
.replace(/;$/, "")
.trim();
+ // A type that admits `undefined` is optional whether or not it is written
+ // with `?`. `assignee: null | undefined` used to publish as required, so a
+ // caller had to send `assignee: null` and every status change cleared it.
+ const admitsUndefined = splitAtTopLevel(fieldType, "|").some(
+ (part) => part.trim() === "undefined"
+ );
+
const fieldSchema = typeToJsonSchema(fieldType, ctx);
properties[fieldName] = description
? { ...fieldSchema, description }
: fieldSchema;
- if (!optional) required.push(fieldName);
+ if (!optional && !admitsUndefined) required.push(fieldName);
}
const schema: Record<string, unknown> = { type: "object", properties };
@@ -961,6 +1000,72 @@ export function withoutAbsentAuditColumns(
return fields.filter((f) => !dropped.includes(f));
}
+/**
+ * The positional params the dispatcher fills from the authenticated context,
+ * and with what.
+ *
+ * `client`, `db`, `userId`, `companyId` and `companyGroupId` are the positional
+ * contract (`POSITIONAL_CONTEXT`). The acting user under any other name is read
+ * from the body: a param the function writes to `createdBy` / `updatedBy`
+ * (`auditParams`) is who made the write, so it is filled with the caller.
+ *
+ * A param NAMED for an audit column that the body is never seen writing to one
+ * fails generation. Published as an ordinary argument it would let a caller name
+ * the author; hidden without a slot, nobody would fill it.
+ */
+export function contextParamsOf(
+ fn: Pick<ServiceFunction, "node" | "params" | "toolName">
+): Record<string, ContextSource> {
+ const actors = new Set(auditParams(fn.node));
+ const named: Record<string, ContextSource> = POSITIONAL_CONTEXT;
+ const out: Record<string, ContextSource> = {};
+ for (const param of fn.params) {
+ if (param.name in named) {
+ out[param.name] = named[param.name];
+ } else if (actors.has(param.name)) {
+ out[param.name] = "userId";
+ } else if ((AUDIT_FIELDS as readonly string[]).includes(param.name)) {
+ throw new Error(
+ `${fn.toolName} takes a positional \`${param.name}\`, but its body is not seen writing it to a createdBy/updatedBy column, so it cannot be filled with the acting user. Name it \`userId\`, or write it to the audit column directly.`
+ );
+ }
+ }
+ return out;
+}
+
+/**
+ * A tool declared `read` may only call SQL functions that read.
+ *
+ * The compiler sees the `.rpc()` call but not the SQL behind it, so a read
+ * that writes through a function went unnoticed: `settings_getNextSequence`
+ * advanced a sequence while published as a READ gated on `settings:view`. The
+ * function's own definition answers it (`sql-effects.ts`, Postgres's parser).
+ * "Cannot tell" refuses too — a read is a promise, not a default.
+ */
+export function assertReadCallsOnlyReads(
+ fn: Pick<ServiceFunction, "node" | "toolName">,
+ effects: Pick<SqlFunctionEffects, "effectOf">
+): void {
+ for (const name of rpcCalls(fn.node)) {
+ if (name === null) {
+ throw new Error(
+ `${fn.toolName} is declared \`${MCP_EXPOSURE_TAG} read\` but calls .rpc() with a name that is not a string literal, so what it runs cannot be read. Name the function, or declare a write verb.`
+ );
+ }
+ const effect = effects.effectOf(name);
+ if (effect.kind === "writes") {
+ throw new Error(
+ `${fn.toolName} is declared \`${MCP_EXPOSURE_TAG} read\` but calls the SQL function ${name}, which writes (${effect.reason}). Declare the verb that says what it does.`
+ );
+ }
+ if (effect.kind === "unknown") {
+ throw new Error(
+ `${fn.toolName} is declared \`${MCP_EXPOSURE_TAG} read\` but calls the SQL function ${name}, and whether that writes cannot be told: ${effect.reason}. Resolve it in packages/database/src/sql-effects.ts, or declare a write verb.`
+ );
+ }
+ }
+}
+
export function withPayloadUserId(
fields: AuthField[],
func: Pick<ServiceFunction, "params">
@@ -972,6 +1077,248 @@ export function withPayloadUserId(
return declaresUserId ? [...fields, "userId"] : fields;
}
+/**
+ * A payload object that declares `companyGroupId` gets it from the caller's
+ * session: the schema never publishes the field, so nobody else can supply
+ * it. Read off the parameter's type, so a named or inferred type counts as
+ * much as an inline one. Every pivot report failed without it — the SQL
+ * function was called with no group at all.
+ */
+export function withPayloadCompanyGroup(
+ fields: AuthField[],
+ func: Pick<ServiceFunction, "node" | "name">
+): AuthField[] {
+ if (fields.includes("companyGroupId")) return fields;
+ let declares = false;
+ for (const param of func.node.getParameters()) {
+ const type = param.getType();
+ // An optional parameter is a union with `undefined`, which is not a shape.
+ const members = (type.isUnion() ? type.getUnionTypes() : [type]).filter(
+ (member) => !member.isUndefined() && !member.isNull()
+ );
+ const declaring = members.filter((member) =>
+ member.getProperty("companyGroupId")
+ );
+ if (declaring.length === 0) continue;
+ // The dispatcher cannot tell the shapes of a union apart, so it stamps all
+ // of them. A shape that does not expect the field would spread it into its
+ // row — `upsertPurchaseOrder`'s update wrote it to a table with no such column.
+ if (declaring.length < members.length) {
+ throw new Error(
+ `${func.name}: only some shapes of \`${param.getName()}\` declare companyGroupId, and the API fills it on all of them. Declare it on each (optional where unused) and keep it out of the row.`
+ );
+ }
+ declares = true;
+ }
+ return declares ? [...fields, "companyGroupId"] : fields;
+}
+
+/** A schema that says nothing about its value (a description aside). */
+function saysNothing(schema: unknown): boolean {
+ return (
+ schema !== null &&
+ typeof schema === "object" &&
+ !Array.isArray(schema) &&
+ Object.keys(schema).every((key) => key === "description")
+ );
+}
+
+/**
+ * `any`, `unknown` and the database's `Json` really are anything. `Json` is
+ * recognised by what it is — a string, a number, a boolean, a list or a map —
+ * because `customFields?: Json` reaches the checker as a flattened union with
+ * the alias gone.
+ */
+function isFreeForm(type: Type): boolean {
+ if (type.isAny() || type.isUnknown()) return true;
+ if (!type.isUnion()) return false;
+ const members = type.getUnionTypes();
+ return (
+ members.some((member) => member.isString()) &&
+ members.some((member) => member.isNumber()) &&
+ members.some((member) => member.isArray()) &&
+ members.some(
+ (member) => member.isObject() && member.getStringIndexType() !== undefined
+ )
+ );
+}
+
+/** The type of `name` on an object type, or on the first shape of a union that has it. */
+function propertyType(type: Type, name: string, at: Node): Type | undefined {
+ const members = type.isUnion() ? type.getUnionTypes() : [type];
+ for (const member of members) {
+ const property = member.getProperty(name);
+ if (property) return property.getTypeAtLocation(at);
+ }
+ return undefined;
+}
+
+function elementType(type: Type): Type | undefined {
+ const members = type.isUnion() ? type.getUnionTypes() : [type];
+ return members.find((member) => member.isArray())?.getArrayElementType();
+}
+
+function typed(schema: unknown, type: Type, at: Node): unknown {
+ if (schema === null || typeof schema !== "object" || Array.isArray(schema)) {
+ return schema;
+ }
+ const node = schema as Record<string, unknown>;
+ if (saysNothing(node)) {
+ return isFreeForm(type) ? node : { ...reflectType(type, at), ...node };
+ }
+ if (node.properties && typeof node.properties === "object") {
+ const properties = node.properties as Record<string, unknown>;
+ for (const [name, property] of Object.entries(properties)) {
+ const inner = propertyType(type, name, at);
+ if (inner) properties[name] = typed(property, inner, at);
+ }
+ }
+ if (node.items && typeof node.items === "object") {
+ const element = elementType(type);
+ if (element) node.items = typed(node.items, element, at);
+ }
+ for (const keyword of ["anyOf", "oneOf"]) {
+ const alternatives = node[keyword];
+ if (Array.isArray(alternatives)) {
+ node[keyword] = alternatives.map((alternative) => typed(alternative, type, at));
+ }
+ }
+ return node;
+}
+
+/**
+ * Describe every argument the schema left blank from the parameter's own
+ * TYPE. The schema is built from the signature's text and the validators, and
+ * what neither resolves — a named row type, a `ReturnType<…>`, an enum from
+ * another module — used to be published as `{}`: an argument with no shape,
+ * which a caller can only guess at (`getDocumentTemplate`'s `documentType` is
+ * one of eleven strings). The type checker knows; only `any`, `unknown` and `Json`
+ * stay blank, because they are.
+ */
+export function describeUntypedArguments(
+ schema: Record<string, unknown>,
+ func: Pick<ServiceFunction, "node">,
+ contextParams: Record<string, unknown>
+): void {
+ const properties = schema.properties as Record<string, unknown> | undefined;
+ if (!properties) return;
+ const params = func.node
+ .getParameters()
+ .filter((param) => !(param.getName() in contextParams));
+ const payload = params.length === 1 ? params[0].getType() : undefined;
+ for (const [name, property] of Object.entries(properties)) {
+ // A flat schema's property is a field of the one payload; otherwise it is
+ // the parameter of that name.
+ const type =
+ (payload && propertyType(payload, name, func.node)) ??
+ params.find((param) => param.getName() === name)?.getType();
+ if (type) properties[name] = typed(property, type, func.node);
+ }
+}
+
+/**
+ * When the dispatcher fills a default the schema publishes. A default is a
+ * promise to the caller: "leave this out and you get X". It can be kept where
+ * the call supplies a whole value — a read's options, a new row, an action's
+ * arguments. On an update a field left out means "leave it alone", so filling
+ * it would overwrite the stored value; and an upsert the dispatcher cannot tell
+ * apart (no rule) might be one.
+ */
+export function defaultsPolicy(
+ verb: McpVerb,
+ upsert: ManifestEntry["upsert"]
+): ManifestEntry["defaults"] {
+ if (verb === "read" || verb === "create" || verb === "action") return "always";
+ if (verb === "upsert" && upsert) return "create";
+ return undefined;
+}
+
+const CREATE_ONLY_NOTE = "Applied when creating; on update a field left out keeps its value.";
+
+/**
+ * Make the schema's defaults say only what the dispatcher does. It fills a
+ * default on an object it was sent, through `properties`, an array's `items`,
+ * and a union's one object (or one array) alternative; one anywhere else
+ * (a union of several objects, a record's values) is never applied, and with
+ * no policy none is. Those are removed, so no schema promises a value the
+ * caller will not get. Returns whether any is left. `withSchemaDefaults` in
+ * the dispatcher is the same walk over a value.
+ */
+export function publishDefaults(
+ schema: Record<string, unknown>,
+ policy: ManifestEntry["defaults"]
+): boolean {
+ let kept = false;
+ const isObject = (value: unknown): value is Record<string, unknown> =>
+ value !== null && typeof value === "object" && !Array.isArray(value);
+
+ const visit = (node: unknown, applied: boolean): void => {
+ if (Array.isArray(node)) {
+ for (const item of node) visit(item, false);
+ return;
+ }
+ if (!isObject(node)) return;
+ if ("default" in node) {
+ if (policy && applied) {
+ kept = true;
+ if (policy === "create") {
+ node.description =
+ typeof node.description === "string" && node.description
+ ? `${node.description} ${CREATE_ONLY_NOTE}`
+ : CREATE_ONLY_NOTE;
+ }
+ } else {
+ delete node.default;
+ }
+ }
+ for (const [keyword, child] of Object.entries(node)) {
+ // Values, not schemas: a default of `{ default: … }` is not a keyword.
+ if (keyword === "default" || keyword === "enum" || keyword === "const") {
+ continue;
+ }
+ if (keyword === "properties" && isObject(child)) {
+ for (const property of Object.values(child)) visit(property, applied);
+ } else if (keyword === "items" && isObject(child)) {
+ visit(child, applied);
+ } else if (
+ (keyword === "anyOf" || keyword === "oneOf") &&
+ Array.isArray(child)
+ ) {
+ for (const kind of ["object", "array"]) {
+ const fitting = child.filter(
+ (alternative) => isObject(alternative) && alternative.type === kind
+ );
+ for (const alternative of fitting) {
+ visit(alternative, applied && fitting.length === 1);
+ }
+ }
+ for (const alternative of child) {
+ if (
+ !isObject(alternative) ||
+ (alternative.type !== "object" && alternative.type !== "array")
+ ) {
+ visit(alternative, false);
+ }
+ }
+ } else {
+ // A record's values, several object alternatives: never filled.
+ visit(child, false);
+ }
+ }
+ };
+
+ // The root is the payload itself, never a property with a default of its own.
+ for (const property of Object.values(
+ isObject(schema.properties) ? schema.properties : {}
+ )) {
+ visit(property, true);
+ }
+ for (const [keyword, child] of Object.entries(schema)) {
+ if (keyword !== "properties") visit(child, false);
+ }
+ return kept;
+}
+
/**
* Delete `pattern` wherever a sibling `format` is present, recursively. zod
* v4's email conversion emits BOTH — `format: "email"` plus a ~200-character
@@ -1142,7 +1489,10 @@ function buildToolSchema(
func: Pick<ServiceFunction, "params">,
ctx: SchemaBuildContext = {}
): { schema: Record<string, unknown>; paramCount: number } {
- const userParams = func.params.filter((p) => !CONTEXT_PARAMS.has(p.name));
+ const context = ctx.contextParams;
+ const userParams = func.params.filter((p) =>
+ context ? !(p.name in context) : !CONTEXT_PARAMS.has(p.name)
+ );
const resolveCtx: TypeResolveContext = { ...ctx };
if (userParams.length === 0) {
@@ -1292,6 +1642,14 @@ function buildToolSchema(
type: "object",
properties: { [param.name]: innerSchema },
};
+ // The wrapper is required exactly when something inside it is.
+ if (
+ Array.isArray(innerSchema.required) &&
+ innerSchema.required.length > 0 &&
+ !param.optional
+ ) {
+ schema.required = [param.name];
+ }
const propCount = Object.keys(
(innerSchema.properties as Record<string, unknown>) || {}
).length;
@@ -1372,6 +1730,9 @@ export type ValidatorResolution = "native" | "unresolved";
/** Per-module state threaded into `buildToolSchema`. */
interface SchemaBuildContext {
module?: string;
+ /** The positional params the dispatcher fills (`contextParamsOf`); they are
+ * left out of the published schema. */
+ contextParams?: Record<string, ContextSource>;
validators?: ValidatorRegistry;
/** Module-local sources for bare type-alias resolution (see `resolveTypeAlias`). */
aliasSources?: string[];
@@ -1392,6 +1753,8 @@ export interface BuildOptions {
validators?: ValidatorRegistry;
/** Reflected response schemas, keyed `{module}_{fn}`. Absent = inputs only. */
responses?: ResponseSchemaIndex;
+ /** What each SQL function does. Absent = `read` tools' rpc calls go unchecked. */
+ sqlEffects?: SqlFunctionEffects;
/** Called once per `z.infer` param with how its schema was resolved. */
onValidatorResolved?: (
toolName: string,
@@ -1468,6 +1831,9 @@ export function buildAllToolMetadata(opts: BuildOptions = {}): ManifestEntry[] {
const classification: Classification = declared.destructive
? "DESTRUCTIVE"
: verb.classification;
+ if (classification === "READ" && opts.sqlEffects) {
+ assertReadCallsOnlyReads(func, opts.sqlEffects);
+ }
// The dispatcher fills one positional argument per parameter from a JSON
// object; a variadic tail has no such slot.
const rest = func.params.find((p) => p.rest);
@@ -1479,14 +1845,17 @@ export function buildAllToolMetadata(opts: BuildOptions = {}): ManifestEntry[] {
// A declared `@mcp audit` states INTENT and wins outright (a ledger row
// keeps `updatedBy` NULL even though the column exists); only the verb's
// own set is checked against the real schema.
- const injectAuth = withPayloadUserId(
- declaredAudit(func) ??
- withoutAbsentAuditColumns(
- ["companyId", ...verb.audit],
- func,
- (table, dropped) =>
- opts.onAuditColumnsDropped?.(toolName, table, dropped)
- ),
+ const injectAuth = withPayloadCompanyGroup(
+ withPayloadUserId(
+ declaredAudit(func) ??
+ withoutAbsentAuditColumns(
+ ["companyId", ...verb.audit],
+ func,
+ (table, dropped) =>
+ opts.onAuditColumnsDropped?.(toolName, table, dropped)
+ ),
+ func
+ ),
func
);
// A JSDoc on the function itself beats the override table (code closest
@@ -1496,17 +1865,20 @@ export function buildAllToolMetadata(opts: BuildOptions = {}): ManifestEntry[] {
DESCRIPTION_OVERRIDES[toolName] ||
generateDescription(func.name);
const serviceParams = func.params.map((p) => p.name);
+ const contextParams = contextParamsOf(func);
const permission: ToolPermission = declaredPermission(func) ?? {
module: mod in PERMISSION_MODULE_MAP ? PERMISSION_MODULE_MAP[mod] : mod,
actions: [...verb.actions]
};
const { schema, paramCount } = buildToolSchema(func, {
module: mod,
+ contextParams,
validators: opts.validators,
aliasSources,
onResolved: (validatorName, how) =>
opts.onValidatorResolved?.(toolName, validatorName, how),
});
+ describeUntypedArguments(schema, func, contextParams);
stripRedundantPatterns(schema);
// A service that picks insert-vs-update by testing for an audit field on
// the payload needs exactly ONE of them stamped. BOTH directions count:
@@ -1514,12 +1886,22 @@ export function buildAllToolMetadata(opts: BuildOptions = {}): ManifestEntry[] {
// `"updatedBy" in` (update-branch first, upsertQuoteMaterial /
// upsertJobMaterial). Which one is decided by the dispatcher from the
// rule recorded here, never by an argument the caller has to supply.
+ // A service that branches some other way (`"id" in payload`) is given
+ // the same rule whenever its type makes `id` decisive. Without one the
+ // dispatcher stamped both audit fields on every call, so an update
+ // through the API rewrote the row's createdBy.
const upsert =
injectAuth.includes("createdBy") &&
branchesOnKeyPresence(func.node, OPERATION_FIELDS)
? upsertRule(func, schema)
- : undefined;
+ : declared.verb === "upsert" &&
+ settingLines(func, "key").length === 0 &&
+ idDistinguishesUpdate(func.node, CONTEXT_PARAMS)
+ ? { keys: ["id"] }
+ : undefined;
if (upsert) describeUpsertKeys(schema, upsert);
+ const defaults = defaultsPolicy(declared.verb, upsert);
+ const publishesDefaults = publishDefaults(schema, defaults);
const responseSchema = opts.responses?.get(mod, func.name) ?? undefined;
@@ -1530,13 +1912,16 @@ export function buildAllToolMetadata(opts: BuildOptions = {}): ManifestEntry[] {
description,
paramCount,
serviceParams,
+ contextParams,
injectAuth,
+ resultShape: opts.responses?.shape(mod, func.name) ?? "plain",
permission,
// Whether the service applies limit/offset itself. A list operation
// that does not ignores pagination args entirely (the fetchAll
// `get*List` reads), so the MCP layer pages the response instead.
paginates: bodyPaginates(func.node),
...(upsert ? { upsert } : {}),
+ ...(defaults && publishesDefaults ? { defaults } : {}),
schema,
...(responseSchema ? { responseSchema } : {}),
});
@@ -1575,6 +1960,7 @@ export async function buildAllToolMetadataWithValidators(
const validators = await buildValidatorRegistry(MODULE_LIST);
const ast = opts.ast ?? buildServiceAst(MODULE_LIST);
const responses = buildResponseSchemaIndex(ast);
+ const sqlEffects = await loadSqlFunctionEffects();
const resolutions: ValidatorResolutionRecord[] = [];
const tools = buildAllToolMetadata({
@@ -1582,6 +1968,7 @@ export async function buildAllToolMetadataWithValidators(
ast,
validators,
responses,
+ sqlEffects,
onValidatorResolved: (toolName, validatorName, how) => {
resolutions.push({ toolName, validatorName, how });
opts.onValidatorResolved?.(toolName, validatorName, how);
diff --git a/scripts/lib/validator-registry.ts b/scripts/lib/validator-registry.ts
index 270d8d2e25..fa2297a775 100644
--- a/scripts/lib/validator-registry.ts
+++ b/scripts/lib/validator-registry.ts
@@ -11,6 +11,7 @@
* here and the result is handed in as data.
*/
+import type { ContextSource } from "@carbon/api";
import type { z } from "zod";
import { createValidatorLoader, isZodSchema } from "./validator-loader";
import {
@@ -24,21 +25,33 @@ import {
* because forms submit them, but publishing them in the manifest would invite a
* caller to set `companyId`.
*
+ * `POSITIONAL_CONTEXT` is the positional contract: a service parameter with one
+ * of these names is that context value, and `service-metadata.ts` records it in
+ * the manifest for the dispatcher to follow.
+ *
* Shared with `service-metadata.ts`, which strips the same set from a service's
* own parameter list, 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",
+export const POSITIONAL_CONTEXT = {
+ client: "client",
+ eliminationClient: "client",
+ db: "db",
+ companyId: "companyId",
+ userId: "userId",
+ companyGroupId: "companyGroupId",
+} as const satisfies Record<string, ContextSource>;
+
+/** The audit columns. As a payload FIELD either is stamped by the dispatcher;
+ * as a positional PARAM it is the acting user only when the body is seen
+ * writing it to that column (`contextParamsOf`). */
+export const AUDIT_FIELDS = ["createdBy", "updatedBy"] as const;
+
+export const CONTEXT_PARAMS = new Set<string>([
+ ...Object.keys(POSITIONAL_CONTEXT),
+ ...AUDIT_FIELDS,
]);
/** A module whose validators are reused across modules when a local lookup misses. */
diff --git a/turbo.json b/turbo.json
index c7be377f71..2f38e59e25 100644
--- a/turbo.json
+++ b/turbo.json
@@ -87,6 +87,7 @@
"apps/erp/tsconfig.json",
"packages/{api,database,documents,files,locale,logger,notifications,printing,utils}/src/**",
"packages/database/supabase/functions/shared/**",
+ "packages/database/supabase/migrations/**",
"scripts/generate-mcp.ts",
"scripts/lib/**"
],