@viu/emporix-sdk 2.4.0 → 2.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 +41 -0
- package/README.md +23 -3
- 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-hksRbb95.d.cts → context-CgUWXqEt.d.cts} +1 -1
- package/dist/{context-hksRbb95.d.ts → context-CgUWXqEt.d.ts} +1 -1
- package/dist/customer-groups.d.cts +1 -1
- package/dist/customer-groups.d.ts +1 -1
- package/dist/customer.d.cts +1 -1
- package/dist/customer.d.ts +1 -1
- package/dist/index.cjs +450 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1858 -49
- package/dist/index.d.ts +1858 -49
- package/dist/index.js +446 -2
- 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
|
@@ -4507,8 +4507,442 @@ var UnitHandlingService = class {
|
|
|
4507
4507
|
}
|
|
4508
4508
|
};
|
|
4509
4509
|
|
|
4510
|
+
// src/services/catalog.ts
|
|
4511
|
+
var SERVICE23 = { kind: "service" };
|
|
4512
|
+
var CatalogService = class {
|
|
4513
|
+
constructor(ctx) {
|
|
4514
|
+
this.ctx = ctx;
|
|
4515
|
+
}
|
|
4516
|
+
ctx;
|
|
4517
|
+
base() {
|
|
4518
|
+
return `/catalog/${this.ctx.tenant}/catalogs`;
|
|
4519
|
+
}
|
|
4520
|
+
/** List catalogs (filtered/sorted). */
|
|
4521
|
+
async listCatalogs(query = {}, auth2 = SERVICE23) {
|
|
4522
|
+
return this.ctx.http.request({
|
|
4523
|
+
method: "GET",
|
|
4524
|
+
path: this.base(),
|
|
4525
|
+
auth: auth2,
|
|
4526
|
+
...Object.keys(query).length ? { query } : {}
|
|
4527
|
+
});
|
|
4528
|
+
}
|
|
4529
|
+
/** Retrieve a catalog by id. */
|
|
4530
|
+
async getCatalog(catalogId, auth2 = SERVICE23) {
|
|
4531
|
+
return this.ctx.http.request({
|
|
4532
|
+
method: "GET",
|
|
4533
|
+
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
4534
|
+
auth: auth2
|
|
4535
|
+
});
|
|
4536
|
+
}
|
|
4537
|
+
/** Retrieve all catalogs that contain a category. */
|
|
4538
|
+
async getCatalogsForCategory(categoryId, auth2 = SERVICE23) {
|
|
4539
|
+
return this.ctx.http.request({
|
|
4540
|
+
method: "GET",
|
|
4541
|
+
path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
|
|
4542
|
+
auth: auth2
|
|
4543
|
+
});
|
|
4544
|
+
}
|
|
4545
|
+
/** Create a catalog. */
|
|
4546
|
+
async createCatalog(input, auth2 = SERVICE23) {
|
|
4547
|
+
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
4548
|
+
}
|
|
4549
|
+
/** Upsert a catalog by id (`PUT`). */
|
|
4550
|
+
async updateCatalog(catalogId, input, auth2 = SERVICE23) {
|
|
4551
|
+
return this.ctx.http.request({
|
|
4552
|
+
method: "PUT",
|
|
4553
|
+
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
4554
|
+
auth: auth2,
|
|
4555
|
+
body: input
|
|
4556
|
+
});
|
|
4557
|
+
}
|
|
4558
|
+
/** Partially update a catalog by id (`PATCH`). */
|
|
4559
|
+
async patchCatalog(catalogId, patch, auth2 = SERVICE23) {
|
|
4560
|
+
await this.ctx.http.request({
|
|
4561
|
+
method: "PATCH",
|
|
4562
|
+
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
4563
|
+
auth: auth2,
|
|
4564
|
+
body: patch
|
|
4565
|
+
});
|
|
4566
|
+
}
|
|
4567
|
+
/** Remove a catalog by id. */
|
|
4568
|
+
async deleteCatalog(catalogId, auth2 = SERVICE23) {
|
|
4569
|
+
await this.ctx.http.request({
|
|
4570
|
+
method: "DELETE",
|
|
4571
|
+
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
4572
|
+
auth: auth2
|
|
4573
|
+
});
|
|
4574
|
+
}
|
|
4575
|
+
};
|
|
4576
|
+
|
|
4577
|
+
// src/services/vendor.ts
|
|
4578
|
+
var SERVICE24 = { kind: "service" };
|
|
4579
|
+
var VendorService = class {
|
|
4580
|
+
constructor(ctx) {
|
|
4581
|
+
this.ctx = ctx;
|
|
4582
|
+
}
|
|
4583
|
+
ctx;
|
|
4584
|
+
base() {
|
|
4585
|
+
return `/vendor/${this.ctx.tenant}`;
|
|
4586
|
+
}
|
|
4587
|
+
// --- Vendors ---
|
|
4588
|
+
/** List all vendors. */
|
|
4589
|
+
async listVendors(query = {}, auth2 = SERVICE24) {
|
|
4590
|
+
return this.ctx.http.request({
|
|
4591
|
+
method: "GET",
|
|
4592
|
+
path: `${this.base()}/vendors`,
|
|
4593
|
+
auth: auth2,
|
|
4594
|
+
...Object.keys(query).length ? { query } : {}
|
|
4595
|
+
});
|
|
4596
|
+
}
|
|
4597
|
+
/** Retrieve a vendor by id. */
|
|
4598
|
+
async getVendor(vendorId, auth2 = SERVICE24) {
|
|
4599
|
+
return this.ctx.http.request({
|
|
4600
|
+
method: "GET",
|
|
4601
|
+
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
4602
|
+
auth: auth2
|
|
4603
|
+
});
|
|
4604
|
+
}
|
|
4605
|
+
/** Search vendors (`POST /vendors/search`). */
|
|
4606
|
+
async searchVendors(query, auth2 = SERVICE24) {
|
|
4607
|
+
return this.ctx.http.request({
|
|
4608
|
+
method: "POST",
|
|
4609
|
+
path: `${this.base()}/vendors/search`,
|
|
4610
|
+
auth: auth2,
|
|
4611
|
+
body: query
|
|
4612
|
+
});
|
|
4613
|
+
}
|
|
4614
|
+
/** Create a vendor. */
|
|
4615
|
+
async createVendor(input, auth2 = SERVICE24) {
|
|
4616
|
+
return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
|
|
4617
|
+
}
|
|
4618
|
+
/** Upsert a vendor by id (`PUT`). */
|
|
4619
|
+
async updateVendor(vendorId, input, auth2 = SERVICE24) {
|
|
4620
|
+
await this.ctx.http.request({
|
|
4621
|
+
method: "PUT",
|
|
4622
|
+
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
4623
|
+
auth: auth2,
|
|
4624
|
+
body: input
|
|
4625
|
+
});
|
|
4626
|
+
}
|
|
4627
|
+
/** Delete a vendor by id. */
|
|
4628
|
+
async deleteVendor(vendorId, auth2 = SERVICE24) {
|
|
4629
|
+
await this.ctx.http.request({
|
|
4630
|
+
method: "DELETE",
|
|
4631
|
+
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
4632
|
+
auth: auth2
|
|
4633
|
+
});
|
|
4634
|
+
}
|
|
4635
|
+
// --- Vendor locations ---
|
|
4636
|
+
/** List all vendor locations. */
|
|
4637
|
+
async listVendorLocations(query = {}, auth2 = SERVICE24) {
|
|
4638
|
+
return this.ctx.http.request({
|
|
4639
|
+
method: "GET",
|
|
4640
|
+
path: `${this.base()}/locations`,
|
|
4641
|
+
auth: auth2,
|
|
4642
|
+
...Object.keys(query).length ? { query } : {}
|
|
4643
|
+
});
|
|
4644
|
+
}
|
|
4645
|
+
/** Retrieve a vendor location by id. */
|
|
4646
|
+
async getVendorLocation(locationId, auth2 = SERVICE24) {
|
|
4647
|
+
return this.ctx.http.request({
|
|
4648
|
+
method: "GET",
|
|
4649
|
+
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
4650
|
+
auth: auth2
|
|
4651
|
+
});
|
|
4652
|
+
}
|
|
4653
|
+
/** Create a vendor location. */
|
|
4654
|
+
async createVendorLocation(input, auth2 = SERVICE24) {
|
|
4655
|
+
return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
|
|
4656
|
+
}
|
|
4657
|
+
/** Upsert a vendor location by id (`PUT`). */
|
|
4658
|
+
async updateVendorLocation(locationId, input, auth2 = SERVICE24) {
|
|
4659
|
+
await this.ctx.http.request({
|
|
4660
|
+
method: "PUT",
|
|
4661
|
+
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
4662
|
+
auth: auth2,
|
|
4663
|
+
body: input
|
|
4664
|
+
});
|
|
4665
|
+
}
|
|
4666
|
+
/** Delete a vendor location by id. */
|
|
4667
|
+
async deleteVendorLocation(locationId, auth2 = SERVICE24) {
|
|
4668
|
+
await this.ctx.http.request({
|
|
4669
|
+
method: "DELETE",
|
|
4670
|
+
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
4671
|
+
auth: auth2
|
|
4672
|
+
});
|
|
4673
|
+
}
|
|
4674
|
+
};
|
|
4675
|
+
|
|
4676
|
+
// src/services/pick-pack.ts
|
|
4677
|
+
var SERVICE25 = { kind: "service" };
|
|
4678
|
+
var PickPackService = class {
|
|
4679
|
+
constructor(ctx) {
|
|
4680
|
+
this.ctx = ctx;
|
|
4681
|
+
}
|
|
4682
|
+
ctx;
|
|
4683
|
+
base() {
|
|
4684
|
+
return `/pick-pack/${this.ctx.tenant}`;
|
|
4685
|
+
}
|
|
4686
|
+
orderPath(orderId) {
|
|
4687
|
+
return `${this.base()}/orders/${encodeURIComponent(orderId)}`;
|
|
4688
|
+
}
|
|
4689
|
+
/** List packlist orders. */
|
|
4690
|
+
async listOrders(query = {}, auth2 = SERVICE25) {
|
|
4691
|
+
return this.ctx.http.request({
|
|
4692
|
+
method: "GET",
|
|
4693
|
+
path: `${this.base()}/orders`,
|
|
4694
|
+
auth: auth2,
|
|
4695
|
+
...Object.keys(query).length ? { query } : {}
|
|
4696
|
+
});
|
|
4697
|
+
}
|
|
4698
|
+
/** Retrieve a packlist order by id. */
|
|
4699
|
+
async getOrder(orderId, auth2 = SERVICE25) {
|
|
4700
|
+
return this.ctx.http.request({ method: "GET", path: this.orderPath(orderId), auth: auth2 });
|
|
4701
|
+
}
|
|
4702
|
+
/** Update an order's status (`PATCH`). Returns an acknowledgement. */
|
|
4703
|
+
async updateOrder(orderId, change, auth2 = SERVICE25) {
|
|
4704
|
+
return this.ctx.http.request({ method: "PATCH", path: this.orderPath(orderId), auth: auth2, body: change });
|
|
4705
|
+
}
|
|
4706
|
+
/** Finish an order. Returns an acknowledgement. */
|
|
4707
|
+
async finishOrder(orderId, auth2 = SERVICE25) {
|
|
4708
|
+
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/finish`, auth: auth2 });
|
|
4709
|
+
}
|
|
4710
|
+
/** List order cycles (ids). */
|
|
4711
|
+
async listOrderCycles(query = {}, auth2 = SERVICE25) {
|
|
4712
|
+
return this.ctx.http.request({
|
|
4713
|
+
method: "GET",
|
|
4714
|
+
path: `${this.base()}/orderCycles`,
|
|
4715
|
+
auth: auth2,
|
|
4716
|
+
...Object.keys(query).length ? { query } : {}
|
|
4717
|
+
});
|
|
4718
|
+
}
|
|
4719
|
+
/** Add an assignee to an order. Returns an acknowledgement. */
|
|
4720
|
+
async addAssignee(orderId, assignee, auth2 = SERVICE25) {
|
|
4721
|
+
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/assignees`, auth: auth2, body: assignee });
|
|
4722
|
+
}
|
|
4723
|
+
/** Remove an assignee from an order. */
|
|
4724
|
+
async removeAssignee(orderId, assigneeId, auth2 = SERVICE25) {
|
|
4725
|
+
await this.ctx.http.request({
|
|
4726
|
+
method: "DELETE",
|
|
4727
|
+
path: `${this.orderPath(orderId)}/assignees/${encodeURIComponent(assigneeId)}`,
|
|
4728
|
+
auth: auth2
|
|
4729
|
+
});
|
|
4730
|
+
}
|
|
4731
|
+
/** Update packaging products for an order (`PUT`). Returns an acknowledgement. */
|
|
4732
|
+
async updatePackaging(orderId, change, auth2 = SERVICE25) {
|
|
4733
|
+
return this.ctx.http.request({ method: "PUT", path: `${this.orderPath(orderId)}/packaging`, auth: auth2, body: change });
|
|
4734
|
+
}
|
|
4735
|
+
/** Create a packing event. Returns an acknowledgement. */
|
|
4736
|
+
async createEvent(event, auth2 = SERVICE25) {
|
|
4737
|
+
return this.ctx.http.request({ method: "POST", path: `${this.base()}/events`, auth: auth2, body: event });
|
|
4738
|
+
}
|
|
4739
|
+
/** List packing events. */
|
|
4740
|
+
async listEvents(query = {}, auth2 = SERVICE25) {
|
|
4741
|
+
return this.ctx.http.request({
|
|
4742
|
+
method: "GET",
|
|
4743
|
+
path: `${this.base()}/events`,
|
|
4744
|
+
auth: auth2,
|
|
4745
|
+
...Object.keys(query).length ? { query } : {}
|
|
4746
|
+
});
|
|
4747
|
+
}
|
|
4748
|
+
/** Trigger an order recalculation. Returns the created job's id. */
|
|
4749
|
+
async triggerRecalculation(input, auth2 = SERVICE25) {
|
|
4750
|
+
return this.ctx.http.request({
|
|
4751
|
+
method: "POST",
|
|
4752
|
+
path: `${this.base()}/jobs/recalculations`,
|
|
4753
|
+
auth: auth2,
|
|
4754
|
+
body: input
|
|
4755
|
+
});
|
|
4756
|
+
}
|
|
4757
|
+
/** Retrieve a recalculation job by id. */
|
|
4758
|
+
async getRecalculationJob(jobId, auth2 = SERVICE25) {
|
|
4759
|
+
return this.ctx.http.request({
|
|
4760
|
+
method: "GET",
|
|
4761
|
+
path: `${this.base()}/jobs/recalculations/${encodeURIComponent(jobId)}`,
|
|
4762
|
+
auth: auth2
|
|
4763
|
+
});
|
|
4764
|
+
}
|
|
4765
|
+
};
|
|
4766
|
+
|
|
4767
|
+
// src/services/customer-admin.ts
|
|
4768
|
+
var SERVICE26 = { kind: "service" };
|
|
4769
|
+
var CustomerAdminService = class {
|
|
4770
|
+
constructor(ctx) {
|
|
4771
|
+
this.ctx = ctx;
|
|
4772
|
+
}
|
|
4773
|
+
ctx;
|
|
4774
|
+
base() {
|
|
4775
|
+
return `/customer/${this.ctx.tenant}/customers`;
|
|
4776
|
+
}
|
|
4777
|
+
customerPath(customerNumber) {
|
|
4778
|
+
return `${this.base()}/${encodeURIComponent(customerNumber)}`;
|
|
4779
|
+
}
|
|
4780
|
+
addressPath(customerNumber, addressId) {
|
|
4781
|
+
return `${this.customerPath(customerNumber)}/addresses/${encodeURIComponent(addressId)}`;
|
|
4782
|
+
}
|
|
4783
|
+
// --- Customers ---
|
|
4784
|
+
/** List customers. */
|
|
4785
|
+
async listCustomers(query = {}, auth2 = SERVICE26) {
|
|
4786
|
+
return this.ctx.http.request({
|
|
4787
|
+
method: "GET",
|
|
4788
|
+
path: this.base(),
|
|
4789
|
+
auth: auth2,
|
|
4790
|
+
...Object.keys(query).length ? { query } : {}
|
|
4791
|
+
});
|
|
4792
|
+
}
|
|
4793
|
+
/** Search customers (`POST /customers/search`). */
|
|
4794
|
+
async searchCustomers(query, auth2 = SERVICE26) {
|
|
4795
|
+
return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body: query });
|
|
4796
|
+
}
|
|
4797
|
+
/** Retrieve a customer profile by number. */
|
|
4798
|
+
async getCustomer(customerNumber, auth2 = SERVICE26) {
|
|
4799
|
+
return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
|
|
4800
|
+
}
|
|
4801
|
+
/** Create a customer. */
|
|
4802
|
+
async createCustomer(input, auth2 = SERVICE26) {
|
|
4803
|
+
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
4804
|
+
}
|
|
4805
|
+
/** Upsert a customer profile by number (`PUT`). */
|
|
4806
|
+
async upsertCustomer(customerNumber, input, auth2 = SERVICE26) {
|
|
4807
|
+
return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
|
|
4808
|
+
}
|
|
4809
|
+
/** Partially update a customer profile (`PATCH`). */
|
|
4810
|
+
async patchCustomer(customerNumber, patch, auth2 = SERVICE26) {
|
|
4811
|
+
await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
|
|
4812
|
+
}
|
|
4813
|
+
/** Delete a customer profile. */
|
|
4814
|
+
async deleteCustomer(customerNumber, auth2 = SERVICE26) {
|
|
4815
|
+
await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
|
|
4816
|
+
}
|
|
4817
|
+
// --- Addresses ---
|
|
4818
|
+
/** List a customer's addresses. */
|
|
4819
|
+
async listAddresses(customerNumber, auth2 = SERVICE26) {
|
|
4820
|
+
return this.ctx.http.request({
|
|
4821
|
+
method: "GET",
|
|
4822
|
+
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
4823
|
+
auth: auth2
|
|
4824
|
+
});
|
|
4825
|
+
}
|
|
4826
|
+
/** Retrieve one address. */
|
|
4827
|
+
async getAddress(customerNumber, addressId, auth2 = SERVICE26) {
|
|
4828
|
+
return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
4829
|
+
}
|
|
4830
|
+
/** Add an address. */
|
|
4831
|
+
async addAddress(customerNumber, input, auth2 = SERVICE26) {
|
|
4832
|
+
return this.ctx.http.request({
|
|
4833
|
+
method: "POST",
|
|
4834
|
+
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
4835
|
+
auth: auth2,
|
|
4836
|
+
body: input
|
|
4837
|
+
});
|
|
4838
|
+
}
|
|
4839
|
+
/** Upsert an address by id (`PUT`). */
|
|
4840
|
+
async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE26) {
|
|
4841
|
+
return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
|
|
4842
|
+
}
|
|
4843
|
+
/** Partially update an address by id (`PATCH`). */
|
|
4844
|
+
async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE26) {
|
|
4845
|
+
await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
|
|
4846
|
+
}
|
|
4847
|
+
/** Delete an address by id. */
|
|
4848
|
+
async deleteAddress(customerNumber, addressId, auth2 = SERVICE26) {
|
|
4849
|
+
await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
4850
|
+
}
|
|
4851
|
+
/** Add tags to an address (`?tags=` query). */
|
|
4852
|
+
async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE26) {
|
|
4853
|
+
await this.ctx.http.request({
|
|
4854
|
+
method: "POST",
|
|
4855
|
+
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
4856
|
+
auth: auth2,
|
|
4857
|
+
query: { tags: tags.join(",") }
|
|
4858
|
+
});
|
|
4859
|
+
}
|
|
4860
|
+
/** Remove tags from an address (`?tags=` query). */
|
|
4861
|
+
async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE26) {
|
|
4862
|
+
await this.ctx.http.request({
|
|
4863
|
+
method: "DELETE",
|
|
4864
|
+
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
4865
|
+
auth: auth2,
|
|
4866
|
+
query: { tags: tags.join(",") }
|
|
4867
|
+
});
|
|
4868
|
+
}
|
|
4869
|
+
};
|
|
4870
|
+
|
|
4871
|
+
// src/services/approval.ts
|
|
4872
|
+
var SERVICE27 = { kind: "service" };
|
|
4873
|
+
var ApprovalService = class {
|
|
4874
|
+
constructor(ctx) {
|
|
4875
|
+
this.ctx = ctx;
|
|
4876
|
+
}
|
|
4877
|
+
ctx;
|
|
4878
|
+
base() {
|
|
4879
|
+
return `/approval/${this.ctx.tenant}`;
|
|
4880
|
+
}
|
|
4881
|
+
/** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
|
|
4882
|
+
async listApprovals(query = {}, auth2 = SERVICE27) {
|
|
4883
|
+
return this.ctx.http.request({
|
|
4884
|
+
method: "GET",
|
|
4885
|
+
path: `${this.base()}/approvals`,
|
|
4886
|
+
auth: auth2,
|
|
4887
|
+
...Object.keys(query).length ? { query } : {}
|
|
4888
|
+
});
|
|
4889
|
+
}
|
|
4890
|
+
/** Retrieve a single approval by id. */
|
|
4891
|
+
async getApproval(approvalId, auth2 = SERVICE27) {
|
|
4892
|
+
return this.ctx.http.request({
|
|
4893
|
+
method: "GET",
|
|
4894
|
+
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
4895
|
+
auth: auth2
|
|
4896
|
+
});
|
|
4897
|
+
}
|
|
4898
|
+
/** Create an approval request (cart or quote). Returns the created `{ id }`. */
|
|
4899
|
+
async createApproval(input, auth2 = SERVICE27) {
|
|
4900
|
+
return this.ctx.http.request({
|
|
4901
|
+
method: "POST",
|
|
4902
|
+
path: `${this.base()}/approvals`,
|
|
4903
|
+
auth: auth2,
|
|
4904
|
+
body: input
|
|
4905
|
+
});
|
|
4906
|
+
}
|
|
4907
|
+
/** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
|
|
4908
|
+
async updateApproval(approvalId, ops, auth2 = SERVICE27) {
|
|
4909
|
+
await this.ctx.http.request({
|
|
4910
|
+
method: "PATCH",
|
|
4911
|
+
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
4912
|
+
auth: auth2,
|
|
4913
|
+
body: ops
|
|
4914
|
+
});
|
|
4915
|
+
}
|
|
4916
|
+
/** Delete an approval by id. */
|
|
4917
|
+
async deleteApproval(approvalId, auth2 = SERVICE27) {
|
|
4918
|
+
await this.ctx.http.request({
|
|
4919
|
+
method: "DELETE",
|
|
4920
|
+
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
4921
|
+
auth: auth2
|
|
4922
|
+
});
|
|
4923
|
+
}
|
|
4924
|
+
/** Check whether an operation on a resource is permitted / needs approval. */
|
|
4925
|
+
async checkPermitted(input, auth2 = SERVICE27) {
|
|
4926
|
+
return this.ctx.http.request({
|
|
4927
|
+
method: "POST",
|
|
4928
|
+
path: `${this.base()}/approval/permitted`,
|
|
4929
|
+
auth: auth2,
|
|
4930
|
+
body: input
|
|
4931
|
+
});
|
|
4932
|
+
}
|
|
4933
|
+
/** Search for users eligible to approve a resource. Returns an array. */
|
|
4934
|
+
async searchApprovers(input, auth2 = SERVICE27) {
|
|
4935
|
+
return this.ctx.http.request({
|
|
4936
|
+
method: "POST",
|
|
4937
|
+
path: `${this.base()}/search/users`,
|
|
4938
|
+
auth: auth2,
|
|
4939
|
+
body: input
|
|
4940
|
+
});
|
|
4941
|
+
}
|
|
4942
|
+
};
|
|
4943
|
+
|
|
4510
4944
|
// package.json
|
|
4511
|
-
var version = "2.
|
|
4945
|
+
var version = "2.5.0";
|
|
4512
4946
|
|
|
4513
4947
|
// src/version.ts
|
|
4514
4948
|
var SDK_VERSION = version;
|
|
@@ -4554,6 +4988,11 @@ var EmporixClient = class {
|
|
|
4554
4988
|
sepaExport;
|
|
4555
4989
|
indexing;
|
|
4556
4990
|
units;
|
|
4991
|
+
catalogs;
|
|
4992
|
+
vendors;
|
|
4993
|
+
pickPack;
|
|
4994
|
+
customerAdmin;
|
|
4995
|
+
approvals;
|
|
4557
4996
|
/** The validated tenant this client is bound to. */
|
|
4558
4997
|
tenant;
|
|
4559
4998
|
/**
|
|
@@ -4645,6 +5084,11 @@ var EmporixClient = class {
|
|
|
4645
5084
|
this.sepaExport = new SepaExportService(mk("sepa-export"));
|
|
4646
5085
|
this.indexing = new IndexingService(mk("indexing"));
|
|
4647
5086
|
this.units = new UnitHandlingService(mk("unit-handling"));
|
|
5087
|
+
this.catalogs = new CatalogService(mk("catalog"));
|
|
5088
|
+
this.vendors = new VendorService(mk("vendor"));
|
|
5089
|
+
this.pickPack = new PickPackService(mk("pick-pack"));
|
|
5090
|
+
this.customerAdmin = new CustomerAdminService(mk("customer-admin"));
|
|
5091
|
+
this.approvals = new ApprovalService(mk("approval"));
|
|
4648
5092
|
}
|
|
4649
5093
|
/** Sets the runtime log level globally or for one service. */
|
|
4650
5094
|
setLogLevel(level, opts = {}) {
|
|
@@ -4657,9 +5101,11 @@ var EmporixClient = class {
|
|
|
4657
5101
|
};
|
|
4658
5102
|
|
|
4659
5103
|
exports.AiService = AiService;
|
|
5104
|
+
exports.ApprovalService = ApprovalService;
|
|
4660
5105
|
exports.AvailabilityService = AvailabilityService;
|
|
4661
5106
|
exports.BrandService = BrandService;
|
|
4662
5107
|
exports.CartService = CartService;
|
|
5108
|
+
exports.CatalogService = CatalogService;
|
|
4663
5109
|
exports.CategoryService = CategoryService;
|
|
4664
5110
|
exports.CheckoutService = CheckoutService;
|
|
4665
5111
|
exports.ClientConfigService = ClientConfigService;
|
|
@@ -4668,6 +5114,7 @@ exports.ContactsService = ContactsService;
|
|
|
4668
5114
|
exports.CountryService = CountryService;
|
|
4669
5115
|
exports.CouponService = CouponService;
|
|
4670
5116
|
exports.CurrencyService = CurrencyService;
|
|
5117
|
+
exports.CustomerAdminService = CustomerAdminService;
|
|
4671
5118
|
exports.CustomerGroupsService = CustomerGroupsService;
|
|
4672
5119
|
exports.CustomerService = CustomerService;
|
|
4673
5120
|
exports.DEFAULT_HOST = DEFAULT_HOST;
|
|
@@ -4690,6 +5137,7 @@ exports.LocationsService = LocationsService;
|
|
|
4690
5137
|
exports.MediaService = MediaService;
|
|
4691
5138
|
exports.OrdersService = OrdersService;
|
|
4692
5139
|
exports.PaymentGatewayService = PaymentGatewayService;
|
|
5140
|
+
exports.PickPackService = PickPackService;
|
|
4693
5141
|
exports.PriceService = PriceService;
|
|
4694
5142
|
exports.ProductService = ProductService;
|
|
4695
5143
|
exports.RagIndexerService = RagIndexerService;
|
|
@@ -4707,6 +5155,7 @@ exports.SiteService = SiteService;
|
|
|
4707
5155
|
exports.TaxService = TaxService;
|
|
4708
5156
|
exports.TenantConfigService = TenantConfigService;
|
|
4709
5157
|
exports.UnitHandlingService = UnitHandlingService;
|
|
5158
|
+
exports.VendorService = VendorService;
|
|
4710
5159
|
exports.WebhookService = WebhookService;
|
|
4711
5160
|
exports.auth = auth;
|
|
4712
5161
|
exports.createConsoleLogger = createConsoleLogger;
|