@viu/emporix-sdk 4.3.1 → 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 +34 -0
- package/README.md +2 -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.cjs +3 -0
- package/dist/category.cjs.map +1 -1
- package/dist/category.d.cts +17 -11
- package/dist/category.d.ts +17 -11
- package/dist/category.js +1 -1
- package/dist/checkout.d.cts +1 -1
- package/dist/checkout.d.ts +1 -1
- package/dist/{chunk-2SHTDVOC.js → chunk-J2AN2FMK.js} +7 -2
- package/dist/chunk-J2AN2FMK.js.map +1 -0
- package/dist/{chunk-MSQ3GEIW.js → chunk-KJEBG7MP.js} +5 -2
- package/dist/chunk-KJEBG7MP.js.map +1 -0
- package/dist/companies.d.cts +1 -1
- package/dist/companies.d.ts +1 -1
- package/dist/contacts.d.cts +1 -1
- package/dist/contacts.d.ts +1 -1
- package/dist/{context-5lt8Q0MT.d.ts → context-BJeomwxV.d.cts} +24 -1
- package/dist/{context-5lt8Q0MT.d.cts → context-BJeomwxV.d.ts} +24 -1
- package/dist/{customer-groups-8cgS8S5d.d.cts → customer-groups-ByNcTPoL.d.cts} +1 -1
- package/dist/{customer-groups-DizW_a-w.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 +282 -90
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +498 -5
- package/dist/index.d.ts +498 -5
- package/dist/index.js +278 -95
- 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.cjs +5 -0
- package/dist/product.cjs.map +1 -1
- package/dist/product.d.cts +8 -2
- package/dist/product.d.ts +8 -2
- package/dist/product.js +1 -1
- package/dist/segment.d.cts +1 -1
- package/dist/segment.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunk-2SHTDVOC.js.map +0 -1
- package/dist/chunk-MSQ3GEIW.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -126,7 +126,8 @@ function validateConfig(input) {
|
|
|
126
126
|
maxLifetimeSeconds: input.cache?.maxLifetimeSeconds ?? 3600
|
|
127
127
|
},
|
|
128
128
|
logger: input.logger,
|
|
129
|
-
fetch: input.fetch
|
|
129
|
+
fetch: input.fetch,
|
|
130
|
+
contentLanguage: input.contentLanguage
|
|
130
131
|
};
|
|
131
132
|
}
|
|
132
133
|
|
|
@@ -985,10 +986,11 @@ var HttpClient = class {
|
|
|
985
986
|
buildHeaders(o, token, isFormData) {
|
|
986
987
|
return {
|
|
987
988
|
// Before `o.headers` on purpose: a caller may override the tenant for a
|
|
988
|
-
// single request, the way `Accept-Language` can be
|
|
989
|
-
// `Authorization` is non-negotiable.
|
|
989
|
+
// single request, the way `Accept-Language` and `Content-Language` can be
|
|
990
|
+
// overridden. Only `Authorization` is non-negotiable.
|
|
990
991
|
...this.opts.tenant !== void 0 ? { "Emporix-Tenant": this.opts.tenant } : {},
|
|
991
992
|
...this.opts.requestContext?.language ? { "Accept-Language": this.opts.requestContext.language } : {},
|
|
993
|
+
...this.opts.contentLanguage && o.body !== void 0 ? { "Content-Language": this.opts.contentLanguage } : {},
|
|
992
994
|
...o.headers ?? {},
|
|
993
995
|
Authorization: `Bearer ${token}`,
|
|
994
996
|
// JSON bodies: set Content-Type. FormData bodies: let `fetch`
|
|
@@ -1242,7 +1244,7 @@ var HttpClient = class {
|
|
|
1242
1244
|
};
|
|
1243
1245
|
|
|
1244
1246
|
// package.json
|
|
1245
|
-
var version = "4.
|
|
1247
|
+
var version = "4.5.0";
|
|
1246
1248
|
|
|
1247
1249
|
// src/version.ts
|
|
1248
1250
|
var SDK_VERSION = version;
|
|
@@ -1285,7 +1287,8 @@ function createCore(config) {
|
|
|
1285
1287
|
requestContext,
|
|
1286
1288
|
// exactOptionalPropertyTypes: `{ fetch: undefined }` is a type error
|
|
1287
1289
|
// against `fetch?: typeof globalThis.fetch`, so spread conditionally.
|
|
1288
|
-
...cfg.fetch !== void 0 ? { fetch: cfg.fetch } : {}
|
|
1290
|
+
...cfg.fetch !== void 0 ? { fetch: cfg.fetch } : {},
|
|
1291
|
+
...cfg.contentLanguage !== void 0 ? { contentLanguage: cfg.contentLanguage } : {}
|
|
1289
1292
|
})
|
|
1290
1293
|
});
|
|
1291
1294
|
return {
|
|
@@ -1865,6 +1868,7 @@ var ProductService = class {
|
|
|
1865
1868
|
method: "POST",
|
|
1866
1869
|
path: `/product/${this.ctx.tenant}/products`,
|
|
1867
1870
|
...Object.keys(query).length > 0 ? { query } : {},
|
|
1871
|
+
...options.contentLanguage === void 0 ? {} : { headers: { "Content-Language": options.contentLanguage } },
|
|
1868
1872
|
body: input,
|
|
1869
1873
|
auth: auth2
|
|
1870
1874
|
});
|
|
@@ -1897,6 +1901,7 @@ var ProductService = class {
|
|
|
1897
1901
|
method: "PATCH",
|
|
1898
1902
|
path: `/product/${this.ctx.tenant}/products/${productId}`,
|
|
1899
1903
|
...Object.keys(query).length > 0 ? { query } : {},
|
|
1904
|
+
...options.contentLanguage === void 0 ? {} : { headers: { "Content-Language": options.contentLanguage } },
|
|
1900
1905
|
body: input,
|
|
1901
1906
|
auth: auth2
|
|
1902
1907
|
});
|
|
@@ -1923,6 +1928,7 @@ var ProductService = class {
|
|
|
1923
1928
|
method: "PUT",
|
|
1924
1929
|
path: `/product/${this.ctx.tenant}/products/${productId}`,
|
|
1925
1930
|
...Object.keys(query).length > 0 ? { query } : {},
|
|
1931
|
+
...options.contentLanguage === void 0 ? {} : { headers: { "Content-Language": options.contentLanguage } },
|
|
1926
1932
|
body: input,
|
|
1927
1933
|
auth: auth2
|
|
1928
1934
|
});
|
|
@@ -1957,6 +1963,7 @@ var ProductService = class {
|
|
|
1957
1963
|
method: "POST",
|
|
1958
1964
|
path: `/product/${this.ctx.tenant}/products/bulk`,
|
|
1959
1965
|
...Object.keys(query).length > 0 ? { query } : {},
|
|
1966
|
+
...options.contentLanguage === void 0 ? {} : { headers: { "Content-Language": options.contentLanguage } },
|
|
1960
1967
|
body: input,
|
|
1961
1968
|
auth: auth2
|
|
1962
1969
|
});
|
|
@@ -1975,6 +1982,7 @@ var ProductService = class {
|
|
|
1975
1982
|
method: "PUT",
|
|
1976
1983
|
path: `/product/${this.ctx.tenant}/products/bulk`,
|
|
1977
1984
|
...Object.keys(query).length > 0 ? { query } : {},
|
|
1985
|
+
...options.contentLanguage === void 0 ? {} : { headers: { "Content-Language": options.contentLanguage } },
|
|
1978
1986
|
body: input,
|
|
1979
1987
|
auth: auth2
|
|
1980
1988
|
});
|
|
@@ -2285,6 +2293,7 @@ var CategoryService = class {
|
|
|
2285
2293
|
method: "POST",
|
|
2286
2294
|
path: `/category/${this.ctx.tenant}/categories`,
|
|
2287
2295
|
...options.publish === void 0 ? {} : { query: { publish: String(options.publish) } },
|
|
2296
|
+
...options.contentLanguage === void 0 ? {} : { headers: { "Content-Language": options.contentLanguage } },
|
|
2288
2297
|
body: input,
|
|
2289
2298
|
auth: auth2
|
|
2290
2299
|
});
|
|
@@ -2299,6 +2308,7 @@ var CategoryService = class {
|
|
|
2299
2308
|
method: "PUT",
|
|
2300
2309
|
path: `/category/${this.ctx.tenant}/categories/${categoryId}`,
|
|
2301
2310
|
...options.publish === void 0 ? {} : { query: { publish: String(options.publish) } },
|
|
2311
|
+
...options.contentLanguage === void 0 ? {} : { headers: { "Content-Language": options.contentLanguage } },
|
|
2302
2312
|
body: input,
|
|
2303
2313
|
auth: auth2
|
|
2304
2314
|
});
|
|
@@ -2312,6 +2322,7 @@ var CategoryService = class {
|
|
|
2312
2322
|
method: "PATCH",
|
|
2313
2323
|
path: `/category/${this.ctx.tenant}/categories/${categoryId}`,
|
|
2314
2324
|
...options.publish === void 0 ? {} : { query: { publish: String(options.publish) } },
|
|
2325
|
+
...options.contentLanguage === void 0 ? {} : { headers: { "Content-Language": options.contentLanguage } },
|
|
2315
2326
|
body: input,
|
|
2316
2327
|
auth: auth2
|
|
2317
2328
|
});
|
|
@@ -8429,8 +8440,186 @@ var IndexingService = class {
|
|
|
8429
8440
|
}
|
|
8430
8441
|
};
|
|
8431
8442
|
|
|
8432
|
-
// src/services/
|
|
8443
|
+
// src/services/search.ts
|
|
8433
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" };
|
|
8434
8623
|
var DEFAULT_PAGE_SIZE = 50;
|
|
8435
8624
|
function pageArgs(opts) {
|
|
8436
8625
|
return { pageNumber: opts.pageNumber ?? 1, pageSize: opts.pageSize ?? DEFAULT_PAGE_SIZE };
|
|
@@ -8480,7 +8669,7 @@ var ImportService = class {
|
|
|
8480
8669
|
return `/importtool/${this.ctx.tenant}`;
|
|
8481
8670
|
}
|
|
8482
8671
|
/** List every import configuration of the tenant. */
|
|
8483
|
-
async listConfigs(auth2 =
|
|
8672
|
+
async listConfigs(auth2 = SERVICE30) {
|
|
8484
8673
|
return this.ctx.http.request({
|
|
8485
8674
|
method: "GET",
|
|
8486
8675
|
path: `${this.base()}/configs`,
|
|
@@ -8488,7 +8677,7 @@ var ImportService = class {
|
|
|
8488
8677
|
});
|
|
8489
8678
|
}
|
|
8490
8679
|
/** Fetch one configuration by id. */
|
|
8491
|
-
async getConfig(id, auth2 =
|
|
8680
|
+
async getConfig(id, auth2 = SERVICE30) {
|
|
8492
8681
|
return this.ctx.http.request({
|
|
8493
8682
|
method: "GET",
|
|
8494
8683
|
path: `${this.base()}/configs/${encodeURIComponent(id)}`,
|
|
@@ -8496,7 +8685,7 @@ var ImportService = class {
|
|
|
8496
8685
|
});
|
|
8497
8686
|
}
|
|
8498
8687
|
/** List the streams of one configuration. */
|
|
8499
|
-
async listStreams(configId, auth2 =
|
|
8688
|
+
async listStreams(configId, auth2 = SERVICE30) {
|
|
8500
8689
|
return this.ctx.http.request({
|
|
8501
8690
|
method: "GET",
|
|
8502
8691
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/streams`,
|
|
@@ -8504,7 +8693,7 @@ var ImportService = class {
|
|
|
8504
8693
|
});
|
|
8505
8694
|
}
|
|
8506
8695
|
/** Fetch one stream by id. */
|
|
8507
|
-
async getStream(id, auth2 =
|
|
8696
|
+
async getStream(id, auth2 = SERVICE30) {
|
|
8508
8697
|
return this.ctx.http.request({
|
|
8509
8698
|
method: "GET",
|
|
8510
8699
|
path: `${this.base()}/streams/${encodeURIComponent(id)}`,
|
|
@@ -8521,7 +8710,7 @@ var ImportService = class {
|
|
|
8521
8710
|
* takes stream **ids** — map through {@link listStreams} before passing a
|
|
8522
8711
|
* subset back.
|
|
8523
8712
|
*/
|
|
8524
|
-
async getStreamOrder(configId, auth2 =
|
|
8713
|
+
async getStreamOrder(configId, auth2 = SERVICE30) {
|
|
8525
8714
|
return this.ctx.http.request({
|
|
8526
8715
|
method: "GET",
|
|
8527
8716
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/stream-order`,
|
|
@@ -8533,7 +8722,7 @@ var ImportService = class {
|
|
|
8533
8722
|
* configured — the service answers `204`, not `404`, so an absent schedule is
|
|
8534
8723
|
* a normal result rather than an error.
|
|
8535
8724
|
*/
|
|
8536
|
-
async getSchedule(configId, auth2 =
|
|
8725
|
+
async getSchedule(configId, auth2 = SERVICE30) {
|
|
8537
8726
|
const res = await this.ctx.http.request({
|
|
8538
8727
|
method: "GET",
|
|
8539
8728
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
|
|
@@ -8554,7 +8743,7 @@ var ImportService = class {
|
|
|
8554
8743
|
* schedule. Use {@link deleteSchedule} to clear a schedule that outlived its
|
|
8555
8744
|
* configuration.
|
|
8556
8745
|
*/
|
|
8557
|
-
async setSchedule(configId, input, auth2 =
|
|
8746
|
+
async setSchedule(configId, input, auth2 = SERVICE30) {
|
|
8558
8747
|
return this.ctx.http.request({
|
|
8559
8748
|
method: "PUT",
|
|
8560
8749
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
|
|
@@ -8574,7 +8763,7 @@ var ImportService = class {
|
|
|
8574
8763
|
* The service answers `204`, so this resolves to `void` rather than to the
|
|
8575
8764
|
* removed schedule.
|
|
8576
8765
|
*/
|
|
8577
|
-
async deleteSchedule(configId, auth2 =
|
|
8766
|
+
async deleteSchedule(configId, auth2 = SERVICE30) {
|
|
8578
8767
|
await this.ctx.http.request({
|
|
8579
8768
|
method: "DELETE",
|
|
8580
8769
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/schedule`,
|
|
@@ -8623,7 +8812,7 @@ var ImportService = class {
|
|
|
8623
8812
|
* }
|
|
8624
8813
|
* ```
|
|
8625
8814
|
*/
|
|
8626
|
-
async triggerRun(configId, input = {}, auth2 =
|
|
8815
|
+
async triggerRun(configId, input = {}, auth2 = SERVICE30) {
|
|
8627
8816
|
return this.ctx.http.request({
|
|
8628
8817
|
method: "POST",
|
|
8629
8818
|
path: `${this.base()}/configs/${encodeURIComponent(configId)}/runs`,
|
|
@@ -8632,7 +8821,7 @@ var ImportService = class {
|
|
|
8632
8821
|
});
|
|
8633
8822
|
}
|
|
8634
8823
|
/** List a configuration's runs, newest first. */
|
|
8635
|
-
async listRuns(configId, opts = {}, auth2 =
|
|
8824
|
+
async listRuns(configId, opts = {}, auth2 = SERVICE30) {
|
|
8636
8825
|
const args = pageArgs(opts);
|
|
8637
8826
|
const wire = await this.ctx.http.request({
|
|
8638
8827
|
method: "GET",
|
|
@@ -8643,7 +8832,7 @@ var ImportService = class {
|
|
|
8643
8832
|
return toPage(wire, args);
|
|
8644
8833
|
}
|
|
8645
8834
|
/** Fetch one run with its per-stream progress. */
|
|
8646
|
-
async getRun(runId, auth2 =
|
|
8835
|
+
async getRun(runId, auth2 = SERVICE30) {
|
|
8647
8836
|
return this.ctx.http.request({
|
|
8648
8837
|
method: "GET",
|
|
8649
8838
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}`,
|
|
@@ -8663,7 +8852,7 @@ var ImportService = class {
|
|
|
8663
8852
|
* arrive as `{ type: "unknown" }` rather than throwing — see
|
|
8664
8853
|
* {@link ImportRunEvent}.
|
|
8665
8854
|
*/
|
|
8666
|
-
async *streamRun(runId, auth2 =
|
|
8855
|
+
async *streamRun(runId, auth2 = SERVICE30) {
|
|
8667
8856
|
const frames = this.ctx.http.requestStream({
|
|
8668
8857
|
method: "GET",
|
|
8669
8858
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/events`,
|
|
@@ -8678,7 +8867,7 @@ var ImportService = class {
|
|
|
8678
8867
|
* a result, not an error. A state conflict may instead come back as a `409`,
|
|
8679
8868
|
* which does throw.
|
|
8680
8869
|
*/
|
|
8681
|
-
async cancelRun(runId, opts = {}, auth2 =
|
|
8870
|
+
async cancelRun(runId, opts = {}, auth2 = SERVICE30) {
|
|
8682
8871
|
const query = {};
|
|
8683
8872
|
if (opts.force) query.force = "true";
|
|
8684
8873
|
return this.ctx.http.request({
|
|
@@ -8689,7 +8878,7 @@ var ImportService = class {
|
|
|
8689
8878
|
});
|
|
8690
8879
|
}
|
|
8691
8880
|
/** List the errors recorded during a run. */
|
|
8692
|
-
async listRunErrors(runId, opts = {}, auth2 =
|
|
8881
|
+
async listRunErrors(runId, opts = {}, auth2 = SERVICE30) {
|
|
8693
8882
|
const args = pageArgs(opts);
|
|
8694
8883
|
const wire = await this.ctx.http.request({
|
|
8695
8884
|
method: "GET",
|
|
@@ -8710,7 +8899,7 @@ var ImportService = class {
|
|
|
8710
8899
|
* `rows.length` as the size of the problem. `limit` defaults to 500 here
|
|
8711
8900
|
* (1–50 000); {@link downloadRunDiagnosticsCsv} defaults to 50 000.
|
|
8712
8901
|
*/
|
|
8713
|
-
async listRunDiagnostics(runId, query = {}, auth2 =
|
|
8902
|
+
async listRunDiagnostics(runId, query = {}, auth2 = SERVICE30) {
|
|
8714
8903
|
return this.ctx.http.request({
|
|
8715
8904
|
method: "GET",
|
|
8716
8905
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/diagnostics`,
|
|
@@ -8728,7 +8917,7 @@ var ImportService = class {
|
|
|
8728
8917
|
* prefixed with an apostrophe so spreadsheet software does not evaluate source
|
|
8729
8918
|
* data as a formula. Strip it if you parse the file instead of opening it.
|
|
8730
8919
|
*/
|
|
8731
|
-
async downloadRunDiagnosticsCsv(runId, query = {}, auth2 =
|
|
8920
|
+
async downloadRunDiagnosticsCsv(runId, query = {}, auth2 = SERVICE30) {
|
|
8732
8921
|
return this.ctx.http.request({
|
|
8733
8922
|
method: "GET",
|
|
8734
8923
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/diagnostics/csv`,
|
|
@@ -8737,7 +8926,7 @@ var ImportService = class {
|
|
|
8737
8926
|
});
|
|
8738
8927
|
}
|
|
8739
8928
|
/** List the target types that hold imported records — the valid `type` values for {@link searchRecords}. */
|
|
8740
|
-
async listDataTypes(auth2 =
|
|
8929
|
+
async listDataTypes(auth2 = SERVICE30) {
|
|
8741
8930
|
return this.ctx.http.request({
|
|
8742
8931
|
method: "GET",
|
|
8743
8932
|
path: `${this.base()}/data/types`,
|
|
@@ -8745,7 +8934,7 @@ var ImportService = class {
|
|
|
8745
8934
|
});
|
|
8746
8935
|
}
|
|
8747
8936
|
/** Search imported records of one target type. */
|
|
8748
|
-
async searchRecords(opts, auth2 =
|
|
8937
|
+
async searchRecords(opts, auth2 = SERVICE30) {
|
|
8749
8938
|
const args = pageArgs(opts);
|
|
8750
8939
|
const query = {
|
|
8751
8940
|
type: opts.type,
|
|
@@ -8763,7 +8952,7 @@ var ImportService = class {
|
|
|
8763
8952
|
return toPage(wire, args);
|
|
8764
8953
|
}
|
|
8765
8954
|
/** Search the imported records produced by one stream. */
|
|
8766
|
-
async searchStreamRecords(streamId, opts = {}, auth2 =
|
|
8955
|
+
async searchStreamRecords(streamId, opts = {}, auth2 = SERVICE30) {
|
|
8767
8956
|
const args = pageArgs(opts);
|
|
8768
8957
|
const query = {
|
|
8769
8958
|
page: args.pageNumber - 1,
|
|
@@ -8792,7 +8981,7 @@ var ImportService = class {
|
|
|
8792
8981
|
*
|
|
8793
8982
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8794
8983
|
*/
|
|
8795
|
-
async stats(query = {}, auth2 =
|
|
8984
|
+
async stats(query = {}, auth2 = SERVICE30) {
|
|
8796
8985
|
return this.ctx.http.request({
|
|
8797
8986
|
method: "GET",
|
|
8798
8987
|
path: `${this.base()}/stats`,
|
|
@@ -8810,7 +8999,7 @@ var ImportService = class {
|
|
|
8810
8999
|
*
|
|
8811
9000
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8812
9001
|
*/
|
|
8813
|
-
async listJobGroups(auth2 =
|
|
9002
|
+
async listJobGroups(auth2 = SERVICE30) {
|
|
8814
9003
|
return this.ctx.http.request({
|
|
8815
9004
|
method: "GET",
|
|
8816
9005
|
path: `${this.base()}/dashboard/job-groups`,
|
|
@@ -8826,7 +9015,7 @@ var ImportService = class {
|
|
|
8826
9015
|
*
|
|
8827
9016
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8828
9017
|
*/
|
|
8829
|
-
async getHealthThresholds(auth2 =
|
|
9018
|
+
async getHealthThresholds(auth2 = SERVICE30) {
|
|
8830
9019
|
return this.ctx.http.request({
|
|
8831
9020
|
method: "GET",
|
|
8832
9021
|
path: `${this.base()}/settings/health-thresholds`,
|
|
@@ -8838,7 +9027,7 @@ var ImportService = class {
|
|
|
8838
9027
|
*
|
|
8839
9028
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8840
9029
|
*/
|
|
8841
|
-
async getLicense(auth2 =
|
|
9030
|
+
async getLicense(auth2 = SERVICE30) {
|
|
8842
9031
|
return this.ctx.http.request({
|
|
8843
9032
|
method: "GET",
|
|
8844
9033
|
path: `${this.base()}/license`,
|
|
@@ -8858,7 +9047,7 @@ var ImportService = class {
|
|
|
8858
9047
|
*
|
|
8859
9048
|
* **Preview upstream**: the contract may change without a major bump.
|
|
8860
9049
|
*/
|
|
8861
|
-
async retryRun(runId, auth2 =
|
|
9050
|
+
async retryRun(runId, auth2 = SERVICE30) {
|
|
8862
9051
|
return this.ctx.http.request({
|
|
8863
9052
|
method: "POST",
|
|
8864
9053
|
path: `${this.base()}/runs/${encodeURIComponent(runId)}/retry`,
|
|
@@ -8868,7 +9057,7 @@ var ImportService = class {
|
|
|
8868
9057
|
};
|
|
8869
9058
|
|
|
8870
9059
|
// src/services/audit-log.ts
|
|
8871
|
-
var
|
|
9060
|
+
var SERVICE31 = { kind: "service" };
|
|
8872
9061
|
function toPage2(wire) {
|
|
8873
9062
|
const pageNumber = wire.page ?? 1;
|
|
8874
9063
|
const totalPages = wire.totalPages ?? 0;
|
|
@@ -8920,7 +9109,7 @@ var AuditLogService = class {
|
|
|
8920
9109
|
* });
|
|
8921
9110
|
* ```
|
|
8922
9111
|
*/
|
|
8923
|
-
async list(opts = {}, auth2 =
|
|
9112
|
+
async list(opts = {}, auth2 = SERVICE31) {
|
|
8924
9113
|
const wire = await this.ctx.http.request({
|
|
8925
9114
|
method: "GET",
|
|
8926
9115
|
path: `${this.base()}/changelogs`,
|
|
@@ -8934,7 +9123,7 @@ var AuditLogService = class {
|
|
|
8934
9123
|
};
|
|
8935
9124
|
|
|
8936
9125
|
// src/services/unit-handling.ts
|
|
8937
|
-
var
|
|
9126
|
+
var SERVICE32 = { kind: "service" };
|
|
8938
9127
|
var UnitHandlingService = class {
|
|
8939
9128
|
constructor(ctx) {
|
|
8940
9129
|
this.ctx = ctx;
|
|
@@ -8945,7 +9134,7 @@ var UnitHandlingService = class {
|
|
|
8945
9134
|
return `/unit-handling/${this.ctx.tenant}`;
|
|
8946
9135
|
}
|
|
8947
9136
|
/** Find units (filter/sort/page). */
|
|
8948
|
-
async listUnits(query = {}, auth2 =
|
|
9137
|
+
async listUnits(query = {}, auth2 = SERVICE32) {
|
|
8949
9138
|
return this.ctx.http.request({
|
|
8950
9139
|
method: "GET",
|
|
8951
9140
|
path: `${this.base()}/units`,
|
|
@@ -8954,7 +9143,7 @@ var UnitHandlingService = class {
|
|
|
8954
9143
|
});
|
|
8955
9144
|
}
|
|
8956
9145
|
/** Retrieve a unit by code. */
|
|
8957
|
-
async getUnit(unitCode, auth2 =
|
|
9146
|
+
async getUnit(unitCode, auth2 = SERVICE32) {
|
|
8958
9147
|
return this.ctx.http.request({
|
|
8959
9148
|
method: "GET",
|
|
8960
9149
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -8962,11 +9151,11 @@ var UnitHandlingService = class {
|
|
|
8962
9151
|
});
|
|
8963
9152
|
}
|
|
8964
9153
|
/** Add a new unit. */
|
|
8965
|
-
async createUnit(input, auth2 =
|
|
9154
|
+
async createUnit(input, auth2 = SERVICE32) {
|
|
8966
9155
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/units`, auth: auth2, body: input });
|
|
8967
9156
|
}
|
|
8968
9157
|
/** Update a unit by code. */
|
|
8969
|
-
async updateUnit(unitCode, input, auth2 =
|
|
9158
|
+
async updateUnit(unitCode, input, auth2 = SERVICE32) {
|
|
8970
9159
|
await this.ctx.http.request({
|
|
8971
9160
|
method: "PUT",
|
|
8972
9161
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -8975,7 +9164,7 @@ var UnitHandlingService = class {
|
|
|
8975
9164
|
});
|
|
8976
9165
|
}
|
|
8977
9166
|
/** Delete a unit by code. */
|
|
8978
|
-
async deleteUnit(unitCode, auth2 =
|
|
9167
|
+
async deleteUnit(unitCode, auth2 = SERVICE32) {
|
|
8979
9168
|
await this.ctx.http.request({
|
|
8980
9169
|
method: "DELETE",
|
|
8981
9170
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -8983,7 +9172,7 @@ var UnitHandlingService = class {
|
|
|
8983
9172
|
});
|
|
8984
9173
|
}
|
|
8985
9174
|
/** Delete multiple units by code (bulk). The codes are sent as the request body. */
|
|
8986
|
-
async deleteUnits(codes, auth2 =
|
|
9175
|
+
async deleteUnits(codes, auth2 = SERVICE32) {
|
|
8987
9176
|
await this.ctx.http.request({
|
|
8988
9177
|
method: "DELETE",
|
|
8989
9178
|
path: `${this.base()}/units`,
|
|
@@ -8992,7 +9181,7 @@ var UnitHandlingService = class {
|
|
|
8992
9181
|
});
|
|
8993
9182
|
}
|
|
8994
9183
|
/** Fetch a conversion factor (`PUT /units/conversion-factor-commands`). */
|
|
8995
|
-
async getConversionFactor(input, auth2 =
|
|
9184
|
+
async getConversionFactor(input, auth2 = SERVICE32) {
|
|
8996
9185
|
return this.ctx.http.request({
|
|
8997
9186
|
method: "PUT",
|
|
8998
9187
|
path: `${this.base()}/units/conversion-factor-commands`,
|
|
@@ -9001,7 +9190,7 @@ var UnitHandlingService = class {
|
|
|
9001
9190
|
});
|
|
9002
9191
|
}
|
|
9003
9192
|
/** Convert a value between units (`PUT /units/convert-unit-commands`). */
|
|
9004
|
-
async convertUnit(input, auth2 =
|
|
9193
|
+
async convertUnit(input, auth2 = SERVICE32) {
|
|
9005
9194
|
return this.ctx.http.request({
|
|
9006
9195
|
method: "PUT",
|
|
9007
9196
|
path: `${this.base()}/units/convert-unit-commands`,
|
|
@@ -9010,13 +9199,13 @@ var UnitHandlingService = class {
|
|
|
9010
9199
|
});
|
|
9011
9200
|
}
|
|
9012
9201
|
/** List all unit types. */
|
|
9013
|
-
async listUnitTypes(auth2 =
|
|
9202
|
+
async listUnitTypes(auth2 = SERVICE32) {
|
|
9014
9203
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/types`, auth: auth2 });
|
|
9015
9204
|
}
|
|
9016
9205
|
};
|
|
9017
9206
|
|
|
9018
9207
|
// src/services/catalog.ts
|
|
9019
|
-
var
|
|
9208
|
+
var SERVICE33 = { kind: "service" };
|
|
9020
9209
|
var CatalogService = class {
|
|
9021
9210
|
constructor(ctx) {
|
|
9022
9211
|
this.ctx = ctx;
|
|
@@ -9027,7 +9216,7 @@ var CatalogService = class {
|
|
|
9027
9216
|
return `/catalog/${this.ctx.tenant}/catalogs`;
|
|
9028
9217
|
}
|
|
9029
9218
|
/** List catalogs (filtered/sorted). */
|
|
9030
|
-
async listCatalogs(query = {}, auth2 =
|
|
9219
|
+
async listCatalogs(query = {}, auth2 = SERVICE33) {
|
|
9031
9220
|
return this.ctx.http.request({
|
|
9032
9221
|
method: "GET",
|
|
9033
9222
|
path: this.base(),
|
|
@@ -9036,7 +9225,7 @@ var CatalogService = class {
|
|
|
9036
9225
|
});
|
|
9037
9226
|
}
|
|
9038
9227
|
/** Retrieve a catalog by id. */
|
|
9039
|
-
async getCatalog(catalogId, auth2 =
|
|
9228
|
+
async getCatalog(catalogId, auth2 = SERVICE33) {
|
|
9040
9229
|
return this.ctx.http.request({
|
|
9041
9230
|
method: "GET",
|
|
9042
9231
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9044,7 +9233,7 @@ var CatalogService = class {
|
|
|
9044
9233
|
});
|
|
9045
9234
|
}
|
|
9046
9235
|
/** Retrieve all catalogs that contain a category. */
|
|
9047
|
-
async getCatalogsForCategory(categoryId, auth2 =
|
|
9236
|
+
async getCatalogsForCategory(categoryId, auth2 = SERVICE33) {
|
|
9048
9237
|
return this.ctx.http.request({
|
|
9049
9238
|
method: "GET",
|
|
9050
9239
|
path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
|
|
@@ -9052,11 +9241,11 @@ var CatalogService = class {
|
|
|
9052
9241
|
});
|
|
9053
9242
|
}
|
|
9054
9243
|
/** Create a catalog. */
|
|
9055
|
-
async createCatalog(input, auth2 =
|
|
9244
|
+
async createCatalog(input, auth2 = SERVICE33) {
|
|
9056
9245
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
9057
9246
|
}
|
|
9058
9247
|
/** Upsert a catalog by id (`PUT`). */
|
|
9059
|
-
async updateCatalog(catalogId, input, auth2 =
|
|
9248
|
+
async updateCatalog(catalogId, input, auth2 = SERVICE33) {
|
|
9060
9249
|
return this.ctx.http.request({
|
|
9061
9250
|
method: "PUT",
|
|
9062
9251
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9065,7 +9254,7 @@ var CatalogService = class {
|
|
|
9065
9254
|
});
|
|
9066
9255
|
}
|
|
9067
9256
|
/** Partially update a catalog by id (`PATCH`). */
|
|
9068
|
-
async patchCatalog(catalogId, patch, auth2 =
|
|
9257
|
+
async patchCatalog(catalogId, patch, auth2 = SERVICE33) {
|
|
9069
9258
|
await this.ctx.http.request({
|
|
9070
9259
|
method: "PATCH",
|
|
9071
9260
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9074,7 +9263,7 @@ var CatalogService = class {
|
|
|
9074
9263
|
});
|
|
9075
9264
|
}
|
|
9076
9265
|
/** Remove a catalog by id. */
|
|
9077
|
-
async deleteCatalog(catalogId, auth2 =
|
|
9266
|
+
async deleteCatalog(catalogId, auth2 = SERVICE33) {
|
|
9078
9267
|
await this.ctx.http.request({
|
|
9079
9268
|
method: "DELETE",
|
|
9080
9269
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -9084,7 +9273,7 @@ var CatalogService = class {
|
|
|
9084
9273
|
};
|
|
9085
9274
|
|
|
9086
9275
|
// src/services/vendor.ts
|
|
9087
|
-
var
|
|
9276
|
+
var SERVICE34 = { kind: "service" };
|
|
9088
9277
|
var VendorService = class {
|
|
9089
9278
|
constructor(ctx) {
|
|
9090
9279
|
this.ctx = ctx;
|
|
@@ -9096,7 +9285,7 @@ var VendorService = class {
|
|
|
9096
9285
|
}
|
|
9097
9286
|
// --- Vendors ---
|
|
9098
9287
|
/** List all vendors. */
|
|
9099
|
-
async listVendors(query = {}, auth2 =
|
|
9288
|
+
async listVendors(query = {}, auth2 = SERVICE34) {
|
|
9100
9289
|
return this.ctx.http.request({
|
|
9101
9290
|
method: "GET",
|
|
9102
9291
|
path: `${this.base()}/vendors`,
|
|
@@ -9105,7 +9294,7 @@ var VendorService = class {
|
|
|
9105
9294
|
});
|
|
9106
9295
|
}
|
|
9107
9296
|
/** Retrieve a vendor by id. */
|
|
9108
|
-
async getVendor(vendorId, auth2 =
|
|
9297
|
+
async getVendor(vendorId, auth2 = SERVICE34) {
|
|
9109
9298
|
return this.ctx.http.request({
|
|
9110
9299
|
method: "GET",
|
|
9111
9300
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -9116,7 +9305,7 @@ var VendorService = class {
|
|
|
9116
9305
|
* Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to
|
|
9117
9306
|
* a string; paging, sort and fields go in the query string.
|
|
9118
9307
|
*/
|
|
9119
|
-
async searchVendors(query, auth2 =
|
|
9308
|
+
async searchVendors(query, auth2 = SERVICE34) {
|
|
9120
9309
|
const input = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
9121
9310
|
return this.ctx.http.request({
|
|
9122
9311
|
method: "POST",
|
|
@@ -9126,11 +9315,11 @@ var VendorService = class {
|
|
|
9126
9315
|
});
|
|
9127
9316
|
}
|
|
9128
9317
|
/** Create a vendor. */
|
|
9129
|
-
async createVendor(input, auth2 =
|
|
9318
|
+
async createVendor(input, auth2 = SERVICE34) {
|
|
9130
9319
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
|
|
9131
9320
|
}
|
|
9132
9321
|
/** Upsert a vendor by id (`PUT`). */
|
|
9133
|
-
async updateVendor(vendorId, input, auth2 =
|
|
9322
|
+
async updateVendor(vendorId, input, auth2 = SERVICE34) {
|
|
9134
9323
|
await this.ctx.http.request({
|
|
9135
9324
|
method: "PUT",
|
|
9136
9325
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -9139,7 +9328,7 @@ var VendorService = class {
|
|
|
9139
9328
|
});
|
|
9140
9329
|
}
|
|
9141
9330
|
/** Delete a vendor by id. */
|
|
9142
|
-
async deleteVendor(vendorId, auth2 =
|
|
9331
|
+
async deleteVendor(vendorId, auth2 = SERVICE34) {
|
|
9143
9332
|
await this.ctx.http.request({
|
|
9144
9333
|
method: "DELETE",
|
|
9145
9334
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -9148,7 +9337,7 @@ var VendorService = class {
|
|
|
9148
9337
|
}
|
|
9149
9338
|
// --- Vendor locations ---
|
|
9150
9339
|
/** List all vendor locations. */
|
|
9151
|
-
async listVendorLocations(query = {}, auth2 =
|
|
9340
|
+
async listVendorLocations(query = {}, auth2 = SERVICE34) {
|
|
9152
9341
|
return this.ctx.http.request({
|
|
9153
9342
|
method: "GET",
|
|
9154
9343
|
path: `${this.base()}/locations`,
|
|
@@ -9157,7 +9346,7 @@ var VendorService = class {
|
|
|
9157
9346
|
});
|
|
9158
9347
|
}
|
|
9159
9348
|
/** Retrieve a vendor location by id. */
|
|
9160
|
-
async getVendorLocation(locationId, auth2 =
|
|
9349
|
+
async getVendorLocation(locationId, auth2 = SERVICE34) {
|
|
9161
9350
|
return this.ctx.http.request({
|
|
9162
9351
|
method: "GET",
|
|
9163
9352
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -9165,11 +9354,11 @@ var VendorService = class {
|
|
|
9165
9354
|
});
|
|
9166
9355
|
}
|
|
9167
9356
|
/** Create a vendor location. */
|
|
9168
|
-
async createVendorLocation(input, auth2 =
|
|
9357
|
+
async createVendorLocation(input, auth2 = SERVICE34) {
|
|
9169
9358
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
|
|
9170
9359
|
}
|
|
9171
9360
|
/** Upsert a vendor location by id (`PUT`). */
|
|
9172
|
-
async updateVendorLocation(locationId, input, auth2 =
|
|
9361
|
+
async updateVendorLocation(locationId, input, auth2 = SERVICE34) {
|
|
9173
9362
|
await this.ctx.http.request({
|
|
9174
9363
|
method: "PUT",
|
|
9175
9364
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -9178,7 +9367,7 @@ var VendorService = class {
|
|
|
9178
9367
|
});
|
|
9179
9368
|
}
|
|
9180
9369
|
/** Delete a vendor location by id. */
|
|
9181
|
-
async deleteVendorLocation(locationId, auth2 =
|
|
9370
|
+
async deleteVendorLocation(locationId, auth2 = SERVICE34) {
|
|
9182
9371
|
await this.ctx.http.request({
|
|
9183
9372
|
method: "DELETE",
|
|
9184
9373
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -9188,7 +9377,7 @@ var VendorService = class {
|
|
|
9188
9377
|
};
|
|
9189
9378
|
|
|
9190
9379
|
// src/services/customer-admin.ts
|
|
9191
|
-
var
|
|
9380
|
+
var SERVICE35 = { kind: "service" };
|
|
9192
9381
|
var CustomerAdminService = class {
|
|
9193
9382
|
constructor(ctx) {
|
|
9194
9383
|
this.ctx = ctx;
|
|
@@ -9209,7 +9398,7 @@ var CustomerAdminService = class {
|
|
|
9209
9398
|
}
|
|
9210
9399
|
// --- Customers ---
|
|
9211
9400
|
/** List customers. */
|
|
9212
|
-
async listCustomers(query = {}, auth2 =
|
|
9401
|
+
async listCustomers(query = {}, auth2 = SERVICE35) {
|
|
9213
9402
|
return this.ctx.http.request({
|
|
9214
9403
|
method: "GET",
|
|
9215
9404
|
path: this.base(),
|
|
@@ -9221,7 +9410,7 @@ var CustomerAdminService = class {
|
|
|
9221
9410
|
* Search customers (`POST /customers/search`). A built filter in `q` is resolved
|
|
9222
9411
|
* to a string; `pageNumber`, `pageSize`, `sort` and `expand` go in the query string.
|
|
9223
9412
|
*/
|
|
9224
|
-
async searchCustomers(query, auth2 =
|
|
9413
|
+
async searchCustomers(query, auth2 = SERVICE35) {
|
|
9225
9414
|
const input = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
9226
9415
|
return this.ctx.http.request({
|
|
9227
9416
|
method: "POST",
|
|
@@ -9231,28 +9420,28 @@ var CustomerAdminService = class {
|
|
|
9231
9420
|
});
|
|
9232
9421
|
}
|
|
9233
9422
|
/** Retrieve a customer profile by number. */
|
|
9234
|
-
async getCustomer(customerNumber, auth2 =
|
|
9423
|
+
async getCustomer(customerNumber, auth2 = SERVICE35) {
|
|
9235
9424
|
return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
|
|
9236
9425
|
}
|
|
9237
9426
|
/** Create a customer. */
|
|
9238
|
-
async createCustomer(input, auth2 =
|
|
9427
|
+
async createCustomer(input, auth2 = SERVICE35) {
|
|
9239
9428
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
9240
9429
|
}
|
|
9241
9430
|
/** Upsert a customer profile by number (`PUT`). */
|
|
9242
|
-
async upsertCustomer(customerNumber, input, auth2 =
|
|
9431
|
+
async upsertCustomer(customerNumber, input, auth2 = SERVICE35) {
|
|
9243
9432
|
return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
|
|
9244
9433
|
}
|
|
9245
9434
|
/** Partially update a customer profile (`PATCH`). */
|
|
9246
|
-
async patchCustomer(customerNumber, patch, auth2 =
|
|
9435
|
+
async patchCustomer(customerNumber, patch, auth2 = SERVICE35) {
|
|
9247
9436
|
await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
|
|
9248
9437
|
}
|
|
9249
9438
|
/** Delete a customer profile. */
|
|
9250
|
-
async deleteCustomer(customerNumber, auth2 =
|
|
9439
|
+
async deleteCustomer(customerNumber, auth2 = SERVICE35) {
|
|
9251
9440
|
await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
|
|
9252
9441
|
}
|
|
9253
9442
|
// --- Addresses ---
|
|
9254
9443
|
/** List a customer's addresses. */
|
|
9255
|
-
async listAddresses(customerNumber, auth2 =
|
|
9444
|
+
async listAddresses(customerNumber, auth2 = SERVICE35) {
|
|
9256
9445
|
return this.ctx.http.request({
|
|
9257
9446
|
method: "GET",
|
|
9258
9447
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -9260,11 +9449,11 @@ var CustomerAdminService = class {
|
|
|
9260
9449
|
});
|
|
9261
9450
|
}
|
|
9262
9451
|
/** Retrieve one address. */
|
|
9263
|
-
async getAddress(customerNumber, addressId, auth2 =
|
|
9452
|
+
async getAddress(customerNumber, addressId, auth2 = SERVICE35) {
|
|
9264
9453
|
return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
9265
9454
|
}
|
|
9266
9455
|
/** Add an address. */
|
|
9267
|
-
async addAddress(customerNumber, input, auth2 =
|
|
9456
|
+
async addAddress(customerNumber, input, auth2 = SERVICE35) {
|
|
9268
9457
|
return this.ctx.http.request({
|
|
9269
9458
|
method: "POST",
|
|
9270
9459
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -9273,19 +9462,19 @@ var CustomerAdminService = class {
|
|
|
9273
9462
|
});
|
|
9274
9463
|
}
|
|
9275
9464
|
/** Upsert an address by id (`PUT`). */
|
|
9276
|
-
async upsertAddress(customerNumber, addressId, input, auth2 =
|
|
9465
|
+
async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE35) {
|
|
9277
9466
|
return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
|
|
9278
9467
|
}
|
|
9279
9468
|
/** Partially update an address by id (`PATCH`). */
|
|
9280
|
-
async patchAddress(customerNumber, addressId, patch, auth2 =
|
|
9469
|
+
async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE35) {
|
|
9281
9470
|
await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
|
|
9282
9471
|
}
|
|
9283
9472
|
/** Delete an address by id. */
|
|
9284
|
-
async deleteAddress(customerNumber, addressId, auth2 =
|
|
9473
|
+
async deleteAddress(customerNumber, addressId, auth2 = SERVICE35) {
|
|
9285
9474
|
await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
9286
9475
|
}
|
|
9287
9476
|
/** Add tags to an address (`?tags=` query). */
|
|
9288
|
-
async addAddressTags(customerNumber, addressId, tags, auth2 =
|
|
9477
|
+
async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE35) {
|
|
9289
9478
|
await this.ctx.http.request({
|
|
9290
9479
|
method: "POST",
|
|
9291
9480
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -9294,7 +9483,7 @@ var CustomerAdminService = class {
|
|
|
9294
9483
|
});
|
|
9295
9484
|
}
|
|
9296
9485
|
/** Remove tags from an address (`?tags=` query). */
|
|
9297
|
-
async removeAddressTags(customerNumber, addressId, tags, auth2 =
|
|
9486
|
+
async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE35) {
|
|
9298
9487
|
await this.ctx.http.request({
|
|
9299
9488
|
method: "DELETE",
|
|
9300
9489
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -9308,7 +9497,7 @@ var CustomerAdminService = class {
|
|
|
9308
9497
|
* `customer.import_read` scope. An unconfigured tenant answers with an empty
|
|
9309
9498
|
* object rather than a 404.
|
|
9310
9499
|
*/
|
|
9311
|
-
async getPasswordMigrationRetention(auth2 =
|
|
9500
|
+
async getPasswordMigrationRetention(auth2 = SERVICE35) {
|
|
9312
9501
|
return this.ctx.http.request({
|
|
9313
9502
|
method: "GET",
|
|
9314
9503
|
path: this.configPath(),
|
|
@@ -9321,7 +9510,7 @@ var CustomerAdminService = class {
|
|
|
9321
9510
|
* `legacyAuth`** — that import is rejected without an active config. Re-POST with
|
|
9322
9511
|
* an earlier `retentionEndDate` to shorten a running window.
|
|
9323
9512
|
*/
|
|
9324
|
-
async configurePasswordMigrationRetention(input, auth2 =
|
|
9513
|
+
async configurePasswordMigrationRetention(input, auth2 = SERVICE35) {
|
|
9325
9514
|
return this.ctx.http.request({
|
|
9326
9515
|
method: "POST",
|
|
9327
9516
|
path: this.configPath(),
|
|
@@ -9334,7 +9523,7 @@ var CustomerAdminService = class {
|
|
|
9334
9523
|
* Intended for after the migration window: when the window ends, unmigrated
|
|
9335
9524
|
* accounts need a password reset and their legacy credentials are cleared.
|
|
9336
9525
|
*/
|
|
9337
|
-
async deletePasswordMigrationRetention(auth2 =
|
|
9526
|
+
async deletePasswordMigrationRetention(auth2 = SERVICE35) {
|
|
9338
9527
|
await this.ctx.http.request({ method: "DELETE", path: this.configPath(), auth: auth2 });
|
|
9339
9528
|
}
|
|
9340
9529
|
// --- Bulk import ---
|
|
@@ -9347,7 +9536,7 @@ var CustomerAdminService = class {
|
|
|
9347
9536
|
* `account.legacyAuth`, and importing `legacyAuth` requires an active retention
|
|
9348
9537
|
* config (see `configurePasswordMigrationRetention`).
|
|
9349
9538
|
*/
|
|
9350
|
-
async importCustomers(input, auth2 =
|
|
9539
|
+
async importCustomers(input, auth2 = SERVICE35) {
|
|
9351
9540
|
return this.ctx.http.request({
|
|
9352
9541
|
method: "POST",
|
|
9353
9542
|
path: `${this.base()}/import`,
|
|
@@ -9358,7 +9547,7 @@ var CustomerAdminService = class {
|
|
|
9358
9547
|
};
|
|
9359
9548
|
|
|
9360
9549
|
// src/services/approval.ts
|
|
9361
|
-
var
|
|
9550
|
+
var SERVICE36 = { kind: "service" };
|
|
9362
9551
|
var ApprovalService = class {
|
|
9363
9552
|
constructor(ctx) {
|
|
9364
9553
|
this.ctx = ctx;
|
|
@@ -9369,7 +9558,7 @@ var ApprovalService = class {
|
|
|
9369
9558
|
return `/approval/${this.ctx.tenant}`;
|
|
9370
9559
|
}
|
|
9371
9560
|
/** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
|
|
9372
|
-
async listApprovals(query = {}, auth2 =
|
|
9561
|
+
async listApprovals(query = {}, auth2 = SERVICE36) {
|
|
9373
9562
|
return this.ctx.http.request({
|
|
9374
9563
|
method: "GET",
|
|
9375
9564
|
path: `${this.base()}/approvals`,
|
|
@@ -9378,7 +9567,7 @@ var ApprovalService = class {
|
|
|
9378
9567
|
});
|
|
9379
9568
|
}
|
|
9380
9569
|
/** Retrieve a single approval by id. */
|
|
9381
|
-
async getApproval(approvalId, auth2 =
|
|
9570
|
+
async getApproval(approvalId, auth2 = SERVICE36) {
|
|
9382
9571
|
return this.ctx.http.request({
|
|
9383
9572
|
method: "GET",
|
|
9384
9573
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -9386,7 +9575,7 @@ var ApprovalService = class {
|
|
|
9386
9575
|
});
|
|
9387
9576
|
}
|
|
9388
9577
|
/** Create an approval request (cart or quote). Returns the created `{ id }`. */
|
|
9389
|
-
async createApproval(input, auth2 =
|
|
9578
|
+
async createApproval(input, auth2 = SERVICE36) {
|
|
9390
9579
|
return this.ctx.http.request({
|
|
9391
9580
|
method: "POST",
|
|
9392
9581
|
path: `${this.base()}/approvals`,
|
|
@@ -9395,7 +9584,7 @@ var ApprovalService = class {
|
|
|
9395
9584
|
});
|
|
9396
9585
|
}
|
|
9397
9586
|
/** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
|
|
9398
|
-
async updateApproval(approvalId, ops, auth2 =
|
|
9587
|
+
async updateApproval(approvalId, ops, auth2 = SERVICE36) {
|
|
9399
9588
|
await this.ctx.http.request({
|
|
9400
9589
|
method: "PATCH",
|
|
9401
9590
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -9404,7 +9593,7 @@ var ApprovalService = class {
|
|
|
9404
9593
|
});
|
|
9405
9594
|
}
|
|
9406
9595
|
/** Delete an approval by id. */
|
|
9407
|
-
async deleteApproval(approvalId, auth2 =
|
|
9596
|
+
async deleteApproval(approvalId, auth2 = SERVICE36) {
|
|
9408
9597
|
await this.ctx.http.request({
|
|
9409
9598
|
method: "DELETE",
|
|
9410
9599
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -9412,7 +9601,7 @@ var ApprovalService = class {
|
|
|
9412
9601
|
});
|
|
9413
9602
|
}
|
|
9414
9603
|
/** Check whether an operation on a resource is permitted / needs approval. */
|
|
9415
|
-
async checkPermitted(input, auth2 =
|
|
9604
|
+
async checkPermitted(input, auth2 = SERVICE36) {
|
|
9416
9605
|
return this.ctx.http.request({
|
|
9417
9606
|
method: "POST",
|
|
9418
9607
|
path: `${this.base()}/approval/permitted`,
|
|
@@ -9421,7 +9610,7 @@ var ApprovalService = class {
|
|
|
9421
9610
|
});
|
|
9422
9611
|
}
|
|
9423
9612
|
/** Search for users eligible to approve a resource. Returns an array. */
|
|
9424
|
-
async searchApprovers(input, auth2 =
|
|
9613
|
+
async searchApprovers(input, auth2 = SERVICE36) {
|
|
9425
9614
|
return this.ctx.http.request({
|
|
9426
9615
|
method: "POST",
|
|
9427
9616
|
path: `${this.base()}/search/users`,
|
|
@@ -9483,6 +9672,7 @@ var EmporixClient = class {
|
|
|
9483
9672
|
quotes;
|
|
9484
9673
|
returns;
|
|
9485
9674
|
indexing;
|
|
9675
|
+
search;
|
|
9486
9676
|
imports;
|
|
9487
9677
|
auditLogs;
|
|
9488
9678
|
units;
|
|
@@ -9557,6 +9747,7 @@ var EmporixClient = class {
|
|
|
9557
9747
|
this.quotes = new QuoteService(mk(QuoteService.channel));
|
|
9558
9748
|
this.returns = new ReturnsService(mk(ReturnsService.channel));
|
|
9559
9749
|
this.indexing = new IndexingService(mk(IndexingService.channel));
|
|
9750
|
+
this.search = new SearchService(mk(SearchService.channel));
|
|
9560
9751
|
this.imports = new ImportService(mk(ImportService.channel));
|
|
9561
9752
|
this.auditLogs = new AuditLogService(mk(AuditLogService.channel));
|
|
9562
9753
|
this.units = new UnitHandlingService(mk(UnitHandlingService.channel));
|
|
@@ -9685,6 +9876,7 @@ exports.RewardPointsService = RewardPointsService;
|
|
|
9685
9876
|
exports.STORAGE_KEYS = STORAGE_KEYS;
|
|
9686
9877
|
exports.SalesOrdersService = SalesOrdersService;
|
|
9687
9878
|
exports.SchemaService = SchemaService;
|
|
9879
|
+
exports.SearchService = SearchService;
|
|
9688
9880
|
exports.SegmentService = SegmentService;
|
|
9689
9881
|
exports.SequentialIdService = SequentialIdService;
|
|
9690
9882
|
exports.SessionContextService = SessionContextService;
|