@cutoptim/engine 1.3.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -402,6 +402,10 @@ export interface Part2D {
402
402
  meta?: Record<string, unknown>;
403
403
  /** The row's id, so a `matchedSets` layout can name it. Any JSON value is accepted here. Only an id a set REFERS TO is checked: it must be a non-empty string of printable characters, at most 64 long, or a safe integer (`7` and `"7"` are the same id), and it must be on exactly one part. Every other id is ignored, whatever it holds (a float, an object, null, repeated, long, empty): always without a non-empty `matchedSets`, and on the rows no set names with one — so an ERP article number is safe to send. */
404
404
  id?: unknown;
405
+ /** QR payload template for every copy of this row: returned resolved in `labels[].qr` and printed as a QR code (error correction level M) on each of the row's labels in `labelsPdf`. Exactly two tokens are filled in: `{piece}` (the copy, 1-based — the `k` of the `k/n` printed on the label) and `{of}` (the row's `qty`); any other `{…}` stays as sent. At most 300 UTF-8 bytes once filled in, printable characters only (no control characters); not together with `qrs`. A wrong value is a 400 `invalid_request` naming the field, before any quota is used. Metadata only: it never changes the plan or `planHash`. On a small label format a long payload can print below 0.4 mm per module, and `warnings` then says so. 2D only. */
406
+ qr?: string;
407
+ /** One QR payload per copy of this row, used verbatim: copy `k` (the `k/n` printed on its label) gets entry `k`, in `labels[].qr` and on `labelsPdf`. Exactly `qty` entries (`qty` defaults to 1), each 1 to 300 UTF-8 bytes of printable characters; not together with `qr`. A wrong value is a 400 `invalid_request` naming the field, before any quota is used. 2D only. */
408
+ qrs?: Array<string>;
405
409
  }
406
410
  /** Parts cut out of ONE piece of board, side by side or one above the other, exactly one kerf apart, so the figure of the veneer runs on across them (a drawer front over two doors). The set travels through the optimizer as one rectangle — the block — and comes back as its members. Every refusal is a 400 before the quota is reserved; a size mismatch is a warning (`matchedSets[].warnings`), not an error. At most 24 members per set; a part can be in one set only. Engines `heuristic` and `balanced` (which does not rank `priority`, so under `respectStock` a set can lose its place there); `max` refuses a request with sets (400 `details.unsupported`). */
