@viu/emporix-sdk 4.0.1 → 4.2.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/CHANGELOG.md +65 -0
- package/README.md +1 -0
- package/dist/cart.cjs +85 -0
- package/dist/cart.cjs.map +1 -1
- package/dist/cart.d.cts +352 -1
- package/dist/cart.d.ts +352 -1
- package/dist/cart.js +1 -1
- package/dist/{chunk-QQMLN76U.js → chunk-2OTFVTG6.js} +7 -4
- package/dist/chunk-2OTFVTG6.js.map +1 -0
- package/dist/{chunk-CSYXGTOH.js → chunk-5MPL4XBD.js} +68 -4
- package/dist/chunk-5MPL4XBD.js.map +1 -0
- package/dist/{chunk-P3RANRGB.js → chunk-IYNT5BQW.js} +16 -2
- package/dist/chunk-IYNT5BQW.js.map +1 -0
- package/dist/{chunk-ZOFGDNSX.js → chunk-K4KXT6NX.js} +12 -6
- package/dist/chunk-K4KXT6NX.js.map +1 -0
- package/dist/{chunk-XJJDCK2Z.js → chunk-N2CE3J4M.js} +12 -7
- package/dist/chunk-N2CE3J4M.js.map +1 -0
- package/dist/{chunk-YVZ6GOLE.js → chunk-S2ERKGYL.js} +48 -3
- package/dist/chunk-S2ERKGYL.js.map +1 -0
- package/dist/{chunk-5XZ6MSXW.js → chunk-VXORPTMP.js} +19 -2
- package/dist/chunk-VXORPTMP.js.map +1 -0
- package/dist/chunk-ZWJUDXTK.js +15 -0
- package/dist/chunk-ZWJUDXTK.js.map +1 -0
- package/dist/companies.cjs +15 -2
- package/dist/companies.cjs.map +1 -1
- package/dist/companies.d.cts +5 -3
- package/dist/companies.d.ts +5 -3
- package/dist/companies.js +2 -1
- package/dist/customer-groups.cjs +17 -0
- package/dist/customer-groups.cjs.map +1 -1
- package/dist/customer-groups.js +1 -1
- package/dist/index.cjs +259 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +150 -28
- package/dist/index.d.ts +150 -28
- package/dist/index.js +99 -59
- package/dist/index.js.map +1 -1
- package/dist/media.cjs +66 -2
- package/dist/media.cjs.map +1 -1
- package/dist/media.d.cts +184 -5
- package/dist/media.d.ts +184 -5
- package/dist/media.js +1 -1
- package/dist/orders.cjs +14 -0
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.d.cts +6 -0
- package/dist/orders.d.ts +6 -0
- package/dist/orders.js +1 -1
- package/dist/price.cjs +20 -4
- package/dist/price.cjs.map +1 -1
- package/dist/price.d.cts +12 -4
- package/dist/price.d.ts +12 -4
- package/dist/price.js +2 -1
- package/dist/search-DU6tE356.d.cts +15 -0
- package/dist/search-DU6tE356.d.ts +15 -0
- package/dist/segment.cjs +21 -5
- package/dist/segment.cjs.map +1 -1
- package/dist/segment.d.cts +16 -6
- package/dist/segment.d.ts +16 -6
- package/dist/segment.js +2 -1
- package/package.json +1 -1
- package/dist/chunk-5XZ6MSXW.js.map +0 -1
- package/dist/chunk-CSYXGTOH.js.map +0 -1
- package/dist/chunk-P3RANRGB.js.map +0 -1
- package/dist/chunk-QQMLN76U.js.map +0 -1
- package/dist/chunk-XJJDCK2Z.js.map +0 -1
- package/dist/chunk-YVZ6GOLE.js.map +0 -1
- package/dist/chunk-ZOFGDNSX.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { LocationsService } from './chunk-IAOWDMTA.js';
|
|
2
2
|
export { LocationsService } from './chunk-IAOWDMTA.js';
|
|
3
|
-
import { MediaService } from './chunk-
|
|
4
|
-
export { MediaService } from './chunk-
|
|
5
|
-
import { OrdersService, SalesOrdersService } from './chunk-
|
|
6
|
-
export { OrdersService, SalesOrdersService } from './chunk-
|
|
3
|
+
import { MediaService } from './chunk-5MPL4XBD.js';
|
|
4
|
+
export { MediaService } from './chunk-5MPL4XBD.js';
|
|
5
|
+
import { OrdersService, SalesOrdersService } from './chunk-IYNT5BQW.js';
|
|
6
|
+
export { OrdersService, SalesOrdersService } from './chunk-IYNT5BQW.js';
|
|
7
7
|
import { auth, resolveToken, DefaultTokenProvider, CustomerRefreshRegistry, PaymentGatewayService } from './chunk-4VRUMCS2.js';
|
|
8
8
|
export { CustomerRefreshRegistry, DefaultTokenProvider, PaymentGatewayService, auth, resolveToken } from './chunk-4VRUMCS2.js';
|
|
9
|
-
import { PriceService } from './chunk-
|
|
10
|
-
export { PriceService } from './chunk-
|
|
9
|
+
import { PriceService } from './chunk-K4KXT6NX.js';
|
|
10
|
+
export { PriceService } from './chunk-K4KXT6NX.js';
|
|
11
11
|
import { ProductService } from './chunk-2SHTDVOC.js';
|
|
12
12
|
export { ProductService } from './chunk-2SHTDVOC.js';
|
|
13
|
-
import { SegmentService } from './chunk-
|
|
14
|
-
export { SegmentService } from './chunk-
|
|
13
|
+
import { SegmentService } from './chunk-N2CE3J4M.js';
|
|
14
|
+
export { SegmentService } from './chunk-N2CE3J4M.js';
|
|
15
15
|
import { AvailabilityService } from './chunk-XQAOHHXL.js';
|
|
16
16
|
export { AvailabilityService } from './chunk-XQAOHHXL.js';
|
|
17
|
-
import { CartService } from './chunk-
|
|
18
|
-
export { CartService } from './chunk-
|
|
17
|
+
import { CartService } from './chunk-S2ERKGYL.js';
|
|
18
|
+
export { CartService } from './chunk-S2ERKGYL.js';
|
|
19
19
|
import { CategoryService } from './chunk-MSQ3GEIW.js';
|
|
20
20
|
export { CategoryService } from './chunk-MSQ3GEIW.js';
|
|
21
21
|
export { iterateAll } from './chunk-W6SLZNRX.js';
|
|
@@ -24,12 +24,13 @@ export { resolveQuery } from './chunk-S5HEIQDK.js';
|
|
|
24
24
|
import { requestPage } from './chunk-LKHKFF7B.js';
|
|
25
25
|
import { CheckoutService } from './chunk-RYQVMR26.js';
|
|
26
26
|
export { CheckoutService } from './chunk-RYQVMR26.js';
|
|
27
|
-
import { CompaniesService } from './chunk-
|
|
28
|
-
export { CompaniesService } from './chunk-
|
|
27
|
+
import { CompaniesService } from './chunk-2OTFVTG6.js';
|
|
28
|
+
export { CompaniesService } from './chunk-2OTFVTG6.js';
|
|
29
|
+
import { splitQuery, SEARCH_PAGING } from './chunk-ZWJUDXTK.js';
|
|
29
30
|
import { ContactsService } from './chunk-27NLS646.js';
|
|
30
31
|
export { ContactsService } from './chunk-27NLS646.js';
|
|
31
|
-
import { CustomerGroupsService, IamService } from './chunk-
|
|
32
|
-
export { CustomerGroupsService, IamService } from './chunk-
|
|
32
|
+
import { CustomerGroupsService, IamService } from './chunk-VXORPTMP.js';
|
|
33
|
+
export { CustomerGroupsService, IamService } from './chunk-VXORPTMP.js';
|
|
33
34
|
import { CustomerService } from './chunk-UA4BM6OP.js';
|
|
34
35
|
export { CustomerService } from './chunk-UA4BM6OP.js';
|
|
35
36
|
import './chunk-3BDDYX3V.js';
|
|
@@ -945,7 +946,7 @@ var HttpClient = class {
|
|
|
945
946
|
};
|
|
946
947
|
|
|
947
948
|
// package.json
|
|
948
|
-
var version = "4.0
|
|
949
|
+
var version = "4.2.0";
|
|
949
950
|
|
|
950
951
|
// src/version.ts
|
|
951
952
|
var SDK_VERSION = version;
|
|
@@ -1388,6 +1389,21 @@ var ClientConfigService = class {
|
|
|
1388
1389
|
|
|
1389
1390
|
// src/services/shopping-list.ts
|
|
1390
1391
|
var RESERVED = /* @__PURE__ */ new Set(["customerId", "metadata"]);
|
|
1392
|
+
function toLists(env) {
|
|
1393
|
+
const out = [];
|
|
1394
|
+
for (const [key, value] of Object.entries(env)) {
|
|
1395
|
+
if (RESERVED.has(key) || value === null || typeof value !== "object") continue;
|
|
1396
|
+
const v = value;
|
|
1397
|
+
out.push({
|
|
1398
|
+
key,
|
|
1399
|
+
name: v.name ?? key,
|
|
1400
|
+
items: v.items ?? [],
|
|
1401
|
+
...v.mixins ? { mixins: v.mixins } : {},
|
|
1402
|
+
...v.metadata ? { metadata: v.metadata } : {}
|
|
1403
|
+
});
|
|
1404
|
+
}
|
|
1405
|
+
return out;
|
|
1406
|
+
}
|
|
1391
1407
|
var ShoppingListService = class {
|
|
1392
1408
|
constructor(ctx) {
|
|
1393
1409
|
this.ctx = ctx;
|
|
@@ -1397,7 +1413,11 @@ var ShoppingListService = class {
|
|
|
1397
1413
|
base() {
|
|
1398
1414
|
return `/shoppinglist/${this.ctx.tenant}/shopping-lists`;
|
|
1399
1415
|
}
|
|
1400
|
-
/**
|
|
1416
|
+
/**
|
|
1417
|
+
* The caller's lists, normalized to an array. With employee scope Emporix
|
|
1418
|
+
* returns **every customer's** lists and ignores `name` — read one customer's
|
|
1419
|
+
* with {@link getForCustomer} instead.
|
|
1420
|
+
*/
|
|
1401
1421
|
async list(auth2, opts = {}) {
|
|
1402
1422
|
const envelopes = await this.ctx.http.request({
|
|
1403
1423
|
method: "GET",
|
|
@@ -1405,21 +1425,20 @@ var ShoppingListService = class {
|
|
|
1405
1425
|
auth: auth2,
|
|
1406
1426
|
...opts.name ? { query: { name: opts.name } } : {}
|
|
1407
1427
|
});
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
return out;
|
|
1428
|
+
return (envelopes ?? []).flatMap(toLists);
|
|
1429
|
+
}
|
|
1430
|
+
/**
|
|
1431
|
+
* One customer's lists (`GET /shopping-lists/{customerId}`), normalized to an
|
|
1432
|
+
* array — the employee read; `name` narrows it to one list.
|
|
1433
|
+
*/
|
|
1434
|
+
async getForCustomer(customerId, auth2, opts = {}) {
|
|
1435
|
+
const envelope = await this.ctx.http.request({
|
|
1436
|
+
method: "GET",
|
|
1437
|
+
path: `${this.base()}/${encodeURIComponent(customerId)}`,
|
|
1438
|
+
auth: auth2,
|
|
1439
|
+
...opts.name ? { query: { name: opts.name } } : {}
|
|
1440
|
+
});
|
|
1441
|
+
return envelope ? toLists(envelope) : [];
|
|
1423
1442
|
}
|
|
1424
1443
|
/** Create a list; returns the new list id. */
|
|
1425
1444
|
async create(draft, auth2) {
|
|
@@ -1448,8 +1467,8 @@ var ShoppingListService = class {
|
|
|
1448
1467
|
...opts.name ? { query: { name: opts.name } } : {}
|
|
1449
1468
|
});
|
|
1450
1469
|
}
|
|
1451
|
-
async loadList(listName, auth2) {
|
|
1452
|
-
const lists = await this.list(auth2, { name: listName });
|
|
1470
|
+
async loadList(customerId, listName, auth2) {
|
|
1471
|
+
const lists = auth2.kind === "service" ? await this.getForCustomer(customerId, auth2, { name: listName }) : await this.list(auth2, { name: listName });
|
|
1453
1472
|
const found = lists.find((l) => l.name === listName);
|
|
1454
1473
|
if (!found) throw new EmporixNotFoundError(`Shopping list "${listName}" not found`, 404);
|
|
1455
1474
|
return found;
|
|
@@ -1463,20 +1482,20 @@ var ShoppingListService = class {
|
|
|
1463
1482
|
}
|
|
1464
1483
|
/** Add/replace an item by `productId` (read-modify-write, last-write-wins). */
|
|
1465
1484
|
async addItem(customerId, listName, item, auth2) {
|
|
1466
|
-
const list = await this.loadList(listName, auth2);
|
|
1485
|
+
const list = await this.loadList(customerId, listName, auth2);
|
|
1467
1486
|
const items = [...list.items.filter((i) => i.productId !== item.productId), item];
|
|
1468
1487
|
await this.put(customerId, list, items, auth2);
|
|
1469
1488
|
}
|
|
1470
1489
|
/** Remove an item by `productId` (no-op if absent). */
|
|
1471
1490
|
async removeItem(customerId, listName, productId, auth2) {
|
|
1472
|
-
const list = await this.loadList(listName, auth2);
|
|
1491
|
+
const list = await this.loadList(customerId, listName, auth2);
|
|
1473
1492
|
const items = list.items.filter((i) => i.productId !== productId);
|
|
1474
1493
|
await this.put(customerId, list, items, auth2);
|
|
1475
1494
|
}
|
|
1476
1495
|
/** Set an item's quantity; `quantity <= 0` removes it. Adds the item if absent. */
|
|
1477
1496
|
async setItemQuantity(customerId, listName, productId, quantity, auth2) {
|
|
1478
1497
|
if (quantity <= 0) return this.removeItem(customerId, listName, productId, auth2);
|
|
1479
|
-
const list = await this.loadList(listName, auth2);
|
|
1498
|
+
const list = await this.loadList(customerId, listName, auth2);
|
|
1480
1499
|
let items = list.items.map((i) => i.productId === productId ? { ...i, quantity } : i);
|
|
1481
1500
|
if (!items.some((i) => i.productId === productId)) items = [...items, { productId, quantity }];
|
|
1482
1501
|
await this.put(customerId, list, items, auth2);
|
|
@@ -1809,13 +1828,14 @@ var FeeService = class {
|
|
|
1809
1828
|
* Finds item fees for several products on one site
|
|
1810
1829
|
* (`POST /itemFees/searchByProductIds`). Note the upstream asymmetry:
|
|
1811
1830
|
* `productIds` is a comma-separated **string** and `siteCode` is singular.
|
|
1831
|
+
* `siteFallback` goes in the query string, everything else in the body.
|
|
1812
1832
|
*/
|
|
1813
1833
|
async searchItemFeesByProductIds(search, auth2 = SERVICE6) {
|
|
1814
1834
|
return this.ctx.http.request({
|
|
1815
1835
|
method: "POST",
|
|
1816
1836
|
path: `${this.itemFeesBase()}/searchByProductIds`,
|
|
1817
1837
|
auth: auth2,
|
|
1818
|
-
|
|
1838
|
+
...splitQuery(search, ["siteFallback"]),
|
|
1819
1839
|
idempotent: true
|
|
1820
1840
|
// pure read over POST — safe to replay on 5xx/429
|
|
1821
1841
|
});
|
|
@@ -2421,9 +2441,9 @@ var AgenticCrudResource = class {
|
|
|
2421
2441
|
list(query = {}, auth2 = SERVICE9) {
|
|
2422
2442
|
return this.ctx.http.request({ method: "GET", path: this.path, auth: auth2, query: { ...query } });
|
|
2423
2443
|
}
|
|
2424
|
-
/** Structured search (`POST {path}/search`)
|
|
2444
|
+
/** Structured search (`POST {path}/search`): `q` in the body, paging/sort/fields in the query. */
|
|
2425
2445
|
search(query, auth2 = SERVICE9) {
|
|
2426
|
-
return this.ctx.http.request({ method: "POST", path: `${this.path}/search`, auth: auth2,
|
|
2446
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/search`, auth: auth2, ...splitQuery(query, SEARCH_PAGING) });
|
|
2427
2447
|
}
|
|
2428
2448
|
/** Retrieve one entry by id (`GET {path}/{id}`). */
|
|
2429
2449
|
get(id, opts = {}, auth2 = SERVICE9) {
|
|
@@ -2473,7 +2493,7 @@ var JobsResource = class {
|
|
|
2473
2493
|
}
|
|
2474
2494
|
/** Structured job search (`POST /jobs/search`). */
|
|
2475
2495
|
search(query, auth2 = SERVICE9) {
|
|
2476
|
-
return this.ctx.http.request({ method: "POST", path: `${this.base}/jobs/search`, auth: auth2,
|
|
2496
|
+
return this.ctx.http.request({ method: "POST", path: `${this.base}/jobs/search`, auth: auth2, ...splitQuery(query, SEARCH_PAGING) });
|
|
2477
2497
|
}
|
|
2478
2498
|
/** Retrieve one job (`GET /jobs/{jobId}`). */
|
|
2479
2499
|
get(jobId, auth2 = SERVICE9) {
|
|
@@ -2497,7 +2517,7 @@ var TemplatesResource = class {
|
|
|
2497
2517
|
}
|
|
2498
2518
|
/** Structured template search (`POST /agentic/templates/search`). */
|
|
2499
2519
|
search(query, auth2 = SERVICE9) {
|
|
2500
|
-
return this.ctx.http.request({ method: "POST", path: `${this.path}/search`, auth: auth2,
|
|
2520
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/search`, auth: auth2, ...splitQuery(query, SEARCH_PAGING) });
|
|
2501
2521
|
}
|
|
2502
2522
|
/**
|
|
2503
2523
|
* Instantiate a new agent from a template
|
|
@@ -2530,7 +2550,7 @@ var LogsResource = class {
|
|
|
2530
2550
|
}
|
|
2531
2551
|
/** Structured request-log search (`POST /agentic/logs/requests/search`). */
|
|
2532
2552
|
searchRequests(query, auth2 = SERVICE9) {
|
|
2533
|
-
return this.ctx.http.request({ method: "POST", path: `${this.path}/requests/search`, auth: auth2,
|
|
2553
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/requests/search`, auth: auth2, ...splitQuery(query, SEARCH_PAGING) });
|
|
2534
2554
|
}
|
|
2535
2555
|
/** List session logs (`GET /agentic/logs/sessions`). */
|
|
2536
2556
|
listSessions(query = {}, auth2 = SERVICE9) {
|
|
@@ -2542,7 +2562,7 @@ var LogsResource = class {
|
|
|
2542
2562
|
}
|
|
2543
2563
|
/** Structured session-log search (`POST /agentic/logs/sessions/search`). */
|
|
2544
2564
|
searchSessions(query, auth2 = SERVICE9) {
|
|
2545
|
-
return this.ctx.http.request({ method: "POST", path: `${this.path}/sessions/search`, auth: auth2,
|
|
2565
|
+
return this.ctx.http.request({ method: "POST", path: `${this.path}/sessions/search`, auth: auth2, ...splitQuery(query, SEARCH_PAGING) });
|
|
2546
2566
|
}
|
|
2547
2567
|
};
|
|
2548
2568
|
var AnalyticsResource = class {
|
|
@@ -2574,6 +2594,10 @@ function assertChatOptions(opts, method) {
|
|
|
2574
2594
|
function sessionHeader(opts) {
|
|
2575
2595
|
return opts.sessionId ? { headers: { "session-id": opts.sessionId } } : {};
|
|
2576
2596
|
}
|
|
2597
|
+
var AUTH_KINDS = /* @__PURE__ */ new Set(["service", "anonymous", "customer", "raw"]);
|
|
2598
|
+
function isAuthContext(value) {
|
|
2599
|
+
return AUTH_KINDS.has(String(value.kind));
|
|
2600
|
+
}
|
|
2577
2601
|
var AiService = class {
|
|
2578
2602
|
constructor(ctx) {
|
|
2579
2603
|
this.ctx = ctx;
|
|
@@ -2642,12 +2666,13 @@ var AiService = class {
|
|
|
2642
2666
|
body: input
|
|
2643
2667
|
});
|
|
2644
2668
|
}
|
|
2645
|
-
|
|
2646
|
-
|
|
2669
|
+
async listAgents(queryOrAuth = {}, auth2 = SERVICE10) {
|
|
2670
|
+
const [query, ctx] = isAuthContext(queryOrAuth) ? [{}, queryOrAuth] : [queryOrAuth, auth2];
|
|
2647
2671
|
return this.ctx.http.request({
|
|
2648
2672
|
method: "GET",
|
|
2649
2673
|
path: `${this.base()}/agentic/agents`,
|
|
2650
|
-
auth:
|
|
2674
|
+
auth: ctx,
|
|
2675
|
+
query: { ...query }
|
|
2651
2676
|
});
|
|
2652
2677
|
}
|
|
2653
2678
|
/** Retrieve one agent by id. */
|
|
@@ -2692,13 +2717,16 @@ var AiService = class {
|
|
|
2692
2717
|
...opts.force ? { query: { force: "true" } } : {}
|
|
2693
2718
|
});
|
|
2694
2719
|
}
|
|
2695
|
-
/**
|
|
2720
|
+
/**
|
|
2721
|
+
* Server-side agent search (`POST /agentic/agents/search`). `q` goes in the
|
|
2722
|
+
* body; `pageNumber`, `pageSize`, `sort` and `fields` in the query string.
|
|
2723
|
+
*/
|
|
2696
2724
|
async searchAgents(query, auth2 = SERVICE10) {
|
|
2697
2725
|
return this.ctx.http.request({
|
|
2698
2726
|
method: "POST",
|
|
2699
2727
|
path: `${this.base()}/agentic/agents/search`,
|
|
2700
2728
|
auth: auth2,
|
|
2701
|
-
|
|
2729
|
+
...splitQuery(query, SEARCH_PAGING)
|
|
2702
2730
|
});
|
|
2703
2731
|
}
|
|
2704
2732
|
/**
|
|
@@ -2751,21 +2779,22 @@ var AiService = class {
|
|
|
2751
2779
|
});
|
|
2752
2780
|
for await (const ev of events) yield ev.data;
|
|
2753
2781
|
}
|
|
2754
|
-
|
|
2755
|
-
|
|
2782
|
+
async listConversations(queryOrAuth = {}, auth2 = SERVICE10) {
|
|
2783
|
+
const [query, ctx] = isAuthContext(queryOrAuth) ? [{}, queryOrAuth] : [queryOrAuth, auth2];
|
|
2756
2784
|
return this.ctx.http.request({
|
|
2757
2785
|
method: "GET",
|
|
2758
2786
|
path: `${this.base()}/agentic/conversations`,
|
|
2759
|
-
auth:
|
|
2787
|
+
auth: ctx,
|
|
2788
|
+
query: { ...query }
|
|
2760
2789
|
});
|
|
2761
2790
|
}
|
|
2762
|
-
/** Server-side conversation search (`POST /agentic/conversations/search`). */
|
|
2791
|
+
/** Server-side conversation search (`POST /agentic/conversations/search`), paged like {@link searchAgents}. */
|
|
2763
2792
|
async searchConversations(query, auth2 = SERVICE10) {
|
|
2764
2793
|
return this.ctx.http.request({
|
|
2765
2794
|
method: "POST",
|
|
2766
2795
|
path: `${this.base()}/agentic/conversations/search`,
|
|
2767
2796
|
auth: auth2,
|
|
2768
|
-
|
|
2797
|
+
...splitQuery(query, SEARCH_PAGING)
|
|
2769
2798
|
});
|
|
2770
2799
|
}
|
|
2771
2800
|
// --- Standalone agentic reads / bulk operations ------------------------
|
|
@@ -4961,14 +4990,17 @@ var VendorService = class {
|
|
|
4961
4990
|
auth: auth2
|
|
4962
4991
|
});
|
|
4963
4992
|
}
|
|
4964
|
-
/**
|
|
4993
|
+
/**
|
|
4994
|
+
* Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to
|
|
4995
|
+
* a string; paging, sort and fields go in the query string.
|
|
4996
|
+
*/
|
|
4965
4997
|
async searchVendors(query, auth2 = SERVICE26) {
|
|
4966
|
-
const
|
|
4998
|
+
const input = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
4967
4999
|
return this.ctx.http.request({
|
|
4968
5000
|
method: "POST",
|
|
4969
5001
|
path: `${this.base()}/vendors/search`,
|
|
4970
5002
|
auth: auth2,
|
|
4971
|
-
|
|
5003
|
+
...splitQuery(input, SEARCH_PAGING)
|
|
4972
5004
|
});
|
|
4973
5005
|
}
|
|
4974
5006
|
/** Create a vendor. */
|
|
@@ -5063,10 +5095,18 @@ var CustomerAdminService = class {
|
|
|
5063
5095
|
...Object.keys(query).length ? { query } : {}
|
|
5064
5096
|
});
|
|
5065
5097
|
}
|
|
5066
|
-
/**
|
|
5098
|
+
/**
|
|
5099
|
+
* Search customers (`POST /customers/search`). A built filter in `q` is resolved
|
|
5100
|
+
* to a string; `pageNumber`, `pageSize`, `sort` and `expand` go in the query string.
|
|
5101
|
+
*/
|
|
5067
5102
|
async searchCustomers(query, auth2 = SERVICE27) {
|
|
5068
|
-
const
|
|
5069
|
-
return this.ctx.http.request({
|
|
5103
|
+
const input = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
5104
|
+
return this.ctx.http.request({
|
|
5105
|
+
method: "POST",
|
|
5106
|
+
path: `${this.base()}/search`,
|
|
5107
|
+
auth: auth2,
|
|
5108
|
+
...splitQuery(input, ["pageNumber", "pageSize", "sort", "expand"])
|
|
5109
|
+
});
|
|
5070
5110
|
}
|
|
5071
5111
|
/** Retrieve a customer profile by number. */
|
|
5072
5112
|
async getCustomer(customerNumber, auth2 = SERVICE27) {
|