@agentforge-io/sdk-server 4.62.0 → 4.63.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.
@@ -34,6 +34,20 @@ export declare class CasesResource {
34
34
  * then says it was weighed.
35
35
  */
36
36
  weighLine(caseId: string, line: string, weight: number): Promise<CaseView>;
37
+ /**
38
+ * `POST /api/v1/cases/:id/lines/takeaway` — PDK-BUG-006: while dispatching, the team marks ONE
39
+ * line of a sent order «para llevar» (`takeaway: true`) or back to eaten here (`false`);
40
+ * `key` is the receipt line's `key`. Internal packing info: it is not a proposal, the customer
41
+ * is not told, the receipt keeps its revision and the price does not change. The same value
42
+ * is a no-op. The line takes another `key` (read the receipt again); a line of the same
43
+ * product and choice already in the other state absorbs it (one line, quantities added).
44
+ * Returns the updated case (`receipt.allTakeaway` follows). 400 closed or still-edited order,
45
+ * 404 unknown line, 409 a proposal is waiting (withdraw it first).
46
+ */
47
+ setLineTakeaway(caseId: string, input: {
48
+ key: string;
49
+ takeaway: boolean;
50
+ }): Promise<CaseView>;
37
51
  /**
38
52
  * `POST /api/v1/cases/:id/proposal` — AGF-PDK-DISPATCH-PROPOSAL: the business proposes
39
53
  * changes while picking (a line out of stock, another product in its place; lines by
@@ -69,6 +69,19 @@ class CasesResource {
69
69
  async weighLine(caseId, line, weight) {
70
70
  return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/weigh`, { line, weight });
71
71
  }
72
+ /**
73
+ * `POST /api/v1/cases/:id/lines/takeaway` — PDK-BUG-006: while dispatching, the team marks ONE
74
+ * line of a sent order «para llevar» (`takeaway: true`) or back to eaten here (`false`);
75
+ * `key` is the receipt line's `key`. Internal packing info: it is not a proposal, the customer
76
+ * is not told, the receipt keeps its revision and the price does not change. The same value
77
+ * is a no-op. The line takes another `key` (read the receipt again); a line of the same
78
+ * product and choice already in the other state absorbs it (one line, quantities added).
79
+ * Returns the updated case (`receipt.allTakeaway` follows). 400 closed or still-edited order,
80
+ * 404 unknown line, 409 a proposal is waiting (withdraw it first).
81
+ */
82
+ async setLineTakeaway(caseId, input) {
83
+ return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/lines/takeaway`, { key: input.key, takeaway: input.takeaway });
84
+ }
72
85
  /**
73
86
  * `POST /api/v1/cases/:id/proposal` — AGF-PDK-DISPATCH-PROPOSAL: the business proposes
74
87
  * changes while picking (a line out of stock, another product in its place; lines by
package/dist/types.d.ts CHANGED
@@ -2269,6 +2269,8 @@ export interface CaseView {
2269
2269
  token: string;
2270
2270
  issuedAt: string;
2271
2271
  revision: number;
2272
+ /** PDK-BUG-006 — every product line of the receipt is to go (`takeaway`). Absent/false on mixed or eat-here orders, older receipts and older platforms. */
2273
+ allTakeaway?: boolean;
2272
2274
  } | null;
2273
2275
  /** What the customer asked after the business took the case (change, cancel), until the business moves it. */
2274
2276
  customerRequest: {
@@ -2411,6 +2413,9 @@ export interface CaseReceiptLine {
2411
2413
  name: string;
2412
2414
  deltaCents: number;
2413
2415
  }>;
2416
+ /** PDK-BUG-006 — the line is to go (packed for takeaway). Present only when `true`; absent means
2417
+ * eaten here, and also on receipts issued before this flag or by an older platform. */
2418
+ takeaway?: true;
2414
2419
  /** AGF-PDK-DISPATCH-PROPOSAL — the line's identity (product + choice): what `cases.propose` names.
2415
2420
  * Absent on an older platform. */
2416
2421
  key?: string;
@@ -2606,6 +2611,9 @@ export interface CreateDirectOrderInput {
2606
2611
  /** AGF-UNITS U3 — sold by value («$3.000 de queso»): the amount in cents instead of a quantity; its own line. */
2607
2612
  amountCents?: number;
2608
2613
  options?: CatalogOptionChoice[];
2614
+ /** PDK-BUG-006 — this line is to go (packed for takeaway). Boolean only; `false`/absent = eaten here.
2615
+ * The same product + options with another `takeaway` is a separate line. No packaging charge. */
2616
+ takeaway?: boolean;
2609
2617
  }>;
2610
2618
  /** The order type's other fields (entrega, direccion, notas…), by key. */
2611
2619
  fields?: Record<string, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/sdk-server",
3
- "version": "4.62.0",
3
+ "version": "4.63.0",
4
4
  "description": "Server-side SDK for backend apps integrating with AgentForge platform. Auth via ChatToken, ak_live_ API key or App secret (sk_live_), with App installations across tenants.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",