@viu/emporix-sdk 3.5.0 → 4.0.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 +148 -0
- package/README.md +2 -2
- package/dist/availability.d.cts +1 -1
- package/dist/availability.d.ts +1 -1
- package/dist/cart.d.cts +1 -1
- package/dist/cart.d.ts +1 -1
- package/dist/category.d.cts +1 -1
- package/dist/category.d.ts +1 -1
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/{chunk-JQWUGGRV.js → chunk-2SHTDVOC.js} +22 -2
- package/dist/chunk-2SHTDVOC.js.map +1 -0
- package/dist/{chunk-TI56QENX.js → chunk-CSYXGTOH.js} +31 -2
- package/dist/chunk-CSYXGTOH.js.map +1 -0
- package/dist/{chunk-3G5KROEC.js → chunk-XJJDCK2Z.js} +80 -3
- package/dist/chunk-XJJDCK2Z.js.map +1 -0
- package/dist/companies.d.cts +1 -1
- package/dist/companies.d.ts +1 -1
- package/dist/contacts.d.cts +1 -1
- package/dist/contacts.d.ts +1 -1
- package/dist/{context-CZdtWgQO.d.cts → context-5lt8Q0MT.d.cts} +1 -1
- package/dist/{context-CZdtWgQO.d.ts → context-5lt8Q0MT.d.ts} +1 -1
- package/dist/{customer-groups-OEnqHFsX.d.cts → customer-groups-8cgS8S5d.d.cts} +1 -1
- package/dist/{customer-groups-DhrOoC8M.d.ts → customer-groups-DizW_a-w.d.ts} +1 -1
- package/dist/customer-groups.d.cts +2 -2
- package/dist/customer-groups.d.ts +2 -2
- package/dist/customer.d.cts +1 -1
- package/dist/customer.d.ts +1 -1
- package/dist/index.cjs +272 -132
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +333 -591
- package/dist/index.d.ts +333 -591
- package/dist/index.js +152 -137
- package/dist/index.js.map +1 -1
- package/dist/locations.d.cts +1 -1
- package/dist/locations.d.ts +1 -1
- package/dist/media.cjs +29 -0
- package/dist/media.cjs.map +1 -1
- package/dist/media.d.cts +45 -3
- package/dist/media.d.ts +45 -3
- package/dist/media.js +1 -1
- package/dist/orders.d.cts +1 -1
- package/dist/orders.d.ts +1 -1
- package/dist/payment.d.cts +1 -1
- package/dist/payment.d.ts +1 -1
- package/dist/price.d.cts +1 -1
- package/dist/price.d.ts +1 -1
- package/dist/product.cjs +20 -0
- package/dist/product.cjs.map +1 -1
- package/dist/product.d.cts +24 -2
- package/dist/product.d.ts +24 -2
- package/dist/product.js +1 -1
- package/dist/segment.cjs +78 -1
- package/dist/segment.cjs.map +1 -1
- package/dist/segment.d.cts +90 -3
- package/dist/segment.d.ts +90 -3
- package/dist/segment.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-3G5KROEC.js.map +0 -1
- package/dist/chunk-JQWUGGRV.js.map +0 -1
- package/dist/chunk-TI56QENX.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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-
|
|
3
|
+
import { MediaService } from './chunk-CSYXGTOH.js';
|
|
4
|
+
export { MediaService } from './chunk-CSYXGTOH.js';
|
|
5
5
|
import { OrdersService, SalesOrdersService } from './chunk-P3RANRGB.js';
|
|
6
6
|
export { OrdersService, SalesOrdersService } from './chunk-P3RANRGB.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
9
|
import { PriceService } from './chunk-ZOFGDNSX.js';
|
|
10
10
|
export { PriceService } from './chunk-ZOFGDNSX.js';
|
|
11
|
-
import { ProductService } from './chunk-
|
|
12
|
-
export { ProductService } from './chunk-
|
|
13
|
-
import { SegmentService } from './chunk-
|
|
14
|
-
export { SegmentService } from './chunk-
|
|
11
|
+
import { ProductService } from './chunk-2SHTDVOC.js';
|
|
12
|
+
export { ProductService } from './chunk-2SHTDVOC.js';
|
|
13
|
+
import { SegmentService } from './chunk-XJJDCK2Z.js';
|
|
14
|
+
export { SegmentService } from './chunk-XJJDCK2Z.js';
|
|
15
15
|
import { AvailabilityService } from './chunk-XQAOHHXL.js';
|
|
16
16
|
export { AvailabilityService } from './chunk-XQAOHHXL.js';
|
|
17
17
|
import { CartService } from './chunk-YVZ6GOLE.js';
|
|
@@ -945,7 +945,7 @@ var HttpClient = class {
|
|
|
945
945
|
};
|
|
946
946
|
|
|
947
947
|
// package.json
|
|
948
|
-
var version = "
|
|
948
|
+
var version = "4.0.0";
|
|
949
949
|
|
|
950
950
|
// src/version.ts
|
|
951
951
|
var SDK_VERSION = version;
|
|
@@ -2564,6 +2564,16 @@ var AnalyticsResource = class {
|
|
|
2564
2564
|
|
|
2565
2565
|
// src/services/ai.ts
|
|
2566
2566
|
var SERVICE10 = { kind: "service" };
|
|
2567
|
+
function assertChatOptions(opts, method) {
|
|
2568
|
+
if (typeof opts === "object" && opts !== null && "kind" in opts) {
|
|
2569
|
+
throw new Error(
|
|
2570
|
+
`ai.${method}: the second argument is { sessionId? } since 4.0.0 \u2014 pass the auth context third`
|
|
2571
|
+
);
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
function sessionHeader(opts) {
|
|
2575
|
+
return opts.sessionId ? { headers: { "session-id": opts.sessionId } } : {};
|
|
2576
|
+
}
|
|
2567
2577
|
var AiService = class {
|
|
2568
2578
|
constructor(ctx) {
|
|
2569
2579
|
this.ctx = ctx;
|
|
@@ -2694,40 +2704,50 @@ var AiService = class {
|
|
|
2694
2704
|
/**
|
|
2695
2705
|
* Synchronous agent chat (`POST /agentic/chat`). Returns the response
|
|
2696
2706
|
* ARRAY verbatim (the upstream contract is an array, not a single object).
|
|
2707
|
+
*
|
|
2708
|
+
* `opts.sessionId` is sent as the `session-id` header. It carries the
|
|
2709
|
+
* conversation — continuity needs it plus `enabledMemory` on the agent — and
|
|
2710
|
+
* it is how a chat reaches an attachment: pass the `sessionId` the upload or
|
|
2711
|
+
* reuse returned, and list the file under `input.attachments`.
|
|
2697
2712
|
*/
|
|
2698
|
-
async chat(input, auth2 = SERVICE10) {
|
|
2713
|
+
async chat(input, opts = {}, auth2 = SERVICE10) {
|
|
2714
|
+
assertChatOptions(opts, "chat");
|
|
2699
2715
|
return this.ctx.http.request({
|
|
2700
2716
|
method: "POST",
|
|
2701
2717
|
path: `${this.base()}/agentic/chat`,
|
|
2702
2718
|
auth: auth2,
|
|
2703
|
-
body: input
|
|
2719
|
+
body: input,
|
|
2720
|
+
...sessionHeader(opts)
|
|
2704
2721
|
});
|
|
2705
2722
|
}
|
|
2706
2723
|
/**
|
|
2707
2724
|
* Fire-and-forget agent chat (`POST /agentic/chat-async`, HTTP 201).
|
|
2708
|
-
* Returns the job-id ARRAY verbatim.
|
|
2725
|
+
* Returns the job-id ARRAY verbatim. `opts` as for {@link chat}.
|
|
2709
2726
|
*/
|
|
2710
|
-
async chatAsync(input, auth2 = SERVICE10) {
|
|
2727
|
+
async chatAsync(input, opts = {}, auth2 = SERVICE10) {
|
|
2728
|
+
assertChatOptions(opts, "chatAsync");
|
|
2711
2729
|
return this.ctx.http.request({
|
|
2712
2730
|
method: "POST",
|
|
2713
2731
|
path: `${this.base()}/agentic/chat-async`,
|
|
2714
2732
|
auth: auth2,
|
|
2715
|
-
body: input
|
|
2733
|
+
body: input,
|
|
2734
|
+
...sessionHeader(opts)
|
|
2716
2735
|
});
|
|
2717
2736
|
}
|
|
2718
2737
|
/**
|
|
2719
2738
|
* Streaming agent chat (`POST /agentic/chat-stream`, `text/event-stream`).
|
|
2720
2739
|
* Yields each SSE `data` payload verbatim — the upstream contract types the
|
|
2721
2740
|
* stream body as an opaque string, so chunks are raw strings, not parsed
|
|
2722
|
-
* objects. Consume with `for await`.
|
|
2741
|
+
* objects. Consume with `for await`. `opts` as for {@link chat}.
|
|
2723
2742
|
*/
|
|
2724
2743
|
async *chatStream(input, opts = {}, auth2 = SERVICE10) {
|
|
2744
|
+
assertChatOptions(opts, "chatStream");
|
|
2725
2745
|
const events = this.ctx.http.requestStream({
|
|
2726
2746
|
method: "POST",
|
|
2727
2747
|
path: `${this.base()}/agentic/chat-stream`,
|
|
2728
2748
|
auth: auth2,
|
|
2729
2749
|
body: input,
|
|
2730
|
-
...opts
|
|
2750
|
+
...sessionHeader(opts)
|
|
2731
2751
|
});
|
|
2732
2752
|
for await (const ev of events) yield ev.data;
|
|
2733
2753
|
}
|
|
@@ -2770,6 +2790,10 @@ var AiService = class {
|
|
|
2770
2790
|
* (`POST /agentic/{agentId}/attachments`, multipart, HTTP 201). The response
|
|
2771
2791
|
* `sessionId` must be threaded into subsequent chat calls to bind the file.
|
|
2772
2792
|
* Pass `opts.sessionId` to attach to an existing session.
|
|
2793
|
+
*
|
|
2794
|
+
* The endpoint takes exactly one of `attachment` or `attachmentId` — both or
|
|
2795
|
+
* neither is a `400`. This method always sends the file; to point a second
|
|
2796
|
+
* agent at a file already in the session, use {@link reuseAttachment}.
|
|
2773
2797
|
*/
|
|
2774
2798
|
async uploadAttachment(agentId, attachment, opts = {}, auth2 = SERVICE10) {
|
|
2775
2799
|
const form = new FormData();
|
|
@@ -2782,6 +2806,34 @@ var AiService = class {
|
|
|
2782
2806
|
...opts.sessionId ? { headers: { "session-id": opts.sessionId } } : {}
|
|
2783
2807
|
});
|
|
2784
2808
|
}
|
|
2809
|
+
/**
|
|
2810
|
+
* Assign an existing media asset to an agent as a chat attachment
|
|
2811
|
+
* (`POST /agentic/{agentId}/attachments` with the `attachmentId` form field,
|
|
2812
|
+
* HTTP 200). Resolves to the attachment `id` and the `sessionId` to send on
|
|
2813
|
+
* the following chat calls.
|
|
2814
|
+
*
|
|
2815
|
+
* Use it to hand a second agent the same file instead of uploading it twice.
|
|
2816
|
+
* Pass `opts.sessionId` to attach to an existing chat session; without it the
|
|
2817
|
+
* service opens a new one and returns its id — thread that into the chat, or
|
|
2818
|
+
* the agent never sees the file. With `ai.agentexecution_manage` the asset may
|
|
2819
|
+
* be any media asset, not only one uploaded to this session.
|
|
2820
|
+
*
|
|
2821
|
+
* ```ts
|
|
2822
|
+
* const { id, sessionId } = await client.ai.uploadAttachment("agent-a", file);
|
|
2823
|
+
* await client.ai.reuseAttachment("agent-b", id!, { sessionId: sessionId! });
|
|
2824
|
+
* ```
|
|
2825
|
+
*/
|
|
2826
|
+
async reuseAttachment(agentId, attachmentId, opts = {}, auth2 = SERVICE10) {
|
|
2827
|
+
const form = new FormData();
|
|
2828
|
+
form.append("attachmentId", attachmentId);
|
|
2829
|
+
return this.ctx.http.request({
|
|
2830
|
+
method: "POST",
|
|
2831
|
+
path: `${this.base()}/agentic/${encodeURIComponent(agentId)}/attachments`,
|
|
2832
|
+
auth: auth2,
|
|
2833
|
+
body: form,
|
|
2834
|
+
...opts.sessionId ? { headers: { "session-id": opts.sessionId } } : {}
|
|
2835
|
+
});
|
|
2836
|
+
}
|
|
2785
2837
|
/** Export agents + components as a base64/checksum blob (`POST /agentic/agents/export`). */
|
|
2786
2838
|
async exportAgents(body, auth2 = SERVICE10) {
|
|
2787
2839
|
return this.ctx.http.request({
|
|
@@ -4322,6 +4374,23 @@ var ImportService = class {
|
|
|
4322
4374
|
auth: auth2
|
|
4323
4375
|
});
|
|
4324
4376
|
}
|
|
4377
|
+
/**
|
|
4378
|
+
* The order in which a configuration's streams run, and the dependencies
|
|
4379
|
+
* behind it. Read it here instead of deriving it from the stream definitions:
|
|
4380
|
+
* mapping transformations add dependencies that no single stream shows, so a
|
|
4381
|
+
* self-computed order can differ from the one used at run time.
|
|
4382
|
+
*
|
|
4383
|
+
* The result lists stream **names**, while {@link triggerRun}'s `streamIds`
|
|
4384
|
+
* takes stream **ids** — map through {@link listStreams} before passing a
|
|
4385
|
+
* subset back.
|
|
4386
|
+
*/
|
|
4387
|
+
async getStreamOrder(configId, auth2 = SERVICE22) {
|
|
4388
|
+
return this.ctx.http.request({
|
|
4389
|
+
method: "GET",
|
|
4390
|
+
path: `${this.base()}/configs/${encodeURIComponent(configId)}/stream-order`,
|
|
4391
|
+
auth: auth2
|
|
4392
|
+
});
|
|
4393
|
+
}
|
|
4325
4394
|
/**
|
|
4326
4395
|
* Fetch a configuration's schedule. Resolves to `null` when none is
|
|
4327
4396
|
* configured — the service answers `204`, not `404`, so an absent schedule is
|
|
@@ -4386,6 +4455,9 @@ var ImportService = class {
|
|
|
4386
4455
|
* integration scenario are indistinguishable in the history. Note the service
|
|
4387
4456
|
* **rejects** an `origin` over 40 characters instead of shortening it.
|
|
4388
4457
|
*
|
|
4458
|
+
* `streamIds` runs a subset — see {@link ImportRunInput} for what is rejected,
|
|
4459
|
+
* and note it takes ids where {@link getStreamOrder} reports names.
|
|
4460
|
+
*
|
|
4389
4461
|
* Not retried on a 5xx: a POST that timed out may already have queued a run.
|
|
4390
4462
|
*
|
|
4391
4463
|
* @example
|
|
@@ -4477,6 +4549,43 @@ var ImportService = class {
|
|
|
4477
4549
|
});
|
|
4478
4550
|
return toPage(wire, args);
|
|
4479
4551
|
}
|
|
4552
|
+
/**
|
|
4553
|
+
* The rows behind a run's feed-quality counters: source rows that repeated a
|
|
4554
|
+
* natural key (`kind: "REPEATED_KEY"`, counted as `duplicateKeys`) and child
|
|
4555
|
+
* lines with no parent to attach to (`"UNRESOLVED_PARENT"`, counted as
|
|
4556
|
+
* `unresolvedParents`). Neither is a failure, which is why these rows are not
|
|
4557
|
+
* in {@link listRunErrors}.
|
|
4558
|
+
*
|
|
4559
|
+
* **A capped sample** — see {@link ImportRunDiagnostics} before reading
|
|
4560
|
+
* `rows.length` as the size of the problem. `limit` defaults to 500 here
|
|
4561
|
+
* (1–50 000); {@link downloadRunDiagnosticsCsv} defaults to 50 000.
|
|
4562
|
+
*/
|
|
4563
|
+
async listRunDiagnostics(runId, query = {}, auth2 = SERVICE22) {
|
|
4564
|
+
return this.ctx.http.request({
|
|
4565
|
+
method: "GET",
|
|
4566
|
+
path: `${this.base()}/runs/${encodeURIComponent(runId)}/diagnostics`,
|
|
4567
|
+
query: { ...query },
|
|
4568
|
+
auth: auth2
|
|
4569
|
+
});
|
|
4570
|
+
}
|
|
4571
|
+
/**
|
|
4572
|
+
* The same rows as {@link listRunDiagnostics}, as CSV text for a spreadsheet
|
|
4573
|
+
* or a ticket. Comment lines above the header record whether `limit` or the
|
|
4574
|
+
* recording cap cut rows off, so the file keeps that context when shared on
|
|
4575
|
+
* its own. `limit` defaults to 50 000 here, not 500.
|
|
4576
|
+
*
|
|
4577
|
+
* Every value is quoted, and a value starting with `=`, `+`, `-` or `@` is
|
|
4578
|
+
* prefixed with an apostrophe so spreadsheet software does not evaluate source
|
|
4579
|
+
* data as a formula. Strip it if you parse the file instead of opening it.
|
|
4580
|
+
*/
|
|
4581
|
+
async downloadRunDiagnosticsCsv(runId, query = {}, auth2 = SERVICE22) {
|
|
4582
|
+
return this.ctx.http.request({
|
|
4583
|
+
method: "GET",
|
|
4584
|
+
path: `${this.base()}/runs/${encodeURIComponent(runId)}/diagnostics/csv`,
|
|
4585
|
+
query: { ...query },
|
|
4586
|
+
auth: auth2
|
|
4587
|
+
});
|
|
4588
|
+
}
|
|
4480
4589
|
/** List the target types that hold imported records — the valid `type` values for {@link searchRecords}. */
|
|
4481
4590
|
async listDataTypes(auth2 = SERVICE22) {
|
|
4482
4591
|
return this.ctx.http.request({
|
|
@@ -4924,100 +5033,8 @@ var VendorService = class {
|
|
|
4924
5033
|
}
|
|
4925
5034
|
};
|
|
4926
5035
|
|
|
4927
|
-
// src/services/pick-pack.ts
|
|
4928
|
-
var SERVICE27 = { kind: "service" };
|
|
4929
|
-
var PickPackService = class {
|
|
4930
|
-
constructor(ctx) {
|
|
4931
|
-
this.ctx = ctx;
|
|
4932
|
-
}
|
|
4933
|
-
ctx;
|
|
4934
|
-
static channel = "pick-pack";
|
|
4935
|
-
base() {
|
|
4936
|
-
return `/pick-pack/${this.ctx.tenant}`;
|
|
4937
|
-
}
|
|
4938
|
-
orderPath(orderId) {
|
|
4939
|
-
return `${this.base()}/orders/${encodeURIComponent(orderId)}`;
|
|
4940
|
-
}
|
|
4941
|
-
/** List packlist orders. */
|
|
4942
|
-
async listOrders(query = {}, auth2 = SERVICE27) {
|
|
4943
|
-
return this.ctx.http.request({
|
|
4944
|
-
method: "GET",
|
|
4945
|
-
path: `${this.base()}/orders`,
|
|
4946
|
-
auth: auth2,
|
|
4947
|
-
...Object.keys(query).length ? { query } : {}
|
|
4948
|
-
});
|
|
4949
|
-
}
|
|
4950
|
-
/** Retrieve a packlist order by id. */
|
|
4951
|
-
async getOrder(orderId, auth2 = SERVICE27) {
|
|
4952
|
-
return this.ctx.http.request({ method: "GET", path: this.orderPath(orderId), auth: auth2 });
|
|
4953
|
-
}
|
|
4954
|
-
/** Update an order's status (`PATCH`). Returns an acknowledgement. */
|
|
4955
|
-
async updateOrder(orderId, change, auth2 = SERVICE27) {
|
|
4956
|
-
return this.ctx.http.request({ method: "PATCH", path: this.orderPath(orderId), auth: auth2, body: change });
|
|
4957
|
-
}
|
|
4958
|
-
/** Finish an order. Returns an acknowledgement. */
|
|
4959
|
-
async finishOrder(orderId, auth2 = SERVICE27) {
|
|
4960
|
-
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/finish`, auth: auth2 });
|
|
4961
|
-
}
|
|
4962
|
-
/** List order cycles (ids). */
|
|
4963
|
-
async listOrderCycles(query = {}, auth2 = SERVICE27) {
|
|
4964
|
-
return this.ctx.http.request({
|
|
4965
|
-
method: "GET",
|
|
4966
|
-
path: `${this.base()}/orderCycles`,
|
|
4967
|
-
auth: auth2,
|
|
4968
|
-
...Object.keys(query).length ? { query } : {}
|
|
4969
|
-
});
|
|
4970
|
-
}
|
|
4971
|
-
/** Add an assignee to an order. Returns an acknowledgement. */
|
|
4972
|
-
async addAssignee(orderId, assignee, auth2 = SERVICE27) {
|
|
4973
|
-
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/assignees`, auth: auth2, body: assignee });
|
|
4974
|
-
}
|
|
4975
|
-
/** Remove an assignee from an order. */
|
|
4976
|
-
async removeAssignee(orderId, assigneeId, auth2 = SERVICE27) {
|
|
4977
|
-
await this.ctx.http.request({
|
|
4978
|
-
method: "DELETE",
|
|
4979
|
-
path: `${this.orderPath(orderId)}/assignees/${encodeURIComponent(assigneeId)}`,
|
|
4980
|
-
auth: auth2
|
|
4981
|
-
});
|
|
4982
|
-
}
|
|
4983
|
-
/** Update packaging products for an order (`PUT`). Returns an acknowledgement. */
|
|
4984
|
-
async updatePackaging(orderId, change, auth2 = SERVICE27) {
|
|
4985
|
-
return this.ctx.http.request({ method: "PUT", path: `${this.orderPath(orderId)}/packaging`, auth: auth2, body: change });
|
|
4986
|
-
}
|
|
4987
|
-
/** Create a packing event. Returns an acknowledgement. */
|
|
4988
|
-
async createEvent(event, auth2 = SERVICE27) {
|
|
4989
|
-
return this.ctx.http.request({ method: "POST", path: `${this.base()}/events`, auth: auth2, body: event });
|
|
4990
|
-
}
|
|
4991
|
-
/** List packing events. */
|
|
4992
|
-
async listEvents(query = {}, auth2 = SERVICE27) {
|
|
4993
|
-
return this.ctx.http.request({
|
|
4994
|
-
method: "GET",
|
|
4995
|
-
path: `${this.base()}/events`,
|
|
4996
|
-
auth: auth2,
|
|
4997
|
-
...Object.keys(query).length ? { query } : {}
|
|
4998
|
-
});
|
|
4999
|
-
}
|
|
5000
|
-
/** Trigger an order recalculation. Returns the created job's id. */
|
|
5001
|
-
async triggerRecalculation(input, auth2 = SERVICE27) {
|
|
5002
|
-
return this.ctx.http.request({
|
|
5003
|
-
method: "POST",
|
|
5004
|
-
path: `${this.base()}/jobs/recalculations`,
|
|
5005
|
-
auth: auth2,
|
|
5006
|
-
body: input
|
|
5007
|
-
});
|
|
5008
|
-
}
|
|
5009
|
-
/** Retrieve a recalculation job by id. */
|
|
5010
|
-
async getRecalculationJob(jobId, auth2 = SERVICE27) {
|
|
5011
|
-
return this.ctx.http.request({
|
|
5012
|
-
method: "GET",
|
|
5013
|
-
path: `${this.base()}/jobs/recalculations/${encodeURIComponent(jobId)}`,
|
|
5014
|
-
auth: auth2
|
|
5015
|
-
});
|
|
5016
|
-
}
|
|
5017
|
-
};
|
|
5018
|
-
|
|
5019
5036
|
// src/services/customer-admin.ts
|
|
5020
|
-
var
|
|
5037
|
+
var SERVICE27 = { kind: "service" };
|
|
5021
5038
|
var CustomerAdminService = class {
|
|
5022
5039
|
constructor(ctx) {
|
|
5023
5040
|
this.ctx = ctx;
|
|
@@ -5038,7 +5055,7 @@ var CustomerAdminService = class {
|
|
|
5038
5055
|
}
|
|
5039
5056
|
// --- Customers ---
|
|
5040
5057
|
/** List customers. */
|
|
5041
|
-
async listCustomers(query = {}, auth2 =
|
|
5058
|
+
async listCustomers(query = {}, auth2 = SERVICE27) {
|
|
5042
5059
|
return this.ctx.http.request({
|
|
5043
5060
|
method: "GET",
|
|
5044
5061
|
path: this.base(),
|
|
@@ -5047,33 +5064,33 @@ var CustomerAdminService = class {
|
|
|
5047
5064
|
});
|
|
5048
5065
|
}
|
|
5049
5066
|
/** Search customers (`POST /customers/search`). A built filter in `q` is resolved to a string. */
|
|
5050
|
-
async searchCustomers(query, auth2 =
|
|
5067
|
+
async searchCustomers(query, auth2 = SERVICE27) {
|
|
5051
5068
|
const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
5052
5069
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body });
|
|
5053
5070
|
}
|
|
5054
5071
|
/** Retrieve a customer profile by number. */
|
|
5055
|
-
async getCustomer(customerNumber, auth2 =
|
|
5072
|
+
async getCustomer(customerNumber, auth2 = SERVICE27) {
|
|
5056
5073
|
return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
|
|
5057
5074
|
}
|
|
5058
5075
|
/** Create a customer. */
|
|
5059
|
-
async createCustomer(input, auth2 =
|
|
5076
|
+
async createCustomer(input, auth2 = SERVICE27) {
|
|
5060
5077
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
5061
5078
|
}
|
|
5062
5079
|
/** Upsert a customer profile by number (`PUT`). */
|
|
5063
|
-
async upsertCustomer(customerNumber, input, auth2 =
|
|
5080
|
+
async upsertCustomer(customerNumber, input, auth2 = SERVICE27) {
|
|
5064
5081
|
return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
|
|
5065
5082
|
}
|
|
5066
5083
|
/** Partially update a customer profile (`PATCH`). */
|
|
5067
|
-
async patchCustomer(customerNumber, patch, auth2 =
|
|
5084
|
+
async patchCustomer(customerNumber, patch, auth2 = SERVICE27) {
|
|
5068
5085
|
await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
|
|
5069
5086
|
}
|
|
5070
5087
|
/** Delete a customer profile. */
|
|
5071
|
-
async deleteCustomer(customerNumber, auth2 =
|
|
5088
|
+
async deleteCustomer(customerNumber, auth2 = SERVICE27) {
|
|
5072
5089
|
await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
|
|
5073
5090
|
}
|
|
5074
5091
|
// --- Addresses ---
|
|
5075
5092
|
/** List a customer's addresses. */
|
|
5076
|
-
async listAddresses(customerNumber, auth2 =
|
|
5093
|
+
async listAddresses(customerNumber, auth2 = SERVICE27) {
|
|
5077
5094
|
return this.ctx.http.request({
|
|
5078
5095
|
method: "GET",
|
|
5079
5096
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -5081,11 +5098,11 @@ var CustomerAdminService = class {
|
|
|
5081
5098
|
});
|
|
5082
5099
|
}
|
|
5083
5100
|
/** Retrieve one address. */
|
|
5084
|
-
async getAddress(customerNumber, addressId, auth2 =
|
|
5101
|
+
async getAddress(customerNumber, addressId, auth2 = SERVICE27) {
|
|
5085
5102
|
return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
5086
5103
|
}
|
|
5087
5104
|
/** Add an address. */
|
|
5088
|
-
async addAddress(customerNumber, input, auth2 =
|
|
5105
|
+
async addAddress(customerNumber, input, auth2 = SERVICE27) {
|
|
5089
5106
|
return this.ctx.http.request({
|
|
5090
5107
|
method: "POST",
|
|
5091
5108
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -5094,19 +5111,19 @@ var CustomerAdminService = class {
|
|
|
5094
5111
|
});
|
|
5095
5112
|
}
|
|
5096
5113
|
/** Upsert an address by id (`PUT`). */
|
|
5097
|
-
async upsertAddress(customerNumber, addressId, input, auth2 =
|
|
5114
|
+
async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE27) {
|
|
5098
5115
|
return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
|
|
5099
5116
|
}
|
|
5100
5117
|
/** Partially update an address by id (`PATCH`). */
|
|
5101
|
-
async patchAddress(customerNumber, addressId, patch, auth2 =
|
|
5118
|
+
async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE27) {
|
|
5102
5119
|
await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
|
|
5103
5120
|
}
|
|
5104
5121
|
/** Delete an address by id. */
|
|
5105
|
-
async deleteAddress(customerNumber, addressId, auth2 =
|
|
5122
|
+
async deleteAddress(customerNumber, addressId, auth2 = SERVICE27) {
|
|
5106
5123
|
await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
5107
5124
|
}
|
|
5108
5125
|
/** Add tags to an address (`?tags=` query). */
|
|
5109
|
-
async addAddressTags(customerNumber, addressId, tags, auth2 =
|
|
5126
|
+
async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE27) {
|
|
5110
5127
|
await this.ctx.http.request({
|
|
5111
5128
|
method: "POST",
|
|
5112
5129
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -5115,7 +5132,7 @@ var CustomerAdminService = class {
|
|
|
5115
5132
|
});
|
|
5116
5133
|
}
|
|
5117
5134
|
/** Remove tags from an address (`?tags=` query). */
|
|
5118
|
-
async removeAddressTags(customerNumber, addressId, tags, auth2 =
|
|
5135
|
+
async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE27) {
|
|
5119
5136
|
await this.ctx.http.request({
|
|
5120
5137
|
method: "DELETE",
|
|
5121
5138
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -5129,7 +5146,7 @@ var CustomerAdminService = class {
|
|
|
5129
5146
|
* `customer.import_read` scope. An unconfigured tenant answers with an empty
|
|
5130
5147
|
* object rather than a 404.
|
|
5131
5148
|
*/
|
|
5132
|
-
async getPasswordMigrationRetention(auth2 =
|
|
5149
|
+
async getPasswordMigrationRetention(auth2 = SERVICE27) {
|
|
5133
5150
|
return this.ctx.http.request({
|
|
5134
5151
|
method: "GET",
|
|
5135
5152
|
path: this.configPath(),
|
|
@@ -5142,7 +5159,7 @@ var CustomerAdminService = class {
|
|
|
5142
5159
|
* `legacyAuth`** — that import is rejected without an active config. Re-POST with
|
|
5143
5160
|
* an earlier `retentionEndDate` to shorten a running window.
|
|
5144
5161
|
*/
|
|
5145
|
-
async configurePasswordMigrationRetention(input, auth2 =
|
|
5162
|
+
async configurePasswordMigrationRetention(input, auth2 = SERVICE27) {
|
|
5146
5163
|
return this.ctx.http.request({
|
|
5147
5164
|
method: "POST",
|
|
5148
5165
|
path: this.configPath(),
|
|
@@ -5155,7 +5172,7 @@ var CustomerAdminService = class {
|
|
|
5155
5172
|
* Intended for after the migration window: when the window ends, unmigrated
|
|
5156
5173
|
* accounts need a password reset and their legacy credentials are cleared.
|
|
5157
5174
|
*/
|
|
5158
|
-
async deletePasswordMigrationRetention(auth2 =
|
|
5175
|
+
async deletePasswordMigrationRetention(auth2 = SERVICE27) {
|
|
5159
5176
|
await this.ctx.http.request({ method: "DELETE", path: this.configPath(), auth: auth2 });
|
|
5160
5177
|
}
|
|
5161
5178
|
// --- Bulk import ---
|
|
@@ -5168,7 +5185,7 @@ var CustomerAdminService = class {
|
|
|
5168
5185
|
* `account.legacyAuth`, and importing `legacyAuth` requires an active retention
|
|
5169
5186
|
* config (see `configurePasswordMigrationRetention`).
|
|
5170
5187
|
*/
|
|
5171
|
-
async importCustomers(input, auth2 =
|
|
5188
|
+
async importCustomers(input, auth2 = SERVICE27) {
|
|
5172
5189
|
return this.ctx.http.request({
|
|
5173
5190
|
method: "POST",
|
|
5174
5191
|
path: `${this.base()}/import`,
|
|
@@ -5179,7 +5196,7 @@ var CustomerAdminService = class {
|
|
|
5179
5196
|
};
|
|
5180
5197
|
|
|
5181
5198
|
// src/services/approval.ts
|
|
5182
|
-
var
|
|
5199
|
+
var SERVICE28 = { kind: "service" };
|
|
5183
5200
|
var ApprovalService = class {
|
|
5184
5201
|
constructor(ctx) {
|
|
5185
5202
|
this.ctx = ctx;
|
|
@@ -5190,7 +5207,7 @@ var ApprovalService = class {
|
|
|
5190
5207
|
return `/approval/${this.ctx.tenant}`;
|
|
5191
5208
|
}
|
|
5192
5209
|
/** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
|
|
5193
|
-
async listApprovals(query = {}, auth2 =
|
|
5210
|
+
async listApprovals(query = {}, auth2 = SERVICE28) {
|
|
5194
5211
|
return this.ctx.http.request({
|
|
5195
5212
|
method: "GET",
|
|
5196
5213
|
path: `${this.base()}/approvals`,
|
|
@@ -5199,7 +5216,7 @@ var ApprovalService = class {
|
|
|
5199
5216
|
});
|
|
5200
5217
|
}
|
|
5201
5218
|
/** Retrieve a single approval by id. */
|
|
5202
|
-
async getApproval(approvalId, auth2 =
|
|
5219
|
+
async getApproval(approvalId, auth2 = SERVICE28) {
|
|
5203
5220
|
return this.ctx.http.request({
|
|
5204
5221
|
method: "GET",
|
|
5205
5222
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5207,7 +5224,7 @@ var ApprovalService = class {
|
|
|
5207
5224
|
});
|
|
5208
5225
|
}
|
|
5209
5226
|
/** Create an approval request (cart or quote). Returns the created `{ id }`. */
|
|
5210
|
-
async createApproval(input, auth2 =
|
|
5227
|
+
async createApproval(input, auth2 = SERVICE28) {
|
|
5211
5228
|
return this.ctx.http.request({
|
|
5212
5229
|
method: "POST",
|
|
5213
5230
|
path: `${this.base()}/approvals`,
|
|
@@ -5216,7 +5233,7 @@ var ApprovalService = class {
|
|
|
5216
5233
|
});
|
|
5217
5234
|
}
|
|
5218
5235
|
/** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
|
|
5219
|
-
async updateApproval(approvalId, ops, auth2 =
|
|
5236
|
+
async updateApproval(approvalId, ops, auth2 = SERVICE28) {
|
|
5220
5237
|
await this.ctx.http.request({
|
|
5221
5238
|
method: "PATCH",
|
|
5222
5239
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5225,7 +5242,7 @@ var ApprovalService = class {
|
|
|
5225
5242
|
});
|
|
5226
5243
|
}
|
|
5227
5244
|
/** Delete an approval by id. */
|
|
5228
|
-
async deleteApproval(approvalId, auth2 =
|
|
5245
|
+
async deleteApproval(approvalId, auth2 = SERVICE28) {
|
|
5229
5246
|
await this.ctx.http.request({
|
|
5230
5247
|
method: "DELETE",
|
|
5231
5248
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -5233,7 +5250,7 @@ var ApprovalService = class {
|
|
|
5233
5250
|
});
|
|
5234
5251
|
}
|
|
5235
5252
|
/** Check whether an operation on a resource is permitted / needs approval. */
|
|
5236
|
-
async checkPermitted(input, auth2 =
|
|
5253
|
+
async checkPermitted(input, auth2 = SERVICE28) {
|
|
5237
5254
|
return this.ctx.http.request({
|
|
5238
5255
|
method: "POST",
|
|
5239
5256
|
path: `${this.base()}/approval/permitted`,
|
|
@@ -5242,7 +5259,7 @@ var ApprovalService = class {
|
|
|
5242
5259
|
});
|
|
5243
5260
|
}
|
|
5244
5261
|
/** Search for users eligible to approve a resource. Returns an array. */
|
|
5245
|
-
async searchApprovers(input, auth2 =
|
|
5262
|
+
async searchApprovers(input, auth2 = SERVICE28) {
|
|
5246
5263
|
return this.ctx.http.request({
|
|
5247
5264
|
method: "POST",
|
|
5248
5265
|
path: `${this.base()}/search/users`,
|
|
@@ -5309,7 +5326,6 @@ var EmporixClient = class {
|
|
|
5309
5326
|
units;
|
|
5310
5327
|
catalogs;
|
|
5311
5328
|
vendors;
|
|
5312
|
-
pickPack;
|
|
5313
5329
|
customerAdmin;
|
|
5314
5330
|
approvals;
|
|
5315
5331
|
/** The validated tenant this client is bound to. */
|
|
@@ -5384,7 +5400,6 @@ var EmporixClient = class {
|
|
|
5384
5400
|
this.units = new UnitHandlingService(mk(UnitHandlingService.channel));
|
|
5385
5401
|
this.catalogs = new CatalogService(mk(CatalogService.channel));
|
|
5386
5402
|
this.vendors = new VendorService(mk(VendorService.channel));
|
|
5387
|
-
this.pickPack = new PickPackService(mk(PickPackService.channel));
|
|
5388
5403
|
this.customerAdmin = new CustomerAdminService(mk(CustomerAdminService.channel));
|
|
5389
5404
|
this.approvals = new ApprovalService(mk(ApprovalService.channel));
|
|
5390
5405
|
}
|
|
@@ -5454,6 +5469,6 @@ function productYrn(tenant, productId) {
|
|
|
5454
5469
|
return `urn:yaas:hybris:product:product:${tenant};${productId}`;
|
|
5455
5470
|
}
|
|
5456
5471
|
|
|
5457
|
-
export { AiService, ApprovalService, AuditLogService, BrandService, CatalogService, ClientConfigService, CloudFunctionsService, CountryService, CouponService, CurrencyService, CustomerAdminService, DEFAULT_HOST, EmporixClient, FeeService, HttpClient, ImportService, IndexingService, InvoiceService, LEVEL, LabelService, LevelResolver,
|
|
5472
|
+
export { AiService, ApprovalService, AuditLogService, BrandService, CatalogService, ClientConfigService, CloudFunctionsService, CountryService, CouponService, CurrencyService, CustomerAdminService, DEFAULT_HOST, EmporixClient, FeeService, HttpClient, ImportService, IndexingService, InvoiceService, LEVEL, LabelService, LevelResolver, QuoteService, RagIndexerService, ReturnsService, RewardPointsService, STORAGE_KEYS, SchemaService, SequentialIdService, SessionContextService, ShippingService, ShoppingListService, SiteService, TaxService, TenantConfigService, UnitHandlingService, VendorService, WebhookService, approvalStatusPatch, createConsoleLogger, createCookieBackedStorage, createCookieStorage, createCore, createEmporixClient, createListenerSet, createLocalStorage, createLocalStorageStorage, createMemoryStorage, createNoopLogger, createServerStorage, createSessionStorage, emporixKey, fromWebStorage, getCustomerSessionStore, parseAnonymousSession, pickFee, productIdFromYrn, productYrn, redact, resolveZone, serverAuth, siteMeta, validateConfig };
|
|
5458
5473
|
//# sourceMappingURL=index.js.map
|
|
5459
5474
|
//# sourceMappingURL=index.js.map
|