@viu/emporix-sdk 4.4.0 → 4.6.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 +16 -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 +303 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +579 -4
- package/dist/index.d.ts +579 -4
- package/dist/index.js +303 -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.6.0";
|
|
1248
1248
|
|
|
1249
1249
|
// src/version.ts
|
|
1250
1250
|
var SDK_VERSION = version;
|
|
@@ -8440,8 +8440,222 @@ 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
|
+
* `metadata.version` is optional on an update too. When sent, it is an
|
|
8580
|
+
* optimistic lock: a stale one answers `409`, as does a job that is already
|
|
8581
|
+
* running for this index.
|
|
8582
|
+
*/
|
|
8583
|
+
async upsertIndex(type, id, input, auth2 = SERVICE29) {
|
|
8584
|
+
return this.ctx.http.request({
|
|
8585
|
+
method: "PUT",
|
|
8586
|
+
path: `${this.base()}/search/${encodeURIComponent(type)}/indexes/${encodeURIComponent(id)}`,
|
|
8587
|
+
auth: auth2,
|
|
8588
|
+
body: input
|
|
8589
|
+
});
|
|
8590
|
+
}
|
|
8591
|
+
/**
|
|
8592
|
+
* Start deleting a search index. Resolves to the id of the job that removes
|
|
8593
|
+
* it (`202`); `409` means a job for this index is already running.
|
|
8594
|
+
*/
|
|
8595
|
+
async deleteIndex(type, id, auth2 = SERVICE29) {
|
|
8596
|
+
return this.ctx.http.request({
|
|
8597
|
+
method: "DELETE",
|
|
8598
|
+
path: `${this.base()}/search/${encodeURIComponent(type)}/indexes/${encodeURIComponent(id)}`,
|
|
8599
|
+
auth: auth2
|
|
8600
|
+
});
|
|
8601
|
+
}
|
|
8602
|
+
/**
|
|
8603
|
+
* Export the configuration of the selected indexes as one package, to be
|
|
8604
|
+
* imported on another tenant with {@link importIndexes}. The decoded `data`
|
|
8605
|
+
* holds `id`, `type`, `fields` and the optional `name` and `description` of
|
|
8606
|
+
* each index, not its `status` or `metadata`. `404` when a selected index does
|
|
8607
|
+
* not exist, `400` for an empty selection.
|
|
8608
|
+
*/
|
|
8609
|
+
async exportIndexes(selections, auth2 = SERVICE29) {
|
|
8610
|
+
return this.ctx.http.request({
|
|
8611
|
+
method: "POST",
|
|
8612
|
+
path: `${this.base()}/search/indexes/export`,
|
|
8613
|
+
auth: auth2,
|
|
8614
|
+
body: selections,
|
|
8615
|
+
idempotent: true
|
|
8616
|
+
// pure read over POST — safe to replay on 5xx/429
|
|
8617
|
+
});
|
|
8618
|
+
}
|
|
8619
|
+
/**
|
|
8620
|
+
* Create or update every index in a package from {@link exportIndexes}, with
|
|
8621
|
+
* the same checks as {@link upsertIndex}. Resolves to one result per index,
|
|
8622
|
+
* in package order; `jobId` and `jobType` are absent for a ready index whose
|
|
8623
|
+
* fields did not change.
|
|
8624
|
+
*
|
|
8625
|
+
* Not atomic: when an index fails, the ones before it stay created or updated
|
|
8626
|
+
* and the call throws that index's error — `400` for an unreadable package or
|
|
8627
|
+
* an invalid field, `409` for a running job or a stale `metadata.version`.
|
|
8628
|
+
*/
|
|
8629
|
+
async importIndexes(pkg, auth2 = SERVICE29) {
|
|
8630
|
+
return this.ctx.http.request({
|
|
8631
|
+
method: "POST",
|
|
8632
|
+
path: `${this.base()}/search/indexes/import`,
|
|
8633
|
+
auth: auth2,
|
|
8634
|
+
body: pkg
|
|
8635
|
+
});
|
|
8636
|
+
}
|
|
8637
|
+
/** List index jobs of the tenant. */
|
|
8638
|
+
async listJobs(opts = {}, auth2 = SERVICE29) {
|
|
8639
|
+
const { query, page } = pageQuery(opts);
|
|
8640
|
+
return requestPage(
|
|
8641
|
+
this.ctx.http,
|
|
8642
|
+
{ method: "GET", path: `${this.base()}/jobs`, auth: auth2, query },
|
|
8643
|
+
page
|
|
8644
|
+
);
|
|
8645
|
+
}
|
|
8646
|
+
/** Fetch one index job. */
|
|
8647
|
+
async getJob(id, opts = {}, auth2 = SERVICE29) {
|
|
8648
|
+
return this.ctx.http.request({
|
|
8649
|
+
method: "GET",
|
|
8650
|
+
path: `${this.base()}/jobs/${encodeURIComponent(id)}`,
|
|
8651
|
+
auth: auth2,
|
|
8652
|
+
...opts.fields === void 0 ? {} : { query: { fields: opts.fields } }
|
|
8653
|
+
});
|
|
8654
|
+
}
|
|
8655
|
+
};
|
|
8656
|
+
|
|
8657
|
+
// src/services/imports.ts
|
|
8658
|
+
var SERVICE30 = { kind: "service" };
|
|
8445
8659
|
var DEFAULT_PAGE_SIZE = 50;
|
|
8446
8660
|
function pageArgs(opts) {
|
|
8447
8661
|
return { pageNumber: opts.pageNumber ?? 1, pageSize: opts.pageSize ?? DEFAULT_PAGE_SIZE };
|
|
@@ -8491,7 +8705,7 @@ var ImportService = class {
|
|
|
8491
8705
|
return `/importtool/${this.ctx.tenant}`;
|
|
8492
8706
|
}
|
|
8493
8707
|
/** List every import configuration of the tenant. */
|
|
8494
|
-
async listConfigs(auth2 =
|
|
8708
|
+
async listConfigs(auth2 = SERVICE30) {
|
|
8495
8709
|
return this.ctx.http.request({
|
|
8496
8710
|
method: "GET",
|
|
8497
8711
|
path: `${this.base()}/configs`,
|
|
@@ -8499,7 +8713,7 @@ var ImportService = class {
|
|
|
8499
8713
|
});
|
|
8500
8714
|
}
|
|
8501
8715
|
/** Fetch one configuration by id. */
|
|
8502
|
-
async getConfig(id, auth2 =
|
|
8716
|
+
async getConfig(id, auth2 = SERVICE30) {
|
|
8503
8717
|
return this.ctx.http.request({
|
|
8504
8718
|
method: "GET",
|
|
8505
8719
|
path: `${this.base()}/configs/${encodeURIComponent(id)}`,
|
|
@@ -8507,7 +8721,7 @@ var ImportService = class {
|
|
|
8507
8721
|
});
|
|
8508
8722
|
}
|
|
8509
8723
|
/** List the streams of one configuration. */
|
|
8510
|
-
async listStreams(configId, auth2 =
|
|
8724
|
+
async listStreams(configId, auth2 = SERVICE30) {
|
|
8511
8725
|
return this.ctx.http.request({
|
|
8512
8726
|
method: "GET",
|
|
8513
8727
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/streams`,
|
|
@@ -8515,7 +8729,7 @@ var ImportService = class {
|
|
|
8515
8729
|
});
|
|
8516
8730
|
}
|
|
8517
8731
|
/** Fetch one stream by id. */
|
|
8518
|
-
async getStream(id, auth2 =
|
|
8732
|
+
async getStream(id, auth2 = SERVICE30) {
|
|
8519
8733
|
return this.ctx.http.request({
|
|
8520
8734
|
method: "GET",
|
|
8521
8735
|
path: `${this.base()}/streams/${encodeURIComponent(id)}`,
|
|
@@ -8532,7 +8746,7 @@ var ImportService = class {
|
|
|
8532
8746
|
* takes stream **ids** — map through {@link listStreams} before passing a
|
|
8533
8747
|
* subset back.
|
|
8534
8748
|
*/
|
|
8535
|
-
async getStreamOrder(configId, auth2 =
|
|
8749
|
+
async getStreamOrder(configId, auth2 = SERVICE30) {
|
|
8536
8750
|
return this.ctx.http.request({
|
|
8537
8751
|
method: "GET",
|
|
8538
8752
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/stream-order`,
|
|
@@ -8544,7 +8758,7 @@ var ImportService = class {
|
|
|
8544
8758
|
* configured — the service answers `204`, not `404`, so an absent schedule is
|
|
8545
8759
|
* a normal result rather than an error.
|
|
8546
8760
|
*/
|
|
8547
|
-
async getSchedule(configId, auth2 =
|
|
8761
|
+
async getSchedule(configId, auth2 = SERVICE30) {
|
|
8548
8762
|
const res = await this.ctx.http.request({
|
|
8549
8763
|
method: "GET",
|
|
8550
8764
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
|
|
@@ -8565,7 +8779,7 @@ var ImportService = class {
|
|
|
8565
8779
|
* schedule. Use {@link deleteSchedule} to clear a schedule that outlived its
|
|
8566
8780
|
* configuration.
|
|
8567
8781
|
*/
|
|
8568
|
-
async setSchedule(configId, input, auth2 =
|
|
8782
|
+
async setSchedule(configId, input, auth2 = SERVICE30) {
|
|
8569
8783
|
return this.ctx.http.request({
|
|
8570
8784
|
method: "PUT",
|
|
8571
8785
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
|
|
@@ -8585,7 +8799,7 @@ var ImportService = class {
|
|
|
8585
8799
|
* The service answers `204`, so this resolves to `void` rather than to the
|
|
8586
8800
|
* removed schedule.
|
|
8587
8801
|
*/
|
|
8588
|
-
async deleteSchedule(configId, auth2 =
|
|
8802
|
+
async deleteSchedule(configId, auth2 = SERVICE30) {
|
|
8589
8803
|
await this.ctx.http.request({
|
|
8590
8804
|
method: "DELETE",
|
|
8591
8805
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
|
|
@@ -8634,7 +8848,7 @@ var ImportService = class {
|
|
|
8634
8848
|
* }
|
|
8635
8849
|
* ```
|
|
8636
8850
|
*/
|
|
8637
|
-
async triggerRun(configId, input = {}, auth2 =
|
|
8851
|
+
async triggerRun(configId, input = {}, auth2 = SERVICE30) {
|
|
8638
8852
|
return this.ctx.http.request({
|
|
8639
8853
|
method: "POST",
|
|
8640
8854
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/runs`,
|
|
@@ -8643,7 +8857,7 @@ var ImportService = class {
|
|
|
8643
8857
|
});
|
|
8644
8858
|
}
|
|
8645
8859
|
/** List a configuration's runs, newest first. */
|
|
8646
|
-
async listRuns(configId, opts = {}, auth2 =
|
|
8860
|
+
async listRuns(configId, opts = {}, auth2 = SERVICE30) {
|
|
8647
8861
|
const args = pageArgs(opts);
|
|
8648
8862
|
const wire = await this.ctx.http.request({
|
|
8649
8863
|
method: "GET",
|
|
@@ -8654,7 +8868,7 @@ var ImportService = class {
|
|
|
8654
8868
|
return toPage(wire, args);
|
|
8655
8869
|
}
|
|
8656
8870
|
/** Fetch one run with its per-stream progress. */
|
|
8657
|
-
async getRun(runId, auth2 =
|
|
8871
|
+
async getRun(runId, auth2 = SERVICE30) {
|
|
8658
8872
|
return this.ctx.http.request({
|
|
8659
8873
|
method: "GET",
|
|
8660
8874
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}`,
|
|
@@ -8674,7 +8888,7 @@ var ImportService = class {
|
|
|
8674
8888
|
* arrive as `{ type: "unknown" }` rather than throwing — see
|
|
8675
8889
|
* {@link ImportRunEvent}.
|
|
8676
8890
|
*/
|
|
8677
|
-
async *streamRun(runId, auth2 =
|
|
8891
|
+
async *streamRun(runId, auth2 = SERVICE30) {
|
|
8678
8892
|
const frames = this.ctx.http.requestStream({
|
|
8679
8893
|
method: "GET",
|
|
8680
8894
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/events`,
|
|
@@ -8689,7 +8903,7 @@ var ImportService = class {
|
|
|
8689
8903
|
* a result, not an error. A state conflict may instead come back as a `409`,
|
|
8690
8904
|
* which does throw.
|
|
8691
8905
|
*/
|
|
8692
|
-
async cancelRun(runId, opts = {}, auth2 =
|
|
8906
|
+
async cancelRun(runId, opts = {}, auth2 = SERVICE30) {
|
|
8693
8907
|
const query = {};
|
|
8694
8908
|
if (opts.force) query.force = "true";
|
|
8695
8909
|
return this.ctx.http.request({
|
|
@@ -8700,7 +8914,7 @@ var ImportService = class {
|
|
|
8700
8914
|
});
|
|
8701
8915
|
}
|
|
8702
8916
|
/** List the errors recorded during a run. */
|
|
8703
|
-
async listRunErrors(runId, opts = {}, auth2 =
|
|
8917
|
+
async listRunErrors(runId, opts = {}, auth2 = SERVICE30) {
|
|
8704
8918
|
const args = pageArgs(opts);
|
|
8705
8919
|
const wire = await this.ctx.http.request({
|
|
8706
8920
|
method: "GET",
|
|
@@ -8721,7 +8935,7 @@ var ImportService = class {
|
|
|
8721
8935
|
* `rows.length` as the size of the problem. `limit` defaults to 500 here
|
|
8722
8936
|
* (1–50 000); {@link downloadRunDiagnosticsCsv} defaults to 50 000.
|
|
8723
8937
|
*/
|
|
8724
|
-
async listRunDiagnostics(runId, query = {}, auth2 =
|
|
8938
|
+
async listRunDiagnostics(runId, query = {}, auth2 = SERVICE30) {
|
|
8725
8939
|
return this.ctx.http.request({
|
|
8726
8940
|
method: "GET",
|
|
8727
8941
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/diagnostics`,
|
|
@@ -8739,7 +8953,7 @@ var ImportService = class {
|
|
|
8739
8953
|
* prefixed with an apostrophe so spreadsheet software does not evaluate source
|
|
8740
8954
|
* data as a formula. Strip it if you parse the file instead of opening it.
|
|
8741
8955
|
*/
|
|
8742
|
-
async downloadRunDiagnosticsCsv(runId, query = {}, auth2 =
|
|
8956
|
+
async downloadRunDiagnosticsCsv(runId, query = {}, auth2 = SERVICE30) {
|
|
8743
8957
|
return this.ctx.http.request({
|
|
8744
8958
|
method: "GET",
|
|
8745
8959
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/diagnostics/csv`,
|
|
@@ -8748,7 +8962,7 @@ var ImportService = class {
|
|
|
8748
8962
|
});
|
|
8749
8963
|
}
|
|
8750
8964
|
/** List the target types that hold imported records — the valid `type` values for {@link searchRecords}. */
|
|
8751
|
-
async listDataTypes(auth2 =
|
|
8965
|
+
async listDataTypes(auth2 = SERVICE30) {
|
|
8752
8966
|
return this.ctx.http.request({
|
|
8753
8967
|
method: "GET",
|
|
8754
8968
|
path: `${this.base()}/data/types`,
|
|
@@ -8756,7 +8970,7 @@ var ImportService = class {
|
|
|
8756
8970
|
});
|
|
8757
8971
|
}
|
|
8758
8972
|
/** Search imported records of one target type. */
|
|
8759
|
-
async searchRecords(opts, auth2 =
|
|
8973
|
+
async searchRecords(opts, auth2 = SERVICE30) {
|
|
8760
8974
|
const args = pageArgs(opts);
|
|
8761
8975
|
const query = {
|
|
8762
8976
|
type: opts.type,
|
|
@@ -8774,7 +8988,7 @@ var ImportService = class {
|
|
|
8774
8988
|
return toPage(wire, args);
|
|
8775
8989
|
}
|
|
8776
8990
|
/** Search the imported records produced by one stream. */
|
|
8777
|
-
async searchStreamRecords(streamId, opts = {}, auth2 =
|
|
8991
|
+
async searchStreamRecords(streamId, opts = {}, auth2 = SERVICE30) {
|
|
8778
8992
|
const args = pageArgs(opts);
|
|
8779
8993
|
const query = {
|
|
8780
8994
|
page: args.pageNumber - 1,
|
|
@@ -8803,7 +9017,7 @@ var ImportService = class {
|
|
|
8803
9017
|
*
|
|
8804
9018
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8805
9019
|
*/
|
|
8806
|
-
async stats(query = {}, auth2 =
|
|
9020
|
+
async stats(query = {}, auth2 = SERVICE30) {
|
|
8807
9021
|
return this.ctx.http.request({
|
|
8808
9022
|
method: "GET",
|
|
8809
9023
|
path: `${this.base()}/stats`,
|
|
@@ -8821,7 +9035,7 @@ var ImportService = class {
|
|
|
8821
9035
|
*
|
|
8822
9036
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8823
9037
|
*/
|
|
8824
|
-
async listJobGroups(auth2 =
|
|
9038
|
+
async listJobGroups(auth2 = SERVICE30) {
|
|
8825
9039
|
return this.ctx.http.request({
|
|
8826
9040
|
method: "GET",
|
|
8827
9041
|
path: `${this.base()}/dashboard/job-groups`,
|
|
@@ -8837,7 +9051,7 @@ var ImportService = class {
|
|
|
8837
9051
|
*
|
|
8838
9052
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8839
9053
|
*/
|
|
8840
|
-
async getHealthThresholds(auth2 =
|
|
9054
|
+
async getHealthThresholds(auth2 = SERVICE30) {
|
|
8841
9055
|
return this.ctx.http.request({
|
|
8842
9056
|
method: "GET",
|
|
8843
9057
|
path: `${this.base()}/settings/health-thresholds`,
|
|
@@ -8849,7 +9063,7 @@ var ImportService = class {
|
|
|
8849
9063
|
*
|
|
8850
9064
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8851
9065
|
*/
|
|
8852
|
-
async getLicense(auth2 =
|
|
9066
|
+
async getLicense(auth2 = SERVICE30) {
|
|
8853
9067
|
return this.ctx.http.request({
|
|
8854
9068
|
method: "GET",
|
|
8855
9069
|
path: `${this.base()}/license`,
|
|
@@ -8869,7 +9083,7 @@ var ImportService = class {
|
|
|
8869
9083
|
*
|
|
8870
9084
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8871
9085
|
*/
|
|
8872
|
-
async retryRun(runId, auth2 =
|
|
9086
|
+
async retryRun(runId, auth2 = SERVICE30) {
|
|
8873
9087
|
return this.ctx.http.request({
|
|
8874
9088
|
method: "POST",
|
|
8875
9089
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/retry`,
|
|
@@ -8879,7 +9093,7 @@ var ImportService = class {
|
|
|
8879
9093
|
};
|
|
8880
9094
|
|
|
8881
9095
|
// src/services/audit-log.ts
|
|
8882
|
-
var
|
|
9096
|
+
var SERVICE31 = { kind: "service" };
|
|
8883
9097
|
function toPage2(wire) {
|
|
8884
9098
|
const pageNumber = wire.page ?? 1;
|
|
8885
9099
|
const totalPages = wire.totalPages ?? 0;
|
|
@@ -8931,7 +9145,7 @@ var AuditLogService = class {
|
|
|
8931
9145
|
* });
|
|
8932
9146
|
* ```
|
|
8933
9147
|
*/
|
|
8934
|
-
async list(opts = {}, auth2 =
|
|
9148
|
+
async list(opts = {}, auth2 = SERVICE31) {
|
|
8935
9149
|
const wire = await this.ctx.http.request({
|
|
8936
9150
|
method: "GET",
|
|
8937
9151
|
path: `${this.base()}/changelogs`,
|
|
@@ -8945,7 +9159,7 @@ var AuditLogService = class {
|
|
|
8945
9159
|
};
|
|
8946
9160
|
|
|
8947
9161
|
// src/services/unit-handling.ts
|
|
8948
|
-
var
|
|
9162
|
+
var SERVICE32 = { kind: "service" };
|
|
8949
9163
|
var UnitHandlingService = class {
|
|
8950
9164
|
constructor(ctx) {
|
|
8951
9165
|
this.ctx = ctx;
|
|
@@ -8956,7 +9170,7 @@ var UnitHandlingService = class {
|
|
|
8956
9170
|
return `/unit-handling/${this.ctx.tenant}`;
|
|
8957
9171
|
}
|
|
8958
9172
|
/** Find units (filter/sort/page). */
|
|
8959
|
-
async listUnits(query = {}, auth2 =
|
|
9173
|
+
async listUnits(query = {}, auth2 = SERVICE32) {
|
|
8960
9174
|
return this.ctx.http.request({
|
|
8961
9175
|
method: "GET",
|
|
8962
9176
|
path: `${this.base()}/units`,
|
|
@@ -8965,7 +9179,7 @@ var UnitHandlingService = class {
|
|
|
8965
9179
|
});
|
|
8966
9180
|
}
|
|
8967
9181
|
/** Retrieve a unit by code. */
|
|
8968
|
-
async getUnit(unitCode, auth2 =
|
|
9182
|
+
async getUnit(unitCode, auth2 = SERVICE32) {
|
|
8969
9183
|
return this.ctx.http.request({
|
|
8970
9184
|
method: "GET",
|
|
8971
9185
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -8973,11 +9187,11 @@ var UnitHandlingService = class {
|
|
|
8973
9187
|
});
|
|
8974
9188
|
}
|
|
8975
9189
|
/** Add a new unit. */
|
|
8976
|
-
async createUnit(input, auth2 =
|
|
9190
|
+
async createUnit(input, auth2 = SERVICE32) {
|
|
8977
9191
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/units`, auth: auth2, body: input });
|
|
8978
9192
|
}
|
|
8979
9193
|
/** Update a unit by code. */
|
|
8980
|
-
async updateUnit(unitCode, input, auth2 =
|
|
9194
|
+
async updateUnit(unitCode, input, auth2 = SERVICE32) {
|
|
8981
9195
|
await this.ctx.http.request({
|
|
8982
9196
|
method: "PUT",
|
|
8983
9197
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -8986,7 +9200,7 @@ var UnitHandlingService = class {
|
|
|
8986
9200
|
});
|
|
8987
9201
|
}
|
|
8988
9202
|
/** Delete a unit by code. */
|
|
8989
|
-
async deleteUnit(unitCode, auth2 =
|
|
9203
|
+
async deleteUnit(unitCode, auth2 = SERVICE32) {
|
|
8990
9204
|
await this.ctx.http.request({
|
|
8991
9205
|
method: "DELETE",
|
|
8992
9206
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -8994,7 +9208,7 @@ var UnitHandlingService = class {
|
|
|
8994
9208
|
});
|
|
8995
9209
|
}
|
|
8996
9210
|
/** Delete multiple units by code (bulk). The codes are sent as the request body. */
|
|
8997
|
-
async deleteUnits(codes, auth2 =
|
|
9211
|
+
async deleteUnits(codes, auth2 = SERVICE32) {
|
|
8998
9212
|
await this.ctx.http.request({
|
|
8999
9213
|
method: "DELETE",
|
|
9000
9214
|
path: `${this.base()}/units`,
|
|
@@ -9003,7 +9217,7 @@ var UnitHandlingService = class {
|
|
|
9003
9217
|
});
|
|
9004
9218
|
}
|
|
9005
9219
|
/** Fetch a conversion factor (`PUT /units/conversion-factor-commands`). */
|
|
9006
|
-
async getConversionFactor(input, auth2 =
|
|
9220
|
+
async getConversionFactor(input, auth2 = SERVICE32) {
|
|
9007
9221
|
return this.ctx.http.request({
|
|
9008
9222
|
method: "PUT",
|
|
9009
9223
|
path: `${this.base()}/units/conversion-factor-commands`,
|
|
@@ -9012,7 +9226,7 @@ var UnitHandlingService = class {
|
|
|
9012
9226
|
});
|
|
9013
9227
|
}
|
|
9014
9228
|
/** Convert a value between units (`PUT /units/convert-unit-commands`). */
|
|
9015
|
-
async convertUnit(input, auth2 =
|
|
9229
|
+
async convertUnit(input, auth2 = SERVICE32) {
|
|
9016
9230
|
return this.ctx.http.request({
|
|
9017
9231
|
method: "PUT",
|
|
9018
9232
|
path: `${this.base()}/units/convert-unit-commands`,
|
|
@@ -9021,13 +9235,13 @@ var UnitHandlingService = class {
|
|
|
9021
9235
|
});
|
|
9022
9236
|
}
|
|
9023
9237
|
/** List all unit types. */
|
|
9024
|
-
async listUnitTypes(auth2 =
|
|
9238
|
+
async listUnitTypes(auth2 = SERVICE32) {
|
|
9025
9239
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/types`, auth: auth2 });
|
|
9026
9240
|
}
|
|
9027
9241
|
};
|
|
9028
9242
|
|
|
9029
9243
|
// src/services/catalog.ts
|
|
9030
|
-
var
|
|
9244
|
+
var SERVICE33 = { kind: "service" };
|
|
9031
9245
|
var CatalogService = class {
|
|
9032
9246
|
constructor(ctx) {
|
|
9033
9247
|
this.ctx = ctx;
|
|
@@ -9038,7 +9252,7 @@ var CatalogService = class {
|
|
|
9038
9252
|
return `/catalog/${this.ctx.tenant}/catalogs`;
|
|
9039
9253
|
}
|
|
9040
9254
|
/** List catalogs (filtered/sorted). */
|
|
9041
|
-
async listCatalogs(query = {}, auth2 =
|
|
9255
|
+
async listCatalogs(query = {}, auth2 = SERVICE33) {
|
|
9042
9256
|
return this.ctx.http.request({
|
|
9043
9257
|
method: "GET",
|
|
9044
9258
|
path: this.base(),
|
|
@@ -9047,7 +9261,7 @@ var CatalogService = class {
|
|
|
9047
9261
|
});
|
|
9048
9262
|
}
|
|
9049
9263
|
/** Retrieve a catalog by id. */
|
|
9050
|
-
async getCatalog(catalogId, auth2 =
|
|
9264
|
+
async getCatalog(catalogId, auth2 = SERVICE33) {
|
|
9051
9265
|
return this.ctx.http.request({
|
|
9052
9266
|
method: "GET",
|
|
9053
9267
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9055,7 +9269,7 @@ var CatalogService = class {
|
|
|
9055
9269
|
});
|
|
9056
9270
|
}
|
|
9057
9271
|
/** Retrieve all catalogs that contain a category. */
|
|
9058
|
-
async getCatalogsForCategory(categoryId, auth2 =
|
|
9272
|
+
async getCatalogsForCategory(categoryId, auth2 = SERVICE33) {
|
|
9059
9273
|
return this.ctx.http.request({
|
|
9060
9274
|
method: "GET",
|
|
9061
9275
|
path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
|
|
@@ -9063,11 +9277,11 @@ var CatalogService = class {
|
|
|
9063
9277
|
});
|
|
9064
9278
|
}
|
|
9065
9279
|
/** Create a catalog. */
|
|
9066
|
-
async createCatalog(input, auth2 =
|
|
9280
|
+
async createCatalog(input, auth2 = SERVICE33) {
|
|
9067
9281
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
9068
9282
|
}
|
|
9069
9283
|
/** Upsert a catalog by id (`PUT`). */
|
|
9070
|
-
async updateCatalog(catalogId, input, auth2 =
|
|
9284
|
+
async updateCatalog(catalogId, input, auth2 = SERVICE33) {
|
|
9071
9285
|
return this.ctx.http.request({
|
|
9072
9286
|
method: "PUT",
|
|
9073
9287
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9076,7 +9290,7 @@ var CatalogService = class {
|
|
|
9076
9290
|
});
|
|
9077
9291
|
}
|
|
9078
9292
|
/** Partially update a catalog by id (`PATCH`). */
|
|
9079
|
-
async patchCatalog(catalogId, patch, auth2 =
|
|
9293
|
+
async patchCatalog(catalogId, patch, auth2 = SERVICE33) {
|
|
9080
9294
|
await this.ctx.http.request({
|
|
9081
9295
|
method: "PATCH",
|
|
9082
9296
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9085,7 +9299,7 @@ var CatalogService = class {
|
|
|
9085
9299
|
});
|
|
9086
9300
|
}
|
|
9087
9301
|
/** Remove a catalog by id. */
|
|
9088
|
-
async deleteCatalog(catalogId, auth2 =
|
|
9302
|
+
async deleteCatalog(catalogId, auth2 = SERVICE33) {
|
|
9089
9303
|
await this.ctx.http.request({
|
|
9090
9304
|
method: "DELETE",
|
|
9091
9305
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9095,7 +9309,7 @@ var CatalogService = class {
|
|
|
9095
9309
|
};
|
|
9096
9310
|
|
|
9097
9311
|
// src/services/vendor.ts
|
|
9098
|
-
var
|
|
9312
|
+
var SERVICE34 = { kind: "service" };
|
|
9099
9313
|
var VendorService = class {
|
|
9100
9314
|
constructor(ctx) {
|
|
9101
9315
|
this.ctx = ctx;
|
|
@@ -9107,7 +9321,7 @@ var VendorService = class {
|
|
|
9107
9321
|
}
|
|
9108
9322
|
// --- Vendors ---
|
|
9109
9323
|
/** List all vendors. */
|
|
9110
|
-
async listVendors(query = {}, auth2 =
|
|
9324
|
+
async listVendors(query = {}, auth2 = SERVICE34) {
|
|
9111
9325
|
return this.ctx.http.request({
|
|
9112
9326
|
method: "GET",
|
|
9113
9327
|
path: `${this.base()}/vendors`,
|
|
@@ -9116,7 +9330,7 @@ var VendorService = class {
|
|
|
9116
9330
|
});
|
|
9117
9331
|
}
|
|
9118
9332
|
/** Retrieve a vendor by id. */
|
|
9119
|
-
async getVendor(vendorId, auth2 =
|
|
9333
|
+
async getVendor(vendorId, auth2 = SERVICE34) {
|
|
9120
9334
|
return this.ctx.http.request({
|
|
9121
9335
|
method: "GET",
|
|
9122
9336
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -9127,7 +9341,7 @@ var VendorService = class {
|
|
|
9127
9341
|
* Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to
|
|
9128
9342
|
* a string; paging, sort and fields go in the query string.
|
|
9129
9343
|
*/
|
|
9130
|
-
async searchVendors(query, auth2 =
|
|
9344
|
+
async searchVendors(query, auth2 = SERVICE34) {
|
|
9131
9345
|
const input = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
9132
9346
|
return this.ctx.http.request({
|
|
9133
9347
|
method: "POST",
|
|
@@ -9137,11 +9351,11 @@ var VendorService = class {
|
|
|
9137
9351
|
});
|
|
9138
9352
|
}
|
|
9139
9353
|
/** Create a vendor. */
|
|
9140
|
-
async createVendor(input, auth2 =
|
|
9354
|
+
async createVendor(input, auth2 = SERVICE34) {
|
|
9141
9355
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
|
|
9142
9356
|
}
|
|
9143
9357
|
/** Upsert a vendor by id (`PUT`). */
|
|
9144
|
-
async updateVendor(vendorId, input, auth2 =
|
|
9358
|
+
async updateVendor(vendorId, input, auth2 = SERVICE34) {
|
|
9145
9359
|
await this.ctx.http.request({
|
|
9146
9360
|
method: "PUT",
|
|
9147
9361
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -9150,7 +9364,7 @@ var VendorService = class {
|
|
|
9150
9364
|
});
|
|
9151
9365
|
}
|
|
9152
9366
|
/** Delete a vendor by id. */
|
|
9153
|
-
async deleteVendor(vendorId, auth2 =
|
|
9367
|
+
async deleteVendor(vendorId, auth2 = SERVICE34) {
|
|
9154
9368
|
await this.ctx.http.request({
|
|
9155
9369
|
method: "DELETE",
|
|
9156
9370
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -9159,7 +9373,7 @@ var VendorService = class {
|
|
|
9159
9373
|
}
|
|
9160
9374
|
// --- Vendor locations ---
|
|
9161
9375
|
/** List all vendor locations. */
|
|
9162
|
-
async listVendorLocations(query = {}, auth2 =
|
|
9376
|
+
async listVendorLocations(query = {}, auth2 = SERVICE34) {
|
|
9163
9377
|
return this.ctx.http.request({
|
|
9164
9378
|
method: "GET",
|
|
9165
9379
|
path: `${this.base()}/locations`,
|
|
@@ -9168,7 +9382,7 @@ var VendorService = class {
|
|
|
9168
9382
|
});
|
|
9169
9383
|
}
|
|
9170
9384
|
/** Retrieve a vendor location by id. */
|
|
9171
|
-
async getVendorLocation(locationId, auth2 =
|
|
9385
|
+
async getVendorLocation(locationId, auth2 = SERVICE34) {
|
|
9172
9386
|
return this.ctx.http.request({
|
|
9173
9387
|
method: "GET",
|
|
9174
9388
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -9176,11 +9390,11 @@ var VendorService = class {
|
|
|
9176
9390
|
});
|
|
9177
9391
|
}
|
|
9178
9392
|
/** Create a vendor location. */
|
|
9179
|
-
async createVendorLocation(input, auth2 =
|
|
9393
|
+
async createVendorLocation(input, auth2 = SERVICE34) {
|
|
9180
9394
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
|
|
9181
9395
|
}
|
|
9182
9396
|
/** Upsert a vendor location by id (`PUT`). */
|
|
9183
|
-
async updateVendorLocation(locationId, input, auth2 =
|
|
9397
|
+
async updateVendorLocation(locationId, input, auth2 = SERVICE34) {
|
|
9184
9398
|
await this.ctx.http.request({
|
|
9185
9399
|
method: "PUT",
|
|
9186
9400
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -9189,7 +9403,7 @@ var VendorService = class {
|
|
|
9189
9403
|
});
|
|
9190
9404
|
}
|
|
9191
9405
|
/** Delete a vendor location by id. */
|
|
9192
|
-
async deleteVendorLocation(locationId, auth2 =
|
|
9406
|
+
async deleteVendorLocation(locationId, auth2 = SERVICE34) {
|
|
9193
9407
|
await this.ctx.http.request({
|
|
9194
9408
|
method: "DELETE",
|
|
9195
9409
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -9199,7 +9413,7 @@ var VendorService = class {
|
|
|
9199
9413
|
};
|
|
9200
9414
|
|
|
9201
9415
|
// src/services/customer-admin.ts
|
|
9202
|
-
var
|
|
9416
|
+
var SERVICE35 = { kind: "service" };
|
|
9203
9417
|
var CustomerAdminService = class {
|
|
9204
9418
|
constructor(ctx) {
|
|
9205
9419
|
this.ctx = ctx;
|
|
@@ -9220,7 +9434,7 @@ var CustomerAdminService = class {
|
|
|
9220
9434
|
}
|
|
9221
9435
|
// --- Customers ---
|
|
9222
9436
|
/** List customers. */
|
|
9223
|
-
async listCustomers(query = {}, auth2 =
|
|
9437
|
+
async listCustomers(query = {}, auth2 = SERVICE35) {
|
|
9224
9438
|
return this.ctx.http.request({
|
|
9225
9439
|
method: "GET",
|
|
9226
9440
|
path: this.base(),
|
|
@@ -9232,7 +9446,7 @@ var CustomerAdminService = class {
|
|
|
9232
9446
|
* Search customers (`POST /customers/search`). A built filter in `q` is resolved
|
|
9233
9447
|
* to a string; `pageNumber`, `pageSize`, `sort` and `expand` go in the query string.
|
|
9234
9448
|
*/
|
|
9235
|
-
async searchCustomers(query, auth2 =
|
|
9449
|
+
async searchCustomers(query, auth2 = SERVICE35) {
|
|
9236
9450
|
const input = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
9237
9451
|
return this.ctx.http.request({
|
|
9238
9452
|
method: "POST",
|
|
@@ -9242,28 +9456,28 @@ var CustomerAdminService = class {
|
|
|
9242
9456
|
});
|
|
9243
9457
|
}
|
|
9244
9458
|
/** Retrieve a customer profile by number. */
|
|
9245
|
-
async getCustomer(customerNumber, auth2 =
|
|
9459
|
+
async getCustomer(customerNumber, auth2 = SERVICE35) {
|
|
9246
9460
|
return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
|
|
9247
9461
|
}
|
|
9248
9462
|
/** Create a customer. */
|
|
9249
|
-
async createCustomer(input, auth2 =
|
|
9463
|
+
async createCustomer(input, auth2 = SERVICE35) {
|
|
9250
9464
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
9251
9465
|
}
|
|
9252
9466
|
/** Upsert a customer profile by number (`PUT`). */
|
|
9253
|
-
async upsertCustomer(customerNumber, input, auth2 =
|
|
9467
|
+
async upsertCustomer(customerNumber, input, auth2 = SERVICE35) {
|
|
9254
9468
|
return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
|
|
9255
9469
|
}
|
|
9256
9470
|
/** Partially update a customer profile (`PATCH`). */
|
|
9257
|
-
async patchCustomer(customerNumber, patch, auth2 =
|
|
9471
|
+
async patchCustomer(customerNumber, patch, auth2 = SERVICE35) {
|
|
9258
9472
|
await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
|
|
9259
9473
|
}
|
|
9260
9474
|
/** Delete a customer profile. */
|
|
9261
|
-
async deleteCustomer(customerNumber, auth2 =
|
|
9475
|
+
async deleteCustomer(customerNumber, auth2 = SERVICE35) {
|
|
9262
9476
|
await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
|
|
9263
9477
|
}
|
|
9264
9478
|
// --- Addresses ---
|
|
9265
9479
|
/** List a customer's addresses. */
|
|
9266
|
-
async listAddresses(customerNumber, auth2 =
|
|
9480
|
+
async listAddresses(customerNumber, auth2 = SERVICE35) {
|
|
9267
9481
|
return this.ctx.http.request({
|
|
9268
9482
|
method: "GET",
|
|
9269
9483
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -9271,11 +9485,11 @@ var CustomerAdminService = class {
|
|
|
9271
9485
|
});
|
|
9272
9486
|
}
|
|
9273
9487
|
/** Retrieve one address. */
|
|
9274
|
-
async getAddress(customerNumber, addressId, auth2 =
|
|
9488
|
+
async getAddress(customerNumber, addressId, auth2 = SERVICE35) {
|
|
9275
9489
|
return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
9276
9490
|
}
|
|
9277
9491
|
/** Add an address. */
|
|
9278
|
-
async addAddress(customerNumber, input, auth2 =
|
|
9492
|
+
async addAddress(customerNumber, input, auth2 = SERVICE35) {
|
|
9279
9493
|
return this.ctx.http.request({
|
|
9280
9494
|
method: "POST",
|
|
9281
9495
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -9284,19 +9498,19 @@ var CustomerAdminService = class {
|
|
|
9284
9498
|
});
|
|
9285
9499
|
}
|
|
9286
9500
|
/** Upsert an address by id (`PUT`). */
|
|
9287
|
-
async upsertAddress(customerNumber, addressId, input, auth2 =
|
|
9501
|
+
async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE35) {
|
|
9288
9502
|
return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
|
|
9289
9503
|
}
|
|
9290
9504
|
/** Partially update an address by id (`PATCH`). */
|
|
9291
|
-
async patchAddress(customerNumber, addressId, patch, auth2 =
|
|
9505
|
+
async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE35) {
|
|
9292
9506
|
await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
|
|
9293
9507
|
}
|
|
9294
9508
|
/** Delete an address by id. */
|
|
9295
|
-
async deleteAddress(customerNumber, addressId, auth2 =
|
|
9509
|
+
async deleteAddress(customerNumber, addressId, auth2 = SERVICE35) {
|
|
9296
9510
|
await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
9297
9511
|
}
|
|
9298
9512
|
/** Add tags to an address (`?tags=` query). */
|
|
9299
|
-
async addAddressTags(customerNumber, addressId, tags, auth2 =
|
|
9513
|
+
async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE35) {
|
|
9300
9514
|
await this.ctx.http.request({
|
|
9301
9515
|
method: "POST",
|
|
9302
9516
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -9305,7 +9519,7 @@ var CustomerAdminService = class {
|
|
|
9305
9519
|
});
|
|
9306
9520
|
}
|
|
9307
9521
|
/** Remove tags from an address (`?tags=` query). */
|
|
9308
|
-
async removeAddressTags(customerNumber, addressId, tags, auth2 =
|
|
9522
|
+
async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE35) {
|
|
9309
9523
|
await this.ctx.http.request({
|
|
9310
9524
|
method: "DELETE",
|
|
9311
9525
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -9319,7 +9533,7 @@ var CustomerAdminService = class {
|
|
|
9319
9533
|
* `customer.import_read` scope. An unconfigured tenant answers with an empty
|
|
9320
9534
|
* object rather than a 404.
|
|
9321
9535
|
*/
|
|
9322
|
-
async getPasswordMigrationRetention(auth2 =
|
|
9536
|
+
async getPasswordMigrationRetention(auth2 = SERVICE35) {
|
|
9323
9537
|
return this.ctx.http.request({
|
|
9324
9538
|
method: "GET",
|
|
9325
9539
|
path: this.configPath(),
|
|
@@ -9332,7 +9546,7 @@ var CustomerAdminService = class {
|
|
|
9332
9546
|
* `legacyAuth`** — that import is rejected without an active config. Re-POST with
|
|
9333
9547
|
* an earlier `retentionEndDate` to shorten a running window.
|
|
9334
9548
|
*/
|
|
9335
|
-
async configurePasswordMigrationRetention(input, auth2 =
|
|
9549
|
+
async configurePasswordMigrationRetention(input, auth2 = SERVICE35) {
|
|
9336
9550
|
return this.ctx.http.request({
|
|
9337
9551
|
method: "POST",
|
|
9338
9552
|
path: this.configPath(),
|
|
@@ -9345,7 +9559,7 @@ var CustomerAdminService = class {
|
|
|
9345
9559
|
* Intended for after the migration window: when the window ends, unmigrated
|
|
9346
9560
|
* accounts need a password reset and their legacy credentials are cleared.
|
|
9347
9561
|
*/
|
|
9348
|
-
async deletePasswordMigrationRetention(auth2 =
|
|
9562
|
+
async deletePasswordMigrationRetention(auth2 = SERVICE35) {
|
|
9349
9563
|
await this.ctx.http.request({ method: "DELETE", path: this.configPath(), auth: auth2 });
|
|
9350
9564
|
}
|
|
9351
9565
|
// --- Bulk import ---
|
|
@@ -9358,7 +9572,7 @@ var CustomerAdminService = class {
|
|
|
9358
9572
|
* `account.legacyAuth`, and importing `legacyAuth` requires an active retention
|
|
9359
9573
|
* config (see `configurePasswordMigrationRetention`).
|
|
9360
9574
|
*/
|
|
9361
|
-
async importCustomers(input, auth2 =
|
|
9575
|
+
async importCustomers(input, auth2 = SERVICE35) {
|
|
9362
9576
|
return this.ctx.http.request({
|
|
9363
9577
|
method: "POST",
|
|
9364
9578
|
path: `${this.base()}/import`,
|
|
@@ -9369,7 +9583,7 @@ var CustomerAdminService = class {
|
|
|
9369
9583
|
};
|
|
9370
9584
|
|
|
9371
9585
|
// src/services/approval.ts
|
|
9372
|
-
var
|
|
9586
|
+
var SERVICE36 = { kind: "service" };
|
|
9373
9587
|
var ApprovalService = class {
|
|
9374
9588
|
constructor(ctx) {
|
|
9375
9589
|
this.ctx = ctx;
|
|
@@ -9380,7 +9594,7 @@ var ApprovalService = class {
|
|
|
9380
9594
|
return `/approval/${this.ctx.tenant}`;
|
|
9381
9595
|
}
|
|
9382
9596
|
/** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
|
|
9383
|
-
async listApprovals(query = {}, auth2 =
|
|
9597
|
+
async listApprovals(query = {}, auth2 = SERVICE36) {
|
|
9384
9598
|
return this.ctx.http.request({
|
|
9385
9599
|
method: "GET",
|
|
9386
9600
|
path: `${this.base()}/approvals`,
|
|
@@ -9389,7 +9603,7 @@ var ApprovalService = class {
|
|
|
9389
9603
|
});
|
|
9390
9604
|
}
|
|
9391
9605
|
/** Retrieve a single approval by id. */
|
|
9392
|
-
async getApproval(approvalId, auth2 =
|
|
9606
|
+
async getApproval(approvalId, auth2 = SERVICE36) {
|
|
9393
9607
|
return this.ctx.http.request({
|
|
9394
9608
|
method: "GET",
|
|
9395
9609
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -9397,7 +9611,7 @@ var ApprovalService = class {
|
|
|
9397
9611
|
});
|
|
9398
9612
|
}
|
|
9399
9613
|
/** Create an approval request (cart or quote). Returns the created `{ id }`. */
|
|
9400
|
-
async createApproval(input, auth2 =
|
|
9614
|
+
async createApproval(input, auth2 = SERVICE36) {
|
|
9401
9615
|
return this.ctx.http.request({
|
|
9402
9616
|
method: "POST",
|
|
9403
9617
|
path: `${this.base()}/approvals`,
|
|
@@ -9406,7 +9620,7 @@ var ApprovalService = class {
|
|
|
9406
9620
|
});
|
|
9407
9621
|
}
|
|
9408
9622
|
/** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
|
|
9409
|
-
async updateApproval(approvalId, ops, auth2 =
|
|
9623
|
+
async updateApproval(approvalId, ops, auth2 = SERVICE36) {
|
|
9410
9624
|
await this.ctx.http.request({
|
|
9411
9625
|
method: "PATCH",
|
|
9412
9626
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -9415,7 +9629,7 @@ var ApprovalService = class {
|
|
|
9415
9629
|
});
|
|
9416
9630
|
}
|
|
9417
9631
|
/** Delete an approval by id. */
|
|
9418
|
-
async deleteApproval(approvalId, auth2 =
|
|
9632
|
+
async deleteApproval(approvalId, auth2 = SERVICE36) {
|
|
9419
9633
|
await this.ctx.http.request({
|
|
9420
9634
|
method: "DELETE",
|
|
9421
9635
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -9423,7 +9637,7 @@ var ApprovalService = class {
|
|
|
9423
9637
|
});
|
|
9424
9638
|
}
|
|
9425
9639
|
/** Check whether an operation on a resource is permitted / needs approval. */
|
|
9426
|
-
async checkPermitted(input, auth2 =
|
|
9640
|
+
async checkPermitted(input, auth2 = SERVICE36) {
|
|
9427
9641
|
return this.ctx.http.request({
|
|
9428
9642
|
method: "POST",
|
|
9429
9643
|
path: `${this.base()}/approval/permitted`,
|
|
@@ -9432,7 +9646,7 @@ var ApprovalService = class {
|
|
|
9432
9646
|
});
|
|
9433
9647
|
}
|
|
9434
9648
|
/** Search for users eligible to approve a resource. Returns an array. */
|
|
9435
|
-
async searchApprovers(input, auth2 =
|
|
9649
|
+
async searchApprovers(input, auth2 = SERVICE36) {
|
|
9436
9650
|
return this.ctx.http.request({
|
|
9437
9651
|
method: "POST",
|
|
9438
9652
|
path: `${this.base()}/search/users`,
|
|
@@ -9494,6 +9708,7 @@ var EmporixClient = class {
|
|
|
9494
9708
|
quotes;
|
|
9495
9709
|
returns;
|
|
9496
9710
|
indexing;
|
|
9711
|
+
search;
|
|
9497
9712
|
imports;
|
|
9498
9713
|
auditLogs;
|
|
9499
9714
|
units;
|
|
@@ -9568,6 +9783,7 @@ var EmporixClient = class {
|
|
|
9568
9783
|
this.quotes = new QuoteService(mk(QuoteService.channel));
|
|
9569
9784
|
this.returns = new ReturnsService(mk(ReturnsService.channel));
|
|
9570
9785
|
this.indexing = new IndexingService(mk(IndexingService.channel));
|
|
9786
|
+
this.search = new SearchService(mk(SearchService.channel));
|
|
9571
9787
|
this.imports = new ImportService(mk(ImportService.channel));
|
|
9572
9788
|
this.auditLogs = new AuditLogService(mk(AuditLogService.channel));
|
|
9573
9789
|
this.units = new UnitHandlingService(mk(UnitHandlingService.channel));
|
|
@@ -9696,6 +9912,7 @@ exports.RewardPointsService = RewardPointsService;
|
|
|
9696
9912
|
exports.STORAGE_KEYS = STORAGE_KEYS;
|
|
9697
9913
|
exports.SalesOrdersService = SalesOrdersService;
|
|
9698
9914
|
exports.SchemaService = SchemaService;
|
|
9915
|
+
exports.SearchService = SearchService;
|
|
9699
9916
|
exports.SegmentService = SegmentService;
|
|
9700
9917
|
exports.SequentialIdService = SequentialIdService;
|
|
9701
9918
|
exports.SessionContextService = SessionContextService;
|