407
411
  export interface MatchedSet {
@@ -477,6 +481,44 @@ export interface Options2D {
477
481
  effort?: "fast" | "balanced";
478
482
  /** A boolean. With `matchedSets` and the `svg` export: draw the dashed frame and the "SET A" badge of every set instance, in ONE separate group (`<g id="matched-sets" data-role="annotation">`) a laser or CNC import can drop in one move. `false` leaves that group out (the position codes in the part labels stay). Read only in a request with sets — there a value other than `true`, `false` or `null` is a 400; without sets the field is ignored, whatever it holds. */
479
483
  setOutlines?: boolean;
484
+ labels?: LabelOptions;
485
+ }
486
+ /** Label settings — the same settings as the Label format panel of the CutOptim app, under these names. They shape `labelsPdf` and add `piece`, `of`, `sheetNo`, `stockRow` and `sheetMeta` to every `labels[]` entry. Every field is optional; `{}` is valid and only adds those fields. Absent: the label PDF is the A4 sheet and `labels[]` is exactly as without this object. Validated STRICTLY, unlike the rest of `options`: an unknown key, a wrong type or a value out of range is a 400 `invalid_request` with `details.path`, before any call is counted (also on `/v1/validate/2d`). `null` for a field means the field is absent. Sent without `include` `labels` or `labelsPdf`, it changes nothing and the answer says so in `warnings`. 2D only. */
487
+ export interface LabelOptions {
488
+ /** `sheet` = the A4 sheet of labels (3 columns); `roll` = one label per page, `width` × `height` mm, for a label printer; `apli-03056` = APLI 03056 sheets (24 labels of 64.6 × 33.9 mm on A4, 3 × 8); `brother-dk-11201` = Brother DK-11201 roll labels (29 × 90 mm, one per page). */
489
+ format?: "sheet" | "roll" | "apli-03056" | "brother-dk-11201";
490
+ /** Label width in mm, `roll` only. */
491
+ width?: number;
492
+ /** Label height in mm, `roll` only. */
493
+ height?: number;
494
+ offset?: LabelOffset;
495
+ /** Size of the dimension text on the label. */
496
+ dimSize?: "normal" | "large" | "xl";
497
+ /** Print the part number, top left and largest: the 1-based row of the FIRST `parts` row with that name (rows sharing a name share a number; with unique names it equals `labels[].partNo`). */
498
+ partNo?: boolean;
499
+ /** `input` = labels in `parts` order; `cut` = sheet by sheet, in the order the saw plan frees the pieces. */
500
+ order?: "input" | "cut";
501
+ /** Work stages printed as a row of circles to tick off by pen; empty or absent = no row. Each entry is a built-in key — `rc` (rough cut), `c2s` (cut to size), `eb` (edge banded, printed only on a banded part), `s` (sanded), `d` (drilled, not printed yet) — or free text of at most 6 characters, printed as sent (keys are lower case: `RC` is free text). Spaces are trimmed; printable characters only. */
502
+ stages?: Array<string>;
503
+ /** Your own word for a built-in stage key, at most 6 characters; empty or absent = the English abbreviation (RC, C2S, EB, S, D). */
504
+ stageWords?: {
505
+ rc?: string;
506
+ c2s?: string;
507
+ eb?: string;
508
+ s?: string;
509
+ d?: string;
510
+ };
511
+ /** Mark FE on the edges of a piece that lie on a sheet edge with no `trim` on that side (the board's factory edge). */
512
+ factoryEdges?: boolean;
513
+ /** Print the "hidden side" mark. */
514
+ hiddenFaceHint?: boolean;
515
+ /** Print only the labels of these part numbers (the numbers `partNo` prints), e.g. to re-print after sanding. Empty or absent = all. */
516
+ parts?: Array<number>;
517
+ }
518
+ /** Printer offset in mm: moves everything printed on the label right (`x`) and down (`y`); negative values move it back. Applied rounded to 0.1 mm. */
519
+ export interface LabelOffset {
520
+ x?: number;
521
+ y?: number;
480
522
  }
481
523
  export interface Optimize2DRequest {
482
524
  parts: Array<Part2D>;
@@ -835,6 +877,18 @@ export interface Label2D {
835
877
  };
836
878
  /** Opaque JSON object (any keys) echoed back VERBATIM on the matching output (a part's meta on every placed piece of it; a stock row's meta on every sheet/rod cut from it). Attach ERP article numbers, order-line ids, customer refs to reconcile the cut plan with your system. Never parsed, never affects placement. Part meta follows its request row: the meta of each row lands on exactly its qty of placed pieces, even when rows share a name; stock meta by stock-row order. */
837
879
  meta?: Record<string, unknown>;
880
+ /** Which copy of its `parts` row this piece is, 1-based, counted in plan order (sheet, then placement). Present only when the request sends `options.labels`. */
881
+ piece?: number;
882
+ /** The `qty` of its `parts` row (the label prints `piece/of`). Present only when the request sends `options.labels`. */
883
+ of?: number;
884
+ /** The sheet number printed on the label: `sheet` + 1. Present only when the request sends `options.labels`. */
885
+ sheetNo?: number;
886
+ /** Index into the request `stock` array of the row this sheet was cut from. Present only when the request sends `options.labels`. */
887
+ stockRow?: number;
888
+ /** The `meta` of that stock row, verbatim (the same as `sheets[sheet].meta`). Present only when the request sends `options.labels` and the stock row has `meta`. */
889
+ sheetMeta?: Record<string, unknown>;
890
+ /** The resolved QR payload of this copy (`parts[].qr` with `{piece}` / `{of}` filled in, or its `parts[].qrs` entry) — the text the code on `labelsPdf` encodes. Present only when its `parts` row sends `qr` or `qrs`. */
891
+ qr?: string;
838
892
  }
839
893
  /** Linear metres of edge banding the order consumes, grouped by the caller-supplied type reference and reported per part AND as an order total. Present ONLY when at least one part requested banding, so a banding-free response omits the key. Exact geometry, no waste margin — the workshop adds its own. ⚠️ The metres ASSUME MILLIMETRE input: top and bottom edges run the part width, left and right run the height, multiplied by qty, divided by 1000. This is the one response figure named for a unit (edge banding is bought by the metre, and the division only means metres in millimetres); in another unit the raw edge length is w/h × qty and these numbers are that divided by 1000. 2D only. */
840
894
  export interface EdgeBanding {
package/dist/types.gen.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // GENERATED by scripts/gen-sdks.ts from the CutOptim Engine API OpenAPI document — DO NOT EDIT.
2
- // contract 1 · spec sha256 e29a45d3c07667cf676ceb46a7c24ec3203683e50f72ba25f0677ac4af140c71 · @cutoptim/engine 1.3.0
2
+ // contract 1 · spec sha256 57abd7b68ca9e86fe7040dd2e979516274a2bdea5394258959f21bbefc28f624 · @cutoptim/engine 1.5.0
3
3
  export {};
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.3.0";
1
+ export declare const VERSION = "1.5.0";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // The package version — rewritten by scripts/gen-sdks.ts together with package.json (sent as the User-Agent).
2
- export const VERSION = '1.3.0';
2
+ export const VERSION = '1.5.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cutoptim/engine",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "description": "Official client for the CutOptim Engine API — cutting optimization (2D panels, 1D linear, timber, true-shape nesting) over HTTPS.",
5
5
  "license": "MIT",
6
6
  "author": "CutOptim <support@cutoptim.com>",