@agentforge-io/sdk-server 4.36.0 → 4.38.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 +29 -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 {
|
|
@@ -1289,6 +1298,8 @@ export interface CatalogFileMapping {
|
|
|
1289
1298
|
image?: string;
|
|
1290
1299
|
/** The template's "tipo" column (product | service). */
|
|
1291
1300
|
kind?: string;
|
|
1301
|
+
/** AGF-UNITS — the unit of measure column («unidad»: kg, libra, caja, canasta…). Blank cells = unidades. */
|
|
1302
|
+
unit?: string;
|
|
1292
1303
|
}
|
|
1293
1304
|
export interface CatalogFilePlan {
|
|
1294
1305
|
willCreate: number;
|
|
@@ -1296,6 +1307,8 @@ export interface CatalogFilePlan {
|
|
|
1296
1307
|
unchanged: number;
|
|
1297
1308
|
skipped: number;
|
|
1298
1309
|
categoriesToCreate: string[];
|
|
1310
|
+
/** AGF-UNITS — units the file writes that the business does not have yet: the import creates them as its own. */
|
|
1311
|
+
unitsToCreate?: string[];
|
|
1299
1312
|
}
|
|
1300
1313
|
export interface CatalogFilePreview {
|
|
1301
1314
|
headers: string[];
|
|
@@ -1314,6 +1327,8 @@ export interface CatalogFileApplyResult {
|
|
|
1314
1327
|
skipped: number;
|
|
1315
1328
|
unchanged: number;
|
|
1316
1329
|
categoriesCreated: string[];
|
|
1330
|
+
/** AGF-UNITS — the business's own units the import created. */
|
|
1331
|
+
unitsCreated?: string[];
|
|
1317
1332
|
photosImported: number;
|
|
1318
1333
|
warnings: string[];
|
|
1319
1334
|
}
|
|
@@ -1338,6 +1353,8 @@ export interface CatalogMenuItem {
|
|
|
1338
1353
|
priceDeltaCents: number;
|
|
1339
1354
|
}>;
|
|
1340
1355
|
}>;
|
|
1356
|
+
/** AGF-UNITS — what the price is per, when the menu says it («libra», «kg»); absent = unidad. */
|
|
1357
|
+
unit?: string;
|
|
1341
1358
|
}
|
|
1342
1359
|
export interface CatalogMenuReadInput {
|
|
1343
1360
|
/** The pasted menu, or a note to go with the file. */
|
|
@@ -1404,6 +1421,8 @@ export interface CatalogImportColumnMapping {
|
|
|
1404
1421
|
* other value → product with a warning. Optional; omit for sources
|
|
1405
1422
|
* without such a column. */
|
|
1406
1423
|
kind?: string;
|
|
1424
|
+
/** AGF-UNITS — the unit of measure column («unidad»). Optional; blank cells = unidades. */
|
|
1425
|
+
unit?: string;
|
|
1407
1426
|
}
|
|
1408
1427
|
export interface CatalogImportRunResult {
|
|
1409
1428
|
created: number;
|
|
@@ -2031,6 +2050,12 @@ export interface CaseReceiptLine {
|
|
|
2031
2050
|
unit?: string;
|
|
2032
2051
|
/** AGF-UNITS U2 — sold by measure: `qty` is in `unit` (0.75 lb), not a count of items. */
|
|
2033
2052
|
measured?: boolean;
|
|
2053
|
+
/** AGF-UNITS U3 — sold by value: the line costs this (cents); `qty` is the measure it buys (an estimate). */
|
|
2054
|
+
amountCents?: number;
|
|
2055
|
+
/** A value line the business can weigh: pass it to `cases.weighLine`. */
|
|
2056
|
+
weigh?: string;
|
|
2057
|
+
/** The business typed its real weight: `qty` is that, not an estimate. */
|
|
2058
|
+
weighed?: boolean;
|
|
2034
2059
|
/** AGF-MENU-OPTIONS M2 — the options chosen; `unitCents` already includes them. */
|
|
2035
2060
|
options?: Array<{
|
|
2036
2061
|
group: string;
|
|
@@ -2110,8 +2135,11 @@ export interface CreateDirectOrderInput {
|
|
|
2110
2135
|
* product with option groups (AGF-MENU-OPTIONS M2; a required group left out → 400). */
|
|
2111
2136
|
lines: Array<{
|
|
2112
2137
|
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.
|
|
2138
|
+
/** In the product's unit: whole for products sold by unit, a measure on the product's step (0.5 lb) otherwise.
|
|
2139
|
+
* Ignored (send 0) with `amountCents`. */
|
|
2114
2140
|
quantity: number;
|
|
2141
|
+
/** AGF-UNITS U3 — sold by value («$3.000 de queso»): the amount in cents instead of a quantity; its own line. */
|
|
2142
|
+
amountCents?: number;
|
|
2115
2143
|
options?: CatalogOptionChoice[];
|
|
2116
2144
|
}>;
|
|
2117
2145
|
/** 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.38.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",
|