@agentforge-io/sdk-server 4.36.0 → 4.37.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.
- package/dist/resources/cases.d.ts +7 -0
- package/dist/resources/cases.js +9 -0
- package/dist/types.d.ts +19 -1
- package/package.json +1 -1
|
@@ -7,6 +7,13 @@ export declare class CasesResource {
|
|
|
7
7
|
list(input?: ListCasesInput): Promise<CaseView[]>;
|
|
8
8
|
/** `GET /api/v1/cases/:id` — 404 when it is not this workspace's. */
|
|
9
9
|
get(caseId: string): Promise<CaseView>;
|
|
10
|
+
/**
|
|
11
|
+
* `POST /api/v1/cases/:id/weigh` — AGF-UNITS U3: what a line sold by value
|
|
12
|
+
* («$3.000 de queso») really weighed, in the product's unit (`line` = the
|
|
13
|
+
* receipt line's `weigh`). Corrects the stock, never the price; the receipt
|
|
14
|
+
* then says it was weighed.
|
|
15
|
+
*/
|
|
16
|
+
weighLine(caseId: string, line: string, weight: number): Promise<CaseView>;
|
|
10
17
|
/**
|
|
11
18
|
* `POST /api/v1/cases/:id/transition` — the business moves a case:
|
|
12
19
|
* `accepted` / `rejected` from `submitted`, then the type's states,
|
package/dist/resources/cases.js
CHANGED
|
@@ -29,6 +29,15 @@ class CasesResource {
|
|
|
29
29
|
async get(caseId) {
|
|
30
30
|
return this.client.request('GET', `/api/v1/cases/${encodeURIComponent(caseId)}`);
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* `POST /api/v1/cases/:id/weigh` — AGF-UNITS U3: what a line sold by value
|
|
34
|
+
* («$3.000 de queso») really weighed, in the product's unit (`line` = the
|
|
35
|
+
* receipt line's `weigh`). Corrects the stock, never the price; the receipt
|
|
36
|
+
* then says it was weighed.
|
|
37
|
+
*/
|
|
38
|
+
async weighLine(caseId, line, weight) {
|
|
39
|
+
return this.client.request('POST', `/api/v1/cases/${encodeURIComponent(caseId)}/weigh`, { line, weight });
|
|
40
|
+
}
|
|
32
41
|
/**
|
|
33
42
|
* `POST /api/v1/cases/:id/transition` — the business moves a case:
|
|
34
43
|
* `accepted` / `rejected` from `submitted`, then the type's states,
|
package/dist/types.d.ts
CHANGED
|
@@ -1091,6 +1091,15 @@ export interface CatalogSaleRule {
|
|
|
1091
1091
|
step?: number;
|
|
1092
1092
|
/** Fewest units of the product's unit per line. */
|
|
1093
1093
|
min?: number;
|
|
1094
|
+
/**
|
|
1095
|
+
* AGF-UNITS U3 — also sold by value («3000 de queso»): a line may be an
|
|
1096
|
+
* amount of money (cents), at least `min`, on `step`. The customer pays the
|
|
1097
|
+
* amount; the measure is estimated from the price. Measure only.
|
|
1098
|
+
*/
|
|
1099
|
+
value?: {
|
|
1100
|
+
min: number;
|
|
1101
|
+
step: number;
|
|
1102
|
+
};
|
|
1094
1103
|
}
|
|
1095
1104
|
/** AGF-UNITS U1 — a unit of measure: standard (unidad, kg, libra, litro, metro, caja…) or the business's own. */
|
|
1096
1105
|
export interface CatalogUnit {
|
|
@@ -2031,6 +2040,12 @@ export interface CaseReceiptLine {
|
|
|
2031
2040
|
unit?: string;
|
|
2032
2041
|
/** AGF-UNITS U2 — sold by measure: `qty` is in `unit` (0.75 lb), not a count of items. */
|
|
2033
2042
|
measured?: boolean;
|
|
2043
|
+
/** AGF-UNITS U3 — sold by value: the line costs this (cents); `qty` is the measure it buys (an estimate). */
|
|
2044
|
+
amountCents?: number;
|
|
2045
|
+
/** A value line the business can weigh: pass it to `cases.weighLine`. */
|
|
2046
|
+
weigh?: string;
|
|
2047
|
+
/** The business typed its real weight: `qty` is that, not an estimate. */
|
|
2048
|
+
weighed?: boolean;
|
|
2034
2049
|
/** AGF-MENU-OPTIONS M2 — the options chosen; `unitCents` already includes them. */
|
|
2035
2050
|
options?: Array<{
|
|
2036
2051
|
group: string;
|
|
@@ -2110,8 +2125,11 @@ export interface CreateDirectOrderInput {
|
|
|
2110
2125
|
* product with option groups (AGF-MENU-OPTIONS M2; a required group left out → 400). */
|
|
2111
2126
|
lines: Array<{
|
|
2112
2127
|
productId: string;
|
|
2113
|
-
/** In the product's unit: whole for products sold by unit, a measure on the product's step (0.5 lb) otherwise.
|
|
2128
|
+
/** In the product's unit: whole for products sold by unit, a measure on the product's step (0.5 lb) otherwise.
|
|
2129
|
+
* Ignored (send 0) with `amountCents`. */
|
|
2114
2130
|
quantity: number;
|
|
2131
|
+
/** AGF-UNITS U3 — sold by value («$3.000 de queso»): the amount in cents instead of a quantity; its own line. */
|
|
2132
|
+
amountCents?: number;
|
|
2115
2133
|
options?: CatalogOptionChoice[];
|
|
2116
2134
|
}>;
|
|
2117
2135
|
/** The order type's other fields (entrega, direccion, notas…), by key. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.37.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",
|