@viu/emporix-sdk 4.4.0 → 4.5.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 +8 -0
- package/README.md +1 -1
- 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/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-C-A10NL3.d.cts → context-BJeomwxV.d.cts} +1 -1
- package/dist/{context-C-A10NL3.d.ts → context-BJeomwxV.d.ts} +1 -1
- package/dist/{customer-groups-C6jPLdvd.d.cts → customer-groups-ByNcTPoL.d.cts} +1 -1
- package/dist/{customer-groups-E1fY1FR2.d.ts → customer-groups-D7a8BvT2.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 +267 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +497 -4
- package/dist/index.d.ts +497 -4
- package/dist/index.js +267 -87
- package/dist/index.js.map +1 -1
- package/dist/locations.d.cts +1 -1
- package/dist/locations.d.ts +1 -1
- package/dist/media.d.cts +1 -1
- package/dist/media.d.ts +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.d.cts +1 -1
- package/dist/product.d.ts +1 -1
- package/dist/segment.d.cts +1 -1
- package/dist/segment.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1244,7 +1244,7 @@ var HttpClient = class {
|
|
|
1244
1244
|
};
|
|
1245
1245
|
|
|
1246
1246
|
// package.json
|
|
1247
|
-
var version = "4.
|
|
1247
|
+
var version = "4.5.0";
|
|
1248
1248
|
|
|
1249
1249
|
// src/version.ts
|
|
1250
1250
|
var SDK_VERSION = version;
|
|
@@ -8440,8 +8440,186 @@ var IndexingService = class {
|
|
|
8440
8440
|
}
|
|
8441
8441
|
};
|
|
8442
8442
|
|
|
8443
|
-
// src/services/
|
|
8443
|
+
// src/services/search.ts
|
|
8444
8444
|
var SERVICE29 = { kind: "service" };
|
|
8445
|
+
function pageQuery(opts) {
|
|
8446
|
+
const pageNumber = opts.pageNumber ?? 1;
|
|
8447
|
+
const pageSize = opts.pageSize ?? 60;
|
|
8448
|
+
const query = { pageNumber, pageSize };
|
|
8449
|
+
if (opts.sort !== void 0) query.sort = opts.sort;
|
|
8450
|
+
if (opts.q !== void 0) query.q = opts.q;
|
|
8451
|
+
if (opts.fields !== void 0) query.fields = opts.fields;
|
|
8452
|
+
const page = {
|
|
8453
|
+
pageNumber,
|
|
8454
|
+
pageSize,
|
|
8455
|
+
...opts.totalCount === void 0 ? {} : { totalCount: opts.totalCount }
|
|
8456
|
+
};
|
|
8457
|
+
return { query, page };
|
|
8458
|
+
}
|
|
8459
|
+
var SearchService = class {
|
|
8460
|
+
constructor(ctx) {
|
|
8461
|
+
this.ctx = ctx;
|
|
8462
|
+
}
|
|
8463
|
+
ctx;
|
|
8464
|
+
static channel = "search";
|
|
8465
|
+
base() {
|
|
8466
|
+
return `/search/${this.ctx.tenant}`;
|
|
8467
|
+
}
|
|
8468
|
+
/**
|
|
8469
|
+
* Search the documents of one custom schema type. Paging, `sort` and
|
|
8470
|
+
* `fields` travel as query parameters, not in the body.
|
|
8471
|
+
*
|
|
8472
|
+
* Filter and sort fields must be indexed on the index the search uses, or the
|
|
8473
|
+
* call answers `400`. A saved-search call (`{ searchQueryId, query }`) answers
|
|
8474
|
+
* `404` when no saved search has that id for `type`, and `502` means the
|
|
8475
|
+
* Schema Service could not confirm that `type` is a custom entity.
|
|
8476
|
+
*
|
|
8477
|
+
* @example
|
|
8478
|
+
* const hits = await client.search.search("vehicle", {
|
|
8479
|
+
* index: "vehicles",
|
|
8480
|
+
* queries: [{ type: "TEXT", query: "diesel", field: "name.en" }],
|
|
8481
|
+
* filters: { field: "status", operator: "EQ", value: "ACTIVE" },
|
|
8482
|
+
* });
|
|
8483
|
+
*/
|
|
8484
|
+
async search(type, input, opts = {}, auth2 = SERVICE29) {
|
|
8485
|
+
const { query, page } = pageQuery(opts);
|
|
8486
|
+
return requestPage(
|
|
8487
|
+
this.ctx.http,
|
|
8488
|
+
{
|
|
8489
|
+
method: "POST",
|
|
8490
|
+
path: `${this.base()}/search/${encodeURIComponent(type)}`,
|
|
8491
|
+
auth: auth2,
|
|
8492
|
+
query,
|
|
8493
|
+
body: input,
|
|
8494
|
+
idempotent: true
|
|
8495
|
+
// pure read over POST — safe to replay on 5xx/429
|
|
8496
|
+
},
|
|
8497
|
+
page
|
|
8498
|
+
);
|
|
8499
|
+
}
|
|
8500
|
+
/** List saved searches of one custom schema type (`opts.type`), or of every type. */
|
|
8501
|
+
async listSavedSearches(opts = {}, auth2 = SERVICE29) {
|
|
8502
|
+
const { query, page } = pageQuery(opts);
|
|
8503
|
+
const t = opts.type;
|
|
8504
|
+
return requestPage(
|
|
8505
|
+
this.ctx.http,
|
|
8506
|
+
{
|
|
8507
|
+
method: "GET",
|
|
8508
|
+
path: t === void 0 ? `${this.base()}/search/queries` : `${this.base()}/search/${encodeURIComponent(t)}/queries`,
|
|
8509
|
+
auth: auth2,
|
|
8510
|
+
query
|
|
8511
|
+
},
|
|
8512
|
+
page
|
|
8513
|
+
);
|
|
8514
|
+
}
|
|
8515
|
+
/** Fetch one saved search. */
|
|
8516
|
+
async getSavedSearch(type, id, opts = {}, auth2 = SERVICE29) {
|
|
8517
|
+
return this.ctx.http.request({
|
|
8518
|
+
method: "GET",
|
|
8519
|
+
path: `${this.base()}/search/${encodeURIComponent(type)}/queries/${encodeURIComponent(id)}`,
|
|
8520
|
+
auth: auth2,
|
|
8521
|
+
...opts.fields === void 0 ? {} : { query: { fields: opts.fields } }
|
|
8522
|
+
});
|
|
8523
|
+
}
|
|
8524
|
+
/**
|
|
8525
|
+
* Create or replace a saved search. Resolves to `{ id }` when it was created
|
|
8526
|
+
* (`201`) and to `undefined` when it replaced an existing one (`204`).
|
|
8527
|
+
*
|
|
8528
|
+
* A replace needs the stored `metadata.version` — `400` without it, `409`
|
|
8529
|
+
* when it is stale. `index` must already exist for `type` (`404`
|
|
8530
|
+
* otherwise). Saving does not start an index build.
|
|
8531
|
+
*/
|
|
8532
|
+
async upsertSavedSearch(type, id, input, auth2 = SERVICE29) {
|
|
8533
|
+
return this.ctx.http.request({
|
|
8534
|
+
method: "PUT",
|
|
8535
|
+
path: `${this.base()}/search/${encodeURIComponent(type)}/queries/${encodeURIComponent(id)}`,
|
|
8536
|
+
auth: auth2,
|
|
8537
|
+
body: input
|
|
8538
|
+
});
|
|
8539
|
+
}
|
|
8540
|
+
/** Delete a saved search. Does not start an index build. */
|
|
8541
|
+
async deleteSavedSearch(type, id, auth2 = SERVICE29) {
|
|
8542
|
+
await this.ctx.http.request({
|
|
8543
|
+
method: "DELETE",
|
|
8544
|
+
path: `${this.base()}/search/${encodeURIComponent(type)}/queries/${encodeURIComponent(id)}`,
|
|
8545
|
+
auth: auth2
|
|
8546
|
+
});
|
|
8547
|
+
}
|
|
8548
|
+
/** List search indexes of one custom schema type (`opts.type`), or of every type. */
|
|
8549
|
+
async listIndexes(opts = {}, auth2 = SERVICE29) {
|
|
8550
|
+
const { query, page } = pageQuery(opts);
|
|
8551
|
+
const t = opts.type;
|
|
8552
|
+
return requestPage(
|
|
8553
|
+
this.ctx.http,
|
|
8554
|
+
{
|
|
8555
|
+
method: "GET",
|
|
8556
|
+
path: t === void 0 ? `${this.base()}/search/indexes` : `${this.base()}/search/${encodeURIComponent(t)}/indexes`,
|
|
8557
|
+
auth: auth2,
|
|
8558
|
+
query
|
|
8559
|
+
},
|
|
8560
|
+
page
|
|
8561
|
+
);
|
|
8562
|
+
}
|
|
8563
|
+
/** Fetch one search index. */
|
|
8564
|
+
async getIndex(type, id, opts = {}, auth2 = SERVICE29) {
|
|
8565
|
+
return this.ctx.http.request({
|
|
8566
|
+
method: "GET",
|
|
8567
|
+
path: `${this.base()}/search/${encodeURIComponent(type)}/indexes/${encodeURIComponent(id)}`,
|
|
8568
|
+
auth: auth2,
|
|
8569
|
+
...opts.fields === void 0 ? {} : { query: { fields: opts.fields } }
|
|
8570
|
+
});
|
|
8571
|
+
}
|
|
8572
|
+
/**
|
|
8573
|
+
* Create or update a search index. Resolves to the id of the job that builds
|
|
8574
|
+
* it (`202`) — for a new index, a changed field list, or an index whose
|
|
8575
|
+
* status is `building` or `failed` — and to `undefined` (`204`) when the
|
|
8576
|
+
* index is `ready` and its fields are unchanged; `name` and `description`
|
|
8577
|
+
* still change then. Track the job with {@link getJob}.
|
|
8578
|
+
*
|
|
8579
|
+
* An update needs the stored `metadata.version` (`400` without it). `409`
|
|
8580
|
+
* means a job for this index is already running, or the version is stale.
|
|
8581
|
+
*/
|
|
8582
|
+
async upsertIndex(type, id, input, auth2 = SERVICE29) {
|
|
8583
|
+
return this.ctx.http.request({
|
|
8584
|
+
method: "PUT",
|
|
8585
|
+
path: `${this.base()}/search/${encodeURIComponent(type)}/indexes/${encodeURIComponent(id)}`,
|
|
8586
|
+
auth: auth2,
|
|
8587
|
+
body: input
|
|
8588
|
+
});
|
|
8589
|
+
}
|
|
8590
|
+
/**
|
|
8591
|
+
* Start deleting a search index. Resolves to the id of the job that removes
|
|
8592
|
+
* it (`202`); `409` means a job for this index is already running.
|
|
8593
|
+
*/
|
|
8594
|
+
async deleteIndex(type, id, auth2 = SERVICE29) {
|
|
8595
|
+
return this.ctx.http.request({
|
|
8596
|
+
method: "DELETE",
|
|
8597
|
+
path: `${this.base()}/search/${encodeURIComponent(type)}/indexes/${encodeURIComponent(id)}`,
|
|
8598
|
+
auth: auth2
|
|
8599
|
+
});
|
|
8600
|
+
}
|
|
8601
|
+
/** List index jobs of the tenant. */
|
|
8602
|
+
async listJobs(opts = {}, auth2 = SERVICE29) {
|
|
8603
|
+
const { query, page } = pageQuery(opts);
|
|
8604
|
+
return requestPage(
|
|
8605
|
+
this.ctx.http,
|
|
8606
|
+
{ method: "GET", path: `${this.base()}/jobs`, auth: auth2, query },
|
|
8607
|
+
page
|
|
8608
|
+
);
|
|
8609
|
+
}
|
|
8610
|
+
/** Fetch one index job. */
|
|
8611
|
+
async getJob(id, opts = {}, auth2 = SERVICE29) {
|
|
8612
|
+
return this.ctx.http.request({
|
|
8613
|
+
method: "GET",
|
|
8614
|
+
path: `${this.base()}/jobs/${encodeURIComponent(id)}`,
|
|
8615
|
+
auth: auth2,
|
|
8616
|
+
...opts.fields === void 0 ? {} : { query: { fields: opts.fields } }
|
|
8617
|
+
});
|
|
8618
|
+
}
|
|
8619
|
+
};
|
|
8620
|
+
|
|
8621
|
+
// src/services/imports.ts
|
|
8622
|
+
var SERVICE30 = { kind: "service" };
|
|
8445
8623
|
var DEFAULT_PAGE_SIZE = 50;
|
|
8446
8624
|
function pageArgs(opts) {
|
|
8447
8625
|
return { pageNumber: opts.pageNumber ?? 1, pageSize: opts.pageSize ?? DEFAULT_PAGE_SIZE };
|
|
@@ -8491,7 +8669,7 @@ var ImportService = class {
|
|
|
8491
8669
|
return `/importtool/${this.ctx.tenant}`;
|
|
8492
8670
|
}
|
|
8493
8671
|
/** List every import configuration of the tenant. */
|
|
8494
|
-
async listConfigs(auth2 =
|
|
8672
|
+
async listConfigs(auth2 = SERVICE30) {
|
|
8495
8673
|
return this.ctx.http.request({
|
|
8496
8674
|
method: "GET",
|
|
8497
8675
|
path: `${this.base()}/configs`,
|
|
@@ -8499,7 +8677,7 @@ var ImportService = class {
|
|
|
8499
8677
|
});
|
|
8500
8678
|
}
|
|
8501
8679
|
/** Fetch one configuration by id. */
|
|
8502
|
-
async getConfig(id, auth2 =
|
|
8680
|
+
async getConfig(id, auth2 = SERVICE30) {
|
|
8503
8681
|
return this.ctx.http.request({
|
|
8504
8682
|
method: "GET",
|
|
8505
8683
|
path: `${this.base()}/configs/${encodeURIComponent(id)}`,
|
|
@@ -8507,7 +8685,7 @@ var ImportService = class {
|
|
|
8507
8685
|
});
|
|
8508
8686
|
}
|
|
8509
8687
|
/** List the streams of one configuration. */
|
|
8510
|
-
async listStreams(configId, auth2 =
|
|
8688
|
+
async listStreams(configId, auth2 = SERVICE30) {
|
|
8511
8689
|
return this.ctx.http.request({
|
|
8512
8690
|
method: "GET",
|
|
8513
8691
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/streams`,
|
|
@@ -8515,7 +8693,7 @@ var ImportService = class {
|
|
|
8515
8693
|
});
|
|
8516
8694
|
}
|
|
8517
8695
|
/** Fetch one stream by id. */
|
|
8518
|
-
async getStream(id, auth2 =
|
|
8696
|
+
async getStream(id, auth2 = SERVICE30) {
|
|
8519
8697
|
return this.ctx.http.request({
|
|
8520
8698
|
method: "GET",
|
|
8521
8699
|
path: `${this.base()}/streams/${encodeURIComponent(id)}`,
|
|
@@ -8532,7 +8710,7 @@ var ImportService = class {
|
|
|
8532
8710
|
* takes stream **ids** — map through {@link listStreams} before passing a
|
|
8533
8711
|
* subset back.
|
|
8534
8712
|
*/
|
|
8535
|
-
async getStreamOrder(configId, auth2 =
|
|
8713
|
+
async getStreamOrder(configId, auth2 = SERVICE30) {
|
|
8536
8714
|
return this.ctx.http.request({
|
|
8537
8715
|
method: "GET",
|
|
8538
8716
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/stream-order`,
|
|
@@ -8544,7 +8722,7 @@ var ImportService = class {
|
|
|
8544
8722
|
* configured — the service answers `204`, not `404`, so an absent schedule is
|
|
8545
8723
|
* a normal result rather than an error.
|
|
8546
8724
|
*/
|
|
8547
|
-
async getSchedule(configId, auth2 =
|
|
8725
|
+
async getSchedule(configId, auth2 = SERVICE30) {
|
|
8548
8726
|
const res = await this.ctx.http.request({
|
|
8549
8727
|
method: "GET",
|
|
8550
8728
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
|
|
@@ -8565,7 +8743,7 @@ var ImportService = class {
|
|
|
8565
8743
|
* schedule. Use {@link deleteSchedule} to clear a schedule that outlived its
|
|
8566
8744
|
* configuration.
|
|
8567
8745
|
*/
|
|
8568
|
-
async setSchedule(configId, input, auth2 =
|
|
8746
|
+
async setSchedule(configId, input, auth2 = SERVICE30) {
|
|
8569
8747
|
return this.ctx.http.request({
|
|
8570
8748
|
method: "PUT",
|
|
8571
8749
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
|
|
@@ -8585,7 +8763,7 @@ var ImportService = class {
|
|
|
8585
8763
|
* The service answers `204`, so this resolves to `void` rather than to the
|
|
8586
8764
|
* removed schedule.
|
|
8587
8765
|
*/
|
|
8588
|
-
async deleteSchedule(configId, auth2 =
|
|
8766
|
+
async deleteSchedule(configId, auth2 = SERVICE30) {
|
|
8589
8767
|
await this.ctx.http.request({
|
|
8590
8768
|
method: "DELETE",
|
|
8591
8769
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
|
|
@@ -8634,7 +8812,7 @@ var ImportService = class {
|
|
|
8634
8812
|
* }
|
|
8635
8813
|
* ```
|
|
8636
8814
|
*/
|
|
8637
|
-
async triggerRun(configId, input = {}, auth2 =
|
|
8815
|
+
async triggerRun(configId, input = {}, auth2 = SERVICE30) {
|
|
8638
8816
|
return this.ctx.http.request({
|
|
8639
8817
|
method: "POST",
|
|
8640
8818
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/runs`,
|
|
@@ -8643,7 +8821,7 @@ var ImportService = class {
|
|
|
8643
8821
|
});
|
|
8644
8822
|
}
|
|
8645
8823
|
/** List a configuration's runs, newest first. */
|
|
8646
|
-
async listRuns(configId, opts = {}, auth2 =
|
|
8824
|
+
async listRuns(configId, opts = {}, auth2 = SERVICE30) {
|
|
8647
8825
|
const args = pageArgs(opts);
|
|
8648
8826
|
const wire = await this.ctx.http.request({
|
|
8649
8827
|
method: "GET",
|
|
@@ -8654,7 +8832,7 @@ var ImportService = class {
|
|
|
8654
8832
|
return toPage(wire, args);
|
|
8655
8833
|
}
|
|
8656
8834
|
/** Fetch one run with its per-stream progress. */
|
|
8657
|
-
async getRun(runId, auth2 =
|
|
8835
|
+
async getRun(runId, auth2 = SERVICE30) {
|
|
8658
8836
|
return this.ctx.http.request({
|
|
8659
8837
|
method: "GET",
|
|
8660
8838
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}`,
|
|
@@ -8674,7 +8852,7 @@ var ImportService = class {
|
|
|
8674
8852
|
* arrive as `{ type: "unknown" }` rather than throwing — see
|
|
8675
8853
|
* {@link ImportRunEvent}.
|
|
8676
8854
|
*/
|
|
8677
|
-
async *streamRun(runId, auth2 =
|
|
8855
|
+
async *streamRun(runId, auth2 = SERVICE30) {
|
|
8678
8856
|
const frames = this.ctx.http.requestStream({
|
|
8679
8857
|
method: "GET",
|
|
8680
8858
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/events`,
|
|
@@ -8689,7 +8867,7 @@ var ImportService = class {
|
|
|
8689
8867
|
* a result, not an error. A state conflict may instead come back as a `409`,
|
|
8690
8868
|
* which does throw.
|
|
8691
8869
|
*/
|
|
8692
|
-
async cancelRun(runId, opts = {}, auth2 =
|
|
8870
|
+
async cancelRun(runId, opts = {}, auth2 = SERVICE30) {
|
|
8693
8871
|
const query = {};
|
|
8694
8872
|
if (opts.force) query.force = "true";
|
|
8695
8873
|
return this.ctx.http.request({
|
|
@@ -8700,7 +8878,7 @@ var ImportService = class {
|
|
|
8700
8878
|
});
|
|
8701
8879
|
}
|
|
8702
8880
|
/** List the errors recorded during a run. */
|
|
8703
|
-
async listRunErrors(runId, opts = {}, auth2 =
|
|
8881
|
+
async listRunErrors(runId, opts = {}, auth2 = SERVICE30) {
|
|
8704
8882
|
const args = pageArgs(opts);
|
|
8705
8883
|
const wire = await this.ctx.http.request({
|
|
8706
8884
|
method: "GET",
|
|
@@ -8721,7 +8899,7 @@ var ImportService = class {
|
|
|
8721
8899
|
* `rows.length` as the size of the problem. `limit` defaults to 500 here
|
|
8722
8900
|
* (1–50 000); {@link downloadRunDiagnosticsCsv} defaults to 50 000.
|
|
8723
8901
|
*/
|
|
8724
|
-
async listRunDiagnostics(runId, query = {}, auth2 =
|
|
8902
|
+
async listRunDiagnostics(runId, query = {}, auth2 = SERVICE30) {
|
|
8725
8903
|
return this.ctx.http.request({
|
|
8726
8904
|
method: "GET",
|
|
8727
8905
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/diagnostics`,
|
|
@@ -8739,7 +8917,7 @@ var ImportService = class {
|
|
|
8739
8917
|
* prefixed with an apostrophe so spreadsheet software does not evaluate source
|
|
8740
8918
|
* data as a formula. Strip it if you parse the file instead of opening it.
|
|
8741
8919
|
*/
|
|
8742
|
-
async downloadRunDiagnosticsCsv(runId, query = {}, auth2 =
|
|
8920
|
+
async downloadRunDiagnosticsCsv(runId, query = {}, auth2 = SERVICE30) {
|
|
8743
8921
|
return this.ctx.http.request({
|
|
8744
8922
|
method: "GET",
|
|
8745
8923
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/diagnostics/csv`,
|
|
@@ -8748,7 +8926,7 @@ var ImportService = class {
|
|
|
8748
8926
|
});
|
|
8749
8927
|
}
|
|
8750
8928
|
/** List the target types that hold imported records — the valid `type` values for {@link searchRecords}. */
|
|
8751
|
-
async listDataTypes(auth2 =
|
|
8929
|
+
async listDataTypes(auth2 = SERVICE30) {
|
|
8752
8930
|
return this.ctx.http.request({
|
|
8753
8931
|
method: "GET",
|
|
8754
8932
|
path: `${this.base()}/data/types`,
|
|
@@ -8756,7 +8934,7 @@ var ImportService = class {
|
|
|
8756
8934
|
});
|
|
8757
8935
|
}
|
|
8758
8936
|
/** Search imported records of one target type. */
|
|
8759
|
-
async searchRecords(opts, auth2 =
|
|
8937
|
+
async searchRecords(opts, auth2 = SERVICE30) {
|
|
8760
8938
|
const args = pageArgs(opts);
|
|
8761
8939
|
const query = {
|
|
8762
8940
|
type: opts.type,
|
|
@@ -8774,7 +8952,7 @@ var ImportService = class {
|
|
|
8774
8952
|
return toPage(wire, args);
|
|
8775
8953
|
}
|
|
8776
8954
|
/** Search the imported records produced by one stream. */
|
|
8777
|
-
async searchStreamRecords(streamId, opts = {}, auth2 =
|
|
8955
|
+
async searchStreamRecords(streamId, opts = {}, auth2 = SERVICE30) {
|
|
8778
8956
|
const args = pageArgs(opts);
|
|
8779
8957
|
const query = {
|
|
8780
8958
|
page: args.pageNumber - 1,
|
|
@@ -8803,7 +8981,7 @@ var ImportService = class {
|
|
|
8803
8981
|
*
|
|
8804
8982
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8805
8983
|
*/
|
|
8806
|
-
async stats(query = {}, auth2 =
|
|
8984
|
+
async stats(query = {}, auth2 = SERVICE30) {
|
|
8807
8985
|
return this.ctx.http.request({
|
|
8808
8986
|
method: "GET",
|
|
8809
8987
|
path: `${this.base()}/stats`,
|
|
@@ -8821,7 +8999,7 @@ var ImportService = class {
|
|
|
8821
8999
|
*
|
|
8822
9000
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8823
9001
|
*/
|
|
8824
|
-
async listJobGroups(auth2 =
|
|
9002
|
+
async listJobGroups(auth2 = SERVICE30) {
|
|
8825
9003
|
return this.ctx.http.request({
|
|
8826
9004
|
method: "GET",
|
|
8827
9005
|
path: `${this.base()}/dashboard/job-groups`,
|
|
@@ -8837,7 +9015,7 @@ var ImportService = class {
|
|
|
8837
9015
|
*
|
|
8838
9016
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8839
9017
|
*/
|
|
8840
|
-
async getHealthThresholds(auth2 =
|
|
9018
|
+
async getHealthThresholds(auth2 = SERVICE30) {
|
|
8841
9019
|
return this.ctx.http.request({
|
|
8842
9020
|
method: "GET",
|
|
8843
9021
|
path: `${this.base()}/settings/health-thresholds`,
|
|
@@ -8849,7 +9027,7 @@ var ImportService = class {
|
|
|
8849
9027
|
*
|
|
8850
9028
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8851
9029
|
*/
|
|
8852
|
-
async getLicense(auth2 =
|
|
9030
|
+
async getLicense(auth2 = SERVICE30) {
|
|
8853
9031
|
return this.ctx.http.request({
|
|
8854
9032
|
method: "GET",
|
|
8855
9033
|
path: `${this.base()}/license`,
|
|
@@ -8869,7 +9047,7 @@ var ImportService = class {
|
|
|
8869
9047
|
*
|
|
8870
9048
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8871
9049
|
*/
|
|
8872
|
-
async retryRun(runId, auth2 =
|
|
9050
|
+
async retryRun(runId, auth2 = SERVICE30) {
|
|
8873
9051
|
return this.ctx.http.request({
|
|
8874
9052
|
method: "POST",
|
|
8875
9053
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/retry`,
|
|
@@ -8879,7 +9057,7 @@ var ImportService = class {
|
|
|
8879
9057
|
};
|
|
8880
9058
|
|
|
8881
9059
|
// src/services/audit-log.ts
|
|
8882
|
-
var
|
|
9060
|
+
var SERVICE31 = { kind: "service" };
|
|
8883
9061
|
function toPage2(wire) {
|
|
8884
9062
|
const pageNumber = wire.page ?? 1;
|
|
8885
9063
|
const totalPages = wire.totalPages ?? 0;
|
|
@@ -8931,7 +9109,7 @@ var AuditLogService = class {
|
|
|
8931
9109
|
* });
|
|
8932
9110
|
* ```
|
|
8933
9111
|
*/
|
|
8934
|
-
async list(opts = {}, auth2 =
|
|
9112
|
+
async list(opts = {}, auth2 = SERVICE31) {
|
|
8935
9113
|
const wire = await this.ctx.http.request({
|
|
8936
9114
|
method: "GET",
|
|
8937
9115
|
path: `${this.base()}/changelogs`,
|
|
@@ -8945,7 +9123,7 @@ var AuditLogService = class {
|
|
|
8945
9123
|
};
|
|
8946
9124
|
|
|
8947
9125
|
// src/services/unit-handling.ts
|
|
8948
|
-
var
|
|
9126
|
+
var SERVICE32 = { kind: "service" };
|
|
8949
9127
|
var UnitHandlingService = class {
|
|
8950
9128
|
constructor(ctx) {
|
|
8951
9129
|
this.ctx = ctx;
|
|
@@ -8956,7 +9134,7 @@ var UnitHandlingService = class {
|
|
|
8956
9134
|
return `/unit-handling/${this.ctx.tenant}`;
|
|
8957
9135
|
}
|
|
8958
9136
|
/** Find units (filter/sort/page). */
|
|
8959
|
-
async listUnits(query = {}, auth2 =
|
|
9137
|
+
async listUnits(query = {}, auth2 = SERVICE32) {
|
|
8960
9138
|
return this.ctx.http.request({
|
|
8961
9139
|
method: "GET",
|
|
8962
9140
|
path: `${this.base()}/units`,
|
|
@@ -8965,7 +9143,7 @@ var UnitHandlingService = class {
|
|
|
8965
9143
|
});
|
|
8966
9144
|
}
|
|
8967
9145
|
/** Retrieve a unit by code. */
|
|
8968
|
-
async getUnit(unitCode, auth2 =
|
|
9146
|
+
async getUnit(unitCode, auth2 = SERVICE32) {
|
|
8969
9147
|
return this.ctx.http.request({
|
|
8970
9148
|
method: "GET",
|
|
8971
9149
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -8973,11 +9151,11 @@ var UnitHandlingService = class {
|
|
|
8973
9151
|
});
|
|
8974
9152
|
}
|
|
8975
9153
|
/** Add a new unit. */
|
|
8976
|
-
async createUnit(input, auth2 =
|
|
9154
|
+
async createUnit(input, auth2 = SERVICE32) {
|
|
8977
9155
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/units`, auth: auth2, body: input });
|
|
8978
9156
|
}
|
|
8979
9157
|
/** Update a unit by code. */
|
|
8980
|
-
async updateUnit(unitCode, input, auth2 =
|
|
9158
|
+
async updateUnit(unitCode, input, auth2 = SERVICE32) {
|
|
8981
9159
|
await this.ctx.http.request({
|
|
8982
9160
|
method: "PUT",
|
|
8983
9161
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -8986,7 +9164,7 @@ var UnitHandlingService = class {
|
|
|
8986
9164
|
});
|
|
8987
9165
|
}
|
|
8988
9166
|
/** Delete a unit by code. */
|
|
8989
|
-
async deleteUnit(unitCode, auth2 =
|
|
9167
|
+
async deleteUnit(unitCode, auth2 = SERVICE32) {
|
|
8990
9168
|
await this.ctx.http.request({
|
|
8991
9169
|
method: "DELETE",
|
|
8992
9170
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -8994,7 +9172,7 @@ var UnitHandlingService = class {
|
|
|
8994
9172
|
});
|
|
8995
9173
|
}
|
|
8996
9174
|
/** Delete multiple units by code (bulk). The codes are sent as the request body. */
|
|
8997
|
-
async deleteUnits(codes, auth2 =
|
|
9175
|
+
async deleteUnits(codes, auth2 = SERVICE32) {
|
|
8998
9176
|
await this.ctx.http.request({
|
|
8999
9177
|
method: "DELETE",
|
|
9000
9178
|
path: `${this.base()}/units`,
|
|
@@ -9003,7 +9181,7 @@ var UnitHandlingService = class {
|
|
|
9003
9181
|
});
|
|
9004
9182
|
}
|
|
9005
9183
|
/** Fetch a conversion factor (`PUT /units/conversion-factor-commands`). */
|
|
9006
|
-
async getConversionFactor(input, auth2 =
|
|
9184
|
+
async getConversionFactor(input, auth2 = SERVICE32) {
|
|
9007
9185
|
return this.ctx.http.request({
|
|
9008
9186
|
method: "PUT",
|
|
9009
9187
|
path: `${this.base()}/units/conversion-factor-commands`,
|
|
@@ -9012,7 +9190,7 @@ var UnitHandlingService = class {
|
|
|
9012
9190
|
});
|
|
9013
9191
|
}
|
|
9014
9192
|
/** Convert a value between units (`PUT /units/convert-unit-commands`). */
|
|
9015
|
-
async convertUnit(input, auth2 =
|
|
9193
|
+
async convertUnit(input, auth2 = SERVICE32) {
|
|
9016
9194
|
return this.ctx.http.request({
|
|
9017
9195
|
method: "PUT",
|
|
9018
9196
|
path: `${this.base()}/units/convert-unit-commands`,
|
|
@@ -9021,13 +9199,13 @@ var UnitHandlingService = class {
|
|
|
9021
9199
|
});
|
|
9022
9200
|
}
|
|
9023
9201
|
/** List all unit types. */
|
|
9024
|
-
async listUnitTypes(auth2 =
|
|
9202
|
+
async listUnitTypes(auth2 = SERVICE32) {
|
|
9025
9203
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/types`, auth: auth2 });
|
|
9026
9204
|
}
|
|
9027
9205
|
};
|
|
9028
9206
|
|
|
9029
9207
|
// src/services/catalog.ts
|
|
9030
|
-
var
|
|
9208
|
+
var SERVICE33 = { kind: "service" };
|
|
9031
9209
|
var CatalogService = class {
|
|
9032
9210
|
constructor(ctx) {
|
|
9033
9211
|
this.ctx = ctx;
|
|
@@ -9038,7 +9216,7 @@ var CatalogService = class {
|
|
|
9038
9216
|
return `/catalog/${this.ctx.tenant}/catalogs`;
|
|
9039
9217
|
}
|
|
9040
9218
|
/** List catalogs (filtered/sorted). */
|
|
9041
|
-
async listCatalogs(query = {}, auth2 =
|
|
9219
|
+
async listCatalogs(query = {}, auth2 = SERVICE33) {
|
|
9042
9220
|
return this.ctx.http.request({
|
|
9043
9221
|
method: "GET",
|
|
9044
9222
|
path: this.base(),
|
|
@@ -9047,7 +9225,7 @@ var CatalogService = class {
|
|
|
9047
9225
|
});
|
|
9048
9226
|
}
|
|
9049
9227
|
/** Retrieve a catalog by id. */
|
|
9050
|
-
async getCatalog(catalogId, auth2 =
|
|
9228
|
+
async getCatalog(catalogId, auth2 = SERVICE33) {
|
|
9051
9229
|
return this.ctx.http.request({
|
|
9052
9230
|
method: "GET",
|
|
9053
9231
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9055,7 +9233,7 @@ var CatalogService = class {
|
|
|
9055
9233
|
});
|
|
9056
9234
|
}
|
|
9057
9235
|
/** Retrieve all catalogs that contain a category. */
|
|
9058
|
-
async getCatalogsForCategory(categoryId, auth2 =
|
|
9236
|
+
async getCatalogsForCategory(categoryId, auth2 = SERVICE33) {
|
|
9059
9237
|
return this.ctx.http.request({
|
|
9060
9238
|
method: "GET",
|
|
9061
9239
|
path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
|
|
@@ -9063,11 +9241,11 @@ var CatalogService = class {
|
|
|
9063
9241
|
});
|
|
9064
9242
|
}
|
|
9065
9243
|
/** Create a catalog. */
|
|
9066
|
-
async createCatalog(input, auth2 =
|
|
9244
|
+
async createCatalog(input, auth2 = SERVICE33) {
|
|
9067
9245
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
9068
9246
|
}
|
|
9069
9247
|
/** Upsert a catalog by id (`PUT`). */
|
|
9070
|
-
async updateCatalog(catalogId, input, auth2 =
|
|
9248
|
+
async updateCatalog(catalogId, input, auth2 = SERVICE33) {
|
|
9071
9249
|
return this.ctx.http.request({
|
|
9072
9250
|
method: "PUT",
|
|
9073
9251
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9076,7 +9254,7 @@ var CatalogService = class {
|
|
|
9076
9254
|
});
|
|
9077
9255
|
}
|
|
9078
9256
|
/** Partially update a catalog by id (`PATCH`). */
|
|
9079
|
-
async patchCatalog(catalogId, patch, auth2 =
|
|
9257
|
+
async patchCatalog(catalogId, patch, auth2 = SERVICE33) {
|
|
9080
9258
|
await this.ctx.http.request({
|
|
9081
9259
|
method: "PATCH",
|
|
9082
9260
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9085,7 +9263,7 @@ var CatalogService = class {
|
|
|
9085
9263
|
});
|
|
9086
9264
|
}
|
|
9087
9265
|
/** Remove a catalog by id. */
|
|
9088
|
-
async deleteCatalog(catalogId, auth2 =
|
|
9266
|
+
async deleteCatalog(catalogId, auth2 = SERVICE33) {
|
|
9089
9267
|
await this.ctx.http.request({
|
|
9090
9268
|
method: "DELETE",
|
|
9091
9269
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9095,7 +9273,7 @@ var CatalogService = class {
|
|
|
9095
9273
|
};
|
|
9096
9274
|
|
|
9097
9275
|
// src/services/vendor.ts
|
|
9098
|
-
var
|
|
9276
|
+
var SERVICE34 = { kind: "service" };
|
|
9099
9277
|
var VendorService = class {
|
|
9100
9278
|
constructor(ctx) {
|
|
9101
9279
|
this.ctx = ctx;
|
|
@@ -9107,7 +9285,7 @@ var VendorService = class {
|
|
|
9107
9285
|
}
|
|
9108
9286
|
// --- Vendors ---
|
|
9109
9287
|
/** List all vendors. */
|
|
9110
|
-
async listVendors(query = {}, auth2 =
|
|
9288
|
+
async listVendors(query = {}, auth2 = SERVICE34) {
|
|
9111
9289
|
return this.ctx.http.request({
|
|
9112
9290
|
method: "GET",
|
|
9113
9291
|
path: `${this.base()}/vendors`,
|
|
@@ -9116,7 +9294,7 @@ var VendorService = class {
|
|
|
9116
9294
|
});
|
|
9117
9295
|
}
|
|
9118
9296
|
/** Retrieve a vendor by id. */
|
|
9119
|
-
async getVendor(vendorId, auth2 =
|
|
9297
|
+
async getVendor(vendorId, auth2 = SERVICE34) {
|
|
9120
9298
|
return this.ctx.http.request({
|
|
9121
9299
|
method: "GET",
|
|
9122
9300
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -9127,7 +9305,7 @@ var VendorService = class {
|
|
|
9127
9305
|
* Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to
|
|
9128
9306
|
* a string; paging, sort and fields go in the query string.
|
|
9129
9307
|
*/
|
|
9130
|
-
async searchVendors(query, auth2 =
|
|
9308
|
+
async searchVendors(query, auth2 = SERVICE34) {
|
|
9131
9309
|
const input = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
9132
9310
|
return this.ctx.http.request({
|
|
9133
9311
|
method: "POST",
|
|
@@ -9137,11 +9315,11 @@ var VendorService = class {
|
|
|
9137
9315
|
});
|
|
9138
9316
|
}
|
|
9139
9317
|
/** Create a vendor. */
|
|
9140
|
-
async createVendor(input, auth2 =
|
|
9318
|
+
async createVendor(input, auth2 = SERVICE34) {
|
|
9141
9319
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
|
|
9142
9320
|
}
|
|
9143
9321
|
/** Upsert a vendor by id (`PUT`). */
|
|
9144
|
-
async updateVendor(vendorId, input, auth2 =
|
|
9322
|
+
async updateVendor(vendorId, input, auth2 = SERVICE34) {
|
|
9145
9323
|
await this.ctx.http.request({
|
|
9146
9324
|
method: "PUT",
|
|
9147
9325
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -9150,7 +9328,7 @@ var VendorService = class {
|
|
|
9150
9328
|
});
|
|
9151
9329
|
}
|
|
9152
9330
|
/** Delete a vendor by id. */
|
|
9153
|
-
async deleteVendor(vendorId, auth2 =
|
|
9331
|
+
async deleteVendor(vendorId, auth2 = SERVICE34) {
|
|
9154
9332
|
await this.ctx.http.request({
|
|
9155
9333
|
method: "DELETE",
|
|
9156
9334
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -9159,7 +9337,7 @@ var VendorService = class {
|
|
|
9159
9337
|
}
|
|
9160
9338
|
// --- Vendor locations ---
|
|
9161
9339
|
/** List all vendor locations. */
|
|
9162
|
-
async listVendorLocations(query = {}, auth2 =
|
|
9340
|
+
async listVendorLocations(query = {}, auth2 = SERVICE34) {
|
|
9163
9341
|
return this.ctx.http.request({
|
|
9164
9342
|
method: "GET",
|
|
9165
9343
|
path: `${this.base()}/locations`,
|
|
@@ -9168,7 +9346,7 @@ var VendorService = class {
|
|
|
9168
9346
|
});
|
|
9169
9347
|
}
|
|
9170
9348
|
/** Retrieve a vendor location by id. */
|
|
9171
|
-
async getVendorLocation(locationId, auth2 =
|
|
9349
|
+
async getVendorLocation(locationId, auth2 = SERVICE34) {
|
|
9172
9350
|
return this.ctx.http.request({
|
|
9173
9351
|
method: "GET",
|
|
9174
9352
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -9176,11 +9354,11 @@ var VendorService = class {
|
|
|
9176
9354
|
});
|
|
9177
9355
|
}
|
|
9178
9356
|
/** Create a vendor location. */
|
|
9179
|
-
async createVendorLocation(input, auth2 =
|
|
9357
|
+
async createVendorLocation(input, auth2 = SERVICE34) {
|
|
9180
9358
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
|
|
9181
9359
|
}
|
|
9182
9360
|
/** Upsert a vendor location by id (`PUT`). */
|
|
9183
|
-
async updateVendorLocation(locationId, input, auth2 =
|
|
9361
|
+
async updateVendorLocation(locationId, input, auth2 = SERVICE34) {
|
|
9184
9362
|
await this.ctx.http.request({
|
|
9185
9363
|
method: "PUT",
|
|
9186
9364
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -9189,7 +9367,7 @@ var VendorService = class {
|
|
|
9189
9367
|
});
|
|
9190
9368
|
}
|
|
9191
9369
|
/** Delete a vendor location by id. */
|
|
9192
|
-
async deleteVendorLocation(locationId, auth2 =
|
|
9370
|
+
async deleteVendorLocation(locationId, auth2 = SERVICE34) {
|
|
9193
9371
|
await this.ctx.http.request({
|
|
9194
9372
|
method: "DELETE",
|
|
9195
9373
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -9199,7 +9377,7 @@ var VendorService = class {
|
|
|
9199
9377
|
};
|
|
9200
9378
|
|
|
9201
9379
|
// src/services/customer-admin.ts
|
|
9202
|
-
var
|
|
9380
|
+
var SERVICE35 = { kind: "service" };
|
|
9203
9381
|
var CustomerAdminService = class {
|
|
9204
9382
|
constructor(ctx) {
|
|
9205
9383
|
this.ctx = ctx;
|
|
@@ -9220,7 +9398,7 @@ var CustomerAdminService = class {
|
|
|
9220
9398
|
}
|
|
9221
9399
|
// --- Customers ---
|
|
9222
9400
|
/** List customers. */
|
|
9223
|
-
async listCustomers(query = {}, auth2 =
|
|
9401
|
+
async listCustomers(query = {}, auth2 = SERVICE35) {
|
|
9224
9402
|
return this.ctx.http.request({
|
|
9225
9403
|
method: "GET",
|
|
9226
9404
|
path: this.base(),
|
|
@@ -9232,7 +9410,7 @@ var CustomerAdminService = class {
|
|
|
9232
9410
|
* Search customers (`POST /customers/search`). A built filter in `q` is resolved
|
|
9233
9411
|
* to a string; `pageNumber`, `pageSize`, `sort` and `expand` go in the query string.
|
|
9234
9412
|
*/
|
|
9235
|
-
async searchCustomers(query, auth2 =
|
|
9413
|
+
async searchCustomers(query, auth2 = SERVICE35) {
|
|
9236
9414
|
const input = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
9237
9415
|
return this.ctx.http.request({
|
|
9238
9416
|
method: "POST",
|
|
@@ -9242,28 +9420,28 @@ var CustomerAdminService = class {
|
|
|
9242
9420
|
});
|
|
9243
9421
|
}
|
|
9244
9422
|
/** Retrieve a customer profile by number. */
|
|
9245
|
-
async getCustomer(customerNumber, auth2 =
|
|
9423
|
+
async getCustomer(customerNumber, auth2 = SERVICE35) {
|
|
9246
9424
|
return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
|
|
9247
9425
|
}
|
|
9248
9426
|
/** Create a customer. */
|
|
9249
|
-
async createCustomer(input, auth2 =
|
|
9427
|
+
async createCustomer(input, auth2 = SERVICE35) {
|
|
9250
9428
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
9251
9429
|
}
|
|
9252
9430
|
/** Upsert a customer profile by number (`PUT`). */
|
|
9253
|
-
async upsertCustomer(customerNumber, input, auth2 =
|
|
9431
|
+
async upsertCustomer(customerNumber, input, auth2 = SERVICE35) {
|
|
9254
9432
|
return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
|
|
9255
9433
|
}
|
|
9256
9434
|
/** Partially update a customer profile (`PATCH`). */
|
|
9257
|
-
async patchCustomer(customerNumber, patch, auth2 =
|
|
9435
|
+
async patchCustomer(customerNumber, patch, auth2 = SERVICE35) {
|
|
9258
9436
|
await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
|
|
9259
9437
|
}
|
|
9260
9438
|
/** Delete a customer profile. */
|
|
9261
|
-
async deleteCustomer(customerNumber, auth2 =
|
|
9439
|
+
async deleteCustomer(customerNumber, auth2 = SERVICE35) {
|
|
9262
9440
|
await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
|
|
9263
9441
|
}
|
|
9264
9442
|
// --- Addresses ---
|
|
9265
9443
|
/** List a customer's addresses. */
|
|
9266
|
-
async listAddresses(customerNumber, auth2 =
|
|
9444
|
+
async listAddresses(customerNumber, auth2 = SERVICE35) {
|
|
9267
9445
|
return this.ctx.http.request({
|
|
9268
9446
|
method: "GET",
|
|
9269
9447
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -9271,11 +9449,11 @@ var CustomerAdminService = class {
|
|
|
9271
9449
|
});
|
|
9272
9450
|
}
|
|
9273
9451
|
/** Retrieve one address. */
|
|
9274
|
-
async getAddress(customerNumber, addressId, auth2 =
|
|
9452
|
+
async getAddress(customerNumber, addressId, auth2 = SERVICE35) {
|
|
9275
9453
|
return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
9276
9454
|
}
|
|
9277
9455
|
/** Add an address. */
|
|
9278
|
-
async addAddress(customerNumber, input, auth2 =
|
|
9456
|
+
async addAddress(customerNumber, input, auth2 = SERVICE35) {
|
|
9279
9457
|
return this.ctx.http.request({
|
|
9280
9458
|
method: "POST",
|
|
9281
9459
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -9284,19 +9462,19 @@ var CustomerAdminService = class {
|
|
|
9284
9462
|
});
|
|
9285
9463
|
}
|
|
9286
9464
|
/** Upsert an address by id (`PUT`). */
|
|
9287
|
-
async upsertAddress(customerNumber, addressId, input, auth2 =
|
|
9465
|
+
async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE35) {
|
|
9288
9466
|
return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
|
|
9289
9467
|
}
|
|
9290
9468
|
/** Partially update an address by id (`PATCH`). */
|
|
9291
|
-
async patchAddress(customerNumber, addressId, patch, auth2 =
|
|
9469
|
+
async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE35) {
|
|
9292
9470
|
await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
|
|
9293
9471
|
}
|
|
9294
9472
|
/** Delete an address by id. */
|
|
9295
|
-
async deleteAddress(customerNumber, addressId, auth2 =
|
|
9473
|
+
async deleteAddress(customerNumber, addressId, auth2 = SERVICE35) {
|
|
9296
9474
|
await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
9297
9475
|
}
|
|
9298
9476
|
/** Add tags to an address (`?tags=` query). */
|
|
9299
|
-
async addAddressTags(customerNumber, addressId, tags, auth2 =
|
|
9477
|
+
async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE35) {
|
|
9300
9478
|
await this.ctx.http.request({
|
|
9301
9479
|
method: "POST",
|
|
9302
9480
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -9305,7 +9483,7 @@ var CustomerAdminService = class {
|
|
|
9305
9483
|
});
|
|
9306
9484
|
}
|
|
9307
9485
|
/** Remove tags from an address (`?tags=` query). */
|
|
9308
|
-
async removeAddressTags(customerNumber, addressId, tags, auth2 =
|
|
9486
|
+
async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE35) {
|
|
9309
9487
|
await this.ctx.http.request({
|
|
9310
9488
|
method: "DELETE",
|
|
9311
9489
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -9319,7 +9497,7 @@ var CustomerAdminService = class {
|
|
|
9319
9497
|
* `customer.import_read` scope. An unconfigured tenant answers with an empty
|
|
9320
9498
|
* object rather than a 404.
|
|
9321
9499
|
*/
|
|
9322
|
-
async getPasswordMigrationRetention(auth2 =
|
|
9500
|
+
async getPasswordMigrationRetention(auth2 = SERVICE35) {
|
|
9323
9501
|
return this.ctx.http.request({
|
|
9324
9502
|
method: "GET",
|
|
9325
9503
|
path: this.configPath(),
|
|
@@ -9332,7 +9510,7 @@ var CustomerAdminService = class {
|
|
|
9332
9510
|
* `legacyAuth`** — that import is rejected without an active config. Re-POST with
|
|
9333
9511
|
* an earlier `retentionEndDate` to shorten a running window.
|
|
9334
9512
|
*/
|
|
9335
|
-
async configurePasswordMigrationRetention(input, auth2 =
|
|
9513
|
+
async configurePasswordMigrationRetention(input, auth2 = SERVICE35) {
|
|
9336
9514
|
return this.ctx.http.request({
|
|
9337
9515
|
method: "POST",
|
|
9338
9516
|
path: this.configPath(),
|
|
@@ -9345,7 +9523,7 @@ var CustomerAdminService = class {
|
|
|
9345
9523
|
* Intended for after the migration window: when the window ends, unmigrated
|
|
9346
9524
|
* accounts need a password reset and their legacy credentials are cleared.
|
|
9347
9525
|
*/
|
|
9348
|
-
async deletePasswordMigrationRetention(auth2 =
|
|
9526
|
+
async deletePasswordMigrationRetention(auth2 = SERVICE35) {
|
|
9349
9527
|
await this.ctx.http.request({ method: "DELETE", path: this.configPath(), auth: auth2 });
|
|
9350
9528
|
}
|
|
9351
9529
|
// --- Bulk import ---
|
|
@@ -9358,7 +9536,7 @@ var CustomerAdminService = class {
|
|
|
9358
9536
|
* `account.legacyAuth`, and importing `legacyAuth` requires an active retention
|
|
9359
9537
|
* config (see `configurePasswordMigrationRetention`).
|
|
9360
9538
|
*/
|
|
9361
|
-
async importCustomers(input, auth2 =
|
|
9539
|
+
async importCustomers(input, auth2 = SERVICE35) {
|
|
9362
9540
|
return this.ctx.http.request({
|
|
9363
9541
|
method: "POST",
|
|
9364
9542
|
path: `${this.base()}/import`,
|
|
@@ -9369,7 +9547,7 @@ var CustomerAdminService = class {
|
|
|
9369
9547
|
};
|
|
9370
9548
|
|
|
9371
9549
|
// src/services/approval.ts
|
|
9372
|
-
var
|
|
9550
|
+
var SERVICE36 = { kind: "service" };
|
|
9373
9551
|
var ApprovalService = class {
|
|
9374
9552
|
constructor(ctx) {
|
|
9375
9553
|
this.ctx = ctx;
|
|
@@ -9380,7 +9558,7 @@ var ApprovalService = class {
|
|
|
9380
9558
|
return `/approval/${this.ctx.tenant}`;
|
|
9381
9559
|
}
|
|
9382
9560
|
/** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
|
|
9383
|
-
async listApprovals(query = {}, auth2 =
|
|
9561
|
+
async listApprovals(query = {}, auth2 = SERVICE36) {
|
|
9384
9562
|
return this.ctx.http.request({
|
|
9385
9563
|
method: "GET",
|
|
9386
9564
|
path: `${this.base()}/approvals`,
|
|
@@ -9389,7 +9567,7 @@ var ApprovalService = class {
|
|
|
9389
9567
|
});
|
|
9390
9568
|
}
|
|
9391
9569
|
/** Retrieve a single approval by id. */
|
|
9392
|
-
async getApproval(approvalId, auth2 =
|
|
9570
|
+
async getApproval(approvalId, auth2 = SERVICE36) {
|
|
9393
9571
|
return this.ctx.http.request({
|
|
9394
9572
|
method: "GET",
|
|
9395
9573
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -9397,7 +9575,7 @@ var ApprovalService = class {
|
|
|
9397
9575
|
});
|
|
9398
9576
|
}
|
|
9399
9577
|
/** Create an approval request (cart or quote). Returns the created `{ id }`. */
|
|
9400
|
-
async createApproval(input, auth2 =
|
|
9578
|
+
async createApproval(input, auth2 = SERVICE36) {
|
|
9401
9579
|
return this.ctx.http.request({
|
|
9402
9580
|
method: "POST",
|
|
9403
9581
|
path: `${this.base()}/approvals`,
|
|
@@ -9406,7 +9584,7 @@ var ApprovalService = class {
|
|
|
9406
9584
|
});
|
|
9407
9585
|
}
|
|
9408
9586
|
/** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
|
|
9409
|
-
async updateApproval(approvalId, ops, auth2 =
|
|
9587
|
+
async updateApproval(approvalId, ops, auth2 = SERVICE36) {
|
|
9410
9588
|
await this.ctx.http.request({
|
|
9411
9589
|
method: "PATCH",
|
|
9412
9590
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -9415,7 +9593,7 @@ var ApprovalService = class {
|
|
|
9415
9593
|
});
|
|
9416
9594
|
}
|
|
9417
9595
|
/** Delete an approval by id. */
|
|
9418
|
-
async deleteApproval(approvalId, auth2 =
|
|
9596
|
+
async deleteApproval(approvalId, auth2 = SERVICE36) {
|
|
9419
9597
|
await this.ctx.http.request({
|
|
9420
9598
|
method: "DELETE",
|
|
9421
9599
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -9423,7 +9601,7 @@ var ApprovalService = class {
|
|
|
9423
9601
|
});
|
|
9424
9602
|
}
|
|
9425
9603
|
/** Check whether an operation on a resource is permitted / needs approval. */
|
|
9426
|
-
async checkPermitted(input, auth2 =
|
|
9604
|
+
async checkPermitted(input, auth2 = SERVICE36) {
|
|
9427
9605
|
return this.ctx.http.request({
|
|
9428
9606
|
method: "POST",
|
|
9429
9607
|
path: `${this.base()}/approval/permitted`,
|
|
@@ -9432,7 +9610,7 @@ var ApprovalService = class {
|
|
|
9432
9610
|
});
|
|
9433
9611
|
}
|
|
9434
9612
|
/** Search for users eligible to approve a resource. Returns an array. */
|
|
9435
|
-
async searchApprovers(input, auth2 =
|
|
9613
|
+
async searchApprovers(input, auth2 = SERVICE36) {
|
|
9436
9614
|
return this.ctx.http.request({
|
|
9437
9615
|
method: "POST",
|
|
9438
9616
|
path: `${this.base()}/search/users`,
|
|
@@ -9494,6 +9672,7 @@ var EmporixClient = class {
|
|
|
9494
9672
|
quotes;
|
|
9495
9673
|
returns;
|
|
9496
9674
|
indexing;
|
|
9675
|
+
search;
|
|
9497
9676
|
imports;
|
|
9498
9677
|
auditLogs;
|
|
9499
9678
|
units;
|
|
@@ -9568,6 +9747,7 @@ var EmporixClient = class {
|
|
|
9568
9747
|
this.quotes = new QuoteService(mk(QuoteService.channel));
|
|
9569
9748
|
this.returns = new ReturnsService(mk(ReturnsService.channel));
|
|
9570
9749
|
this.indexing = new IndexingService(mk(IndexingService.channel));
|
|
9750
|
+
this.search = new SearchService(mk(SearchService.channel));
|
|
9571
9751
|
this.imports = new ImportService(mk(ImportService.channel));
|
|
9572
9752
|
this.auditLogs = new AuditLogService(mk(AuditLogService.channel));
|
|
9573
9753
|
this.units = new UnitHandlingService(mk(UnitHandlingService.channel));
|
|
@@ -9696,6 +9876,7 @@ exports.RewardPointsService = RewardPointsService;
|
|
|
9696
9876
|
exports.STORAGE_KEYS = STORAGE_KEYS;
|
|
9697
9877
|
exports.SalesOrdersService = SalesOrdersService;
|
|
9698
9878
|
exports.SchemaService = SchemaService;
|
|
9879
|
+
exports.SearchService = SearchService;
|
|
9699
9880
|
exports.SegmentService = SegmentService;
|
|
9700
9881
|
exports.SequentialIdService = SequentialIdService;
|
|
9701
9882
|
exports.SessionContextService = SessionContextService;
|