@viu/emporix-sdk 2.22.0 → 2.23.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 +122 -0
- package/dist/availability.cjs +118 -0
- package/dist/availability.cjs.map +1 -1
- package/dist/availability.d.cts +178 -2
- package/dist/availability.d.ts +178 -2
- package/dist/availability.js +1 -1
- package/dist/cart.cjs +156 -11
- package/dist/cart.cjs.map +1 -1
- package/dist/cart.d.cts +176 -3
- package/dist/cart.d.ts +176 -3
- package/dist/cart.js +1 -1
- package/dist/category.cjs +192 -2
- package/dist/category.cjs.map +1 -1
- package/dist/category.d.cts +398 -1
- package/dist/category.d.ts +398 -1
- package/dist/category.js +1 -1
- package/dist/{chunk-HD5RBCM6.js → chunk-27NLS646.js} +10 -2
- package/dist/chunk-27NLS646.js.map +1 -0
- package/dist/{chunk-MMX5FGMI.js → chunk-6PJFOX3A.js} +109 -2
- package/dist/chunk-6PJFOX3A.js.map +1 -0
- package/dist/chunk-HWVFF6B2.js +378 -0
- package/dist/chunk-HWVFF6B2.js.map +1 -0
- package/dist/chunk-LQFRJSVT.js +224 -0
- package/dist/chunk-LQFRJSVT.js.map +1 -0
- package/dist/chunk-P7G4LOOV.js +264 -0
- package/dist/chunk-P7G4LOOV.js.map +1 -0
- package/dist/{chunk-44F52KRE.js → chunk-QQMLN76U.js} +27 -2
- package/dist/chunk-QQMLN76U.js.map +1 -0
- package/dist/chunk-UNW6SFSB.js +363 -0
- package/dist/chunk-UNW6SFSB.js.map +1 -0
- package/dist/chunk-V3275BA7.js +181 -0
- package/dist/chunk-V3275BA7.js.map +1 -0
- package/dist/chunk-W2KBVWJ2.js +323 -0
- package/dist/chunk-W2KBVWJ2.js.map +1 -0
- package/dist/{chunk-5DWCYDQD.js → chunk-YVZ6GOLE.js} +158 -13
- package/dist/chunk-YVZ6GOLE.js.map +1 -0
- package/dist/chunk-ZOFGDNSX.js +305 -0
- package/dist/chunk-ZOFGDNSX.js.map +1 -0
- package/dist/companies.cjs +25 -0
- package/dist/companies.cjs.map +1 -1
- package/dist/companies.d.cts +14 -0
- package/dist/companies.d.ts +14 -0
- package/dist/companies.js +1 -1
- package/dist/contacts.cjs +8 -0
- package/dist/contacts.cjs.map +1 -1
- package/dist/contacts.d.cts +2 -0
- package/dist/contacts.d.ts +2 -0
- package/dist/contacts.js +1 -1
- package/dist/customer-groups-BxSNFHq1.d.cts +706 -0
- package/dist/customer-groups-GlzWhDsi.d.ts +706 -0
- package/dist/customer-groups.cjs +200 -17
- package/dist/customer-groups.cjs.map +1 -1
- package/dist/customer-groups.d.cts +2 -110
- package/dist/customer-groups.d.ts +2 -110
- package/dist/customer-groups.js +1 -1
- package/dist/index.cjs +2220 -391
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +433 -11
- package/dist/index.d.ts +433 -11
- package/dist/index.js +668 -340
- package/dist/index.js.map +1 -1
- package/dist/orders.cjs +160 -2
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.d.cts +221 -1
- package/dist/orders.d.ts +221 -1
- package/dist/orders.js +1 -1
- package/dist/payment.cjs +107 -0
- package/dist/payment.cjs.map +1 -1
- package/dist/payment.d.cts +299 -1
- package/dist/payment.d.ts +299 -1
- package/dist/payment.js +1 -1
- package/dist/price.cjs +197 -0
- package/dist/price.cjs.map +1 -1
- package/dist/price.d.cts +577 -1
- package/dist/price.d.ts +577 -1
- package/dist/price.js +1 -1
- package/dist/product.cjs +190 -0
- package/dist/product.cjs.map +1 -1
- package/dist/product.d.cts +503 -1
- package/dist/product.d.ts +503 -1
- package/dist/product.js +1 -1
- package/dist/segment.cjs +179 -0
- package/dist/segment.cjs.map +1 -1
- package/dist/segment.d.cts +181 -1
- package/dist/segment.d.ts +181 -1
- package/dist/segment.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-36T4YPQJ.js +0 -106
- package/dist/chunk-36T4YPQJ.js.map +0 -1
- package/dist/chunk-3BTPX7IJ.js +0 -41
- package/dist/chunk-3BTPX7IJ.js.map +0 -1
- package/dist/chunk-44F52KRE.js.map +0 -1
- package/dist/chunk-5DWCYDQD.js.map +0 -1
- package/dist/chunk-A3LYJUD4.js +0 -108
- package/dist/chunk-A3LYJUD4.js.map +0 -1
- package/dist/chunk-DXOLWAOY.js +0 -188
- package/dist/chunk-DXOLWAOY.js.map +0 -1
- package/dist/chunk-FZMP5NQZ.js +0 -173
- package/dist/chunk-FZMP5NQZ.js.map +0 -1
- package/dist/chunk-HD5RBCM6.js.map +0 -1
- package/dist/chunk-IVCCGJN5.js +0 -63
- package/dist/chunk-IVCCGJN5.js.map +0 -1
- package/dist/chunk-MMX5FGMI.js.map +0 -1
- package/dist/chunk-NE7MIZPR.js +0 -144
- package/dist/chunk-NE7MIZPR.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -2,33 +2,33 @@ import { LocationsService } from './chunk-IAOWDMTA.js';
|
|
|
2
2
|
export { LocationsService } from './chunk-IAOWDMTA.js';
|
|
3
3
|
import { MediaService } from './chunk-OTG2S2L4.js';
|
|
4
4
|
export { MediaService } from './chunk-OTG2S2L4.js';
|
|
5
|
-
import { OrdersService, SalesOrdersService } from './chunk-
|
|
6
|
-
export { OrdersService, SalesOrdersService } from './chunk-
|
|
7
|
-
import { auth, resolveToken, DefaultTokenProvider, CustomerRefreshRegistry, PaymentGatewayService } from './chunk-
|
|
8
|
-
export { CustomerRefreshRegistry, DefaultTokenProvider, PaymentGatewayService, auth, resolveToken } from './chunk-
|
|
9
|
-
import { PriceService } from './chunk-
|
|
10
|
-
export { PriceService } from './chunk-
|
|
11
|
-
import { ProductService } from './chunk-
|
|
12
|
-
export { ProductService } from './chunk-
|
|
13
|
-
import { SegmentService } from './chunk-
|
|
14
|
-
export { SegmentService } from './chunk-
|
|
15
|
-
import { AvailabilityService } from './chunk-
|
|
16
|
-
export { AvailabilityService } from './chunk-
|
|
17
|
-
import { CartService } from './chunk-
|
|
18
|
-
export { CartService } from './chunk-
|
|
19
|
-
import { CategoryService } from './chunk-
|
|
20
|
-
export { CategoryService } from './chunk-
|
|
5
|
+
import { OrdersService, SalesOrdersService } from './chunk-P7G4LOOV.js';
|
|
6
|
+
export { OrdersService, SalesOrdersService } from './chunk-P7G4LOOV.js';
|
|
7
|
+
import { auth, resolveToken, DefaultTokenProvider, CustomerRefreshRegistry, PaymentGatewayService } from './chunk-6PJFOX3A.js';
|
|
8
|
+
export { CustomerRefreshRegistry, DefaultTokenProvider, PaymentGatewayService, auth, resolveToken } from './chunk-6PJFOX3A.js';
|
|
9
|
+
import { PriceService } from './chunk-ZOFGDNSX.js';
|
|
10
|
+
export { PriceService } from './chunk-ZOFGDNSX.js';
|
|
11
|
+
import { ProductService } from './chunk-UNW6SFSB.js';
|
|
12
|
+
export { ProductService } from './chunk-UNW6SFSB.js';
|
|
13
|
+
import { SegmentService } from './chunk-W2KBVWJ2.js';
|
|
14
|
+
export { SegmentService } from './chunk-W2KBVWJ2.js';
|
|
15
|
+
import { AvailabilityService } from './chunk-V3275BA7.js';
|
|
16
|
+
export { AvailabilityService } from './chunk-V3275BA7.js';
|
|
17
|
+
import { CartService } from './chunk-YVZ6GOLE.js';
|
|
18
|
+
export { CartService } from './chunk-YVZ6GOLE.js';
|
|
19
|
+
import { CategoryService } from './chunk-HWVFF6B2.js';
|
|
20
|
+
export { CategoryService } from './chunk-HWVFF6B2.js';
|
|
21
21
|
export { iterateAll } from './chunk-GWJ2U2CP.js';
|
|
22
22
|
import { resolveQuery } from './chunk-S5HEIQDK.js';
|
|
23
23
|
export { resolveQuery } from './chunk-S5HEIQDK.js';
|
|
24
24
|
import { CheckoutService } from './chunk-RYQVMR26.js';
|
|
25
25
|
export { CheckoutService } from './chunk-RYQVMR26.js';
|
|
26
|
-
import { CompaniesService } from './chunk-
|
|
27
|
-
export { CompaniesService } from './chunk-
|
|
28
|
-
import { ContactsService } from './chunk-
|
|
29
|
-
export { ContactsService } from './chunk-
|
|
30
|
-
import { CustomerGroupsService } from './chunk-
|
|
31
|
-
export { CustomerGroupsService } from './chunk-
|
|
26
|
+
import { CompaniesService } from './chunk-QQMLN76U.js';
|
|
27
|
+
export { CompaniesService } from './chunk-QQMLN76U.js';
|
|
28
|
+
import { ContactsService } from './chunk-27NLS646.js';
|
|
29
|
+
export { ContactsService } from './chunk-27NLS646.js';
|
|
30
|
+
import { CustomerGroupsService, IamService } from './chunk-LQFRJSVT.js';
|
|
31
|
+
export { CustomerGroupsService, IamService } from './chunk-LQFRJSVT.js';
|
|
32
32
|
import { CustomerService } from './chunk-PRN3T6TY.js';
|
|
33
33
|
export { CustomerService } from './chunk-PRN3T6TY.js';
|
|
34
34
|
import './chunk-3BDDYX3V.js';
|
|
@@ -591,7 +591,7 @@ var HttpClient = class {
|
|
|
591
591
|
};
|
|
592
592
|
|
|
593
593
|
// package.json
|
|
594
|
-
var version = "2.
|
|
594
|
+
var version = "2.23.0";
|
|
595
595
|
|
|
596
596
|
// src/version.ts
|
|
597
597
|
var SDK_VERSION = version;
|
|
@@ -661,6 +661,7 @@ function createCore(config) {
|
|
|
661
661
|
|
|
662
662
|
// src/services/site.ts
|
|
663
663
|
var ANON = auth.anonymous();
|
|
664
|
+
var SERVICE = auth.service();
|
|
664
665
|
var SiteService = class {
|
|
665
666
|
constructor(ctx) {
|
|
666
667
|
this.ctx = ctx;
|
|
@@ -697,6 +698,114 @@ var SiteService = class {
|
|
|
697
698
|
}
|
|
698
699
|
return def;
|
|
699
700
|
}
|
|
701
|
+
/** Lists just the tenant's site codes (`GET /siteslist`). Default auth: anonymous. */
|
|
702
|
+
async listCodes(authCtx = ANON) {
|
|
703
|
+
return this.ctx.http.request({
|
|
704
|
+
method: "GET",
|
|
705
|
+
path: `/site/${this.ctx.tenant}/siteslist`,
|
|
706
|
+
auth: authCtx
|
|
707
|
+
});
|
|
708
|
+
}
|
|
709
|
+
// --- Admin writes. Default auth: service. ---
|
|
710
|
+
/** Creates a site (`POST /sites`). Default auth: service. */
|
|
711
|
+
async create(input, authCtx = SERVICE) {
|
|
712
|
+
return this.ctx.http.request({
|
|
713
|
+
method: "POST",
|
|
714
|
+
path: `/site/${this.ctx.tenant}/sites`,
|
|
715
|
+
body: input,
|
|
716
|
+
auth: authCtx
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* Partially updates a site (`PATCH /sites/{siteCode}`). The endpoint responds
|
|
721
|
+
* 200 without a defined body, so nothing is returned — re-read with
|
|
722
|
+
* {@link get} when the updated site is needed. Default auth: service.
|
|
723
|
+
*/
|
|
724
|
+
async update(siteCode, input, authCtx = SERVICE) {
|
|
725
|
+
await this.ctx.http.request({
|
|
726
|
+
method: "PATCH",
|
|
727
|
+
path: `/site/${this.ctx.tenant}/sites/${siteCode}`,
|
|
728
|
+
body: input,
|
|
729
|
+
auth: authCtx
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Full-replaces a site (`PUT /sites/{siteCode}`). Like {@link update} it
|
|
734
|
+
* returns nothing (200 with no defined body). `options.expand` is forwarded as
|
|
735
|
+
* a query parameter. Default auth: service.
|
|
736
|
+
*/
|
|
737
|
+
async replace(siteCode, input, options = {}, authCtx = SERVICE) {
|
|
738
|
+
await this.ctx.http.request({
|
|
739
|
+
method: "PUT",
|
|
740
|
+
path: `/site/${this.ctx.tenant}/sites/${siteCode}`,
|
|
741
|
+
...options.expand === void 0 ? {} : { query: { expand: options.expand } },
|
|
742
|
+
body: input,
|
|
743
|
+
auth: authCtx
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
/** Deletes a site (`DELETE /sites/{siteCode}`). Default auth: service. */
|
|
747
|
+
async delete(siteCode, authCtx = SERVICE) {
|
|
748
|
+
await this.ctx.http.request({
|
|
749
|
+
method: "DELETE",
|
|
750
|
+
path: `/site/${this.ctx.tenant}/sites/${siteCode}`,
|
|
751
|
+
auth: authCtx
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Site mixins (`/sites/{siteCode}/mixins`). Mixin content is an open map —
|
|
756
|
+
* the spec defines no structure. Reads default to anonymous, writes to
|
|
757
|
+
* service auth.
|
|
758
|
+
*/
|
|
759
|
+
mixins = {
|
|
760
|
+
/** All mixin groups of a site, as a map of group name to content. */
|
|
761
|
+
list: async (siteCode, authCtx = ANON) => this.ctx.http.request({
|
|
762
|
+
method: "GET",
|
|
763
|
+
path: `/site/${this.ctx.tenant}/sites/${siteCode}/mixins`,
|
|
764
|
+
auth: authCtx
|
|
765
|
+
}),
|
|
766
|
+
/** One mixin group's content by name. */
|
|
767
|
+
get: async (siteCode, mixinName, authCtx = ANON) => this.ctx.http.request({
|
|
768
|
+
method: "GET",
|
|
769
|
+
path: `/site/${this.ctx.tenant}/sites/${siteCode}/mixins/${mixinName}`,
|
|
770
|
+
auth: authCtx
|
|
771
|
+
}),
|
|
772
|
+
/** Adds a mixin to a site. Default auth: service. */
|
|
773
|
+
create: async (siteCode, input, authCtx = SERVICE) => this.ctx.http.request({
|
|
774
|
+
method: "POST",
|
|
775
|
+
path: `/site/${this.ctx.tenant}/sites/${siteCode}/mixins`,
|
|
776
|
+
body: input,
|
|
777
|
+
auth: authCtx
|
|
778
|
+
}),
|
|
779
|
+
/**
|
|
780
|
+
* Partially updates a mixin (PATCH). Responds 200 without a defined body,
|
|
781
|
+
* so nothing is returned. Default auth: service.
|
|
782
|
+
*/
|
|
783
|
+
update: async (siteCode, mixinName, input, authCtx = SERVICE) => {
|
|
784
|
+
await this.ctx.http.request({
|
|
785
|
+
method: "PATCH",
|
|
786
|
+
path: `/site/${this.ctx.tenant}/sites/${siteCode}/mixins/${mixinName}`,
|
|
787
|
+
body: input,
|
|
788
|
+
auth: authCtx
|
|
789
|
+
});
|
|
790
|
+
},
|
|
791
|
+
/** Full-replaces a mixin (PUT). Returns nothing, like {@link update}. Default auth: service. */
|
|
792
|
+
replace: async (siteCode, mixinName, input, authCtx = SERVICE) => {
|
|
793
|
+
await this.ctx.http.request({
|
|
794
|
+
method: "PUT",
|
|
795
|
+
path: `/site/${this.ctx.tenant}/sites/${siteCode}/mixins/${mixinName}`,
|
|
796
|
+
body: input,
|
|
797
|
+
auth: authCtx
|
|
798
|
+
});
|
|
799
|
+
},
|
|
800
|
+
/** Removes a mixin from a site. Default auth: service. */
|
|
801
|
+
delete: async (siteCode, mixinName, authCtx = SERVICE) => {
|
|
802
|
+
await this.ctx.http.request({
|
|
803
|
+
method: "DELETE",
|
|
804
|
+
path: `/site/${this.ctx.tenant}/sites/${siteCode}/mixins/${mixinName}`,
|
|
805
|
+
auth: authCtx
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
};
|
|
700
809
|
};
|
|
701
810
|
|
|
702
811
|
// src/services/session-context.ts
|
|
@@ -781,7 +890,7 @@ function isNotFound(err) {
|
|
|
781
890
|
}
|
|
782
891
|
|
|
783
892
|
// src/services/tenant-config.ts
|
|
784
|
-
var
|
|
893
|
+
var SERVICE2 = { kind: "service" };
|
|
785
894
|
var TenantConfigService = class {
|
|
786
895
|
constructor(ctx) {
|
|
787
896
|
this.ctx = ctx;
|
|
@@ -792,7 +901,7 @@ var TenantConfigService = class {
|
|
|
792
901
|
return `/configuration/${this.ctx.tenant}/configurations`;
|
|
793
902
|
}
|
|
794
903
|
/** List tenant configurations, optionally filtered by `keys`. */
|
|
795
|
-
async list(opts = {}, auth2 =
|
|
904
|
+
async list(opts = {}, auth2 = SERVICE2) {
|
|
796
905
|
const query = opts.keys && opts.keys.length > 0 ? { keys: opts.keys.join(",") } : void 0;
|
|
797
906
|
return this.ctx.http.request({
|
|
798
907
|
method: "GET",
|
|
@@ -802,7 +911,7 @@ var TenantConfigService = class {
|
|
|
802
911
|
});
|
|
803
912
|
}
|
|
804
913
|
/** Retrieve one tenant configuration by key. */
|
|
805
|
-
async get(key, auth2 =
|
|
914
|
+
async get(key, auth2 = SERVICE2) {
|
|
806
915
|
return this.ctx.http.request({
|
|
807
916
|
method: "GET",
|
|
808
917
|
path: `${this.base()}/${encodeURIComponent(key)}`,
|
|
@@ -810,7 +919,7 @@ var TenantConfigService = class {
|
|
|
810
919
|
});
|
|
811
920
|
}
|
|
812
921
|
/** Create one or more tenant configurations (array in, array out). */
|
|
813
|
-
async create(drafts, auth2 =
|
|
922
|
+
async create(drafts, auth2 = SERVICE2) {
|
|
814
923
|
return this.ctx.http.request({
|
|
815
924
|
method: "POST",
|
|
816
925
|
path: this.base(),
|
|
@@ -819,7 +928,7 @@ var TenantConfigService = class {
|
|
|
819
928
|
});
|
|
820
929
|
}
|
|
821
930
|
/** Update one tenant configuration by key. */
|
|
822
|
-
async update(key, draft, auth2 =
|
|
931
|
+
async update(key, draft, auth2 = SERVICE2) {
|
|
823
932
|
return this.ctx.http.request({
|
|
824
933
|
method: "PUT",
|
|
825
934
|
path: `${this.base()}/${encodeURIComponent(key)}`,
|
|
@@ -828,17 +937,29 @@ var TenantConfigService = class {
|
|
|
828
937
|
});
|
|
829
938
|
}
|
|
830
939
|
/** Delete one tenant configuration by key. */
|
|
831
|
-
async delete(key, auth2 =
|
|
940
|
+
async delete(key, auth2 = SERVICE2) {
|
|
832
941
|
await this.ctx.http.request({
|
|
833
942
|
method: "DELETE",
|
|
834
943
|
path: `${this.base()}/${encodeURIComponent(key)}`,
|
|
835
944
|
auth: auth2
|
|
836
945
|
});
|
|
837
946
|
}
|
|
947
|
+
/**
|
|
948
|
+
* List the platform-wide global configurations
|
|
949
|
+
* (`GET /global-configurations`) — a separate resource from the tenant's own
|
|
950
|
+
* `/configurations`.
|
|
951
|
+
*/
|
|
952
|
+
async listGlobal(auth2 = SERVICE2) {
|
|
953
|
+
return this.ctx.http.request({
|
|
954
|
+
method: "GET",
|
|
955
|
+
path: `/configuration/${this.ctx.tenant}/global-configurations`,
|
|
956
|
+
auth: auth2
|
|
957
|
+
});
|
|
958
|
+
}
|
|
838
959
|
};
|
|
839
960
|
|
|
840
961
|
// src/services/client-config.ts
|
|
841
|
-
var
|
|
962
|
+
var SERVICE3 = { kind: "service" };
|
|
842
963
|
var ClientConfigService = class {
|
|
843
964
|
constructor(ctx) {
|
|
844
965
|
this.ctx = ctx;
|
|
@@ -849,7 +970,7 @@ var ClientConfigService = class {
|
|
|
849
970
|
return `/configuration/${this.ctx.tenant}/clients/${encodeURIComponent(client)}/configurations`;
|
|
850
971
|
}
|
|
851
972
|
/** List a client's configurations, optionally filtered by `keys`. */
|
|
852
|
-
async list(client, opts = {}, auth2 =
|
|
973
|
+
async list(client, opts = {}, auth2 = SERVICE3) {
|
|
853
974
|
const query = opts.keys && opts.keys.length > 0 ? { keys: opts.keys.join(",") } : void 0;
|
|
854
975
|
return this.ctx.http.request({
|
|
855
976
|
method: "GET",
|
|
@@ -859,7 +980,7 @@ var ClientConfigService = class {
|
|
|
859
980
|
});
|
|
860
981
|
}
|
|
861
982
|
/** Retrieve one client configuration by key. */
|
|
862
|
-
async get(client, key, auth2 =
|
|
983
|
+
async get(client, key, auth2 = SERVICE3) {
|
|
863
984
|
return this.ctx.http.request({
|
|
864
985
|
method: "GET",
|
|
865
986
|
path: `${this.base(client)}/${encodeURIComponent(key)}`,
|
|
@@ -867,7 +988,7 @@ var ClientConfigService = class {
|
|
|
867
988
|
});
|
|
868
989
|
}
|
|
869
990
|
/** Create one or more client configurations. Injects `client` into each item. */
|
|
870
|
-
async create(client, drafts, auth2 =
|
|
991
|
+
async create(client, drafts, auth2 = SERVICE3) {
|
|
871
992
|
const body = drafts.map((d) => ({ ...d, client }));
|
|
872
993
|
return this.ctx.http.request({
|
|
873
994
|
method: "POST",
|
|
@@ -877,7 +998,7 @@ var ClientConfigService = class {
|
|
|
877
998
|
});
|
|
878
999
|
}
|
|
879
1000
|
/** Update one client configuration by key. Injects `client` into the body. */
|
|
880
|
-
async update(client, key, draft, auth2 =
|
|
1001
|
+
async update(client, key, draft, auth2 = SERVICE3) {
|
|
881
1002
|
return this.ctx.http.request({
|
|
882
1003
|
method: "PUT",
|
|
883
1004
|
path: `${this.base(client)}/${encodeURIComponent(key)}`,
|
|
@@ -886,13 +1007,25 @@ var ClientConfigService = class {
|
|
|
886
1007
|
});
|
|
887
1008
|
}
|
|
888
1009
|
/** Delete one client configuration by key. */
|
|
889
|
-
async delete(client, key, auth2 =
|
|
1010
|
+
async delete(client, key, auth2 = SERVICE3) {
|
|
890
1011
|
await this.ctx.http.request({
|
|
891
1012
|
method: "DELETE",
|
|
892
1013
|
path: `${this.base(client)}/${encodeURIComponent(key)}`,
|
|
893
1014
|
auth: auth2
|
|
894
1015
|
});
|
|
895
1016
|
}
|
|
1017
|
+
/**
|
|
1018
|
+
* List the client ids that have configurations (`GET /clients`). Note this
|
|
1019
|
+
* targets `/configuration/{tenant}/clients` directly — the private `base`
|
|
1020
|
+
* helper appends `/configurations` for a specific client.
|
|
1021
|
+
*/
|
|
1022
|
+
async listClients(auth2 = SERVICE3) {
|
|
1023
|
+
return this.ctx.http.request({
|
|
1024
|
+
method: "GET",
|
|
1025
|
+
path: `/configuration/${this.ctx.tenant}/clients`,
|
|
1026
|
+
auth: auth2
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
896
1029
|
};
|
|
897
1030
|
|
|
898
1031
|
// src/services/shopping-list.ts
|
|
@@ -993,7 +1126,7 @@ var ShoppingListService = class {
|
|
|
993
1126
|
};
|
|
994
1127
|
|
|
995
1128
|
// src/services/ai-rag-indexer.ts
|
|
996
|
-
var
|
|
1129
|
+
var SERVICE4 = { kind: "service" };
|
|
997
1130
|
var RagIndexerService = class {
|
|
998
1131
|
constructor(ctx) {
|
|
999
1132
|
this.ctx = ctx;
|
|
@@ -1004,7 +1137,7 @@ var RagIndexerService = class {
|
|
|
1004
1137
|
return `/ai-rag-indexer/${this.ctx.tenant}/${encodeURIComponent(type)}`;
|
|
1005
1138
|
}
|
|
1006
1139
|
/** The indexable embedding field names for `type` (default `"PRODUCT"`). */
|
|
1007
|
-
async ragMetadata(type = "PRODUCT", auth2 =
|
|
1140
|
+
async ragMetadata(type = "PRODUCT", auth2 = SERVICE4) {
|
|
1008
1141
|
return this.ctx.http.request({
|
|
1009
1142
|
method: "GET",
|
|
1010
1143
|
path: `${this.base(type)}/rag-metadata`,
|
|
@@ -1012,7 +1145,7 @@ var RagIndexerService = class {
|
|
|
1012
1145
|
});
|
|
1013
1146
|
}
|
|
1014
1147
|
/** The filterable metadata fields for `type` (default `"PRODUCT"`). */
|
|
1015
|
-
async filterMetadata(type = "PRODUCT", auth2 =
|
|
1148
|
+
async filterMetadata(type = "PRODUCT", auth2 = SERVICE4) {
|
|
1016
1149
|
return this.ctx.http.request({
|
|
1017
1150
|
method: "GET",
|
|
1018
1151
|
path: `${this.base(type)}/filter-metadata`,
|
|
@@ -1026,7 +1159,7 @@ var RagIndexerService = class {
|
|
|
1026
1159
|
* @deprecated since 2026-06-18, removal 2026-12-01 — use the indexing service:
|
|
1027
1160
|
* `client.indexing.createReindexJob({ entityType: "PRODUCT", rag: true })`.
|
|
1028
1161
|
*/
|
|
1029
|
-
async reindex(type = "PRODUCT", auth2 =
|
|
1162
|
+
async reindex(type = "PRODUCT", auth2 = SERVICE4) {
|
|
1030
1163
|
await this.ctx.http.request({
|
|
1031
1164
|
method: "POST",
|
|
1032
1165
|
path: `${this.base(type)}/reindex`,
|
|
@@ -1036,7 +1169,7 @@ var RagIndexerService = class {
|
|
|
1036
1169
|
};
|
|
1037
1170
|
|
|
1038
1171
|
// src/services/sequential-id.ts
|
|
1039
|
-
var
|
|
1172
|
+
var SERVICE5 = { kind: "service" };
|
|
1040
1173
|
var SequentialIdService = class {
|
|
1041
1174
|
constructor(ctx) {
|
|
1042
1175
|
this.ctx = ctx;
|
|
@@ -1047,7 +1180,7 @@ var SequentialIdService = class {
|
|
|
1047
1180
|
return `/sequential-id/${this.ctx.tenant}/schemas`;
|
|
1048
1181
|
}
|
|
1049
1182
|
/** List all sequence schemas for the tenant. */
|
|
1050
|
-
async listSchemas(auth2 =
|
|
1183
|
+
async listSchemas(auth2 = SERVICE5) {
|
|
1051
1184
|
return this.ctx.http.request({
|
|
1052
1185
|
method: "GET",
|
|
1053
1186
|
path: this.base(),
|
|
@@ -1055,7 +1188,7 @@ var SequentialIdService = class {
|
|
|
1055
1188
|
});
|
|
1056
1189
|
}
|
|
1057
1190
|
/** Retrieve one sequence schema by id. */
|
|
1058
|
-
async getSchema(schemaId, auth2 =
|
|
1191
|
+
async getSchema(schemaId, auth2 = SERVICE5) {
|
|
1059
1192
|
return this.ctx.http.request({
|
|
1060
1193
|
method: "GET",
|
|
1061
1194
|
path: `${this.base()}/${encodeURIComponent(schemaId)}`,
|
|
@@ -1063,7 +1196,7 @@ var SequentialIdService = class {
|
|
|
1063
1196
|
});
|
|
1064
1197
|
}
|
|
1065
1198
|
/** Create a sequence schema. Schemas are immutable — there is no update. */
|
|
1066
|
-
async createSchema(schema, auth2 =
|
|
1199
|
+
async createSchema(schema, auth2 = SERVICE5) {
|
|
1067
1200
|
return this.ctx.http.request({
|
|
1068
1201
|
method: "POST",
|
|
1069
1202
|
path: this.base(),
|
|
@@ -1072,7 +1205,7 @@ var SequentialIdService = class {
|
|
|
1072
1205
|
});
|
|
1073
1206
|
}
|
|
1074
1207
|
/** Delete a sequence schema by id. */
|
|
1075
|
-
async deleteSchema(schemaId, auth2 =
|
|
1208
|
+
async deleteSchema(schemaId, auth2 = SERVICE5) {
|
|
1076
1209
|
await this.ctx.http.request({
|
|
1077
1210
|
method: "DELETE",
|
|
1078
1211
|
path: `${this.base()}/${encodeURIComponent(schemaId)}`,
|
|
@@ -1080,7 +1213,7 @@ var SequentialIdService = class {
|
|
|
1080
1213
|
});
|
|
1081
1214
|
}
|
|
1082
1215
|
/** Mark a schema active for its type (only one schema may be active per type). */
|
|
1083
|
-
async setActiveSchema(schemaId, auth2 =
|
|
1216
|
+
async setActiveSchema(schemaId, auth2 = SERVICE5) {
|
|
1084
1217
|
await this.ctx.http.request({
|
|
1085
1218
|
method: "POST",
|
|
1086
1219
|
path: `${this.base()}/${encodeURIComponent(schemaId)}/setActive`,
|
|
@@ -1088,7 +1221,7 @@ var SequentialIdService = class {
|
|
|
1088
1221
|
});
|
|
1089
1222
|
}
|
|
1090
1223
|
/** Get the active schema for a given schema type. */
|
|
1091
|
-
async listSchemasByType(schemaType, auth2 =
|
|
1224
|
+
async listSchemasByType(schemaType, auth2 = SERVICE5) {
|
|
1092
1225
|
return this.ctx.http.request({
|
|
1093
1226
|
method: "GET",
|
|
1094
1227
|
path: `${this.base()}/types/${encodeURIComponent(schemaType)}`,
|
|
@@ -1100,7 +1233,7 @@ var SequentialIdService = class {
|
|
|
1100
1233
|
* `sequenceKey` (independent sub-pool counter) and `placeholders`.
|
|
1101
1234
|
* `opts.siteCode` derives time/country placeholders from the site's settings.
|
|
1102
1235
|
*/
|
|
1103
|
-
async nextId(schemaType, body = {}, opts = {}, auth2 =
|
|
1236
|
+
async nextId(schemaType, body = {}, opts = {}, auth2 = SERVICE5) {
|
|
1104
1237
|
const query = opts.siteCode ? { siteCode: opts.siteCode } : void 0;
|
|
1105
1238
|
return this.ctx.http.request({
|
|
1106
1239
|
method: "POST",
|
|
@@ -1115,7 +1248,7 @@ var SequentialIdService = class {
|
|
|
1115
1248
|
* endpoint path omits the `{tenant}` segment — the service derives the
|
|
1116
1249
|
* tenant from the token.
|
|
1117
1250
|
*/
|
|
1118
|
-
async nextIdsBatch(req, auth2 =
|
|
1251
|
+
async nextIdsBatch(req, auth2 = SERVICE5) {
|
|
1119
1252
|
return this.ctx.http.request({
|
|
1120
1253
|
method: "POST",
|
|
1121
1254
|
path: `/sequential-id/sequenceSchemaBatch/nextIds`,
|
|
@@ -1126,7 +1259,7 @@ var SequentialIdService = class {
|
|
|
1126
1259
|
};
|
|
1127
1260
|
|
|
1128
1261
|
// src/services/fee.ts
|
|
1129
|
-
var
|
|
1262
|
+
var SERVICE6 = { kind: "service" };
|
|
1130
1263
|
var FeeService = class {
|
|
1131
1264
|
constructor(ctx) {
|
|
1132
1265
|
this.ctx = ctx;
|
|
@@ -1149,7 +1282,7 @@ var FeeService = class {
|
|
|
1149
1282
|
* returned page is full). Defaults match Emporix server defaults
|
|
1150
1283
|
* (`pageNumber: 1`, `pageSize: 60`).
|
|
1151
1284
|
*/
|
|
1152
|
-
async list(query = {}, auth2 =
|
|
1285
|
+
async list(query = {}, auth2 = SERVICE6) {
|
|
1153
1286
|
const pageNumber = query.pageNumber ?? 1;
|
|
1154
1287
|
const pageSize = query.pageSize ?? 60;
|
|
1155
1288
|
const items = await this.ctx.http.request({
|
|
@@ -1161,7 +1294,7 @@ var FeeService = class {
|
|
|
1161
1294
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
1162
1295
|
}
|
|
1163
1296
|
/** Retrieve one fee definition by id. */
|
|
1164
|
-
async get(id, auth2 =
|
|
1297
|
+
async get(id, auth2 = SERVICE6) {
|
|
1165
1298
|
return this.ctx.http.request({
|
|
1166
1299
|
method: "GET",
|
|
1167
1300
|
path: `${this.feesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -1169,7 +1302,7 @@ var FeeService = class {
|
|
|
1169
1302
|
});
|
|
1170
1303
|
}
|
|
1171
1304
|
/** Create a fee definition. */
|
|
1172
|
-
async create(draft, auth2 =
|
|
1305
|
+
async create(draft, auth2 = SERVICE6) {
|
|
1173
1306
|
return this.ctx.http.request({
|
|
1174
1307
|
method: "POST",
|
|
1175
1308
|
path: this.feesBase(),
|
|
@@ -1178,7 +1311,7 @@ var FeeService = class {
|
|
|
1178
1311
|
});
|
|
1179
1312
|
}
|
|
1180
1313
|
/** Update a fee definition by id. */
|
|
1181
|
-
async update(id, draft, auth2 =
|
|
1314
|
+
async update(id, draft, auth2 = SERVICE6) {
|
|
1182
1315
|
return this.ctx.http.request({
|
|
1183
1316
|
method: "PUT",
|
|
1184
1317
|
path: `${this.feesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -1187,7 +1320,7 @@ var FeeService = class {
|
|
|
1187
1320
|
});
|
|
1188
1321
|
}
|
|
1189
1322
|
/** Delete a fee definition by id. */
|
|
1190
|
-
async delete(id, auth2 =
|
|
1323
|
+
async delete(id, auth2 = SERVICE6) {
|
|
1191
1324
|
await this.ctx.http.request({
|
|
1192
1325
|
method: "DELETE",
|
|
1193
1326
|
path: `${this.feesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -1196,7 +1329,7 @@ var FeeService = class {
|
|
|
1196
1329
|
}
|
|
1197
1330
|
// --- Item-fee mappings ---
|
|
1198
1331
|
/** List all item-fee mappings. */
|
|
1199
|
-
async listItemFees(auth2 =
|
|
1332
|
+
async listItemFees(auth2 = SERVICE6) {
|
|
1200
1333
|
return this.ctx.http.request({
|
|
1201
1334
|
method: "GET",
|
|
1202
1335
|
path: this.itemFeesBase(),
|
|
@@ -1204,7 +1337,7 @@ var FeeService = class {
|
|
|
1204
1337
|
});
|
|
1205
1338
|
}
|
|
1206
1339
|
/** Fee mappings for one item YRN. */
|
|
1207
|
-
async getItemFees(itemYrn, auth2 =
|
|
1340
|
+
async getItemFees(itemYrn, auth2 = SERVICE6) {
|
|
1208
1341
|
return this.ctx.http.request({
|
|
1209
1342
|
method: "GET",
|
|
1210
1343
|
path: `${this.itemFeesBase()}/${encodeURIComponent(itemYrn)}/fees`,
|
|
@@ -1212,7 +1345,7 @@ var FeeService = class {
|
|
|
1212
1345
|
});
|
|
1213
1346
|
}
|
|
1214
1347
|
/** Create an item-fee mapping. */
|
|
1215
|
-
async createItemFee(draft, auth2 =
|
|
1348
|
+
async createItemFee(draft, auth2 = SERVICE6) {
|
|
1216
1349
|
return this.ctx.http.request({
|
|
1217
1350
|
method: "POST",
|
|
1218
1351
|
path: this.itemFeesBase(),
|
|
@@ -1224,7 +1357,7 @@ var FeeService = class {
|
|
|
1224
1357
|
* Set the fee list for an item YRN. Destructive replace by default; pass
|
|
1225
1358
|
* `{ partial: true }` to merge (`?partial=true`).
|
|
1226
1359
|
*/
|
|
1227
|
-
async setItemFees(itemYrn, feeIds, opts = {}, auth2 =
|
|
1360
|
+
async setItemFees(itemYrn, feeIds, opts = {}, auth2 = SERVICE6) {
|
|
1228
1361
|
return this.ctx.http.request({
|
|
1229
1362
|
method: "PUT",
|
|
1230
1363
|
path: `${this.itemFeesBase()}/${encodeURIComponent(itemYrn)}/fees`,
|
|
@@ -1237,7 +1370,7 @@ var FeeService = class {
|
|
|
1237
1370
|
* Delete item-fee mappings for a YRN. Without `feeId`, removes all mappings
|
|
1238
1371
|
* for the YRN; with `feeId`, removes that single fee from the mapping.
|
|
1239
1372
|
*/
|
|
1240
|
-
async deleteItemFees(itemYrn, feeId, auth2 =
|
|
1373
|
+
async deleteItemFees(itemYrn, feeId, auth2 = SERVICE6) {
|
|
1241
1374
|
const base = `${this.itemFeesBase()}/${encodeURIComponent(itemYrn)}/fees`;
|
|
1242
1375
|
await this.ctx.http.request({
|
|
1243
1376
|
method: "DELETE",
|
|
@@ -1246,7 +1379,7 @@ var FeeService = class {
|
|
|
1246
1379
|
});
|
|
1247
1380
|
}
|
|
1248
1381
|
/** Search item-fee mappings by item YRNs + site. */
|
|
1249
|
-
async searchItemFees(search, auth2 =
|
|
1382
|
+
async searchItemFees(search, auth2 = SERVICE6) {
|
|
1250
1383
|
return this.ctx.http.request({
|
|
1251
1384
|
method: "POST",
|
|
1252
1385
|
path: `${this.itemFeesBase()}/search`,
|
|
@@ -1256,7 +1389,7 @@ var FeeService = class {
|
|
|
1256
1389
|
}
|
|
1257
1390
|
// --- Product-fee mappings ---
|
|
1258
1391
|
/** Fee mappings for a product id. */
|
|
1259
|
-
async getProductFees(productId, auth2 =
|
|
1392
|
+
async getProductFees(productId, auth2 = SERVICE6) {
|
|
1260
1393
|
return this.ctx.http.request({
|
|
1261
1394
|
method: "GET",
|
|
1262
1395
|
path: `${this.productFeesBase()}/${encodeURIComponent(productId)}/fees`,
|
|
@@ -1267,7 +1400,7 @@ var FeeService = class {
|
|
|
1267
1400
|
* Set the fee list for a product id. Destructive replace by default; pass
|
|
1268
1401
|
* `{ partial: true }` to merge (`?partial=true`).
|
|
1269
1402
|
*/
|
|
1270
|
-
async setProductFees(productId, feeIds, opts = {}, auth2 =
|
|
1403
|
+
async setProductFees(productId, feeIds, opts = {}, auth2 = SERVICE6) {
|
|
1271
1404
|
return this.ctx.http.request({
|
|
1272
1405
|
method: "PUT",
|
|
1273
1406
|
path: `${this.productFeesBase()}/${encodeURIComponent(productId)}/fees`,
|
|
@@ -1277,13 +1410,54 @@ var FeeService = class {
|
|
|
1277
1410
|
});
|
|
1278
1411
|
}
|
|
1279
1412
|
/** Delete all fee mappings for a product id. */
|
|
1280
|
-
async deleteProductFees(productId, auth2 =
|
|
1413
|
+
async deleteProductFees(productId, auth2 = SERVICE6) {
|
|
1281
1414
|
await this.ctx.http.request({
|
|
1282
1415
|
method: "DELETE",
|
|
1283
1416
|
path: `${this.productFeesBase()}/${encodeURIComponent(productId)}/fees`,
|
|
1284
1417
|
auth: auth2
|
|
1285
1418
|
});
|
|
1286
1419
|
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Removes **one** fee from a product
|
|
1422
|
+
* (`DELETE /productFees/{productId}/fees/{feeId}`). Use
|
|
1423
|
+
* {@link deleteProductFees} to clear every fee of a product.
|
|
1424
|
+
*/
|
|
1425
|
+
async deleteProductFee(productId, feeId, auth2 = SERVICE6) {
|
|
1426
|
+
await this.ctx.http.request({
|
|
1427
|
+
method: "DELETE",
|
|
1428
|
+
path: `${this.productFeesBase()}/${encodeURIComponent(productId)}/fees/${encodeURIComponent(feeId)}`,
|
|
1429
|
+
auth: auth2
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
/**
|
|
1433
|
+
* Finds item fees for one product across several sites
|
|
1434
|
+
* (`POST /itemFees/searchByProductId`).
|
|
1435
|
+
*/
|
|
1436
|
+
async searchItemFeesByProductId(search, auth2 = SERVICE6) {
|
|
1437
|
+
return this.ctx.http.request({
|
|
1438
|
+
method: "POST",
|
|
1439
|
+
path: `${this.itemFeesBase()}/searchByProductId`,
|
|
1440
|
+
auth: auth2,
|
|
1441
|
+
body: search,
|
|
1442
|
+
idempotent: true
|
|
1443
|
+
// pure read over POST — safe to replay on 5xx/429
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1446
|
+
/**
|
|
1447
|
+
* Finds item fees for several products on one site
|
|
1448
|
+
* (`POST /itemFees/searchByProductIds`). Note the upstream asymmetry:
|
|
1449
|
+
* `productIds` is a comma-separated **string** and `siteCode` is singular.
|
|
1450
|
+
*/
|
|
1451
|
+
async searchItemFeesByProductIds(search, auth2 = SERVICE6) {
|
|
1452
|
+
return this.ctx.http.request({
|
|
1453
|
+
method: "POST",
|
|
1454
|
+
path: `${this.itemFeesBase()}/searchByProductIds`,
|
|
1455
|
+
auth: auth2,
|
|
1456
|
+
body: search,
|
|
1457
|
+
idempotent: true
|
|
1458
|
+
// pure read over POST — safe to replay on 5xx/429
|
|
1459
|
+
});
|
|
1460
|
+
}
|
|
1287
1461
|
};
|
|
1288
1462
|
|
|
1289
1463
|
// src/services/cloud-functions.ts
|
|
@@ -1310,7 +1484,7 @@ var CloudFunctionsService = class {
|
|
|
1310
1484
|
};
|
|
1311
1485
|
|
|
1312
1486
|
// src/services/webhook.ts
|
|
1313
|
-
var
|
|
1487
|
+
var SERVICE7 = { kind: "service" };
|
|
1314
1488
|
var WebhookService = class {
|
|
1315
1489
|
constructor(ctx) {
|
|
1316
1490
|
this.ctx = ctx;
|
|
@@ -1321,7 +1495,7 @@ var WebhookService = class {
|
|
|
1321
1495
|
return `/webhook/${this.ctx.tenant}`;
|
|
1322
1496
|
}
|
|
1323
1497
|
/** List the event-subscription catalog with each event's on/off state. */
|
|
1324
|
-
async listEventSubscriptions(auth2 =
|
|
1498
|
+
async listEventSubscriptions(auth2 = SERVICE7) {
|
|
1325
1499
|
return this.ctx.http.request({
|
|
1326
1500
|
method: "GET",
|
|
1327
1501
|
path: `${this.base()}/event-subscriptions`,
|
|
@@ -1334,7 +1508,7 @@ var WebhookService = class {
|
|
|
1334
1508
|
* `code`/`status` (e.g. `results.filter(r => (r.code ?? 0) >= 400)`). Does
|
|
1335
1509
|
* NOT throw on a 207 with failed items; only a non-2xx HTTP status throws.
|
|
1336
1510
|
*/
|
|
1337
|
-
async updateEventSubscriptions(items, auth2 =
|
|
1511
|
+
async updateEventSubscriptions(items, auth2 = SERVICE7) {
|
|
1338
1512
|
return this.ctx.http.request({
|
|
1339
1513
|
method: "PATCH",
|
|
1340
1514
|
path: `${this.base()}/event-subscriptions`,
|
|
@@ -1343,7 +1517,7 @@ var WebhookService = class {
|
|
|
1343
1517
|
});
|
|
1344
1518
|
}
|
|
1345
1519
|
/** List delivery configurations. */
|
|
1346
|
-
async listConfigs(auth2 =
|
|
1520
|
+
async listConfigs(auth2 = SERVICE7) {
|
|
1347
1521
|
return this.ctx.http.request({
|
|
1348
1522
|
method: "GET",
|
|
1349
1523
|
path: `${this.base()}/config`,
|
|
@@ -1351,7 +1525,7 @@ var WebhookService = class {
|
|
|
1351
1525
|
});
|
|
1352
1526
|
}
|
|
1353
1527
|
/** Retrieve one delivery configuration by code. */
|
|
1354
|
-
async getConfig(code, auth2 =
|
|
1528
|
+
async getConfig(code, auth2 = SERVICE7) {
|
|
1355
1529
|
return this.ctx.http.request({
|
|
1356
1530
|
method: "GET",
|
|
1357
1531
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -1359,7 +1533,7 @@ var WebhookService = class {
|
|
|
1359
1533
|
});
|
|
1360
1534
|
}
|
|
1361
1535
|
/** Create a delivery configuration. Returns the server-assigned `{ code }`. */
|
|
1362
|
-
async createConfig(draft, auth2 =
|
|
1536
|
+
async createConfig(draft, auth2 = SERVICE7) {
|
|
1363
1537
|
return this.ctx.http.request({
|
|
1364
1538
|
method: "POST",
|
|
1365
1539
|
path: `${this.base()}/config`,
|
|
@@ -1368,7 +1542,7 @@ var WebhookService = class {
|
|
|
1368
1542
|
});
|
|
1369
1543
|
}
|
|
1370
1544
|
/** Replace a delivery configuration by code (204). */
|
|
1371
|
-
async replaceConfig(code, draft, auth2 =
|
|
1545
|
+
async replaceConfig(code, draft, auth2 = SERVICE7) {
|
|
1372
1546
|
await this.ctx.http.request({
|
|
1373
1547
|
method: "PUT",
|
|
1374
1548
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -1380,7 +1554,7 @@ var WebhookService = class {
|
|
|
1380
1554
|
* Partially update a delivery configuration by code (204). The body is an
|
|
1381
1555
|
* **array** of `{ op, path, value }` operations (UPSERT / REMOVE).
|
|
1382
1556
|
*/
|
|
1383
|
-
async patchConfig(code, patches, auth2 =
|
|
1557
|
+
async patchConfig(code, patches, auth2 = SERVICE7) {
|
|
1384
1558
|
await this.ctx.http.request({
|
|
1385
1559
|
method: "PATCH",
|
|
1386
1560
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -1392,7 +1566,7 @@ var WebhookService = class {
|
|
|
1392
1566
|
* Delete a delivery configuration by code. Pass `{ force: true }` to delete
|
|
1393
1567
|
* the currently-active config (the server otherwise rejects it).
|
|
1394
1568
|
*/
|
|
1395
|
-
async deleteConfig(code, opts = {}, auth2 =
|
|
1569
|
+
async deleteConfig(code, opts = {}, auth2 = SERVICE7) {
|
|
1396
1570
|
await this.ctx.http.request({
|
|
1397
1571
|
method: "DELETE",
|
|
1398
1572
|
path: `${this.base()}/config/${encodeURIComponent(code)}`,
|
|
@@ -1401,7 +1575,7 @@ var WebhookService = class {
|
|
|
1401
1575
|
});
|
|
1402
1576
|
}
|
|
1403
1577
|
/** Read delivery statistics over an optional `YYYY-MM` range. */
|
|
1404
|
-
async getStatistics(query = {}, auth2 =
|
|
1578
|
+
async getStatistics(query = {}, auth2 = SERVICE7) {
|
|
1405
1579
|
const q = {};
|
|
1406
1580
|
if (query.fromYearMonth) q.fromYearMonth = query.fromYearMonth;
|
|
1407
1581
|
if (query.toYearMonth) q.toYearMonth = query.toYearMonth;
|
|
@@ -1413,7 +1587,7 @@ var WebhookService = class {
|
|
|
1413
1587
|
});
|
|
1414
1588
|
}
|
|
1415
1589
|
/** Obtain Svix dashboard access (URL / token). */
|
|
1416
|
-
async getDashboardAccess(auth2 =
|
|
1590
|
+
async getDashboardAccess(auth2 = SERVICE7) {
|
|
1417
1591
|
return this.ctx.http.request({
|
|
1418
1592
|
method: "GET",
|
|
1419
1593
|
path: `${this.base()}/dashboard-access`,
|
|
@@ -1423,7 +1597,10 @@ var WebhookService = class {
|
|
|
1423
1597
|
};
|
|
1424
1598
|
|
|
1425
1599
|
// src/services/schema.ts
|
|
1426
|
-
var
|
|
1600
|
+
var SERVICE8 = { kind: "service" };
|
|
1601
|
+
function toJsonBlob(file) {
|
|
1602
|
+
return file instanceof Blob ? file : new Blob([JSON.stringify(file)], { type: "application/json" });
|
|
1603
|
+
}
|
|
1427
1604
|
var SchemaService = class {
|
|
1428
1605
|
constructor(ctx) {
|
|
1429
1606
|
this.ctx = ctx;
|
|
@@ -1439,6 +1616,9 @@ var SchemaService = class {
|
|
|
1439
1616
|
instancesBase(type) {
|
|
1440
1617
|
return `${this.entitiesBase()}/${encodeURIComponent(type)}/instances`;
|
|
1441
1618
|
}
|
|
1619
|
+
referencesBase() {
|
|
1620
|
+
return `/schema/${this.ctx.tenant}/references`;
|
|
1621
|
+
}
|
|
1442
1622
|
// --- (A) Schemas ---------------------------------------------------------
|
|
1443
1623
|
/**
|
|
1444
1624
|
* List schemas, wrapped in the shared {@link PaginatedItems} envelope.
|
|
@@ -1446,7 +1626,7 @@ var SchemaService = class {
|
|
|
1446
1626
|
* Pagination defaults match the rest of the SDK (`pageNumber: 1`,
|
|
1447
1627
|
* `pageSize: 60`).
|
|
1448
1628
|
*/
|
|
1449
|
-
async listSchemas(query = {}, auth2 =
|
|
1629
|
+
async listSchemas(query = {}, auth2 = SERVICE8) {
|
|
1450
1630
|
const pageNumber = query.pageNumber ?? 1;
|
|
1451
1631
|
const pageSize = query.pageSize ?? 60;
|
|
1452
1632
|
const q = { pageNumber, pageSize };
|
|
@@ -1461,7 +1641,7 @@ var SchemaService = class {
|
|
|
1461
1641
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
1462
1642
|
}
|
|
1463
1643
|
/** Retrieve one schema by id. */
|
|
1464
|
-
async getSchema(id, auth2 =
|
|
1644
|
+
async getSchema(id, auth2 = SERVICE8) {
|
|
1465
1645
|
return this.ctx.http.request({
|
|
1466
1646
|
method: "GET",
|
|
1467
1647
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}`,
|
|
@@ -1469,7 +1649,7 @@ var SchemaService = class {
|
|
|
1469
1649
|
});
|
|
1470
1650
|
}
|
|
1471
1651
|
/** Create a schema. */
|
|
1472
|
-
async createSchema(draft, auth2 =
|
|
1652
|
+
async createSchema(draft, auth2 = SERVICE8) {
|
|
1473
1653
|
return this.ctx.http.request({
|
|
1474
1654
|
method: "POST",
|
|
1475
1655
|
path: this.schemasBase(),
|
|
@@ -1482,7 +1662,7 @@ var SchemaService = class {
|
|
|
1482
1662
|
* stale version yields 409 Conflict (propagated as the standard conflict
|
|
1483
1663
|
* error).
|
|
1484
1664
|
*/
|
|
1485
|
-
async updateSchema(id, draft, auth2 =
|
|
1665
|
+
async updateSchema(id, draft, auth2 = SERVICE8) {
|
|
1486
1666
|
return this.ctx.http.request({
|
|
1487
1667
|
method: "PUT",
|
|
1488
1668
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}`,
|
|
@@ -1491,7 +1671,7 @@ var SchemaService = class {
|
|
|
1491
1671
|
});
|
|
1492
1672
|
}
|
|
1493
1673
|
/** Delete a schema by id. */
|
|
1494
|
-
async deleteSchema(id, auth2 =
|
|
1674
|
+
async deleteSchema(id, auth2 = SERVICE8) {
|
|
1495
1675
|
await this.ctx.http.request({
|
|
1496
1676
|
method: "DELETE",
|
|
1497
1677
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}`,
|
|
@@ -1502,7 +1682,7 @@ var SchemaService = class {
|
|
|
1502
1682
|
* Validate a schema document without persisting it (`POST /schemas/file`).
|
|
1503
1683
|
* Returns the server's validation result verbatim.
|
|
1504
1684
|
*/
|
|
1505
|
-
async validateSchemaFile(body, auth2 =
|
|
1685
|
+
async validateSchemaFile(body, auth2 = SERVICE8) {
|
|
1506
1686
|
return this.ctx.http.request({
|
|
1507
1687
|
method: "POST",
|
|
1508
1688
|
path: `${this.schemasBase()}/file`,
|
|
@@ -1512,7 +1692,7 @@ var SchemaService = class {
|
|
|
1512
1692
|
}
|
|
1513
1693
|
// --- (B) Types -----------------------------------------------------------
|
|
1514
1694
|
/** List entity types that currently have at least one schema. */
|
|
1515
|
-
async listTypes(auth2 =
|
|
1695
|
+
async listTypes(auth2 = SERVICE8) {
|
|
1516
1696
|
return this.ctx.http.request({
|
|
1517
1697
|
method: "GET",
|
|
1518
1698
|
path: `/schema/${this.ctx.tenant}/types`,
|
|
@@ -1520,7 +1700,7 @@ var SchemaService = class {
|
|
|
1520
1700
|
});
|
|
1521
1701
|
}
|
|
1522
1702
|
/** Set the entity types a schema applies to (`PUT /schemas/{id}/types`). */
|
|
1523
|
-
async setSchemaTypes(id, types, auth2 =
|
|
1703
|
+
async setSchemaTypes(id, types, auth2 = SERVICE8) {
|
|
1524
1704
|
return this.ctx.http.request({
|
|
1525
1705
|
method: "PUT",
|
|
1526
1706
|
path: `${this.schemasBase()}/${encodeURIComponent(id)}/types`,
|
|
@@ -1530,7 +1710,7 @@ var SchemaService = class {
|
|
|
1530
1710
|
}
|
|
1531
1711
|
// --- (C) Custom entities -------------------------------------------------
|
|
1532
1712
|
/** List custom-entity definitions. `expandSchemas` inlines each schema body. */
|
|
1533
|
-
async listCustomEntities(opts = {}, auth2 =
|
|
1713
|
+
async listCustomEntities(opts = {}, auth2 = SERVICE8) {
|
|
1534
1714
|
return this.ctx.http.request({
|
|
1535
1715
|
method: "GET",
|
|
1536
1716
|
path: this.entitiesBase(),
|
|
@@ -1539,7 +1719,7 @@ var SchemaService = class {
|
|
|
1539
1719
|
});
|
|
1540
1720
|
}
|
|
1541
1721
|
/** Retrieve one custom-entity definition by id. */
|
|
1542
|
-
async getCustomEntity(id, auth2 =
|
|
1722
|
+
async getCustomEntity(id, auth2 = SERVICE8) {
|
|
1543
1723
|
return this.ctx.http.request({
|
|
1544
1724
|
method: "GET",
|
|
1545
1725
|
path: `${this.entitiesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -1547,7 +1727,7 @@ var SchemaService = class {
|
|
|
1547
1727
|
});
|
|
1548
1728
|
}
|
|
1549
1729
|
/** Create a custom-entity definition. */
|
|
1550
|
-
async createCustomEntity(draft, auth2 =
|
|
1730
|
+
async createCustomEntity(draft, auth2 = SERVICE8) {
|
|
1551
1731
|
return this.ctx.http.request({
|
|
1552
1732
|
method: "POST",
|
|
1553
1733
|
path: this.entitiesBase(),
|
|
@@ -1556,7 +1736,7 @@ var SchemaService = class {
|
|
|
1556
1736
|
});
|
|
1557
1737
|
}
|
|
1558
1738
|
/** Update a custom-entity definition. */
|
|
1559
|
-
async updateCustomEntity(id, draft, auth2 =
|
|
1739
|
+
async updateCustomEntity(id, draft, auth2 = SERVICE8) {
|
|
1560
1740
|
return this.ctx.http.request({
|
|
1561
1741
|
method: "PUT",
|
|
1562
1742
|
path: `${this.entitiesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -1569,7 +1749,7 @@ var SchemaService = class {
|
|
|
1569
1749
|
* instances or schemas still reference it (propagated as the standard
|
|
1570
1750
|
* conflict error).
|
|
1571
1751
|
*/
|
|
1572
|
-
async deleteCustomEntity(id, auth2 =
|
|
1752
|
+
async deleteCustomEntity(id, auth2 = SERVICE8) {
|
|
1573
1753
|
await this.ctx.http.request({
|
|
1574
1754
|
method: "DELETE",
|
|
1575
1755
|
path: `${this.entitiesBase()}/${encodeURIComponent(id)}`,
|
|
@@ -1581,7 +1761,7 @@ var SchemaService = class {
|
|
|
1581
1761
|
* List a custom entity's instances, wrapped in {@link PaginatedItems}.
|
|
1582
1762
|
* `type` is the custom-entity type and is always the first argument.
|
|
1583
1763
|
*/
|
|
1584
|
-
async listInstances(type, query = {}, auth2 =
|
|
1764
|
+
async listInstances(type, query = {}, auth2 = SERVICE8) {
|
|
1585
1765
|
const pageNumber = query.pageNumber ?? 1;
|
|
1586
1766
|
const pageSize = query.pageSize ?? 60;
|
|
1587
1767
|
const items = await this.ctx.http.request({
|
|
@@ -1593,7 +1773,7 @@ var SchemaService = class {
|
|
|
1593
1773
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
1594
1774
|
}
|
|
1595
1775
|
/** Retrieve one instance by id. */
|
|
1596
|
-
async getInstance(type, id, auth2 =
|
|
1776
|
+
async getInstance(type, id, auth2 = SERVICE8) {
|
|
1597
1777
|
return this.ctx.http.request({
|
|
1598
1778
|
method: "GET",
|
|
1599
1779
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -1601,7 +1781,7 @@ var SchemaService = class {
|
|
|
1601
1781
|
});
|
|
1602
1782
|
}
|
|
1603
1783
|
/** Create an instance of a custom entity. */
|
|
1604
|
-
async createInstance(type, draft, auth2 =
|
|
1784
|
+
async createInstance(type, draft, auth2 = SERVICE8) {
|
|
1605
1785
|
return this.ctx.http.request({
|
|
1606
1786
|
method: "POST",
|
|
1607
1787
|
path: this.instancesBase(type),
|
|
@@ -1610,7 +1790,7 @@ var SchemaService = class {
|
|
|
1610
1790
|
});
|
|
1611
1791
|
}
|
|
1612
1792
|
/** Replace an instance (full `PUT`). */
|
|
1613
|
-
async replaceInstance(type, id, draft, auth2 =
|
|
1793
|
+
async replaceInstance(type, id, draft, auth2 = SERVICE8) {
|
|
1614
1794
|
return this.ctx.http.request({
|
|
1615
1795
|
method: "PUT",
|
|
1616
1796
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -1619,7 +1799,7 @@ var SchemaService = class {
|
|
|
1619
1799
|
});
|
|
1620
1800
|
}
|
|
1621
1801
|
/** Partially update an instance (`PATCH`). */
|
|
1622
|
-
async patchInstance(type, id, patch, auth2 =
|
|
1802
|
+
async patchInstance(type, id, patch, auth2 = SERVICE8) {
|
|
1623
1803
|
return this.ctx.http.request({
|
|
1624
1804
|
method: "PATCH",
|
|
1625
1805
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -1633,7 +1813,7 @@ var SchemaService = class {
|
|
|
1633
1813
|
* a per-item result array — a 207 is success, individual failures live in
|
|
1634
1814
|
* each item's `code`/`status`.
|
|
1635
1815
|
*/
|
|
1636
|
-
async bulkPatchInstances(type, items, auth2 =
|
|
1816
|
+
async bulkPatchInstances(type, items, auth2 = SERVICE8) {
|
|
1637
1817
|
return this.ctx.http.request({
|
|
1638
1818
|
method: "PATCH",
|
|
1639
1819
|
path: `${this.instancesBase(type)}/bulk`,
|
|
@@ -1641,8 +1821,80 @@ var SchemaService = class {
|
|
|
1641
1821
|
body: items
|
|
1642
1822
|
});
|
|
1643
1823
|
}
|
|
1824
|
+
/**
|
|
1825
|
+
* Create multiple instances in one request
|
|
1826
|
+
* (`POST /custom-entities/{type}/instances/bulk`). Returns a 207 envelope:
|
|
1827
|
+
* a per-item result array — a 207 is success, individual failures live in
|
|
1828
|
+
* each item's `code`/`status`.
|
|
1829
|
+
*/
|
|
1830
|
+
async bulkCreateInstances(type, items, auth2 = SERVICE8) {
|
|
1831
|
+
return this.ctx.http.request({
|
|
1832
|
+
method: "POST",
|
|
1833
|
+
path: `${this.instancesBase(type)}/bulk`,
|
|
1834
|
+
auth: auth2,
|
|
1835
|
+
body: items
|
|
1836
|
+
});
|
|
1837
|
+
}
|
|
1838
|
+
/**
|
|
1839
|
+
* Upsert multiple instances in one request
|
|
1840
|
+
* (`PUT /custom-entities/{type}/instances/bulk`). Each item carries its `id`.
|
|
1841
|
+
* Returns the same 207 per-item envelope as {@link bulkCreateInstances}.
|
|
1842
|
+
*/
|
|
1843
|
+
async bulkUpsertInstances(type, items, auth2 = SERVICE8) {
|
|
1844
|
+
return this.ctx.http.request({
|
|
1845
|
+
method: "PUT",
|
|
1846
|
+
path: `${this.instancesBase(type)}/bulk`,
|
|
1847
|
+
auth: auth2,
|
|
1848
|
+
body: items
|
|
1849
|
+
});
|
|
1850
|
+
}
|
|
1851
|
+
/**
|
|
1852
|
+
* Delete multiple instances by id
|
|
1853
|
+
* (`DELETE /custom-entities/{type}/instances/bulk`). Returns the same 207
|
|
1854
|
+
* per-item envelope as {@link bulkCreateInstances}.
|
|
1855
|
+
*
|
|
1856
|
+
* **Note:** the OpenAPI schema declares no request body for this operation,
|
|
1857
|
+
* but its description mandates one — "The IDs of items should be defined in
|
|
1858
|
+
* the request body as an array of strings" (example
|
|
1859
|
+
* `["firstId", "secondId"]`). The SDK follows the description and sends the
|
|
1860
|
+
* id array. Unverified against the live API.
|
|
1861
|
+
*/
|
|
1862
|
+
async bulkDeleteInstances(type, ids, auth2 = SERVICE8) {
|
|
1863
|
+
return this.ctx.http.request({
|
|
1864
|
+
method: "DELETE",
|
|
1865
|
+
path: `${this.instancesBase(type)}/bulk`,
|
|
1866
|
+
auth: auth2,
|
|
1867
|
+
body: ids
|
|
1868
|
+
});
|
|
1869
|
+
}
|
|
1870
|
+
/**
|
|
1871
|
+
* Export custom entities and their schemas
|
|
1872
|
+
* (`POST /custom-entities/export`). Pass the entity types to include; the
|
|
1873
|
+
* result carries a base64 `data` payload plus `exportedAt`.
|
|
1874
|
+
*/
|
|
1875
|
+
async exportCustomEntities(types, auth2 = SERVICE8) {
|
|
1876
|
+
return this.ctx.http.request({
|
|
1877
|
+
method: "POST",
|
|
1878
|
+
path: `${this.entitiesBase()}/export`,
|
|
1879
|
+
auth: auth2,
|
|
1880
|
+
body: types
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
/**
|
|
1884
|
+
* Import custom entities and their schemas
|
|
1885
|
+
* (`POST /custom-entities/import`) from the base64 `data` produced by
|
|
1886
|
+
* {@link exportCustomEntities}.
|
|
1887
|
+
*/
|
|
1888
|
+
async importCustomEntities(input, auth2 = SERVICE8) {
|
|
1889
|
+
await this.ctx.http.request({
|
|
1890
|
+
method: "POST",
|
|
1891
|
+
path: `${this.entitiesBase()}/import`,
|
|
1892
|
+
auth: auth2,
|
|
1893
|
+
body: input
|
|
1894
|
+
});
|
|
1895
|
+
}
|
|
1644
1896
|
/** Delete an instance by id. */
|
|
1645
|
-
async deleteInstance(type, id, auth2 =
|
|
1897
|
+
async deleteInstance(type, id, auth2 = SERVICE8) {
|
|
1646
1898
|
await this.ctx.http.request({
|
|
1647
1899
|
method: "DELETE",
|
|
1648
1900
|
path: `${this.instancesBase(type)}/${encodeURIComponent(id)}`,
|
|
@@ -1653,7 +1905,7 @@ var SchemaService = class {
|
|
|
1653
1905
|
* Structured search over a custom entity's instances
|
|
1654
1906
|
* (`POST /instances/search`), wrapped in {@link PaginatedItems}.
|
|
1655
1907
|
*/
|
|
1656
|
-
async searchInstances(type, body, auth2 =
|
|
1908
|
+
async searchInstances(type, body, auth2 = SERVICE8) {
|
|
1657
1909
|
const items = await this.ctx.http.request({
|
|
1658
1910
|
method: "POST",
|
|
1659
1911
|
path: `${this.instancesBase(type)}/search`,
|
|
@@ -1662,10 +1914,84 @@ var SchemaService = class {
|
|
|
1662
1914
|
});
|
|
1663
1915
|
return { items, pageNumber: 1, pageSize: items.length, hasNextPage: false };
|
|
1664
1916
|
}
|
|
1917
|
+
// --- (E) References ------------------------------------------------------
|
|
1918
|
+
/**
|
|
1919
|
+
* Reference entities (`/references`) — a schema plus an uploaded JSON file.
|
|
1920
|
+
* Create/update are `multipart/form-data` (parts `file` and `body`), like
|
|
1921
|
+
* the media service's blob upload. Default auth: service.
|
|
1922
|
+
*/
|
|
1923
|
+
references = {
|
|
1924
|
+
/**
|
|
1925
|
+
* List references, wrapped in {@link PaginatedItems}. Pagination defaults
|
|
1926
|
+
* match the rest of this service (`pageNumber: 1`, `pageSize: 60`).
|
|
1927
|
+
*/
|
|
1928
|
+
list: async (query = {}, auth2 = SERVICE8) => {
|
|
1929
|
+
const pageNumber = query.pageNumber ?? 1;
|
|
1930
|
+
const pageSize = query.pageSize ?? 60;
|
|
1931
|
+
const q = { pageNumber, pageSize };
|
|
1932
|
+
if (query.sort) q.sort = query.sort;
|
|
1933
|
+
if (query.q) q.q = query.q;
|
|
1934
|
+
if (query.fields) q.fields = query.fields;
|
|
1935
|
+
if (query.type) q.type = query.type;
|
|
1936
|
+
const items = await this.ctx.http.request({
|
|
1937
|
+
method: "GET",
|
|
1938
|
+
path: this.referencesBase(),
|
|
1939
|
+
auth: auth2,
|
|
1940
|
+
query: q
|
|
1941
|
+
});
|
|
1942
|
+
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
1943
|
+
},
|
|
1944
|
+
/** Retrieve one reference by id. */
|
|
1945
|
+
get: async (id, auth2 = SERVICE8) => this.ctx.http.request({
|
|
1946
|
+
method: "GET",
|
|
1947
|
+
path: `${this.referencesBase()}/${encodeURIComponent(id)}`,
|
|
1948
|
+
auth: auth2
|
|
1949
|
+
}),
|
|
1950
|
+
/**
|
|
1951
|
+
* Create a reference. `file` is the reference's JSON content — pass a
|
|
1952
|
+
* `Blob` to upload as-is, or a plain object to have it serialized into a
|
|
1953
|
+
* JSON blob. `body` carries the metadata.
|
|
1954
|
+
*/
|
|
1955
|
+
create: async (input, auth2 = SERVICE8) => {
|
|
1956
|
+
const fd = new FormData();
|
|
1957
|
+
fd.set("file", toJsonBlob(input.file));
|
|
1958
|
+
fd.set("body", JSON.stringify(input.body));
|
|
1959
|
+
return this.ctx.http.request({
|
|
1960
|
+
method: "POST",
|
|
1961
|
+
path: this.referencesBase(),
|
|
1962
|
+
auth: auth2,
|
|
1963
|
+
body: fd
|
|
1964
|
+
});
|
|
1965
|
+
},
|
|
1966
|
+
/**
|
|
1967
|
+
* Update a reference (multipart, like {@link create}). `options.version`
|
|
1968
|
+
* enables optimistic locking — the server answers 409 on a stale version.
|
|
1969
|
+
*/
|
|
1970
|
+
update: async (id, input, options = {}, auth2 = SERVICE8) => {
|
|
1971
|
+
const fd = new FormData();
|
|
1972
|
+
fd.set("file", toJsonBlob(input.file));
|
|
1973
|
+
fd.set("body", JSON.stringify(input.body));
|
|
1974
|
+
await this.ctx.http.request({
|
|
1975
|
+
method: "PUT",
|
|
1976
|
+
path: `${this.referencesBase()}/${encodeURIComponent(id)}`,
|
|
1977
|
+
...options.version === void 0 ? {} : { query: { version: options.version } },
|
|
1978
|
+
auth: auth2,
|
|
1979
|
+
body: fd
|
|
1980
|
+
});
|
|
1981
|
+
},
|
|
1982
|
+
/** Delete a reference by id. */
|
|
1983
|
+
delete: async (id, auth2 = SERVICE8) => {
|
|
1984
|
+
await this.ctx.http.request({
|
|
1985
|
+
method: "DELETE",
|
|
1986
|
+
path: `${this.referencesBase()}/${encodeURIComponent(id)}`,
|
|
1987
|
+
auth: auth2
|
|
1988
|
+
});
|
|
1989
|
+
}
|
|
1990
|
+
};
|
|
1665
1991
|
};
|
|
1666
1992
|
|
|
1667
1993
|
// src/services/ai-resources.ts
|
|
1668
|
-
var
|
|
1994
|
+
var SERVICE9 = { kind: "service" };
|
|
1669
1995
|
var AgenticCrudResource = class {
|
|
1670
1996
|
constructor(ctx, path) {
|
|
1671
1997
|
this.ctx = ctx;
|
|
@@ -1677,15 +2003,15 @@ var AgenticCrudResource = class {
|
|
|
1677
2003
|
return `${this.path}/${encodeURIComponent(id)}`;
|
|
1678
2004
|
}
|
|
1679
2005
|
/** List the collection (`GET {path}`). Optional `q`/paging/sort/fields/expand. */
|
|
1680
|
-
list(query = {}, auth2 =
|
|
2006
|
+
list(query = {}, auth2 = SERVICE9) {
|
|
1681
2007
|
return this.ctx.http.request({ method: "GET", path: this.path, auth: auth2, query: { ...query } });
|
|
1682
2008
|
}
|
|
1683
2009
|
/** Structured search (`POST {path}/search`). Body is `{ q? }`. */
|
|
1684
|
-
search(query, auth2 =
|
|
2010
|
+
search(query, auth2 = SERVICE9) {
|
|
1685
2011
|
return this.ctx.http.request({ method: "POST", path: `${this.path}/search`, auth: auth2, body: query });
|
|
1686
2012
|
}
|
|
1687
2013
|
/** Retrieve one entry by id (`GET {path}/{id}`). */
|
|
1688
|
-
get(id, opts = {}, auth2 =
|
|
2014
|
+
get(id, opts = {}, auth2 = SERVICE9) {
|
|
1689
2015
|
return this.ctx.http.request({ method: "GET", path: this.item(id), auth: auth2, query: { ...opts } });
|
|
1690
2016
|
}
|
|
1691
2017
|
/**
|
|
@@ -1693,7 +2019,7 @@ var AgenticCrudResource = class {
|
|
|
1693
2019
|
* (HTTP 201) and `undefined` on update (HTTP 204). `{ force: true }`
|
|
1694
2020
|
* cascade-disables dependents.
|
|
1695
2021
|
*/
|
|
1696
|
-
upsert(id, body, opts = {}, auth2 =
|
|
2022
|
+
upsert(id, body, opts = {}, auth2 = SERVICE9) {
|
|
1697
2023
|
return this.ctx.http.request({
|
|
1698
2024
|
method: "PUT",
|
|
1699
2025
|
path: this.item(id),
|
|
@@ -1706,11 +2032,11 @@ var AgenticCrudResource = class {
|
|
|
1706
2032
|
* Partial update with an op array (`PATCH {path}/{id}`, 204). `ops` use the
|
|
1707
2033
|
* upstream UPPERCASE enum (`ADD | REMOVE | REPLACE`), sent verbatim.
|
|
1708
2034
|
*/
|
|
1709
|
-
async patch(id, ops, auth2 =
|
|
2035
|
+
async patch(id, ops, auth2 = SERVICE9) {
|
|
1710
2036
|
await this.ctx.http.request({ method: "PATCH", path: this.item(id), auth: auth2, body: ops });
|
|
1711
2037
|
}
|
|
1712
2038
|
/** Delete by id (`DELETE {path}/{id}`). `{ force: true }` removes even if referenced. */
|
|
1713
|
-
async delete(id, opts = {}, auth2 =
|
|
2039
|
+
async delete(id, opts = {}, auth2 = SERVICE9) {
|
|
1714
2040
|
await this.ctx.http.request({
|
|
1715
2041
|
method: "DELETE",
|
|
1716
2042
|
path: this.item(id),
|
|
@@ -1727,19 +2053,19 @@ var JobsResource = class {
|
|
|
1727
2053
|
ctx;
|
|
1728
2054
|
base;
|
|
1729
2055
|
/** List jobs (`GET /jobs`). */
|
|
1730
|
-
list(query = {}, auth2 =
|
|
2056
|
+
list(query = {}, auth2 = SERVICE9) {
|
|
1731
2057
|
return this.ctx.http.request({ method: "GET", path: `${this.base}/jobs`, auth: auth2, query: { ...query } });
|
|
1732
2058
|
}
|
|
1733
2059
|
/** Structured job search (`POST /jobs/search`). */
|
|
1734
|
-
search(query, auth2 =
|
|
2060
|
+
search(query, auth2 = SERVICE9) {
|
|
1735
2061
|
return this.ctx.http.request({ method: "POST", path: `${this.base}/jobs/search`, auth: auth2, body: query });
|
|
1736
2062
|
}
|
|
1737
2063
|
/** Retrieve one job (`GET /jobs/{jobId}`). */
|
|
1738
|
-
get(jobId, auth2 =
|
|
2064
|
+
get(jobId, auth2 = SERVICE9) {
|
|
1739
2065
|
return this.ctx.http.request({ method: "GET", path: `${this.base}/jobs/${encodeURIComponent(jobId)}`, auth: auth2 });
|
|
1740
2066
|
}
|
|
1741
2067
|
/** Delete one job (`DELETE /jobs/{jobId}`). */
|
|
1742
|
-
async delete(jobId, auth2 =
|
|
2068
|
+
async delete(jobId, auth2 = SERVICE9) {
|
|
1743
2069
|
await this.ctx.http.request({ method: "DELETE", path: `${this.base}/jobs/${encodeURIComponent(jobId)}`, auth: auth2 });
|
|
1744
2070
|
}
|
|
1745
2071
|
};
|
|
@@ -1751,11 +2077,11 @@ var TemplatesResource = class {
|
|
|
1751
2077
|
ctx;
|
|
1752
2078
|
path;
|
|
1753
2079
|
/** List available templates (`GET /agentic/templates`). */
|
|
1754
|
-
list(query = {}, auth2 =
|
|
2080
|
+
list(query = {}, auth2 = SERVICE9) {
|
|
1755
2081
|
return this.ctx.http.request({ method: "GET", path: this.path, auth: auth2, query: { ...query } });
|
|
1756
2082
|
}
|
|
1757
2083
|
/** Structured template search (`POST /agentic/templates/search`). */
|
|
1758
|
-
search(query, auth2 =
|
|
2084
|
+
search(query, auth2 = SERVICE9) {
|
|
1759
2085
|
return this.ctx.http.request({ method: "POST", path: `${this.path}/search`, auth: auth2, body: query });
|
|
1760
2086
|
}
|
|
1761
2087
|
/**
|
|
@@ -1763,7 +2089,7 @@ var TemplatesResource = class {
|
|
|
1763
2089
|
* (`POST /agentic/templates/{templateId}/agents`, HTTP 201). Returns the
|
|
1764
2090
|
* created agent's id.
|
|
1765
2091
|
*/
|
|
1766
|
-
clone(templateId, body, auth2 =
|
|
2092
|
+
clone(templateId, body, auth2 = SERVICE9) {
|
|
1767
2093
|
return this.ctx.http.request({
|
|
1768
2094
|
method: "POST",
|
|
1769
2095
|
path: `${this.path}/${encodeURIComponent(templateId)}/agents`,
|
|
@@ -1780,27 +2106,27 @@ var LogsResource = class {
|
|
|
1780
2106
|
ctx;
|
|
1781
2107
|
path;
|
|
1782
2108
|
/** List request logs (`GET /agentic/logs/requests`). */
|
|
1783
|
-
listRequests(query = {}, auth2 =
|
|
2109
|
+
listRequests(query = {}, auth2 = SERVICE9) {
|
|
1784
2110
|
return this.ctx.http.request({ method: "GET", path: `${this.path}/requests`, auth: auth2, query: { ...query } });
|
|
1785
2111
|
}
|
|
1786
2112
|
/** Retrieve one request log (`GET /agentic/logs/requests/{requestId}`). */
|
|
1787
|
-
getRequest(requestId, auth2 =
|
|
2113
|
+
getRequest(requestId, auth2 = SERVICE9) {
|
|
1788
2114
|
return this.ctx.http.request({ method: "GET", path: `${this.path}/requests/${encodeURIComponent(requestId)}`, auth: auth2 });
|
|
1789
2115
|
}
|
|
1790
2116
|
/** Structured request-log search (`POST /agentic/logs/requests/search`). */
|
|
1791
|
-
searchRequests(query, auth2 =
|
|
2117
|
+
searchRequests(query, auth2 = SERVICE9) {
|
|
1792
2118
|
return this.ctx.http.request({ method: "POST", path: `${this.path}/requests/search`, auth: auth2, body: query });
|
|
1793
2119
|
}
|
|
1794
2120
|
/** List session logs (`GET /agentic/logs/sessions`). */
|
|
1795
|
-
listSessions(query = {}, auth2 =
|
|
2121
|
+
listSessions(query = {}, auth2 = SERVICE9) {
|
|
1796
2122
|
return this.ctx.http.request({ method: "GET", path: `${this.path}/sessions`, auth: auth2, query: { ...query } });
|
|
1797
2123
|
}
|
|
1798
2124
|
/** Retrieve one session log (`GET /agentic/logs/sessions/{sessionId}`). */
|
|
1799
|
-
getSession(sessionId, auth2 =
|
|
2125
|
+
getSession(sessionId, auth2 = SERVICE9) {
|
|
1800
2126
|
return this.ctx.http.request({ method: "GET", path: `${this.path}/sessions/${encodeURIComponent(sessionId)}`, auth: auth2 });
|
|
1801
2127
|
}
|
|
1802
2128
|
/** Structured session-log search (`POST /agentic/logs/sessions/search`). */
|
|
1803
|
-
searchSessions(query, auth2 =
|
|
2129
|
+
searchSessions(query, auth2 = SERVICE9) {
|
|
1804
2130
|
return this.ctx.http.request({ method: "POST", path: `${this.path}/sessions/search`, auth: auth2, body: query });
|
|
1805
2131
|
}
|
|
1806
2132
|
};
|
|
@@ -1812,17 +2138,17 @@ var AnalyticsResource = class {
|
|
|
1812
2138
|
ctx;
|
|
1813
2139
|
path;
|
|
1814
2140
|
/** Aggregated metrics (`GET /agentic/analytics`); scope with `agentId`. */
|
|
1815
|
-
get(opts = {}, auth2 =
|
|
2141
|
+
get(opts = {}, auth2 = SERVICE9) {
|
|
1816
2142
|
return this.ctx.http.request({ method: "GET", path: this.path, auth: auth2, query: { ...opts } });
|
|
1817
2143
|
}
|
|
1818
2144
|
/** Per-agent execution counts (`GET /agentic/analytics/executions`). `agentIds` required. */
|
|
1819
|
-
executions(query, auth2 =
|
|
2145
|
+
executions(query, auth2 = SERVICE9) {
|
|
1820
2146
|
return this.ctx.http.request({ method: "GET", path: `${this.path}/executions`, auth: auth2, query: { ...query } });
|
|
1821
2147
|
}
|
|
1822
2148
|
};
|
|
1823
2149
|
|
|
1824
2150
|
// src/services/ai.ts
|
|
1825
|
-
var
|
|
2151
|
+
var SERVICE10 = { kind: "service" };
|
|
1826
2152
|
var AiService = class {
|
|
1827
2153
|
constructor(ctx) {
|
|
1828
2154
|
this.ctx = ctx;
|
|
@@ -1874,7 +2200,7 @@ var AiService = class {
|
|
|
1874
2200
|
return this._analytics ??= new AnalyticsResource(this.ctx, `${this.base()}/agentic/analytics`);
|
|
1875
2201
|
}
|
|
1876
2202
|
/** Generate text from a single prompt (`POST /texts`). Honors `maxTokens`. */
|
|
1877
|
-
async generateText(input, auth2 =
|
|
2203
|
+
async generateText(input, auth2 = SERVICE10) {
|
|
1878
2204
|
return this.ctx.http.request({
|
|
1879
2205
|
method: "POST",
|
|
1880
2206
|
path: `${this.base()}/texts`,
|
|
@@ -1883,7 +2209,7 @@ var AiService = class {
|
|
|
1883
2209
|
});
|
|
1884
2210
|
}
|
|
1885
2211
|
/** Run a chat completion over a message list (`POST /completions`). No `maxTokens`. */
|
|
1886
|
-
async complete(input, auth2 =
|
|
2212
|
+
async complete(input, auth2 = SERVICE10) {
|
|
1887
2213
|
return this.ctx.http.request({
|
|
1888
2214
|
method: "POST",
|
|
1889
2215
|
path: `${this.base()}/completions`,
|
|
@@ -1892,7 +2218,7 @@ var AiService = class {
|
|
|
1892
2218
|
});
|
|
1893
2219
|
}
|
|
1894
2220
|
/** List all agentic agents. */
|
|
1895
|
-
async listAgents(auth2 =
|
|
2221
|
+
async listAgents(auth2 = SERVICE10) {
|
|
1896
2222
|
return this.ctx.http.request({
|
|
1897
2223
|
method: "GET",
|
|
1898
2224
|
path: `${this.base()}/agentic/agents`,
|
|
@@ -1900,7 +2226,7 @@ var AiService = class {
|
|
|
1900
2226
|
});
|
|
1901
2227
|
}
|
|
1902
2228
|
/** Retrieve one agent by id. */
|
|
1903
|
-
async getAgent(id, auth2 =
|
|
2229
|
+
async getAgent(id, auth2 = SERVICE10) {
|
|
1904
2230
|
return this.ctx.http.request({
|
|
1905
2231
|
method: "GET",
|
|
1906
2232
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -1908,7 +2234,7 @@ var AiService = class {
|
|
|
1908
2234
|
});
|
|
1909
2235
|
}
|
|
1910
2236
|
/** Create-or-replace an agent by id (`PUT`). Takes the agent write shape. */
|
|
1911
|
-
async upsertAgent(id, agent, auth2 =
|
|
2237
|
+
async upsertAgent(id, agent, auth2 = SERVICE10) {
|
|
1912
2238
|
return this.ctx.http.request({
|
|
1913
2239
|
method: "PUT",
|
|
1914
2240
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -1921,7 +2247,7 @@ var AiService = class {
|
|
|
1921
2247
|
* UPPERCASE enum (`ADD | REMOVE | REPLACE`) and are sent verbatim — this is
|
|
1922
2248
|
* NOT RFC-6902 JSON-Patch.
|
|
1923
2249
|
*/
|
|
1924
|
-
async patchAgent(id, ops, auth2 =
|
|
2250
|
+
async patchAgent(id, ops, auth2 = SERVICE10) {
|
|
1925
2251
|
return this.ctx.http.request({
|
|
1926
2252
|
method: "PATCH",
|
|
1927
2253
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -1933,7 +2259,7 @@ var AiService = class {
|
|
|
1933
2259
|
* Delete an agent by id. Pass `{ force: true }` to delete an agent that is
|
|
1934
2260
|
* still referenced elsewhere (`?force=true`).
|
|
1935
2261
|
*/
|
|
1936
|
-
async deleteAgent(id, auth2 =
|
|
2262
|
+
async deleteAgent(id, auth2 = SERVICE10, opts = {}) {
|
|
1937
2263
|
await this.ctx.http.request({
|
|
1938
2264
|
method: "DELETE",
|
|
1939
2265
|
path: `${this.base()}/agentic/agents/${encodeURIComponent(id)}`,
|
|
@@ -1942,7 +2268,7 @@ var AiService = class {
|
|
|
1942
2268
|
});
|
|
1943
2269
|
}
|
|
1944
2270
|
/** Server-side agent search (`POST /agentic/agents/search`). */
|
|
1945
|
-
async searchAgents(query, auth2 =
|
|
2271
|
+
async searchAgents(query, auth2 = SERVICE10) {
|
|
1946
2272
|
return this.ctx.http.request({
|
|
1947
2273
|
method: "POST",
|
|
1948
2274
|
path: `${this.base()}/agentic/agents/search`,
|
|
@@ -1954,7 +2280,7 @@ var AiService = class {
|
|
|
1954
2280
|
* Synchronous agent chat (`POST /agentic/chat`). Returns the response
|
|
1955
2281
|
* ARRAY verbatim (the upstream contract is an array, not a single object).
|
|
1956
2282
|
*/
|
|
1957
|
-
async chat(input, auth2 =
|
|
2283
|
+
async chat(input, auth2 = SERVICE10) {
|
|
1958
2284
|
return this.ctx.http.request({
|
|
1959
2285
|
method: "POST",
|
|
1960
2286
|
path: `${this.base()}/agentic/chat`,
|
|
@@ -1966,7 +2292,7 @@ var AiService = class {
|
|
|
1966
2292
|
* Fire-and-forget agent chat (`POST /agentic/chat-async`, HTTP 201).
|
|
1967
2293
|
* Returns the job-id ARRAY verbatim.
|
|
1968
2294
|
*/
|
|
1969
|
-
async chatAsync(input, auth2 =
|
|
2295
|
+
async chatAsync(input, auth2 = SERVICE10) {
|
|
1970
2296
|
return this.ctx.http.request({
|
|
1971
2297
|
method: "POST",
|
|
1972
2298
|
path: `${this.base()}/agentic/chat-async`,
|
|
@@ -1980,7 +2306,7 @@ var AiService = class {
|
|
|
1980
2306
|
* stream body as an opaque string, so chunks are raw strings, not parsed
|
|
1981
2307
|
* objects. Consume with `for await`.
|
|
1982
2308
|
*/
|
|
1983
|
-
async *chatStream(input, opts = {}, auth2 =
|
|
2309
|
+
async *chatStream(input, opts = {}, auth2 = SERVICE10) {
|
|
1984
2310
|
const events = this.ctx.http.requestStream({
|
|
1985
2311
|
method: "POST",
|
|
1986
2312
|
path: `${this.base()}/agentic/chat-stream`,
|
|
@@ -1991,7 +2317,7 @@ var AiService = class {
|
|
|
1991
2317
|
for await (const ev of events) yield ev.data;
|
|
1992
2318
|
}
|
|
1993
2319
|
/** List stored agentic conversations (`GET /agentic/conversations`). */
|
|
1994
|
-
async listConversations(auth2 =
|
|
2320
|
+
async listConversations(auth2 = SERVICE10) {
|
|
1995
2321
|
return this.ctx.http.request({
|
|
1996
2322
|
method: "GET",
|
|
1997
2323
|
path: `${this.base()}/agentic/conversations`,
|
|
@@ -1999,7 +2325,7 @@ var AiService = class {
|
|
|
1999
2325
|
});
|
|
2000
2326
|
}
|
|
2001
2327
|
/** Server-side conversation search (`POST /agentic/conversations/search`). */
|
|
2002
|
-
async searchConversations(query, auth2 =
|
|
2328
|
+
async searchConversations(query, auth2 = SERVICE10) {
|
|
2003
2329
|
return this.ctx.http.request({
|
|
2004
2330
|
method: "POST",
|
|
2005
2331
|
path: `${this.base()}/agentic/conversations/search`,
|
|
@@ -2009,7 +2335,7 @@ var AiService = class {
|
|
|
2009
2335
|
}
|
|
2010
2336
|
// --- Standalone agentic reads / bulk operations ------------------------
|
|
2011
2337
|
/** List models available to the tenant, grouped by provider (`GET /agentic/models`). */
|
|
2012
|
-
async listModels(auth2 =
|
|
2338
|
+
async listModels(auth2 = SERVICE10) {
|
|
2013
2339
|
return this.ctx.http.request({
|
|
2014
2340
|
method: "GET",
|
|
2015
2341
|
path: `${this.base()}/agentic/models`,
|
|
@@ -2017,7 +2343,7 @@ var AiService = class {
|
|
|
2017
2343
|
});
|
|
2018
2344
|
}
|
|
2019
2345
|
/** List commerce events available to agent triggers (`GET /agentic/commerce-events`). */
|
|
2020
|
-
async listCommerceEvents(auth2 =
|
|
2346
|
+
async listCommerceEvents(auth2 = SERVICE10) {
|
|
2021
2347
|
return this.ctx.http.request({
|
|
2022
2348
|
method: "GET",
|
|
2023
2349
|
path: `${this.base()}/agentic/commerce-events`,
|
|
@@ -2030,7 +2356,7 @@ var AiService = class {
|
|
|
2030
2356
|
* `sessionId` must be threaded into subsequent chat calls to bind the file.
|
|
2031
2357
|
* Pass `opts.sessionId` to attach to an existing session.
|
|
2032
2358
|
*/
|
|
2033
|
-
async uploadAttachment(agentId, attachment, opts = {}, auth2 =
|
|
2359
|
+
async uploadAttachment(agentId, attachment, opts = {}, auth2 = SERVICE10) {
|
|
2034
2360
|
const form = new FormData();
|
|
2035
2361
|
form.append("attachment", attachment);
|
|
2036
2362
|
return this.ctx.http.request({
|
|
@@ -2042,7 +2368,7 @@ var AiService = class {
|
|
|
2042
2368
|
});
|
|
2043
2369
|
}
|
|
2044
2370
|
/** Export agents + components as a base64/checksum blob (`POST /agentic/agents/export`). */
|
|
2045
|
-
async exportAgents(body, auth2 =
|
|
2371
|
+
async exportAgents(body, auth2 = SERVICE10) {
|
|
2046
2372
|
return this.ctx.http.request({
|
|
2047
2373
|
method: "POST",
|
|
2048
2374
|
path: `${this.base()}/agentic/agents/export`,
|
|
@@ -2051,7 +2377,7 @@ var AiService = class {
|
|
|
2051
2377
|
});
|
|
2052
2378
|
}
|
|
2053
2379
|
/** Import previously-exported agents (`POST /agentic/agents/import`). */
|
|
2054
|
-
async importAgents(body, auth2 =
|
|
2380
|
+
async importAgents(body, auth2 = SERVICE10) {
|
|
2055
2381
|
return this.ctx.http.request({
|
|
2056
2382
|
method: "POST",
|
|
2057
2383
|
path: `${this.base()}/agentic/agents/import`,
|
|
@@ -2062,7 +2388,7 @@ var AiService = class {
|
|
|
2062
2388
|
};
|
|
2063
2389
|
|
|
2064
2390
|
// src/services/tax.ts
|
|
2065
|
-
var
|
|
2391
|
+
var SERVICE11 = { kind: "service" };
|
|
2066
2392
|
var TaxService = class {
|
|
2067
2393
|
constructor(ctx) {
|
|
2068
2394
|
this.ctx = ctx;
|
|
@@ -2073,7 +2399,7 @@ var TaxService = class {
|
|
|
2073
2399
|
return `/tax/${this.ctx.tenant}`;
|
|
2074
2400
|
}
|
|
2075
2401
|
/** List all per-location tax configurations. */
|
|
2076
|
-
async listTaxConfigs(auth2 =
|
|
2402
|
+
async listTaxConfigs(auth2 = SERVICE11) {
|
|
2077
2403
|
return this.ctx.http.request({
|
|
2078
2404
|
method: "GET",
|
|
2079
2405
|
path: `${this.base()}/taxes`,
|
|
@@ -2081,7 +2407,7 @@ var TaxService = class {
|
|
|
2081
2407
|
});
|
|
2082
2408
|
}
|
|
2083
2409
|
/** Retrieve one tax configuration by its location (country) code. */
|
|
2084
|
-
async getTaxConfig(locationCode, auth2 =
|
|
2410
|
+
async getTaxConfig(locationCode, auth2 = SERVICE11) {
|
|
2085
2411
|
return this.ctx.http.request({
|
|
2086
2412
|
method: "GET",
|
|
2087
2413
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -2089,7 +2415,7 @@ var TaxService = class {
|
|
|
2089
2415
|
});
|
|
2090
2416
|
}
|
|
2091
2417
|
/** Create a tax configuration (`POST`). Returns the created `{ locationCode }`. */
|
|
2092
|
-
async createTaxConfig(input, auth2 =
|
|
2418
|
+
async createTaxConfig(input, auth2 = SERVICE11) {
|
|
2093
2419
|
return this.ctx.http.request({
|
|
2094
2420
|
method: "POST",
|
|
2095
2421
|
path: `${this.base()}/taxes`,
|
|
@@ -2101,7 +2427,7 @@ var TaxService = class {
|
|
|
2101
2427
|
* Update a tax configuration by location code (`PUT`). `metadata.version` is
|
|
2102
2428
|
* required (optimistic locking — a stale version yields 409).
|
|
2103
2429
|
*/
|
|
2104
|
-
async updateTaxConfig(locationCode, input, auth2 =
|
|
2430
|
+
async updateTaxConfig(locationCode, input, auth2 = SERVICE11) {
|
|
2105
2431
|
return this.ctx.http.request({
|
|
2106
2432
|
method: "PUT",
|
|
2107
2433
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -2110,7 +2436,7 @@ var TaxService = class {
|
|
|
2110
2436
|
});
|
|
2111
2437
|
}
|
|
2112
2438
|
/** Delete a tax configuration by location code. */
|
|
2113
|
-
async deleteTaxConfig(locationCode, auth2 =
|
|
2439
|
+
async deleteTaxConfig(locationCode, auth2 = SERVICE11) {
|
|
2114
2440
|
await this.ctx.http.request({
|
|
2115
2441
|
method: "DELETE",
|
|
2116
2442
|
path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
|
|
@@ -2121,7 +2447,7 @@ var TaxService = class {
|
|
|
2121
2447
|
* Calculate net/gross values for a price (`PUT /taxes/calculation-commands`).
|
|
2122
2448
|
* Single command in, single result out.
|
|
2123
2449
|
*/
|
|
2124
|
-
async calculateTax(request, auth2 =
|
|
2450
|
+
async calculateTax(request, auth2 = SERVICE11) {
|
|
2125
2451
|
return this.ctx.http.request({
|
|
2126
2452
|
method: "PUT",
|
|
2127
2453
|
path: `${this.base()}/taxes/calculation-commands`,
|
|
@@ -2132,7 +2458,7 @@ var TaxService = class {
|
|
|
2132
2458
|
};
|
|
2133
2459
|
|
|
2134
2460
|
// src/services/coupon.ts
|
|
2135
|
-
var
|
|
2461
|
+
var SERVICE12 = { kind: "service" };
|
|
2136
2462
|
var CouponService = class {
|
|
2137
2463
|
constructor(ctx) {
|
|
2138
2464
|
this.ctx = ctx;
|
|
@@ -2143,7 +2469,7 @@ var CouponService = class {
|
|
|
2143
2469
|
return `/coupon/${this.ctx.tenant}`;
|
|
2144
2470
|
}
|
|
2145
2471
|
/** List coupons by criteria. Returns a plain array. */
|
|
2146
|
-
async listCoupons(query = {}, auth2 =
|
|
2472
|
+
async listCoupons(query = {}, auth2 = SERVICE12) {
|
|
2147
2473
|
return this.ctx.http.request({
|
|
2148
2474
|
method: "GET",
|
|
2149
2475
|
path: `${this.base()}/coupons`,
|
|
@@ -2152,7 +2478,7 @@ var CouponService = class {
|
|
|
2152
2478
|
});
|
|
2153
2479
|
}
|
|
2154
2480
|
/** Retrieve one coupon by code. */
|
|
2155
|
-
async getCoupon(code, auth2 =
|
|
2481
|
+
async getCoupon(code, auth2 = SERVICE12) {
|
|
2156
2482
|
return this.ctx.http.request({
|
|
2157
2483
|
method: "GET",
|
|
2158
2484
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -2160,7 +2486,7 @@ var CouponService = class {
|
|
|
2160
2486
|
});
|
|
2161
2487
|
}
|
|
2162
2488
|
/** Create a coupon (`POST`, HTTP 201). Returns the created resource's `{ id?, yrn? }`. */
|
|
2163
|
-
async createCoupon(input, auth2 =
|
|
2489
|
+
async createCoupon(input, auth2 = SERVICE12) {
|
|
2164
2490
|
return this.ctx.http.request({
|
|
2165
2491
|
method: "POST",
|
|
2166
2492
|
path: `${this.base()}/coupons`,
|
|
@@ -2169,7 +2495,7 @@ var CouponService = class {
|
|
|
2169
2495
|
});
|
|
2170
2496
|
}
|
|
2171
2497
|
/** Replace a coupon by code (`PUT`). Resolves once the update is accepted. */
|
|
2172
|
-
async updateCoupon(code, input, auth2 =
|
|
2498
|
+
async updateCoupon(code, input, auth2 = SERVICE12) {
|
|
2173
2499
|
await this.ctx.http.request({
|
|
2174
2500
|
method: "PUT",
|
|
2175
2501
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -2178,7 +2504,7 @@ var CouponService = class {
|
|
|
2178
2504
|
});
|
|
2179
2505
|
}
|
|
2180
2506
|
/** Partially update a coupon by code (`PATCH` merge body). */
|
|
2181
|
-
async patchCoupon(code, patch, auth2 =
|
|
2507
|
+
async patchCoupon(code, patch, auth2 = SERVICE12) {
|
|
2182
2508
|
await this.ctx.http.request({
|
|
2183
2509
|
method: "PATCH",
|
|
2184
2510
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -2187,7 +2513,7 @@ var CouponService = class {
|
|
|
2187
2513
|
});
|
|
2188
2514
|
}
|
|
2189
2515
|
/** Delete a coupon by code. */
|
|
2190
|
-
async deleteCoupon(code, auth2 =
|
|
2516
|
+
async deleteCoupon(code, auth2 = SERVICE12) {
|
|
2191
2517
|
await this.ctx.http.request({
|
|
2192
2518
|
method: "DELETE",
|
|
2193
2519
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
|
|
@@ -2198,7 +2524,7 @@ var CouponService = class {
|
|
|
2198
2524
|
* Check whether a coupon can be redeemed (`POST /validation`). Resolves when
|
|
2199
2525
|
* redeemable; throws an `EmporixError` otherwise (no response body).
|
|
2200
2526
|
*/
|
|
2201
|
-
async validateCoupon(code, redemption, auth2 =
|
|
2527
|
+
async validateCoupon(code, redemption, auth2 = SERVICE12) {
|
|
2202
2528
|
await this.ctx.http.request({
|
|
2203
2529
|
method: "POST",
|
|
2204
2530
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/validation`,
|
|
@@ -2207,7 +2533,7 @@ var CouponService = class {
|
|
|
2207
2533
|
});
|
|
2208
2534
|
}
|
|
2209
2535
|
/** List a coupon's redemptions by criteria. */
|
|
2210
|
-
async listRedemptions(code, query = {}, auth2 =
|
|
2536
|
+
async listRedemptions(code, query = {}, auth2 = SERVICE12) {
|
|
2211
2537
|
return this.ctx.http.request({
|
|
2212
2538
|
method: "GET",
|
|
2213
2539
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
|
|
@@ -2216,7 +2542,7 @@ var CouponService = class {
|
|
|
2216
2542
|
});
|
|
2217
2543
|
}
|
|
2218
2544
|
/** Redeem a coupon by creating a redemption (`POST`, HTTP 201). Returns the resource location. */
|
|
2219
|
-
async redeemCoupon(code, redemption, auth2 =
|
|
2545
|
+
async redeemCoupon(code, redemption, auth2 = SERVICE12) {
|
|
2220
2546
|
return this.ctx.http.request({
|
|
2221
2547
|
method: "POST",
|
|
2222
2548
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
|
|
@@ -2225,7 +2551,7 @@ var CouponService = class {
|
|
|
2225
2551
|
});
|
|
2226
2552
|
}
|
|
2227
2553
|
/** Retrieve one redemption by id. */
|
|
2228
|
-
async getRedemption(code, id, auth2 =
|
|
2554
|
+
async getRedemption(code, id, auth2 = SERVICE12) {
|
|
2229
2555
|
return this.ctx.http.request({
|
|
2230
2556
|
method: "GET",
|
|
2231
2557
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
|
|
@@ -2233,7 +2559,7 @@ var CouponService = class {
|
|
|
2233
2559
|
});
|
|
2234
2560
|
}
|
|
2235
2561
|
/** Delete a redemption by id. */
|
|
2236
|
-
async deleteRedemption(code, id, auth2 =
|
|
2562
|
+
async deleteRedemption(code, id, auth2 = SERVICE12) {
|
|
2237
2563
|
await this.ctx.http.request({
|
|
2238
2564
|
method: "DELETE",
|
|
2239
2565
|
path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
|
|
@@ -2241,7 +2567,7 @@ var CouponService = class {
|
|
|
2241
2567
|
});
|
|
2242
2568
|
}
|
|
2243
2569
|
/** Retrieve a customer's referral coupon (resolves to an empty body when none exists). */
|
|
2244
|
-
async getReferralCoupon(customerNumber, auth2 =
|
|
2570
|
+
async getReferralCoupon(customerNumber, auth2 = SERVICE12) {
|
|
2245
2571
|
return this.ctx.http.request({
|
|
2246
2572
|
method: "GET",
|
|
2247
2573
|
path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
|
|
@@ -2249,7 +2575,7 @@ var CouponService = class {
|
|
|
2249
2575
|
});
|
|
2250
2576
|
}
|
|
2251
2577
|
/** Create a referral coupon code for a customer (no request body). */
|
|
2252
|
-
async createReferralCoupon(customerNumber, auth2 =
|
|
2578
|
+
async createReferralCoupon(customerNumber, auth2 = SERVICE12) {
|
|
2253
2579
|
return this.ctx.http.request({
|
|
2254
2580
|
method: "POST",
|
|
2255
2581
|
path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
|
|
@@ -2259,7 +2585,7 @@ var CouponService = class {
|
|
|
2259
2585
|
};
|
|
2260
2586
|
|
|
2261
2587
|
// src/services/reward-points.ts
|
|
2262
|
-
var
|
|
2588
|
+
var SERVICE13 = { kind: "service" };
|
|
2263
2589
|
var RewardPointsService = class {
|
|
2264
2590
|
constructor(ctx) {
|
|
2265
2591
|
this.ctx = ctx;
|
|
@@ -2276,7 +2602,7 @@ var RewardPointsService = class {
|
|
|
2276
2602
|
}
|
|
2277
2603
|
// --- Admin: customer points management (service token) ---
|
|
2278
2604
|
/** Batch summary across all customers. */
|
|
2279
|
-
async listAllSummaries(query = {}, auth2 =
|
|
2605
|
+
async listAllSummaries(query = {}, auth2 = SERVICE13) {
|
|
2280
2606
|
return this.ctx.http.request({
|
|
2281
2607
|
method: "GET",
|
|
2282
2608
|
path: `${this.base()}/summaryBatch`,
|
|
@@ -2285,7 +2611,7 @@ var RewardPointsService = class {
|
|
|
2285
2611
|
});
|
|
2286
2612
|
}
|
|
2287
2613
|
/** Retrieve one customer's reward-points balance. */
|
|
2288
|
-
async getCustomerPoints(customerId, auth2 =
|
|
2614
|
+
async getCustomerPoints(customerId, auth2 = SERVICE13) {
|
|
2289
2615
|
return this.ctx.http.request({
|
|
2290
2616
|
method: "GET",
|
|
2291
2617
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -2293,7 +2619,7 @@ var RewardPointsService = class {
|
|
|
2293
2619
|
});
|
|
2294
2620
|
}
|
|
2295
2621
|
/** Create a reward-points entry for a customer. */
|
|
2296
|
-
async createCustomerPoints(customerId, input, auth2 =
|
|
2622
|
+
async createCustomerPoints(customerId, input, auth2 = SERVICE13) {
|
|
2297
2623
|
await this.ctx.http.request({
|
|
2298
2624
|
method: "POST",
|
|
2299
2625
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -2302,7 +2628,7 @@ var RewardPointsService = class {
|
|
|
2302
2628
|
});
|
|
2303
2629
|
}
|
|
2304
2630
|
/** Delete a customer's reward points. */
|
|
2305
|
-
async deleteCustomerPoints(customerId, auth2 =
|
|
2631
|
+
async deleteCustomerPoints(customerId, auth2 = SERVICE13) {
|
|
2306
2632
|
await this.ctx.http.request({
|
|
2307
2633
|
method: "DELETE",
|
|
2308
2634
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
|
|
@@ -2310,7 +2636,7 @@ var RewardPointsService = class {
|
|
|
2310
2636
|
});
|
|
2311
2637
|
}
|
|
2312
2638
|
/** Retrieve a reward-points summary for one customer. */
|
|
2313
|
-
async getCustomerSummary(customerId, auth2 =
|
|
2639
|
+
async getCustomerSummary(customerId, auth2 = SERVICE13) {
|
|
2314
2640
|
return this.ctx.http.request({
|
|
2315
2641
|
method: "GET",
|
|
2316
2642
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/summary`,
|
|
@@ -2318,7 +2644,7 @@ var RewardPointsService = class {
|
|
|
2318
2644
|
});
|
|
2319
2645
|
}
|
|
2320
2646
|
/** Add reward points for a customer. */
|
|
2321
|
-
async addPoints(customerId, input, auth2 =
|
|
2647
|
+
async addPoints(customerId, input, auth2 = SERVICE13) {
|
|
2322
2648
|
await this.ctx.http.request({
|
|
2323
2649
|
method: "POST",
|
|
2324
2650
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/addPoints`,
|
|
@@ -2327,7 +2653,7 @@ var RewardPointsService = class {
|
|
|
2327
2653
|
});
|
|
2328
2654
|
}
|
|
2329
2655
|
/** Redeem a customer's reward points (on behalf). */
|
|
2330
|
-
async redeemPoints(customerId, input, auth2 =
|
|
2656
|
+
async redeemPoints(customerId, input, auth2 = SERVICE13) {
|
|
2331
2657
|
await this.ctx.http.request({
|
|
2332
2658
|
method: "POST",
|
|
2333
2659
|
path: `${this.base()}/customer/${encodeURIComponent(customerId)}/redeemPoints`,
|
|
@@ -2378,7 +2704,7 @@ var RewardPointsService = class {
|
|
|
2378
2704
|
}
|
|
2379
2705
|
// --- Redeem options (tenant-scoped; read open to customer, management service-only) ---
|
|
2380
2706
|
/** List redeem options. Defaults to the service token; pass a customer `auth` for storefront reads. */
|
|
2381
|
-
async listRedeemOptions(auth2 =
|
|
2707
|
+
async listRedeemOptions(auth2 = SERVICE13) {
|
|
2382
2708
|
return this.ctx.http.request({
|
|
2383
2709
|
method: "GET",
|
|
2384
2710
|
path: `${this.tenantBase()}/redeemOptions`,
|
|
@@ -2386,7 +2712,7 @@ var RewardPointsService = class {
|
|
|
2386
2712
|
});
|
|
2387
2713
|
}
|
|
2388
2714
|
/** Create a redeem option. Returns the updated options list. */
|
|
2389
|
-
async createRedeemOption(input, auth2 =
|
|
2715
|
+
async createRedeemOption(input, auth2 = SERVICE13) {
|
|
2390
2716
|
return this.ctx.http.request({
|
|
2391
2717
|
method: "POST",
|
|
2392
2718
|
path: `${this.tenantBase()}/redeemOptions`,
|
|
@@ -2395,7 +2721,7 @@ var RewardPointsService = class {
|
|
|
2395
2721
|
});
|
|
2396
2722
|
}
|
|
2397
2723
|
/** Update a redeem option by id. Resolves once accepted (no response body). */
|
|
2398
|
-
async updateRedeemOption(redeemOptionId, input, auth2 =
|
|
2724
|
+
async updateRedeemOption(redeemOptionId, input, auth2 = SERVICE13) {
|
|
2399
2725
|
await this.ctx.http.request({
|
|
2400
2726
|
method: "PUT",
|
|
2401
2727
|
path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
|
|
@@ -2404,7 +2730,7 @@ var RewardPointsService = class {
|
|
|
2404
2730
|
});
|
|
2405
2731
|
}
|
|
2406
2732
|
/** Delete a redeem option by id. */
|
|
2407
|
-
async deleteRedeemOption(redeemOptionId, auth2 =
|
|
2733
|
+
async deleteRedeemOption(redeemOptionId, auth2 = SERVICE13) {
|
|
2408
2734
|
await this.ctx.http.request({
|
|
2409
2735
|
method: "DELETE",
|
|
2410
2736
|
path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
|
|
@@ -2414,7 +2740,7 @@ var RewardPointsService = class {
|
|
|
2414
2740
|
};
|
|
2415
2741
|
|
|
2416
2742
|
// src/services/brand.ts
|
|
2417
|
-
var
|
|
2743
|
+
var SERVICE14 = { kind: "service" };
|
|
2418
2744
|
var BrandService = class {
|
|
2419
2745
|
constructor(ctx) {
|
|
2420
2746
|
this.ctx = ctx;
|
|
@@ -2425,7 +2751,7 @@ var BrandService = class {
|
|
|
2425
2751
|
return `/brand/brands`;
|
|
2426
2752
|
}
|
|
2427
2753
|
/** List all brands. */
|
|
2428
|
-
async listBrands(query = {}, auth2 =
|
|
2754
|
+
async listBrands(query = {}, auth2 = SERVICE14) {
|
|
2429
2755
|
return this.ctx.http.request({
|
|
2430
2756
|
method: "GET",
|
|
2431
2757
|
path: this.base(),
|
|
@@ -2434,7 +2760,7 @@ var BrandService = class {
|
|
|
2434
2760
|
});
|
|
2435
2761
|
}
|
|
2436
2762
|
/** Retrieve one brand by id. */
|
|
2437
|
-
async getBrand(brandId, auth2 =
|
|
2763
|
+
async getBrand(brandId, auth2 = SERVICE14) {
|
|
2438
2764
|
return this.ctx.http.request({
|
|
2439
2765
|
method: "GET",
|
|
2440
2766
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -2442,7 +2768,7 @@ var BrandService = class {
|
|
|
2442
2768
|
});
|
|
2443
2769
|
}
|
|
2444
2770
|
/** Create a brand. */
|
|
2445
|
-
async createBrand(input, auth2 =
|
|
2771
|
+
async createBrand(input, auth2 = SERVICE14) {
|
|
2446
2772
|
return this.ctx.http.request({
|
|
2447
2773
|
method: "POST",
|
|
2448
2774
|
path: this.base(),
|
|
@@ -2451,7 +2777,7 @@ var BrandService = class {
|
|
|
2451
2777
|
});
|
|
2452
2778
|
}
|
|
2453
2779
|
/** Replace a brand by id. */
|
|
2454
|
-
async updateBrand(brandId, input, auth2 =
|
|
2780
|
+
async updateBrand(brandId, input, auth2 = SERVICE14) {
|
|
2455
2781
|
return this.ctx.http.request({
|
|
2456
2782
|
method: "PUT",
|
|
2457
2783
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -2460,7 +2786,7 @@ var BrandService = class {
|
|
|
2460
2786
|
});
|
|
2461
2787
|
}
|
|
2462
2788
|
/** Partially update a brand by id. */
|
|
2463
|
-
async patchBrand(brandId, patch, auth2 =
|
|
2789
|
+
async patchBrand(brandId, patch, auth2 = SERVICE14) {
|
|
2464
2790
|
return this.ctx.http.request({
|
|
2465
2791
|
method: "PATCH",
|
|
2466
2792
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -2469,7 +2795,7 @@ var BrandService = class {
|
|
|
2469
2795
|
});
|
|
2470
2796
|
}
|
|
2471
2797
|
/** Delete a brand by id. */
|
|
2472
|
-
async deleteBrand(brandId, auth2 =
|
|
2798
|
+
async deleteBrand(brandId, auth2 = SERVICE14) {
|
|
2473
2799
|
await this.ctx.http.request({
|
|
2474
2800
|
method: "DELETE",
|
|
2475
2801
|
path: `${this.base()}/${encodeURIComponent(brandId)}`,
|
|
@@ -2479,7 +2805,7 @@ var BrandService = class {
|
|
|
2479
2805
|
};
|
|
2480
2806
|
|
|
2481
2807
|
// src/services/label.ts
|
|
2482
|
-
var
|
|
2808
|
+
var SERVICE15 = { kind: "service" };
|
|
2483
2809
|
var LabelService = class {
|
|
2484
2810
|
constructor(ctx) {
|
|
2485
2811
|
this.ctx = ctx;
|
|
@@ -2490,7 +2816,7 @@ var LabelService = class {
|
|
|
2490
2816
|
return `/label/labels`;
|
|
2491
2817
|
}
|
|
2492
2818
|
/** List all labels. */
|
|
2493
|
-
async listLabels(query = {}, auth2 =
|
|
2819
|
+
async listLabels(query = {}, auth2 = SERVICE15) {
|
|
2494
2820
|
return this.ctx.http.request({
|
|
2495
2821
|
method: "GET",
|
|
2496
2822
|
path: this.base(),
|
|
@@ -2499,7 +2825,7 @@ var LabelService = class {
|
|
|
2499
2825
|
});
|
|
2500
2826
|
}
|
|
2501
2827
|
/** Retrieve one label by id. */
|
|
2502
|
-
async getLabel(labelId, auth2 =
|
|
2828
|
+
async getLabel(labelId, auth2 = SERVICE15) {
|
|
2503
2829
|
return this.ctx.http.request({
|
|
2504
2830
|
method: "GET",
|
|
2505
2831
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -2507,7 +2833,7 @@ var LabelService = class {
|
|
|
2507
2833
|
});
|
|
2508
2834
|
}
|
|
2509
2835
|
/** Create a label. */
|
|
2510
|
-
async createLabel(input, auth2 =
|
|
2836
|
+
async createLabel(input, auth2 = SERVICE15) {
|
|
2511
2837
|
return this.ctx.http.request({
|
|
2512
2838
|
method: "POST",
|
|
2513
2839
|
path: this.base(),
|
|
@@ -2516,7 +2842,7 @@ var LabelService = class {
|
|
|
2516
2842
|
});
|
|
2517
2843
|
}
|
|
2518
2844
|
/** Replace a label by id. */
|
|
2519
|
-
async updateLabel(labelId, input, auth2 =
|
|
2845
|
+
async updateLabel(labelId, input, auth2 = SERVICE15) {
|
|
2520
2846
|
return this.ctx.http.request({
|
|
2521
2847
|
method: "PUT",
|
|
2522
2848
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -2525,7 +2851,7 @@ var LabelService = class {
|
|
|
2525
2851
|
});
|
|
2526
2852
|
}
|
|
2527
2853
|
/** Partially update a label by id. */
|
|
2528
|
-
async patchLabel(labelId, patch, auth2 =
|
|
2854
|
+
async patchLabel(labelId, patch, auth2 = SERVICE15) {
|
|
2529
2855
|
return this.ctx.http.request({
|
|
2530
2856
|
method: "PATCH",
|
|
2531
2857
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -2534,7 +2860,7 @@ var LabelService = class {
|
|
|
2534
2860
|
});
|
|
2535
2861
|
}
|
|
2536
2862
|
/** Delete a label by id. */
|
|
2537
|
-
async deleteLabel(labelId, auth2 =
|
|
2863
|
+
async deleteLabel(labelId, auth2 = SERVICE15) {
|
|
2538
2864
|
await this.ctx.http.request({
|
|
2539
2865
|
method: "DELETE",
|
|
2540
2866
|
path: `${this.base()}/${encodeURIComponent(labelId)}`,
|
|
@@ -2544,7 +2870,7 @@ var LabelService = class {
|
|
|
2544
2870
|
};
|
|
2545
2871
|
|
|
2546
2872
|
// src/services/country.ts
|
|
2547
|
-
var
|
|
2873
|
+
var SERVICE16 = { kind: "service" };
|
|
2548
2874
|
var CountryService = class {
|
|
2549
2875
|
constructor(ctx) {
|
|
2550
2876
|
this.ctx = ctx;
|
|
@@ -2555,7 +2881,7 @@ var CountryService = class {
|
|
|
2555
2881
|
return `/country/${this.ctx.tenant}`;
|
|
2556
2882
|
}
|
|
2557
2883
|
/** List all countries. */
|
|
2558
|
-
async listCountries(query = {}, auth2 =
|
|
2884
|
+
async listCountries(query = {}, auth2 = SERVICE16) {
|
|
2559
2885
|
return this.ctx.http.request({
|
|
2560
2886
|
method: "GET",
|
|
2561
2887
|
path: `${this.base()}/countries`,
|
|
@@ -2564,7 +2890,7 @@ var CountryService = class {
|
|
|
2564
2890
|
});
|
|
2565
2891
|
}
|
|
2566
2892
|
/** Retrieve one country by code. */
|
|
2567
|
-
async getCountry(countryCode, auth2 =
|
|
2893
|
+
async getCountry(countryCode, auth2 = SERVICE16) {
|
|
2568
2894
|
return this.ctx.http.request({
|
|
2569
2895
|
method: "GET",
|
|
2570
2896
|
path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
|
|
@@ -2572,7 +2898,7 @@ var CountryService = class {
|
|
|
2572
2898
|
});
|
|
2573
2899
|
}
|
|
2574
2900
|
/** Partially update a country by code. Resolves once accepted (no response body). */
|
|
2575
|
-
async patchCountry(countryCode, patch, auth2 =
|
|
2901
|
+
async patchCountry(countryCode, patch, auth2 = SERVICE16) {
|
|
2576
2902
|
await this.ctx.http.request({
|
|
2577
2903
|
method: "PATCH",
|
|
2578
2904
|
path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
|
|
@@ -2581,7 +2907,7 @@ var CountryService = class {
|
|
|
2581
2907
|
});
|
|
2582
2908
|
}
|
|
2583
2909
|
/** List all regions. */
|
|
2584
|
-
async listRegions(query = {}, auth2 =
|
|
2910
|
+
async listRegions(query = {}, auth2 = SERVICE16) {
|
|
2585
2911
|
return this.ctx.http.request({
|
|
2586
2912
|
method: "GET",
|
|
2587
2913
|
path: `${this.base()}/regions`,
|
|
@@ -2590,7 +2916,7 @@ var CountryService = class {
|
|
|
2590
2916
|
});
|
|
2591
2917
|
}
|
|
2592
2918
|
/** Retrieve one region by code. */
|
|
2593
|
-
async getRegion(regionCode, auth2 =
|
|
2919
|
+
async getRegion(regionCode, auth2 = SERVICE16) {
|
|
2594
2920
|
return this.ctx.http.request({
|
|
2595
2921
|
method: "GET",
|
|
2596
2922
|
path: `${this.base()}/regions/${encodeURIComponent(regionCode)}`,
|
|
@@ -2600,7 +2926,7 @@ var CountryService = class {
|
|
|
2600
2926
|
};
|
|
2601
2927
|
|
|
2602
2928
|
// src/services/currency.ts
|
|
2603
|
-
var
|
|
2929
|
+
var SERVICE17 = { kind: "service" };
|
|
2604
2930
|
var CurrencyService = class {
|
|
2605
2931
|
constructor(ctx) {
|
|
2606
2932
|
this.ctx = ctx;
|
|
@@ -2612,7 +2938,7 @@ var CurrencyService = class {
|
|
|
2612
2938
|
}
|
|
2613
2939
|
// --- Currencies ---
|
|
2614
2940
|
/** List all currencies. */
|
|
2615
|
-
async listCurrencies(query = {}, auth2 =
|
|
2941
|
+
async listCurrencies(query = {}, auth2 = SERVICE17) {
|
|
2616
2942
|
return this.ctx.http.request({
|
|
2617
2943
|
method: "GET",
|
|
2618
2944
|
path: `${this.base()}/currencies`,
|
|
@@ -2621,7 +2947,7 @@ var CurrencyService = class {
|
|
|
2621
2947
|
});
|
|
2622
2948
|
}
|
|
2623
2949
|
/** Retrieve one currency by code. */
|
|
2624
|
-
async getCurrency(code, auth2 =
|
|
2950
|
+
async getCurrency(code, auth2 = SERVICE17) {
|
|
2625
2951
|
return this.ctx.http.request({
|
|
2626
2952
|
method: "GET",
|
|
2627
2953
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -2629,7 +2955,7 @@ var CurrencyService = class {
|
|
|
2629
2955
|
});
|
|
2630
2956
|
}
|
|
2631
2957
|
/** Create a currency. */
|
|
2632
|
-
async createCurrency(input, auth2 =
|
|
2958
|
+
async createCurrency(input, auth2 = SERVICE17) {
|
|
2633
2959
|
return this.ctx.http.request({
|
|
2634
2960
|
method: "POST",
|
|
2635
2961
|
path: `${this.base()}/currencies`,
|
|
@@ -2638,7 +2964,7 @@ var CurrencyService = class {
|
|
|
2638
2964
|
});
|
|
2639
2965
|
}
|
|
2640
2966
|
/** Update a currency by code. */
|
|
2641
|
-
async updateCurrency(code, input, auth2 =
|
|
2967
|
+
async updateCurrency(code, input, auth2 = SERVICE17) {
|
|
2642
2968
|
return this.ctx.http.request({
|
|
2643
2969
|
method: "PUT",
|
|
2644
2970
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -2647,7 +2973,7 @@ var CurrencyService = class {
|
|
|
2647
2973
|
});
|
|
2648
2974
|
}
|
|
2649
2975
|
/** Delete a currency by code. */
|
|
2650
|
-
async deleteCurrency(code, auth2 =
|
|
2976
|
+
async deleteCurrency(code, auth2 = SERVICE17) {
|
|
2651
2977
|
await this.ctx.http.request({
|
|
2652
2978
|
method: "DELETE",
|
|
2653
2979
|
path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
|
|
@@ -2656,7 +2982,7 @@ var CurrencyService = class {
|
|
|
2656
2982
|
}
|
|
2657
2983
|
// --- Exchange rates ---
|
|
2658
2984
|
/** List all exchange rates. */
|
|
2659
|
-
async listExchangeRates(query = {}, auth2 =
|
|
2985
|
+
async listExchangeRates(query = {}, auth2 = SERVICE17) {
|
|
2660
2986
|
return this.ctx.http.request({
|
|
2661
2987
|
method: "GET",
|
|
2662
2988
|
path: `${this.base()}/exchanges`,
|
|
@@ -2665,7 +2991,7 @@ var CurrencyService = class {
|
|
|
2665
2991
|
});
|
|
2666
2992
|
}
|
|
2667
2993
|
/** Retrieve one exchange rate by code. */
|
|
2668
|
-
async getExchangeRate(code, auth2 =
|
|
2994
|
+
async getExchangeRate(code, auth2 = SERVICE17) {
|
|
2669
2995
|
return this.ctx.http.request({
|
|
2670
2996
|
method: "GET",
|
|
2671
2997
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -2673,7 +2999,7 @@ var CurrencyService = class {
|
|
|
2673
2999
|
});
|
|
2674
3000
|
}
|
|
2675
3001
|
/** Create an exchange rate. */
|
|
2676
|
-
async createExchangeRate(input, auth2 =
|
|
3002
|
+
async createExchangeRate(input, auth2 = SERVICE17) {
|
|
2677
3003
|
return this.ctx.http.request({
|
|
2678
3004
|
method: "POST",
|
|
2679
3005
|
path: `${this.base()}/exchanges`,
|
|
@@ -2682,7 +3008,7 @@ var CurrencyService = class {
|
|
|
2682
3008
|
});
|
|
2683
3009
|
}
|
|
2684
3010
|
/** Update an exchange rate by code. */
|
|
2685
|
-
async updateExchangeRate(code, input, auth2 =
|
|
3011
|
+
async updateExchangeRate(code, input, auth2 = SERVICE17) {
|
|
2686
3012
|
return this.ctx.http.request({
|
|
2687
3013
|
method: "PUT",
|
|
2688
3014
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -2691,7 +3017,7 @@ var CurrencyService = class {
|
|
|
2691
3017
|
});
|
|
2692
3018
|
}
|
|
2693
3019
|
/** Delete an exchange rate by code. */
|
|
2694
|
-
async deleteExchangeRate(code, auth2 =
|
|
3020
|
+
async deleteExchangeRate(code, auth2 = SERVICE17) {
|
|
2695
3021
|
await this.ctx.http.request({
|
|
2696
3022
|
method: "DELETE",
|
|
2697
3023
|
path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
|
|
@@ -2701,7 +3027,7 @@ var CurrencyService = class {
|
|
|
2701
3027
|
};
|
|
2702
3028
|
|
|
2703
3029
|
// src/services/shipping.ts
|
|
2704
|
-
var
|
|
3030
|
+
var SERVICE18 = { kind: "service" };
|
|
2705
3031
|
var ShippingService = class {
|
|
2706
3032
|
constructor(ctx) {
|
|
2707
3033
|
this.ctx = ctx;
|
|
@@ -2716,7 +3042,7 @@ var ShippingService = class {
|
|
|
2716
3042
|
}
|
|
2717
3043
|
// --- Sites ---
|
|
2718
3044
|
/** Find shipping-related sites by postal code (`POST /findSite`). */
|
|
2719
|
-
async findSites(input, auth2 =
|
|
3045
|
+
async findSites(input, auth2 = SERVICE18) {
|
|
2720
3046
|
return this.ctx.http.request({
|
|
2721
3047
|
method: "POST",
|
|
2722
3048
|
path: `${this.base()}/findSite`,
|
|
@@ -2726,7 +3052,7 @@ var ShippingService = class {
|
|
|
2726
3052
|
}
|
|
2727
3053
|
// --- Zones ---
|
|
2728
3054
|
/** List shipping zones for a site. */
|
|
2729
|
-
async listZones(site, query = {}, auth2 =
|
|
3055
|
+
async listZones(site, query = {}, auth2 = SERVICE18) {
|
|
2730
3056
|
return this.ctx.http.request({
|
|
2731
3057
|
method: "GET",
|
|
2732
3058
|
path: `${this.siteBase(site)}/zones`,
|
|
@@ -2735,7 +3061,7 @@ var ShippingService = class {
|
|
|
2735
3061
|
});
|
|
2736
3062
|
}
|
|
2737
3063
|
/** Retrieve one shipping zone. */
|
|
2738
|
-
async getZone(site, zoneId, auth2 =
|
|
3064
|
+
async getZone(site, zoneId, auth2 = SERVICE18) {
|
|
2739
3065
|
return this.ctx.http.request({
|
|
2740
3066
|
method: "GET",
|
|
2741
3067
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -2743,7 +3069,7 @@ var ShippingService = class {
|
|
|
2743
3069
|
});
|
|
2744
3070
|
}
|
|
2745
3071
|
/** Create a shipping zone. */
|
|
2746
|
-
async createZone(site, zone, auth2 =
|
|
3072
|
+
async createZone(site, zone, auth2 = SERVICE18) {
|
|
2747
3073
|
return this.ctx.http.request({
|
|
2748
3074
|
method: "POST",
|
|
2749
3075
|
path: `${this.siteBase(site)}/zones`,
|
|
@@ -2752,7 +3078,7 @@ var ShippingService = class {
|
|
|
2752
3078
|
});
|
|
2753
3079
|
}
|
|
2754
3080
|
/** Replace a shipping zone. */
|
|
2755
|
-
async updateZone(site, zoneId, zone, auth2 =
|
|
3081
|
+
async updateZone(site, zoneId, zone, auth2 = SERVICE18) {
|
|
2756
3082
|
await this.ctx.http.request({
|
|
2757
3083
|
method: "PUT",
|
|
2758
3084
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -2761,7 +3087,7 @@ var ShippingService = class {
|
|
|
2761
3087
|
});
|
|
2762
3088
|
}
|
|
2763
3089
|
/** Partially update a shipping zone. */
|
|
2764
|
-
async patchZone(site, zoneId, patch, auth2 =
|
|
3090
|
+
async patchZone(site, zoneId, patch, auth2 = SERVICE18) {
|
|
2765
3091
|
await this.ctx.http.request({
|
|
2766
3092
|
method: "PATCH",
|
|
2767
3093
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -2770,7 +3096,7 @@ var ShippingService = class {
|
|
|
2770
3096
|
});
|
|
2771
3097
|
}
|
|
2772
3098
|
/** Delete a shipping zone. */
|
|
2773
|
-
async deleteZone(site, zoneId, auth2 =
|
|
3099
|
+
async deleteZone(site, zoneId, auth2 = SERVICE18) {
|
|
2774
3100
|
await this.ctx.http.request({
|
|
2775
3101
|
method: "DELETE",
|
|
2776
3102
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
|
|
@@ -2779,7 +3105,7 @@ var ShippingService = class {
|
|
|
2779
3105
|
}
|
|
2780
3106
|
// --- Methods (per zone) ---
|
|
2781
3107
|
/** List shipping methods of a zone. */
|
|
2782
|
-
async listMethods(site, zoneId, query = {}, auth2 =
|
|
3108
|
+
async listMethods(site, zoneId, query = {}, auth2 = SERVICE18) {
|
|
2783
3109
|
return this.ctx.http.request({
|
|
2784
3110
|
method: "GET",
|
|
2785
3111
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
|
|
@@ -2788,7 +3114,7 @@ var ShippingService = class {
|
|
|
2788
3114
|
});
|
|
2789
3115
|
}
|
|
2790
3116
|
/** Retrieve one shipping method. */
|
|
2791
|
-
async getMethod(site, zoneId, methodId, auth2 =
|
|
3117
|
+
async getMethod(site, zoneId, methodId, auth2 = SERVICE18) {
|
|
2792
3118
|
return this.ctx.http.request({
|
|
2793
3119
|
method: "GET",
|
|
2794
3120
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -2796,7 +3122,7 @@ var ShippingService = class {
|
|
|
2796
3122
|
});
|
|
2797
3123
|
}
|
|
2798
3124
|
/** Create a shipping method in a zone. */
|
|
2799
|
-
async createMethod(site, zoneId, method, auth2 =
|
|
3125
|
+
async createMethod(site, zoneId, method, auth2 = SERVICE18) {
|
|
2800
3126
|
return this.ctx.http.request({
|
|
2801
3127
|
method: "POST",
|
|
2802
3128
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
|
|
@@ -2805,7 +3131,7 @@ var ShippingService = class {
|
|
|
2805
3131
|
});
|
|
2806
3132
|
}
|
|
2807
3133
|
/** Replace a shipping method. */
|
|
2808
|
-
async updateMethod(site, zoneId, methodId, method, auth2 =
|
|
3134
|
+
async updateMethod(site, zoneId, methodId, method, auth2 = SERVICE18) {
|
|
2809
3135
|
await this.ctx.http.request({
|
|
2810
3136
|
method: "PUT",
|
|
2811
3137
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -2814,7 +3140,7 @@ var ShippingService = class {
|
|
|
2814
3140
|
});
|
|
2815
3141
|
}
|
|
2816
3142
|
/** Partially update a shipping method. */
|
|
2817
|
-
async patchMethod(site, zoneId, methodId, patch, auth2 =
|
|
3143
|
+
async patchMethod(site, zoneId, methodId, patch, auth2 = SERVICE18) {
|
|
2818
3144
|
await this.ctx.http.request({
|
|
2819
3145
|
method: "PATCH",
|
|
2820
3146
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -2823,7 +3149,7 @@ var ShippingService = class {
|
|
|
2823
3149
|
});
|
|
2824
3150
|
}
|
|
2825
3151
|
/** Delete a shipping method. */
|
|
2826
|
-
async deleteMethod(site, zoneId, methodId, auth2 =
|
|
3152
|
+
async deleteMethod(site, zoneId, methodId, auth2 = SERVICE18) {
|
|
2827
3153
|
await this.ctx.http.request({
|
|
2828
3154
|
method: "DELETE",
|
|
2829
3155
|
path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
|
|
@@ -2832,7 +3158,7 @@ var ShippingService = class {
|
|
|
2832
3158
|
}
|
|
2833
3159
|
// --- Cost / quote ---
|
|
2834
3160
|
/** Calculate the final shipping cost (`POST /quote`). */
|
|
2835
|
-
async quote(site, input, auth2 =
|
|
3161
|
+
async quote(site, input, auth2 = SERVICE18) {
|
|
2836
3162
|
return this.ctx.http.request({
|
|
2837
3163
|
method: "POST",
|
|
2838
3164
|
path: `${this.siteBase(site)}/quote`,
|
|
@@ -2841,7 +3167,7 @@ var ShippingService = class {
|
|
|
2841
3167
|
});
|
|
2842
3168
|
}
|
|
2843
3169
|
/** Calculate the minimum shipping cost (`POST /quote/minimum`). */
|
|
2844
|
-
async quoteMinimum(site, input, auth2 =
|
|
3170
|
+
async quoteMinimum(site, input, auth2 = SERVICE18) {
|
|
2845
3171
|
return this.ctx.http.request({
|
|
2846
3172
|
method: "POST",
|
|
2847
3173
|
path: `${this.siteBase(site)}/quote/minimum`,
|
|
@@ -2850,7 +3176,7 @@ var ShippingService = class {
|
|
|
2850
3176
|
});
|
|
2851
3177
|
}
|
|
2852
3178
|
/** Calculate the shipping cost for a given slot (`POST /quote/slot`). */
|
|
2853
|
-
async quoteSlot(site, input, auth2 =
|
|
3179
|
+
async quoteSlot(site, input, auth2 = SERVICE18) {
|
|
2854
3180
|
return this.ctx.http.request({
|
|
2855
3181
|
method: "POST",
|
|
2856
3182
|
path: `${this.siteBase(site)}/quote/slot`,
|
|
@@ -2860,7 +3186,7 @@ var ShippingService = class {
|
|
|
2860
3186
|
}
|
|
2861
3187
|
// --- Groups ---
|
|
2862
3188
|
/** List shipping groups for a site. */
|
|
2863
|
-
async listGroups(site, query = {}, auth2 =
|
|
3189
|
+
async listGroups(site, query = {}, auth2 = SERVICE18) {
|
|
2864
3190
|
return this.ctx.http.request({
|
|
2865
3191
|
method: "GET",
|
|
2866
3192
|
path: `${this.siteBase(site)}/groups`,
|
|
@@ -2869,7 +3195,7 @@ var ShippingService = class {
|
|
|
2869
3195
|
});
|
|
2870
3196
|
}
|
|
2871
3197
|
/** Retrieve one shipping group. */
|
|
2872
|
-
async getGroup(site, groupId, auth2 =
|
|
3198
|
+
async getGroup(site, groupId, auth2 = SERVICE18) {
|
|
2873
3199
|
return this.ctx.http.request({
|
|
2874
3200
|
method: "GET",
|
|
2875
3201
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -2877,7 +3203,7 @@ var ShippingService = class {
|
|
|
2877
3203
|
});
|
|
2878
3204
|
}
|
|
2879
3205
|
/** Create a shipping group. */
|
|
2880
|
-
async createGroup(site, group, auth2 =
|
|
3206
|
+
async createGroup(site, group, auth2 = SERVICE18) {
|
|
2881
3207
|
return this.ctx.http.request({
|
|
2882
3208
|
method: "POST",
|
|
2883
3209
|
path: `${this.siteBase(site)}/groups`,
|
|
@@ -2886,7 +3212,7 @@ var ShippingService = class {
|
|
|
2886
3212
|
});
|
|
2887
3213
|
}
|
|
2888
3214
|
/** Replace a shipping group. */
|
|
2889
|
-
async updateGroup(site, groupId, group, auth2 =
|
|
3215
|
+
async updateGroup(site, groupId, group, auth2 = SERVICE18) {
|
|
2890
3216
|
await this.ctx.http.request({
|
|
2891
3217
|
method: "PUT",
|
|
2892
3218
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -2895,7 +3221,7 @@ var ShippingService = class {
|
|
|
2895
3221
|
});
|
|
2896
3222
|
}
|
|
2897
3223
|
/** Delete a shipping group. */
|
|
2898
|
-
async deleteGroup(site, groupId, auth2 =
|
|
3224
|
+
async deleteGroup(site, groupId, auth2 = SERVICE18) {
|
|
2899
3225
|
await this.ctx.http.request({
|
|
2900
3226
|
method: "DELETE",
|
|
2901
3227
|
path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
|
|
@@ -2904,7 +3230,7 @@ var ShippingService = class {
|
|
|
2904
3230
|
}
|
|
2905
3231
|
// --- Customer-group relations ---
|
|
2906
3232
|
/** List customer-group relations for a site. */
|
|
2907
|
-
async listCgRelations(site, query = {}, auth2 =
|
|
3233
|
+
async listCgRelations(site, query = {}, auth2 = SERVICE18) {
|
|
2908
3234
|
return this.ctx.http.request({
|
|
2909
3235
|
method: "GET",
|
|
2910
3236
|
path: `${this.siteBase(site)}/cgrelations`,
|
|
@@ -2913,7 +3239,7 @@ var ShippingService = class {
|
|
|
2913
3239
|
});
|
|
2914
3240
|
}
|
|
2915
3241
|
/** Retrieve a customer's customer-group relations. */
|
|
2916
|
-
async getCgRelations(site, customerId, auth2 =
|
|
3242
|
+
async getCgRelations(site, customerId, auth2 = SERVICE18) {
|
|
2917
3243
|
return this.ctx.http.request({
|
|
2918
3244
|
method: "GET",
|
|
2919
3245
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -2921,7 +3247,7 @@ var ShippingService = class {
|
|
|
2921
3247
|
});
|
|
2922
3248
|
}
|
|
2923
3249
|
/** Create a customer-group relation. */
|
|
2924
|
-
async createCgRelation(site, relation, auth2 =
|
|
3250
|
+
async createCgRelation(site, relation, auth2 = SERVICE18) {
|
|
2925
3251
|
return this.ctx.http.request({
|
|
2926
3252
|
method: "POST",
|
|
2927
3253
|
path: `${this.siteBase(site)}/cgrelations`,
|
|
@@ -2930,7 +3256,7 @@ var ShippingService = class {
|
|
|
2930
3256
|
});
|
|
2931
3257
|
}
|
|
2932
3258
|
/** Update a customer's customer-group relations. */
|
|
2933
|
-
async updateCgRelations(site, customerId, relation, auth2 =
|
|
3259
|
+
async updateCgRelations(site, customerId, relation, auth2 = SERVICE18) {
|
|
2934
3260
|
await this.ctx.http.request({
|
|
2935
3261
|
method: "PUT",
|
|
2936
3262
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -2939,7 +3265,7 @@ var ShippingService = class {
|
|
|
2939
3265
|
});
|
|
2940
3266
|
}
|
|
2941
3267
|
/** Delete a customer's customer-group relation. */
|
|
2942
|
-
async deleteCgRelation(site, customerId, auth2 =
|
|
3268
|
+
async deleteCgRelation(site, customerId, auth2 = SERVICE18) {
|
|
2943
3269
|
await this.ctx.http.request({
|
|
2944
3270
|
method: "DELETE",
|
|
2945
3271
|
path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
|
|
@@ -2948,7 +3274,7 @@ var ShippingService = class {
|
|
|
2948
3274
|
}
|
|
2949
3275
|
// --- Phase 2: delivery windows ---
|
|
2950
3276
|
/** Retrieve delivery windows for a delivery area + cart. */
|
|
2951
|
-
async getAreaDeliveryWindows(deliveryAreaId, cartId, auth2 =
|
|
3277
|
+
async getAreaDeliveryWindows(deliveryAreaId, cartId, auth2 = SERVICE18) {
|
|
2952
3278
|
return this.ctx.http.request({
|
|
2953
3279
|
method: "GET",
|
|
2954
3280
|
path: `${this.base()}/areaDeliveryTimes/${encodeURIComponent(deliveryAreaId)}/${encodeURIComponent(cartId)}`,
|
|
@@ -2956,7 +3282,7 @@ var ShippingService = class {
|
|
|
2956
3282
|
});
|
|
2957
3283
|
}
|
|
2958
3284
|
/** Retrieve delivery windows for a cart. */
|
|
2959
|
-
async getCartDeliveryWindows(cartId, auth2 =
|
|
3285
|
+
async getCartDeliveryWindows(cartId, auth2 = SERVICE18) {
|
|
2960
3286
|
return this.ctx.http.request({
|
|
2961
3287
|
method: "GET",
|
|
2962
3288
|
path: `${this.base()}/actualDeliveryWindows/${encodeURIComponent(cartId)}`,
|
|
@@ -2964,7 +3290,7 @@ var ShippingService = class {
|
|
|
2964
3290
|
});
|
|
2965
3291
|
}
|
|
2966
3292
|
/** Increment the delivery-window counter. */
|
|
2967
|
-
async incrementDeliveryWindowCounter(input, auth2 =
|
|
3293
|
+
async incrementDeliveryWindowCounter(input, auth2 = SERVICE18) {
|
|
2968
3294
|
await this.ctx.http.request({
|
|
2969
3295
|
method: "POST",
|
|
2970
3296
|
path: `${this.base()}/actualDeliveryWindows/incrementCounter`,
|
|
@@ -2973,7 +3299,7 @@ var ShippingService = class {
|
|
|
2973
3299
|
});
|
|
2974
3300
|
}
|
|
2975
3301
|
/** Validate a delivery window. Resolves when valid; throws otherwise. */
|
|
2976
|
-
async validateDeliveryWindow(input, auth2 =
|
|
3302
|
+
async validateDeliveryWindow(input, auth2 = SERVICE18) {
|
|
2977
3303
|
await this.ctx.http.request({
|
|
2978
3304
|
method: "POST",
|
|
2979
3305
|
path: `${this.base()}/deliveryWindowValidation`,
|
|
@@ -2983,7 +3309,7 @@ var ShippingService = class {
|
|
|
2983
3309
|
}
|
|
2984
3310
|
// --- Phase 2: delivery times ---
|
|
2985
3311
|
/** List all delivery times. */
|
|
2986
|
-
async listDeliveryTimes(query = {}, auth2 =
|
|
3312
|
+
async listDeliveryTimes(query = {}, auth2 = SERVICE18) {
|
|
2987
3313
|
return this.ctx.http.request({
|
|
2988
3314
|
method: "GET",
|
|
2989
3315
|
path: `${this.base()}/delivery-times`,
|
|
@@ -2992,7 +3318,7 @@ var ShippingService = class {
|
|
|
2992
3318
|
});
|
|
2993
3319
|
}
|
|
2994
3320
|
/** Retrieve one delivery time. */
|
|
2995
|
-
async getDeliveryTime(deliveryTimeId, auth2 =
|
|
3321
|
+
async getDeliveryTime(deliveryTimeId, auth2 = SERVICE18) {
|
|
2996
3322
|
return this.ctx.http.request({
|
|
2997
3323
|
method: "GET",
|
|
2998
3324
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -3000,7 +3326,7 @@ var ShippingService = class {
|
|
|
3000
3326
|
});
|
|
3001
3327
|
}
|
|
3002
3328
|
/** Create a delivery time. */
|
|
3003
|
-
async createDeliveryTime(input, auth2 =
|
|
3329
|
+
async createDeliveryTime(input, auth2 = SERVICE18) {
|
|
3004
3330
|
return this.ctx.http.request({
|
|
3005
3331
|
method: "POST",
|
|
3006
3332
|
path: `${this.base()}/delivery-times`,
|
|
@@ -3009,7 +3335,7 @@ var ShippingService = class {
|
|
|
3009
3335
|
});
|
|
3010
3336
|
}
|
|
3011
3337
|
/** Create multiple delivery times (`POST /delivery-times/bulk`). */
|
|
3012
|
-
async createDeliveryTimesBulk(inputs, auth2 =
|
|
3338
|
+
async createDeliveryTimesBulk(inputs, auth2 = SERVICE18) {
|
|
3013
3339
|
return this.ctx.http.request({
|
|
3014
3340
|
method: "POST",
|
|
3015
3341
|
path: `${this.base()}/delivery-times/bulk`,
|
|
@@ -3018,7 +3344,7 @@ var ShippingService = class {
|
|
|
3018
3344
|
});
|
|
3019
3345
|
}
|
|
3020
3346
|
/** Replace a delivery time. */
|
|
3021
|
-
async updateDeliveryTime(deliveryTimeId, input, auth2 =
|
|
3347
|
+
async updateDeliveryTime(deliveryTimeId, input, auth2 = SERVICE18) {
|
|
3022
3348
|
await this.ctx.http.request({
|
|
3023
3349
|
method: "PUT",
|
|
3024
3350
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -3027,7 +3353,7 @@ var ShippingService = class {
|
|
|
3027
3353
|
});
|
|
3028
3354
|
}
|
|
3029
3355
|
/** Partially update a delivery time (JSON-Patch op array). */
|
|
3030
|
-
async patchDeliveryTime(deliveryTimeId, ops, auth2 =
|
|
3356
|
+
async patchDeliveryTime(deliveryTimeId, ops, auth2 = SERVICE18) {
|
|
3031
3357
|
await this.ctx.http.request({
|
|
3032
3358
|
method: "PATCH",
|
|
3033
3359
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -3036,7 +3362,7 @@ var ShippingService = class {
|
|
|
3036
3362
|
});
|
|
3037
3363
|
}
|
|
3038
3364
|
/** Delete a delivery time. */
|
|
3039
|
-
async deleteDeliveryTime(deliveryTimeId, auth2 =
|
|
3365
|
+
async deleteDeliveryTime(deliveryTimeId, auth2 = SERVICE18) {
|
|
3040
3366
|
await this.ctx.http.request({
|
|
3041
3367
|
method: "DELETE",
|
|
3042
3368
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
|
|
@@ -3045,7 +3371,7 @@ var ShippingService = class {
|
|
|
3045
3371
|
}
|
|
3046
3372
|
// --- Phase 2: delivery time slots ---
|
|
3047
3373
|
/** List slots of a delivery time. */
|
|
3048
|
-
async listSlots(deliveryTimeId, auth2 =
|
|
3374
|
+
async listSlots(deliveryTimeId, auth2 = SERVICE18) {
|
|
3049
3375
|
return this.ctx.http.request({
|
|
3050
3376
|
method: "GET",
|
|
3051
3377
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -3053,7 +3379,7 @@ var ShippingService = class {
|
|
|
3053
3379
|
});
|
|
3054
3380
|
}
|
|
3055
3381
|
/** Retrieve one slot. */
|
|
3056
|
-
async getSlot(deliveryTimeId, slotId, auth2 =
|
|
3382
|
+
async getSlot(deliveryTimeId, slotId, auth2 = SERVICE18) {
|
|
3057
3383
|
return this.ctx.http.request({
|
|
3058
3384
|
method: "GET",
|
|
3059
3385
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -3061,7 +3387,7 @@ var ShippingService = class {
|
|
|
3061
3387
|
});
|
|
3062
3388
|
}
|
|
3063
3389
|
/** Create a slot in a delivery time. */
|
|
3064
|
-
async createSlot(deliveryTimeId, input, auth2 =
|
|
3390
|
+
async createSlot(deliveryTimeId, input, auth2 = SERVICE18) {
|
|
3065
3391
|
return this.ctx.http.request({
|
|
3066
3392
|
method: "POST",
|
|
3067
3393
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -3070,7 +3396,7 @@ var ShippingService = class {
|
|
|
3070
3396
|
});
|
|
3071
3397
|
}
|
|
3072
3398
|
/** Replace a slot. */
|
|
3073
|
-
async updateSlot(deliveryTimeId, slotId, input, auth2 =
|
|
3399
|
+
async updateSlot(deliveryTimeId, slotId, input, auth2 = SERVICE18) {
|
|
3074
3400
|
await this.ctx.http.request({
|
|
3075
3401
|
method: "PUT",
|
|
3076
3402
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -3079,7 +3405,7 @@ var ShippingService = class {
|
|
|
3079
3405
|
});
|
|
3080
3406
|
}
|
|
3081
3407
|
/** Partially update a slot (JSON-Patch op array). */
|
|
3082
|
-
async patchSlot(deliveryTimeId, slotId, ops, auth2 =
|
|
3408
|
+
async patchSlot(deliveryTimeId, slotId, ops, auth2 = SERVICE18) {
|
|
3083
3409
|
await this.ctx.http.request({
|
|
3084
3410
|
method: "PATCH",
|
|
3085
3411
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -3088,7 +3414,7 @@ var ShippingService = class {
|
|
|
3088
3414
|
});
|
|
3089
3415
|
}
|
|
3090
3416
|
/** Delete a slot. */
|
|
3091
|
-
async deleteSlot(deliveryTimeId, slotId, auth2 =
|
|
3417
|
+
async deleteSlot(deliveryTimeId, slotId, auth2 = SERVICE18) {
|
|
3092
3418
|
await this.ctx.http.request({
|
|
3093
3419
|
method: "DELETE",
|
|
3094
3420
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
|
|
@@ -3096,7 +3422,7 @@ var ShippingService = class {
|
|
|
3096
3422
|
});
|
|
3097
3423
|
}
|
|
3098
3424
|
/** Delete all slots of a delivery time. */
|
|
3099
|
-
async deleteAllSlots(deliveryTimeId, auth2 =
|
|
3425
|
+
async deleteAllSlots(deliveryTimeId, auth2 = SERVICE18) {
|
|
3100
3426
|
await this.ctx.http.request({
|
|
3101
3427
|
method: "DELETE",
|
|
3102
3428
|
path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
|
|
@@ -3105,7 +3431,7 @@ var ShippingService = class {
|
|
|
3105
3431
|
}
|
|
3106
3432
|
// --- Phase 2: delivery cycles ---
|
|
3107
3433
|
/** Generate a delivery cycle (`POST /delivery-cycles/generate`). Returns the cycle id. */
|
|
3108
|
-
async generateDeliveryCycle(input, auth2 =
|
|
3434
|
+
async generateDeliveryCycle(input, auth2 = SERVICE18) {
|
|
3109
3435
|
return this.ctx.http.request({
|
|
3110
3436
|
method: "POST",
|
|
3111
3437
|
path: `${this.base()}/delivery-cycles/generate`,
|
|
@@ -3116,7 +3442,7 @@ var ShippingService = class {
|
|
|
3116
3442
|
};
|
|
3117
3443
|
|
|
3118
3444
|
// src/services/invoice.ts
|
|
3119
|
-
var
|
|
3445
|
+
var SERVICE19 = { kind: "service" };
|
|
3120
3446
|
var InvoiceService = class {
|
|
3121
3447
|
constructor(ctx) {
|
|
3122
3448
|
this.ctx = ctx;
|
|
@@ -3127,7 +3453,7 @@ var InvoiceService = class {
|
|
|
3127
3453
|
return `/invoice/${this.ctx.tenant}/jobs/invoices`;
|
|
3128
3454
|
}
|
|
3129
3455
|
/** Create an invoice-generation job (`POST …/jobs/invoices`, 201). */
|
|
3130
|
-
async createJob(draft, auth2 =
|
|
3456
|
+
async createJob(draft, auth2 = SERVICE19) {
|
|
3131
3457
|
return this.ctx.http.request({
|
|
3132
3458
|
method: "POST",
|
|
3133
3459
|
path: this.base(),
|
|
@@ -3136,7 +3462,7 @@ var InvoiceService = class {
|
|
|
3136
3462
|
});
|
|
3137
3463
|
}
|
|
3138
3464
|
/** Retrieve a job and its per-order results (`GET …/jobs/invoices/{jobId}`). */
|
|
3139
|
-
async getJob(jobId, auth2 =
|
|
3465
|
+
async getJob(jobId, auth2 = SERVICE19) {
|
|
3140
3466
|
return this.ctx.http.request({
|
|
3141
3467
|
method: "GET",
|
|
3142
3468
|
path: `${this.base()}/${encodeURIComponent(jobId)}`,
|
|
@@ -3291,7 +3617,7 @@ var QuoteReasonsResource = class {
|
|
|
3291
3617
|
};
|
|
3292
3618
|
|
|
3293
3619
|
// src/services/returns.ts
|
|
3294
|
-
var
|
|
3620
|
+
var SERVICE20 = { kind: "service" };
|
|
3295
3621
|
var ReturnsService = class {
|
|
3296
3622
|
constructor(ctx) {
|
|
3297
3623
|
this.ctx = ctx;
|
|
@@ -3302,7 +3628,7 @@ var ReturnsService = class {
|
|
|
3302
3628
|
return `/return/${this.ctx.tenant}/returns`;
|
|
3303
3629
|
}
|
|
3304
3630
|
/** List returns (paged; supports `pageSize`/`pageNumber`/`sort`/`q`). */
|
|
3305
|
-
async listReturns(query = {}, auth2 =
|
|
3631
|
+
async listReturns(query = {}, auth2 = SERVICE20) {
|
|
3306
3632
|
return this.ctx.http.request({
|
|
3307
3633
|
method: "GET",
|
|
3308
3634
|
path: this.base(),
|
|
@@ -3311,7 +3637,7 @@ var ReturnsService = class {
|
|
|
3311
3637
|
});
|
|
3312
3638
|
}
|
|
3313
3639
|
/** Retrieve one return by id. */
|
|
3314
|
-
async getReturn(returnId, auth2 =
|
|
3640
|
+
async getReturn(returnId, auth2 = SERVICE20) {
|
|
3315
3641
|
return this.ctx.http.request({
|
|
3316
3642
|
method: "GET",
|
|
3317
3643
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -3319,7 +3645,7 @@ var ReturnsService = class {
|
|
|
3319
3645
|
});
|
|
3320
3646
|
}
|
|
3321
3647
|
/** Create a return. Returns the created `{ id }`. */
|
|
3322
|
-
async createReturn(input, auth2 =
|
|
3648
|
+
async createReturn(input, auth2 = SERVICE20) {
|
|
3323
3649
|
return this.ctx.http.request({
|
|
3324
3650
|
method: "POST",
|
|
3325
3651
|
path: this.base(),
|
|
@@ -3328,7 +3654,7 @@ var ReturnsService = class {
|
|
|
3328
3654
|
});
|
|
3329
3655
|
}
|
|
3330
3656
|
/** Replace a return by id (`PUT`). */
|
|
3331
|
-
async updateReturn(returnId, input, auth2 =
|
|
3657
|
+
async updateReturn(returnId, input, auth2 = SERVICE20) {
|
|
3332
3658
|
await this.ctx.http.request({
|
|
3333
3659
|
method: "PUT",
|
|
3334
3660
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -3337,7 +3663,7 @@ var ReturnsService = class {
|
|
|
3337
3663
|
});
|
|
3338
3664
|
}
|
|
3339
3665
|
/** Partially update a return by id (`PATCH`, JSON-Patch op-array). */
|
|
3340
|
-
async patchReturn(returnId, ops, auth2 =
|
|
3666
|
+
async patchReturn(returnId, ops, auth2 = SERVICE20) {
|
|
3341
3667
|
await this.ctx.http.request({
|
|
3342
3668
|
method: "PATCH",
|
|
3343
3669
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -3346,7 +3672,7 @@ var ReturnsService = class {
|
|
|
3346
3672
|
});
|
|
3347
3673
|
}
|
|
3348
3674
|
/** Delete a return by id. */
|
|
3349
|
-
async deleteReturn(returnId, auth2 =
|
|
3675
|
+
async deleteReturn(returnId, auth2 = SERVICE20) {
|
|
3350
3676
|
await this.ctx.http.request({
|
|
3351
3677
|
method: "DELETE",
|
|
3352
3678
|
path: `${this.base()}/${encodeURIComponent(returnId)}`,
|
|
@@ -3356,7 +3682,7 @@ var ReturnsService = class {
|
|
|
3356
3682
|
};
|
|
3357
3683
|
|
|
3358
3684
|
// src/services/sepa-export.ts
|
|
3359
|
-
var
|
|
3685
|
+
var SERVICE21 = { kind: "service" };
|
|
3360
3686
|
var SepaExportService = class {
|
|
3361
3687
|
constructor(ctx) {
|
|
3362
3688
|
this.ctx = ctx;
|
|
@@ -3367,7 +3693,7 @@ var SepaExportService = class {
|
|
|
3367
3693
|
return `/sepa-export/${this.ctx.tenant}`;
|
|
3368
3694
|
}
|
|
3369
3695
|
/** Retrieve a SEPA export file by id. Returns the raw file content (text). */
|
|
3370
|
-
async getFile(fileId, auth2 =
|
|
3696
|
+
async getFile(fileId, auth2 = SERVICE21) {
|
|
3371
3697
|
const path = `${this.base()}/files/${encodeURIComponent(fileId)}`;
|
|
3372
3698
|
const res = await this.ctx.http.requestRaw({ method: "GET", path, auth: auth2 });
|
|
3373
3699
|
if (!res.ok) {
|
|
@@ -3377,7 +3703,7 @@ var SepaExportService = class {
|
|
|
3377
3703
|
return res.text();
|
|
3378
3704
|
}
|
|
3379
3705
|
/** List export jobs. */
|
|
3380
|
-
async listJobs(query = {}, auth2 =
|
|
3706
|
+
async listJobs(query = {}, auth2 = SERVICE21) {
|
|
3381
3707
|
return this.ctx.http.request({
|
|
3382
3708
|
method: "GET",
|
|
3383
3709
|
path: `${this.base()}/jobs`,
|
|
@@ -3386,7 +3712,7 @@ var SepaExportService = class {
|
|
|
3386
3712
|
});
|
|
3387
3713
|
}
|
|
3388
3714
|
/** Create an export job. */
|
|
3389
|
-
async createJob(input, auth2 =
|
|
3715
|
+
async createJob(input, auth2 = SERVICE21) {
|
|
3390
3716
|
return this.ctx.http.request({
|
|
3391
3717
|
method: "POST",
|
|
3392
3718
|
path: `${this.base()}/jobs`,
|
|
@@ -3397,7 +3723,7 @@ var SepaExportService = class {
|
|
|
3397
3723
|
};
|
|
3398
3724
|
|
|
3399
3725
|
// src/services/indexing.ts
|
|
3400
|
-
var
|
|
3726
|
+
var SERVICE22 = { kind: "service" };
|
|
3401
3727
|
var IndexingService = class {
|
|
3402
3728
|
constructor(ctx) {
|
|
3403
3729
|
this.ctx = ctx;
|
|
@@ -3408,11 +3734,11 @@ var IndexingService = class {
|
|
|
3408
3734
|
return `/indexing/${this.ctx.tenant}`;
|
|
3409
3735
|
}
|
|
3410
3736
|
/** List indexing configurations. */
|
|
3411
|
-
async listConfigurations(auth2 =
|
|
3737
|
+
async listConfigurations(auth2 = SERVICE22) {
|
|
3412
3738
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/configurations`, auth: auth2 });
|
|
3413
3739
|
}
|
|
3414
3740
|
/** Get a configuration by provider name. */
|
|
3415
|
-
async getConfiguration(provider, auth2 =
|
|
3741
|
+
async getConfiguration(provider, auth2 = SERVICE22) {
|
|
3416
3742
|
return this.ctx.http.request({
|
|
3417
3743
|
method: "GET",
|
|
3418
3744
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -3420,7 +3746,7 @@ var IndexingService = class {
|
|
|
3420
3746
|
});
|
|
3421
3747
|
}
|
|
3422
3748
|
/** Create a configuration. */
|
|
3423
|
-
async createConfiguration(input, auth2 =
|
|
3749
|
+
async createConfiguration(input, auth2 = SERVICE22) {
|
|
3424
3750
|
return this.ctx.http.request({
|
|
3425
3751
|
method: "POST",
|
|
3426
3752
|
path: `${this.base()}/configurations`,
|
|
@@ -3429,7 +3755,7 @@ var IndexingService = class {
|
|
|
3429
3755
|
});
|
|
3430
3756
|
}
|
|
3431
3757
|
/** Update a configuration by provider name. */
|
|
3432
|
-
async updateConfiguration(provider, input, auth2 =
|
|
3758
|
+
async updateConfiguration(provider, input, auth2 = SERVICE22) {
|
|
3433
3759
|
await this.ctx.http.request({
|
|
3434
3760
|
method: "PUT",
|
|
3435
3761
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -3438,7 +3764,7 @@ var IndexingService = class {
|
|
|
3438
3764
|
});
|
|
3439
3765
|
}
|
|
3440
3766
|
/** Delete a configuration by provider name. */
|
|
3441
|
-
async deleteConfiguration(provider, auth2 =
|
|
3767
|
+
async deleteConfiguration(provider, auth2 = SERVICE22) {
|
|
3442
3768
|
await this.ctx.http.request({
|
|
3443
3769
|
method: "DELETE",
|
|
3444
3770
|
path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -3446,11 +3772,11 @@ var IndexingService = class {
|
|
|
3446
3772
|
});
|
|
3447
3773
|
}
|
|
3448
3774
|
/** List public indexing configurations. */
|
|
3449
|
-
async listPublicConfigurations(auth2 =
|
|
3775
|
+
async listPublicConfigurations(auth2 = SERVICE22) {
|
|
3450
3776
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/public/configurations`, auth: auth2 });
|
|
3451
3777
|
}
|
|
3452
3778
|
/** Get a public configuration by provider name. */
|
|
3453
|
-
async getPublicConfiguration(provider, auth2 =
|
|
3779
|
+
async getPublicConfiguration(provider, auth2 = SERVICE22) {
|
|
3454
3780
|
return this.ctx.http.request({
|
|
3455
3781
|
method: "GET",
|
|
3456
3782
|
path: `${this.base()}/public/configurations/${encodeURIComponent(provider)}`,
|
|
@@ -3463,7 +3789,7 @@ var IndexingService = class {
|
|
|
3463
3789
|
* (PRODUCT only). Resolves to the created job (`201`) or, when a job for that
|
|
3464
3790
|
* `entityType` is already `IN_PROGRESS`, that running job (`200`).
|
|
3465
3791
|
*/
|
|
3466
|
-
async createReindexJob(input, auth2 =
|
|
3792
|
+
async createReindexJob(input, auth2 = SERVICE22) {
|
|
3467
3793
|
return this.ctx.http.request({
|
|
3468
3794
|
method: "POST",
|
|
3469
3795
|
path: `${this.base()}/reindex-jobs`,
|
|
@@ -3472,7 +3798,7 @@ var IndexingService = class {
|
|
|
3472
3798
|
});
|
|
3473
3799
|
}
|
|
3474
3800
|
/** List reindex jobs (paginated). */
|
|
3475
|
-
async listReindexJobs(opts = {}, auth2 =
|
|
3801
|
+
async listReindexJobs(opts = {}, auth2 = SERVICE22) {
|
|
3476
3802
|
const pageNumber = opts.pageNumber ?? 1;
|
|
3477
3803
|
const pageSize = opts.pageSize ?? 50;
|
|
3478
3804
|
const query = { pageNumber, pageSize };
|
|
@@ -3486,7 +3812,7 @@ var IndexingService = class {
|
|
|
3486
3812
|
return { items, pageNumber, pageSize, hasNextPage: items.length === pageSize };
|
|
3487
3813
|
}
|
|
3488
3814
|
/** Fetch one reindex job by id. */
|
|
3489
|
-
async getReindexJob(reindexJobId, auth2 =
|
|
3815
|
+
async getReindexJob(reindexJobId, auth2 = SERVICE22) {
|
|
3490
3816
|
return this.ctx.http.request({
|
|
3491
3817
|
method: "GET",
|
|
3492
3818
|
path: `${this.base()}/reindex-jobs/${encodeURIComponent(reindexJobId)}`,
|
|
@@ -3498,13 +3824,13 @@ var IndexingService = class {
|
|
|
3498
3824
|
* @deprecated since 2026-06-18, removal 2026-12-01 — use {@link createReindexJob}
|
|
3499
3825
|
* (`createReindexJob({ entityType: "PRODUCT" })`), which returns a trackable job.
|
|
3500
3826
|
*/
|
|
3501
|
-
async reindex(input, auth2 =
|
|
3827
|
+
async reindex(input, auth2 = SERVICE22) {
|
|
3502
3828
|
await this.ctx.http.request({ method: "POST", path: `${this.base()}/reindex`, auth: auth2, body: input });
|
|
3503
3829
|
}
|
|
3504
3830
|
};
|
|
3505
3831
|
|
|
3506
3832
|
// src/services/unit-handling.ts
|
|
3507
|
-
var
|
|
3833
|
+
var SERVICE23 = { kind: "service" };
|
|
3508
3834
|
var UnitHandlingService = class {
|
|
3509
3835
|
constructor(ctx) {
|
|
3510
3836
|
this.ctx = ctx;
|
|
@@ -3515,7 +3841,7 @@ var UnitHandlingService = class {
|
|
|
3515
3841
|
return `/unit-handling/${this.ctx.tenant}`;
|
|
3516
3842
|
}
|
|
3517
3843
|
/** Find units (filter/sort/page). */
|
|
3518
|
-
async listUnits(query = {}, auth2 =
|
|
3844
|
+
async listUnits(query = {}, auth2 = SERVICE23) {
|
|
3519
3845
|
return this.ctx.http.request({
|
|
3520
3846
|
method: "GET",
|
|
3521
3847
|
path: `${this.base()}/units`,
|
|
@@ -3524,7 +3850,7 @@ var UnitHandlingService = class {
|
|
|
3524
3850
|
});
|
|
3525
3851
|
}
|
|
3526
3852
|
/** Retrieve a unit by code. */
|
|
3527
|
-
async getUnit(unitCode, auth2 =
|
|
3853
|
+
async getUnit(unitCode, auth2 = SERVICE23) {
|
|
3528
3854
|
return this.ctx.http.request({
|
|
3529
3855
|
method: "GET",
|
|
3530
3856
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -3532,11 +3858,11 @@ var UnitHandlingService = class {
|
|
|
3532
3858
|
});
|
|
3533
3859
|
}
|
|
3534
3860
|
/** Add a new unit. */
|
|
3535
|
-
async createUnit(input, auth2 =
|
|
3861
|
+
async createUnit(input, auth2 = SERVICE23) {
|
|
3536
3862
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/units`, auth: auth2, body: input });
|
|
3537
3863
|
}
|
|
3538
3864
|
/** Update a unit by code. */
|
|
3539
|
-
async updateUnit(unitCode, input, auth2 =
|
|
3865
|
+
async updateUnit(unitCode, input, auth2 = SERVICE23) {
|
|
3540
3866
|
await this.ctx.http.request({
|
|
3541
3867
|
method: "PUT",
|
|
3542
3868
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -3545,7 +3871,7 @@ var UnitHandlingService = class {
|
|
|
3545
3871
|
});
|
|
3546
3872
|
}
|
|
3547
3873
|
/** Delete a unit by code. */
|
|
3548
|
-
async deleteUnit(unitCode, auth2 =
|
|
3874
|
+
async deleteUnit(unitCode, auth2 = SERVICE23) {
|
|
3549
3875
|
await this.ctx.http.request({
|
|
3550
3876
|
method: "DELETE",
|
|
3551
3877
|
path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
|
|
@@ -3553,7 +3879,7 @@ var UnitHandlingService = class {
|
|
|
3553
3879
|
});
|
|
3554
3880
|
}
|
|
3555
3881
|
/** Delete multiple units by code (bulk). The codes are sent as the request body. */
|
|
3556
|
-
async deleteUnits(codes, auth2 =
|
|
3882
|
+
async deleteUnits(codes, auth2 = SERVICE23) {
|
|
3557
3883
|
await this.ctx.http.request({
|
|
3558
3884
|
method: "DELETE",
|
|
3559
3885
|
path: `${this.base()}/units`,
|
|
@@ -3562,7 +3888,7 @@ var UnitHandlingService = class {
|
|
|
3562
3888
|
});
|
|
3563
3889
|
}
|
|
3564
3890
|
/** Fetch a conversion factor (`PUT /units/conversion-factor-commands`). */
|
|
3565
|
-
async getConversionFactor(input, auth2 =
|
|
3891
|
+
async getConversionFactor(input, auth2 = SERVICE23) {
|
|
3566
3892
|
return this.ctx.http.request({
|
|
3567
3893
|
method: "PUT",
|
|
3568
3894
|
path: `${this.base()}/units/conversion-factor-commands`,
|
|
@@ -3571,7 +3897,7 @@ var UnitHandlingService = class {
|
|
|
3571
3897
|
});
|
|
3572
3898
|
}
|
|
3573
3899
|
/** Convert a value between units (`PUT /units/convert-unit-commands`). */
|
|
3574
|
-
async convertUnit(input, auth2 =
|
|
3900
|
+
async convertUnit(input, auth2 = SERVICE23) {
|
|
3575
3901
|
return this.ctx.http.request({
|
|
3576
3902
|
method: "PUT",
|
|
3577
3903
|
path: `${this.base()}/units/convert-unit-commands`,
|
|
@@ -3580,13 +3906,13 @@ var UnitHandlingService = class {
|
|
|
3580
3906
|
});
|
|
3581
3907
|
}
|
|
3582
3908
|
/** List all unit types. */
|
|
3583
|
-
async listUnitTypes(auth2 =
|
|
3909
|
+
async listUnitTypes(auth2 = SERVICE23) {
|
|
3584
3910
|
return this.ctx.http.request({ method: "GET", path: `${this.base()}/types`, auth: auth2 });
|
|
3585
3911
|
}
|
|
3586
3912
|
};
|
|
3587
3913
|
|
|
3588
3914
|
// src/services/catalog.ts
|
|
3589
|
-
var
|
|
3915
|
+
var SERVICE24 = { kind: "service" };
|
|
3590
3916
|
var CatalogService = class {
|
|
3591
3917
|
constructor(ctx) {
|
|
3592
3918
|
this.ctx = ctx;
|
|
@@ -3597,7 +3923,7 @@ var CatalogService = class {
|
|
|
3597
3923
|
return `/catalog/${this.ctx.tenant}/catalogs`;
|
|
3598
3924
|
}
|
|
3599
3925
|
/** List catalogs (filtered/sorted). */
|
|
3600
|
-
async listCatalogs(query = {}, auth2 =
|
|
3926
|
+
async listCatalogs(query = {}, auth2 = SERVICE24) {
|
|
3601
3927
|
return this.ctx.http.request({
|
|
3602
3928
|
method: "GET",
|
|
3603
3929
|
path: this.base(),
|
|
@@ -3606,7 +3932,7 @@ var CatalogService = class {
|
|
|
3606
3932
|
});
|
|
3607
3933
|
}
|
|
3608
3934
|
/** Retrieve a catalog by id. */
|
|
3609
|
-
async getCatalog(catalogId, auth2 =
|
|
3935
|
+
async getCatalog(catalogId, auth2 = SERVICE24) {
|
|
3610
3936
|
return this.ctx.http.request({
|
|
3611
3937
|
method: "GET",
|
|
3612
3938
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -3614,7 +3940,7 @@ var CatalogService = class {
|
|
|
3614
3940
|
});
|
|
3615
3941
|
}
|
|
3616
3942
|
/** Retrieve all catalogs that contain a category. */
|
|
3617
|
-
async getCatalogsForCategory(categoryId, auth2 =
|
|
3943
|
+
async getCatalogsForCategory(categoryId, auth2 = SERVICE24) {
|
|
3618
3944
|
return this.ctx.http.request({
|
|
3619
3945
|
method: "GET",
|
|
3620
3946
|
path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
|
|
@@ -3622,11 +3948,11 @@ var CatalogService = class {
|
|
|
3622
3948
|
});
|
|
3623
3949
|
}
|
|
3624
3950
|
/** Create a catalog. */
|
|
3625
|
-
async createCatalog(input, auth2 =
|
|
3951
|
+
async createCatalog(input, auth2 = SERVICE24) {
|
|
3626
3952
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
3627
3953
|
}
|
|
3628
3954
|
/** Upsert a catalog by id (`PUT`). */
|
|
3629
|
-
async updateCatalog(catalogId, input, auth2 =
|
|
3955
|
+
async updateCatalog(catalogId, input, auth2 = SERVICE24) {
|
|
3630
3956
|
return this.ctx.http.request({
|
|
3631
3957
|
method: "PUT",
|
|
3632
3958
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -3635,7 +3961,7 @@ var CatalogService = class {
|
|
|
3635
3961
|
});
|
|
3636
3962
|
}
|
|
3637
3963
|
/** Partially update a catalog by id (`PATCH`). */
|
|
3638
|
-
async patchCatalog(catalogId, patch, auth2 =
|
|
3964
|
+
async patchCatalog(catalogId, patch, auth2 = SERVICE24) {
|
|
3639
3965
|
await this.ctx.http.request({
|
|
3640
3966
|
method: "PATCH",
|
|
3641
3967
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -3644,7 +3970,7 @@ var CatalogService = class {
|
|
|
3644
3970
|
});
|
|
3645
3971
|
}
|
|
3646
3972
|
/** Remove a catalog by id. */
|
|
3647
|
-
async deleteCatalog(catalogId, auth2 =
|
|
3973
|
+
async deleteCatalog(catalogId, auth2 = SERVICE24) {
|
|
3648
3974
|
await this.ctx.http.request({
|
|
3649
3975
|
method: "DELETE",
|
|
3650
3976
|
path: `${this.base()}/${encodeURIComponent(catalogId)}`,
|
|
@@ -3654,7 +3980,7 @@ var CatalogService = class {
|
|
|
3654
3980
|
};
|
|
3655
3981
|
|
|
3656
3982
|
// src/services/vendor.ts
|
|
3657
|
-
var
|
|
3983
|
+
var SERVICE25 = { kind: "service" };
|
|
3658
3984
|
var VendorService = class {
|
|
3659
3985
|
constructor(ctx) {
|
|
3660
3986
|
this.ctx = ctx;
|
|
@@ -3666,7 +3992,7 @@ var VendorService = class {
|
|
|
3666
3992
|
}
|
|
3667
3993
|
// --- Vendors ---
|
|
3668
3994
|
/** List all vendors. */
|
|
3669
|
-
async listVendors(query = {}, auth2 =
|
|
3995
|
+
async listVendors(query = {}, auth2 = SERVICE25) {
|
|
3670
3996
|
return this.ctx.http.request({
|
|
3671
3997
|
method: "GET",
|
|
3672
3998
|
path: `${this.base()}/vendors`,
|
|
@@ -3675,7 +4001,7 @@ var VendorService = class {
|
|
|
3675
4001
|
});
|
|
3676
4002
|
}
|
|
3677
4003
|
/** Retrieve a vendor by id. */
|
|
3678
|
-
async getVendor(vendorId, auth2 =
|
|
4004
|
+
async getVendor(vendorId, auth2 = SERVICE25) {
|
|
3679
4005
|
return this.ctx.http.request({
|
|
3680
4006
|
method: "GET",
|
|
3681
4007
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -3683,7 +4009,7 @@ var VendorService = class {
|
|
|
3683
4009
|
});
|
|
3684
4010
|
}
|
|
3685
4011
|
/** Search vendors (`POST /vendors/search`). A built filter in `q` is resolved to a string. */
|
|
3686
|
-
async searchVendors(query, auth2 =
|
|
4012
|
+
async searchVendors(query, auth2 = SERVICE25) {
|
|
3687
4013
|
const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
3688
4014
|
return this.ctx.http.request({
|
|
3689
4015
|
method: "POST",
|
|
@@ -3693,11 +4019,11 @@ var VendorService = class {
|
|
|
3693
4019
|
});
|
|
3694
4020
|
}
|
|
3695
4021
|
/** Create a vendor. */
|
|
3696
|
-
async createVendor(input, auth2 =
|
|
4022
|
+
async createVendor(input, auth2 = SERVICE25) {
|
|
3697
4023
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
|
|
3698
4024
|
}
|
|
3699
4025
|
/** Upsert a vendor by id (`PUT`). */
|
|
3700
|
-
async updateVendor(vendorId, input, auth2 =
|
|
4026
|
+
async updateVendor(vendorId, input, auth2 = SERVICE25) {
|
|
3701
4027
|
await this.ctx.http.request({
|
|
3702
4028
|
method: "PUT",
|
|
3703
4029
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -3706,7 +4032,7 @@ var VendorService = class {
|
|
|
3706
4032
|
});
|
|
3707
4033
|
}
|
|
3708
4034
|
/** Delete a vendor by id. */
|
|
3709
|
-
async deleteVendor(vendorId, auth2 =
|
|
4035
|
+
async deleteVendor(vendorId, auth2 = SERVICE25) {
|
|
3710
4036
|
await this.ctx.http.request({
|
|
3711
4037
|
method: "DELETE",
|
|
3712
4038
|
path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
|
|
@@ -3715,7 +4041,7 @@ var VendorService = class {
|
|
|
3715
4041
|
}
|
|
3716
4042
|
// --- Vendor locations ---
|
|
3717
4043
|
/** List all vendor locations. */
|
|
3718
|
-
async listVendorLocations(query = {}, auth2 =
|
|
4044
|
+
async listVendorLocations(query = {}, auth2 = SERVICE25) {
|
|
3719
4045
|
return this.ctx.http.request({
|
|
3720
4046
|
method: "GET",
|
|
3721
4047
|
path: `${this.base()}/locations`,
|
|
@@ -3724,7 +4050,7 @@ var VendorService = class {
|
|
|
3724
4050
|
});
|
|
3725
4051
|
}
|
|
3726
4052
|
/** Retrieve a vendor location by id. */
|
|
3727
|
-
async getVendorLocation(locationId, auth2 =
|
|
4053
|
+
async getVendorLocation(locationId, auth2 = SERVICE25) {
|
|
3728
4054
|
return this.ctx.http.request({
|
|
3729
4055
|
method: "GET",
|
|
3730
4056
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -3732,11 +4058,11 @@ var VendorService = class {
|
|
|
3732
4058
|
});
|
|
3733
4059
|
}
|
|
3734
4060
|
/** Create a vendor location. */
|
|
3735
|
-
async createVendorLocation(input, auth2 =
|
|
4061
|
+
async createVendorLocation(input, auth2 = SERVICE25) {
|
|
3736
4062
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
|
|
3737
4063
|
}
|
|
3738
4064
|
/** Upsert a vendor location by id (`PUT`). */
|
|
3739
|
-
async updateVendorLocation(locationId, input, auth2 =
|
|
4065
|
+
async updateVendorLocation(locationId, input, auth2 = SERVICE25) {
|
|
3740
4066
|
await this.ctx.http.request({
|
|
3741
4067
|
method: "PUT",
|
|
3742
4068
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -3745,7 +4071,7 @@ var VendorService = class {
|
|
|
3745
4071
|
});
|
|
3746
4072
|
}
|
|
3747
4073
|
/** Delete a vendor location by id. */
|
|
3748
|
-
async deleteVendorLocation(locationId, auth2 =
|
|
4074
|
+
async deleteVendorLocation(locationId, auth2 = SERVICE25) {
|
|
3749
4075
|
await this.ctx.http.request({
|
|
3750
4076
|
method: "DELETE",
|
|
3751
4077
|
path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
|
|
@@ -3755,7 +4081,7 @@ var VendorService = class {
|
|
|
3755
4081
|
};
|
|
3756
4082
|
|
|
3757
4083
|
// src/services/pick-pack.ts
|
|
3758
|
-
var
|
|
4084
|
+
var SERVICE26 = { kind: "service" };
|
|
3759
4085
|
var PickPackService = class {
|
|
3760
4086
|
constructor(ctx) {
|
|
3761
4087
|
this.ctx = ctx;
|
|
@@ -3769,7 +4095,7 @@ var PickPackService = class {
|
|
|
3769
4095
|
return `${this.base()}/orders/${encodeURIComponent(orderId)}`;
|
|
3770
4096
|
}
|
|
3771
4097
|
/** List packlist orders. */
|
|
3772
|
-
async listOrders(query = {}, auth2 =
|
|
4098
|
+
async listOrders(query = {}, auth2 = SERVICE26) {
|
|
3773
4099
|
return this.ctx.http.request({
|
|
3774
4100
|
method: "GET",
|
|
3775
4101
|
path: `${this.base()}/orders`,
|
|
@@ -3778,19 +4104,19 @@ var PickPackService = class {
|
|
|
3778
4104
|
});
|
|
3779
4105
|
}
|
|
3780
4106
|
/** Retrieve a packlist order by id. */
|
|
3781
|
-
async getOrder(orderId, auth2 =
|
|
4107
|
+
async getOrder(orderId, auth2 = SERVICE26) {
|
|
3782
4108
|
return this.ctx.http.request({ method: "GET", path: this.orderPath(orderId), auth: auth2 });
|
|
3783
4109
|
}
|
|
3784
4110
|
/** Update an order's status (`PATCH`). Returns an acknowledgement. */
|
|
3785
|
-
async updateOrder(orderId, change, auth2 =
|
|
4111
|
+
async updateOrder(orderId, change, auth2 = SERVICE26) {
|
|
3786
4112
|
return this.ctx.http.request({ method: "PATCH", path: this.orderPath(orderId), auth: auth2, body: change });
|
|
3787
4113
|
}
|
|
3788
4114
|
/** Finish an order. Returns an acknowledgement. */
|
|
3789
|
-
async finishOrder(orderId, auth2 =
|
|
4115
|
+
async finishOrder(orderId, auth2 = SERVICE26) {
|
|
3790
4116
|
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/finish`, auth: auth2 });
|
|
3791
4117
|
}
|
|
3792
4118
|
/** List order cycles (ids). */
|
|
3793
|
-
async listOrderCycles(query = {}, auth2 =
|
|
4119
|
+
async listOrderCycles(query = {}, auth2 = SERVICE26) {
|
|
3794
4120
|
return this.ctx.http.request({
|
|
3795
4121
|
method: "GET",
|
|
3796
4122
|
path: `${this.base()}/orderCycles`,
|
|
@@ -3799,11 +4125,11 @@ var PickPackService = class {
|
|
|
3799
4125
|
});
|
|
3800
4126
|
}
|
|
3801
4127
|
/** Add an assignee to an order. Returns an acknowledgement. */
|
|
3802
|
-
async addAssignee(orderId, assignee, auth2 =
|
|
4128
|
+
async addAssignee(orderId, assignee, auth2 = SERVICE26) {
|
|
3803
4129
|
return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/assignees`, auth: auth2, body: assignee });
|
|
3804
4130
|
}
|
|
3805
4131
|
/** Remove an assignee from an order. */
|
|
3806
|
-
async removeAssignee(orderId, assigneeId, auth2 =
|
|
4132
|
+
async removeAssignee(orderId, assigneeId, auth2 = SERVICE26) {
|
|
3807
4133
|
await this.ctx.http.request({
|
|
3808
4134
|
method: "DELETE",
|
|
3809
4135
|
path: `${this.orderPath(orderId)}/assignees/${encodeURIComponent(assigneeId)}`,
|
|
@@ -3811,15 +4137,15 @@ var PickPackService = class {
|
|
|
3811
4137
|
});
|
|
3812
4138
|
}
|
|
3813
4139
|
/** Update packaging products for an order (`PUT`). Returns an acknowledgement. */
|
|
3814
|
-
async updatePackaging(orderId, change, auth2 =
|
|
4140
|
+
async updatePackaging(orderId, change, auth2 = SERVICE26) {
|
|
3815
4141
|
return this.ctx.http.request({ method: "PUT", path: `${this.orderPath(orderId)}/packaging`, auth: auth2, body: change });
|
|
3816
4142
|
}
|
|
3817
4143
|
/** Create a packing event. Returns an acknowledgement. */
|
|
3818
|
-
async createEvent(event, auth2 =
|
|
4144
|
+
async createEvent(event, auth2 = SERVICE26) {
|
|
3819
4145
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/events`, auth: auth2, body: event });
|
|
3820
4146
|
}
|
|
3821
4147
|
/** List packing events. */
|
|
3822
|
-
async listEvents(query = {}, auth2 =
|
|
4148
|
+
async listEvents(query = {}, auth2 = SERVICE26) {
|
|
3823
4149
|
return this.ctx.http.request({
|
|
3824
4150
|
method: "GET",
|
|
3825
4151
|
path: `${this.base()}/events`,
|
|
@@ -3828,7 +4154,7 @@ var PickPackService = class {
|
|
|
3828
4154
|
});
|
|
3829
4155
|
}
|
|
3830
4156
|
/** Trigger an order recalculation. Returns the created job's id. */
|
|
3831
|
-
async triggerRecalculation(input, auth2 =
|
|
4157
|
+
async triggerRecalculation(input, auth2 = SERVICE26) {
|
|
3832
4158
|
return this.ctx.http.request({
|
|
3833
4159
|
method: "POST",
|
|
3834
4160
|
path: `${this.base()}/jobs/recalculations`,
|
|
@@ -3837,7 +4163,7 @@ var PickPackService = class {
|
|
|
3837
4163
|
});
|
|
3838
4164
|
}
|
|
3839
4165
|
/** Retrieve a recalculation job by id. */
|
|
3840
|
-
async getRecalculationJob(jobId, auth2 =
|
|
4166
|
+
async getRecalculationJob(jobId, auth2 = SERVICE26) {
|
|
3841
4167
|
return this.ctx.http.request({
|
|
3842
4168
|
method: "GET",
|
|
3843
4169
|
path: `${this.base()}/jobs/recalculations/${encodeURIComponent(jobId)}`,
|
|
@@ -3847,7 +4173,7 @@ var PickPackService = class {
|
|
|
3847
4173
|
};
|
|
3848
4174
|
|
|
3849
4175
|
// src/services/customer-admin.ts
|
|
3850
|
-
var
|
|
4176
|
+
var SERVICE27 = { kind: "service" };
|
|
3851
4177
|
var CustomerAdminService = class {
|
|
3852
4178
|
constructor(ctx) {
|
|
3853
4179
|
this.ctx = ctx;
|
|
@@ -3865,7 +4191,7 @@ var CustomerAdminService = class {
|
|
|
3865
4191
|
}
|
|
3866
4192
|
// --- Customers ---
|
|
3867
4193
|
/** List customers. */
|
|
3868
|
-
async listCustomers(query = {}, auth2 =
|
|
4194
|
+
async listCustomers(query = {}, auth2 = SERVICE27) {
|
|
3869
4195
|
return this.ctx.http.request({
|
|
3870
4196
|
method: "GET",
|
|
3871
4197
|
path: this.base(),
|
|
@@ -3874,33 +4200,33 @@ var CustomerAdminService = class {
|
|
|
3874
4200
|
});
|
|
3875
4201
|
}
|
|
3876
4202
|
/** Search customers (`POST /customers/search`). A built filter in `q` is resolved to a string. */
|
|
3877
|
-
async searchCustomers(query, auth2 =
|
|
4203
|
+
async searchCustomers(query, auth2 = SERVICE27) {
|
|
3878
4204
|
const body = query.q !== void 0 ? { ...query, q: resolveQuery(query.q, { compoundLogicalQuery: false }) } : query;
|
|
3879
4205
|
return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body });
|
|
3880
4206
|
}
|
|
3881
4207
|
/** Retrieve a customer profile by number. */
|
|
3882
|
-
async getCustomer(customerNumber, auth2 =
|
|
4208
|
+
async getCustomer(customerNumber, auth2 = SERVICE27) {
|
|
3883
4209
|
return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
|
|
3884
4210
|
}
|
|
3885
4211
|
/** Create a customer. */
|
|
3886
|
-
async createCustomer(input, auth2 =
|
|
4212
|
+
async createCustomer(input, auth2 = SERVICE27) {
|
|
3887
4213
|
return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
|
|
3888
4214
|
}
|
|
3889
4215
|
/** Upsert a customer profile by number (`PUT`). */
|
|
3890
|
-
async upsertCustomer(customerNumber, input, auth2 =
|
|
4216
|
+
async upsertCustomer(customerNumber, input, auth2 = SERVICE27) {
|
|
3891
4217
|
return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
|
|
3892
4218
|
}
|
|
3893
4219
|
/** Partially update a customer profile (`PATCH`). */
|
|
3894
|
-
async patchCustomer(customerNumber, patch, auth2 =
|
|
4220
|
+
async patchCustomer(customerNumber, patch, auth2 = SERVICE27) {
|
|
3895
4221
|
await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
|
|
3896
4222
|
}
|
|
3897
4223
|
/** Delete a customer profile. */
|
|
3898
|
-
async deleteCustomer(customerNumber, auth2 =
|
|
4224
|
+
async deleteCustomer(customerNumber, auth2 = SERVICE27) {
|
|
3899
4225
|
await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
|
|
3900
4226
|
}
|
|
3901
4227
|
// --- Addresses ---
|
|
3902
4228
|
/** List a customer's addresses. */
|
|
3903
|
-
async listAddresses(customerNumber, auth2 =
|
|
4229
|
+
async listAddresses(customerNumber, auth2 = SERVICE27) {
|
|
3904
4230
|
return this.ctx.http.request({
|
|
3905
4231
|
method: "GET",
|
|
3906
4232
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -3908,11 +4234,11 @@ var CustomerAdminService = class {
|
|
|
3908
4234
|
});
|
|
3909
4235
|
}
|
|
3910
4236
|
/** Retrieve one address. */
|
|
3911
|
-
async getAddress(customerNumber, addressId, auth2 =
|
|
4237
|
+
async getAddress(customerNumber, addressId, auth2 = SERVICE27) {
|
|
3912
4238
|
return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
3913
4239
|
}
|
|
3914
4240
|
/** Add an address. */
|
|
3915
|
-
async addAddress(customerNumber, input, auth2 =
|
|
4241
|
+
async addAddress(customerNumber, input, auth2 = SERVICE27) {
|
|
3916
4242
|
return this.ctx.http.request({
|
|
3917
4243
|
method: "POST",
|
|
3918
4244
|
path: `${this.customerPath(customerNumber)}/addresses`,
|
|
@@ -3921,19 +4247,19 @@ var CustomerAdminService = class {
|
|
|
3921
4247
|
});
|
|
3922
4248
|
}
|
|
3923
4249
|
/** Upsert an address by id (`PUT`). */
|
|
3924
|
-
async upsertAddress(customerNumber, addressId, input, auth2 =
|
|
4250
|
+
async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE27) {
|
|
3925
4251
|
return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
|
|
3926
4252
|
}
|
|
3927
4253
|
/** Partially update an address by id (`PATCH`). */
|
|
3928
|
-
async patchAddress(customerNumber, addressId, patch, auth2 =
|
|
4254
|
+
async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE27) {
|
|
3929
4255
|
await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
|
|
3930
4256
|
}
|
|
3931
4257
|
/** Delete an address by id. */
|
|
3932
|
-
async deleteAddress(customerNumber, addressId, auth2 =
|
|
4258
|
+
async deleteAddress(customerNumber, addressId, auth2 = SERVICE27) {
|
|
3933
4259
|
await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
|
|
3934
4260
|
}
|
|
3935
4261
|
/** Add tags to an address (`?tags=` query). */
|
|
3936
|
-
async addAddressTags(customerNumber, addressId, tags, auth2 =
|
|
4262
|
+
async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE27) {
|
|
3937
4263
|
await this.ctx.http.request({
|
|
3938
4264
|
method: "POST",
|
|
3939
4265
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -3942,7 +4268,7 @@ var CustomerAdminService = class {
|
|
|
3942
4268
|
});
|
|
3943
4269
|
}
|
|
3944
4270
|
/** Remove tags from an address (`?tags=` query). */
|
|
3945
|
-
async removeAddressTags(customerNumber, addressId, tags, auth2 =
|
|
4271
|
+
async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE27) {
|
|
3946
4272
|
await this.ctx.http.request({
|
|
3947
4273
|
method: "DELETE",
|
|
3948
4274
|
path: `${this.addressPath(customerNumber, addressId)}/tags`,
|
|
@@ -3953,7 +4279,7 @@ var CustomerAdminService = class {
|
|
|
3953
4279
|
};
|
|
3954
4280
|
|
|
3955
4281
|
// src/services/approval.ts
|
|
3956
|
-
var
|
|
4282
|
+
var SERVICE28 = { kind: "service" };
|
|
3957
4283
|
var ApprovalService = class {
|
|
3958
4284
|
constructor(ctx) {
|
|
3959
4285
|
this.ctx = ctx;
|
|
@@ -3964,7 +4290,7 @@ var ApprovalService = class {
|
|
|
3964
4290
|
return `/approval/${this.ctx.tenant}`;
|
|
3965
4291
|
}
|
|
3966
4292
|
/** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
|
|
3967
|
-
async listApprovals(query = {}, auth2 =
|
|
4293
|
+
async listApprovals(query = {}, auth2 = SERVICE28) {
|
|
3968
4294
|
return this.ctx.http.request({
|
|
3969
4295
|
method: "GET",
|
|
3970
4296
|
path: `${this.base()}/approvals`,
|
|
@@ -3973,7 +4299,7 @@ var ApprovalService = class {
|
|
|
3973
4299
|
});
|
|
3974
4300
|
}
|
|
3975
4301
|
/** Retrieve a single approval by id. */
|
|
3976
|
-
async getApproval(approvalId, auth2 =
|
|
4302
|
+
async getApproval(approvalId, auth2 = SERVICE28) {
|
|
3977
4303
|
return this.ctx.http.request({
|
|
3978
4304
|
method: "GET",
|
|
3979
4305
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -3981,7 +4307,7 @@ var ApprovalService = class {
|
|
|
3981
4307
|
});
|
|
3982
4308
|
}
|
|
3983
4309
|
/** Create an approval request (cart or quote). Returns the created `{ id }`. */
|
|
3984
|
-
async createApproval(input, auth2 =
|
|
4310
|
+
async createApproval(input, auth2 = SERVICE28) {
|
|
3985
4311
|
return this.ctx.http.request({
|
|
3986
4312
|
method: "POST",
|
|
3987
4313
|
path: `${this.base()}/approvals`,
|
|
@@ -3990,7 +4316,7 @@ var ApprovalService = class {
|
|
|
3990
4316
|
});
|
|
3991
4317
|
}
|
|
3992
4318
|
/** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
|
|
3993
|
-
async updateApproval(approvalId, ops, auth2 =
|
|
4319
|
+
async updateApproval(approvalId, ops, auth2 = SERVICE28) {
|
|
3994
4320
|
await this.ctx.http.request({
|
|
3995
4321
|
method: "PATCH",
|
|
3996
4322
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -3999,7 +4325,7 @@ var ApprovalService = class {
|
|
|
3999
4325
|
});
|
|
4000
4326
|
}
|
|
4001
4327
|
/** Delete an approval by id. */
|
|
4002
|
-
async deleteApproval(approvalId, auth2 =
|
|
4328
|
+
async deleteApproval(approvalId, auth2 = SERVICE28) {
|
|
4003
4329
|
await this.ctx.http.request({
|
|
4004
4330
|
method: "DELETE",
|
|
4005
4331
|
path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
|
|
@@ -4007,7 +4333,7 @@ var ApprovalService = class {
|
|
|
4007
4333
|
});
|
|
4008
4334
|
}
|
|
4009
4335
|
/** Check whether an operation on a resource is permitted / needs approval. */
|
|
4010
|
-
async checkPermitted(input, auth2 =
|
|
4336
|
+
async checkPermitted(input, auth2 = SERVICE28) {
|
|
4011
4337
|
return this.ctx.http.request({
|
|
4012
4338
|
method: "POST",
|
|
4013
4339
|
path: `${this.base()}/approval/permitted`,
|
|
@@ -4016,7 +4342,7 @@ var ApprovalService = class {
|
|
|
4016
4342
|
});
|
|
4017
4343
|
}
|
|
4018
4344
|
/** Search for users eligible to approve a resource. Returns an array. */
|
|
4019
|
-
async searchApprovers(input, auth2 =
|
|
4345
|
+
async searchApprovers(input, auth2 = SERVICE28) {
|
|
4020
4346
|
return this.ctx.http.request({
|
|
4021
4347
|
method: "POST",
|
|
4022
4348
|
path: `${this.base()}/search/users`,
|
|
@@ -4043,6 +4369,7 @@ var EmporixClient = class {
|
|
|
4043
4369
|
contacts;
|
|
4044
4370
|
locations;
|
|
4045
4371
|
customerGroups;
|
|
4372
|
+
iam;
|
|
4046
4373
|
orders;
|
|
4047
4374
|
salesOrders;
|
|
4048
4375
|
availability;
|
|
@@ -4116,6 +4443,7 @@ var EmporixClient = class {
|
|
|
4116
4443
|
this.contacts = new ContactsService(mk(ContactsService.channel));
|
|
4117
4444
|
this.locations = new LocationsService(mk(LocationsService.channel));
|
|
4118
4445
|
this.customerGroups = new CustomerGroupsService(mk(CustomerGroupsService.channel));
|
|
4446
|
+
this.iam = new IamService(mk(IamService.channel));
|
|
4119
4447
|
this.orders = new OrdersService(mk(OrdersService.channel));
|
|
4120
4448
|
this.salesOrders = new SalesOrdersService(mk(SalesOrdersService.channel));
|
|
4121
4449
|
this.availability = new AvailabilityService(mk(AvailabilityService.channel));
|