@viu/emporix-sdk 2.3.0 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -3222,8 +3222,1727 @@ var AiService = class {
3222
3222
  }
3223
3223
  };
3224
3224
 
3225
+ // src/services/tax.ts
3226
+ var SERVICE11 = { kind: "service" };
3227
+ var TaxService = class {
3228
+ constructor(ctx) {
3229
+ this.ctx = ctx;
3230
+ }
3231
+ ctx;
3232
+ base() {
3233
+ return `/tax/${this.ctx.tenant}`;
3234
+ }
3235
+ /** List all per-location tax configurations. */
3236
+ async listTaxConfigs(auth2 = SERVICE11) {
3237
+ return this.ctx.http.request({
3238
+ method: "GET",
3239
+ path: `${this.base()}/taxes`,
3240
+ auth: auth2
3241
+ });
3242
+ }
3243
+ /** Retrieve one tax configuration by its location (country) code. */
3244
+ async getTaxConfig(locationCode, auth2 = SERVICE11) {
3245
+ return this.ctx.http.request({
3246
+ method: "GET",
3247
+ path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
3248
+ auth: auth2
3249
+ });
3250
+ }
3251
+ /** Create a tax configuration (`POST`). Returns the created `{ locationCode }`. */
3252
+ async createTaxConfig(input, auth2 = SERVICE11) {
3253
+ return this.ctx.http.request({
3254
+ method: "POST",
3255
+ path: `${this.base()}/taxes`,
3256
+ auth: auth2,
3257
+ body: input
3258
+ });
3259
+ }
3260
+ /**
3261
+ * Update a tax configuration by location code (`PUT`). `metadata.version` is
3262
+ * required (optimistic locking — a stale version yields 409).
3263
+ */
3264
+ async updateTaxConfig(locationCode, input, auth2 = SERVICE11) {
3265
+ return this.ctx.http.request({
3266
+ method: "PUT",
3267
+ path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
3268
+ auth: auth2,
3269
+ body: input
3270
+ });
3271
+ }
3272
+ /** Delete a tax configuration by location code. */
3273
+ async deleteTaxConfig(locationCode, auth2 = SERVICE11) {
3274
+ await this.ctx.http.request({
3275
+ method: "DELETE",
3276
+ path: `${this.base()}/taxes/${encodeURIComponent(locationCode)}`,
3277
+ auth: auth2
3278
+ });
3279
+ }
3280
+ /**
3281
+ * Calculate net/gross values for a price (`PUT /taxes/calculation-commands`).
3282
+ * Single command in, single result out.
3283
+ */
3284
+ async calculateTax(request, auth2 = SERVICE11) {
3285
+ return this.ctx.http.request({
3286
+ method: "PUT",
3287
+ path: `${this.base()}/taxes/calculation-commands`,
3288
+ auth: auth2,
3289
+ body: request
3290
+ });
3291
+ }
3292
+ };
3293
+
3294
+ // src/services/coupon.ts
3295
+ var SERVICE12 = { kind: "service" };
3296
+ var CouponService = class {
3297
+ constructor(ctx) {
3298
+ this.ctx = ctx;
3299
+ }
3300
+ ctx;
3301
+ base() {
3302
+ return `/coupon/${this.ctx.tenant}`;
3303
+ }
3304
+ /** List coupons by criteria. Returns a plain array. */
3305
+ async listCoupons(query = {}, auth2 = SERVICE12) {
3306
+ return this.ctx.http.request({
3307
+ method: "GET",
3308
+ path: `${this.base()}/coupons`,
3309
+ auth: auth2,
3310
+ ...Object.keys(query).length ? { query } : {}
3311
+ });
3312
+ }
3313
+ /** Retrieve one coupon by code. */
3314
+ async getCoupon(code, auth2 = SERVICE12) {
3315
+ return this.ctx.http.request({
3316
+ method: "GET",
3317
+ path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
3318
+ auth: auth2
3319
+ });
3320
+ }
3321
+ /** Create a coupon (`POST`, HTTP 201). Returns the created resource's `{ id?, yrn? }`. */
3322
+ async createCoupon(input, auth2 = SERVICE12) {
3323
+ return this.ctx.http.request({
3324
+ method: "POST",
3325
+ path: `${this.base()}/coupons`,
3326
+ auth: auth2,
3327
+ body: input
3328
+ });
3329
+ }
3330
+ /** Replace a coupon by code (`PUT`). Resolves once the update is accepted. */
3331
+ async updateCoupon(code, input, auth2 = SERVICE12) {
3332
+ await this.ctx.http.request({
3333
+ method: "PUT",
3334
+ path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
3335
+ auth: auth2,
3336
+ body: input
3337
+ });
3338
+ }
3339
+ /** Partially update a coupon by code (`PATCH` merge body). */
3340
+ async patchCoupon(code, patch, auth2 = SERVICE12) {
3341
+ await this.ctx.http.request({
3342
+ method: "PATCH",
3343
+ path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
3344
+ auth: auth2,
3345
+ body: patch
3346
+ });
3347
+ }
3348
+ /** Delete a coupon by code. */
3349
+ async deleteCoupon(code, auth2 = SERVICE12) {
3350
+ await this.ctx.http.request({
3351
+ method: "DELETE",
3352
+ path: `${this.base()}/coupons/${encodeURIComponent(code)}`,
3353
+ auth: auth2
3354
+ });
3355
+ }
3356
+ /**
3357
+ * Check whether a coupon can be redeemed (`POST /validation`). Resolves when
3358
+ * redeemable; throws an `EmporixError` otherwise (no response body).
3359
+ */
3360
+ async validateCoupon(code, redemption, auth2 = SERVICE12) {
3361
+ await this.ctx.http.request({
3362
+ method: "POST",
3363
+ path: `${this.base()}/coupons/${encodeURIComponent(code)}/validation`,
3364
+ auth: auth2,
3365
+ body: redemption
3366
+ });
3367
+ }
3368
+ /** List a coupon's redemptions by criteria. */
3369
+ async listRedemptions(code, query = {}, auth2 = SERVICE12) {
3370
+ return this.ctx.http.request({
3371
+ method: "GET",
3372
+ path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
3373
+ auth: auth2,
3374
+ ...Object.keys(query).length ? { query } : {}
3375
+ });
3376
+ }
3377
+ /** Redeem a coupon by creating a redemption (`POST`, HTTP 201). Returns the resource location. */
3378
+ async redeemCoupon(code, redemption, auth2 = SERVICE12) {
3379
+ return this.ctx.http.request({
3380
+ method: "POST",
3381
+ path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions`,
3382
+ auth: auth2,
3383
+ body: redemption
3384
+ });
3385
+ }
3386
+ /** Retrieve one redemption by id. */
3387
+ async getRedemption(code, id, auth2 = SERVICE12) {
3388
+ return this.ctx.http.request({
3389
+ method: "GET",
3390
+ path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
3391
+ auth: auth2
3392
+ });
3393
+ }
3394
+ /** Delete a redemption by id. */
3395
+ async deleteRedemption(code, id, auth2 = SERVICE12) {
3396
+ await this.ctx.http.request({
3397
+ method: "DELETE",
3398
+ path: `${this.base()}/coupons/${encodeURIComponent(code)}/redemptions/${encodeURIComponent(id)}`,
3399
+ auth: auth2
3400
+ });
3401
+ }
3402
+ /** Retrieve a customer's referral coupon (resolves to an empty body when none exists). */
3403
+ async getReferralCoupon(customerNumber, auth2 = SERVICE12) {
3404
+ return this.ctx.http.request({
3405
+ method: "GET",
3406
+ path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
3407
+ auth: auth2
3408
+ });
3409
+ }
3410
+ /** Create a referral coupon code for a customer (no request body). */
3411
+ async createReferralCoupon(customerNumber, auth2 = SERVICE12) {
3412
+ return this.ctx.http.request({
3413
+ method: "POST",
3414
+ path: `${this.base()}/referral-coupons/${encodeURIComponent(customerNumber)}`,
3415
+ auth: auth2
3416
+ });
3417
+ }
3418
+ };
3419
+
3420
+ // src/services/reward-points.ts
3421
+ var SERVICE13 = { kind: "service" };
3422
+ var RewardPointsService = class {
3423
+ constructor(ctx) {
3424
+ this.ctx = ctx;
3425
+ }
3426
+ ctx;
3427
+ /** Base without tenant (customer / public / batch endpoints). */
3428
+ base() {
3429
+ return `/reward-points`;
3430
+ }
3431
+ /** Tenant-scoped base (redeem options only). */
3432
+ tenantBase() {
3433
+ return `/reward-points/${this.ctx.tenant}`;
3434
+ }
3435
+ // --- Admin: customer points management (service token) ---
3436
+ /** Batch summary across all customers. */
3437
+ async listAllSummaries(query = {}, auth2 = SERVICE13) {
3438
+ return this.ctx.http.request({
3439
+ method: "GET",
3440
+ path: `${this.base()}/summaryBatch`,
3441
+ auth: auth2,
3442
+ ...Object.keys(query).length ? { query } : {}
3443
+ });
3444
+ }
3445
+ /** Retrieve one customer's reward-points balance. */
3446
+ async getCustomerPoints(customerId, auth2 = SERVICE13) {
3447
+ return this.ctx.http.request({
3448
+ method: "GET",
3449
+ path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
3450
+ auth: auth2
3451
+ });
3452
+ }
3453
+ /** Create a reward-points entry for a customer. */
3454
+ async createCustomerPoints(customerId, input, auth2 = SERVICE13) {
3455
+ await this.ctx.http.request({
3456
+ method: "POST",
3457
+ path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
3458
+ auth: auth2,
3459
+ body: input
3460
+ });
3461
+ }
3462
+ /** Delete a customer's reward points. */
3463
+ async deleteCustomerPoints(customerId, auth2 = SERVICE13) {
3464
+ await this.ctx.http.request({
3465
+ method: "DELETE",
3466
+ path: `${this.base()}/customer/${encodeURIComponent(customerId)}`,
3467
+ auth: auth2
3468
+ });
3469
+ }
3470
+ /** Retrieve a reward-points summary for one customer. */
3471
+ async getCustomerSummary(customerId, auth2 = SERVICE13) {
3472
+ return this.ctx.http.request({
3473
+ method: "GET",
3474
+ path: `${this.base()}/customer/${encodeURIComponent(customerId)}/summary`,
3475
+ auth: auth2
3476
+ });
3477
+ }
3478
+ /** Add reward points for a customer. */
3479
+ async addPoints(customerId, input, auth2 = SERVICE13) {
3480
+ await this.ctx.http.request({
3481
+ method: "POST",
3482
+ path: `${this.base()}/customer/${encodeURIComponent(customerId)}/addPoints`,
3483
+ auth: auth2,
3484
+ body: input
3485
+ });
3486
+ }
3487
+ /** Redeem a customer's reward points (on behalf). */
3488
+ async redeemPoints(customerId, input, auth2 = SERVICE13) {
3489
+ await this.ctx.http.request({
3490
+ method: "POST",
3491
+ path: `${this.base()}/customer/${encodeURIComponent(customerId)}/redeemPoints`,
3492
+ auth: auth2,
3493
+ body: input
3494
+ });
3495
+ }
3496
+ // --- Storefront: the signed-in customer's own points (customer token required) ---
3497
+ /** The signed-in customer's reward-points balance. Requires a customer `auth`. */
3498
+ async getMyPoints(auth2) {
3499
+ return this.ctx.http.request({
3500
+ method: "GET",
3501
+ path: `${this.base()}/public/customer`,
3502
+ auth: auth2
3503
+ });
3504
+ }
3505
+ /** The signed-in customer's reward-points summary. Requires a customer `auth`. */
3506
+ async getMySummary(auth2) {
3507
+ return this.ctx.http.request({
3508
+ method: "GET",
3509
+ path: `${this.base()}/public/customer/summary`,
3510
+ auth: auth2
3511
+ });
3512
+ }
3513
+ /**
3514
+ * Redeem the signed-in customer's points for a coupon code. Requires a
3515
+ * customer `auth`. Returns the issued coupon `{ code }`.
3516
+ */
3517
+ async redeemMyPoints(input, auth2) {
3518
+ return this.ctx.http.request({
3519
+ method: "POST",
3520
+ path: `${this.base()}/public/customer/redeem`,
3521
+ auth: auth2,
3522
+ body: input
3523
+ });
3524
+ }
3525
+ // --- Redeem options (tenant-scoped; read open to customer, management service-only) ---
3526
+ /** List redeem options. Defaults to the service token; pass a customer `auth` for storefront reads. */
3527
+ async listRedeemOptions(auth2 = SERVICE13) {
3528
+ return this.ctx.http.request({
3529
+ method: "GET",
3530
+ path: `${this.tenantBase()}/redeemOptions`,
3531
+ auth: auth2
3532
+ });
3533
+ }
3534
+ /** Create a redeem option. Returns the updated options list. */
3535
+ async createRedeemOption(input, auth2 = SERVICE13) {
3536
+ return this.ctx.http.request({
3537
+ method: "POST",
3538
+ path: `${this.tenantBase()}/redeemOptions`,
3539
+ auth: auth2,
3540
+ body: input
3541
+ });
3542
+ }
3543
+ /** Update a redeem option by id. Resolves once accepted (no response body). */
3544
+ async updateRedeemOption(redeemOptionId, input, auth2 = SERVICE13) {
3545
+ await this.ctx.http.request({
3546
+ method: "PUT",
3547
+ path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
3548
+ auth: auth2,
3549
+ body: input
3550
+ });
3551
+ }
3552
+ /** Delete a redeem option by id. */
3553
+ async deleteRedeemOption(redeemOptionId, auth2 = SERVICE13) {
3554
+ await this.ctx.http.request({
3555
+ method: "DELETE",
3556
+ path: `${this.tenantBase()}/redeemOptions/${encodeURIComponent(redeemOptionId)}`,
3557
+ auth: auth2
3558
+ });
3559
+ }
3560
+ };
3561
+
3562
+ // src/services/brand.ts
3563
+ var SERVICE14 = { kind: "service" };
3564
+ var BrandService = class {
3565
+ constructor(ctx) {
3566
+ this.ctx = ctx;
3567
+ }
3568
+ ctx;
3569
+ base() {
3570
+ return `/brand/brands`;
3571
+ }
3572
+ /** List all brands. */
3573
+ async listBrands(query = {}, auth2 = SERVICE14) {
3574
+ return this.ctx.http.request({
3575
+ method: "GET",
3576
+ path: this.base(),
3577
+ auth: auth2,
3578
+ ...Object.keys(query).length ? { query } : {}
3579
+ });
3580
+ }
3581
+ /** Retrieve one brand by id. */
3582
+ async getBrand(brandId, auth2 = SERVICE14) {
3583
+ return this.ctx.http.request({
3584
+ method: "GET",
3585
+ path: `${this.base()}/${encodeURIComponent(brandId)}`,
3586
+ auth: auth2
3587
+ });
3588
+ }
3589
+ /** Create a brand. */
3590
+ async createBrand(input, auth2 = SERVICE14) {
3591
+ return this.ctx.http.request({
3592
+ method: "POST",
3593
+ path: this.base(),
3594
+ auth: auth2,
3595
+ body: input
3596
+ });
3597
+ }
3598
+ /** Replace a brand by id. */
3599
+ async updateBrand(brandId, input, auth2 = SERVICE14) {
3600
+ return this.ctx.http.request({
3601
+ method: "PUT",
3602
+ path: `${this.base()}/${encodeURIComponent(brandId)}`,
3603
+ auth: auth2,
3604
+ body: input
3605
+ });
3606
+ }
3607
+ /** Partially update a brand by id. */
3608
+ async patchBrand(brandId, patch, auth2 = SERVICE14) {
3609
+ return this.ctx.http.request({
3610
+ method: "PATCH",
3611
+ path: `${this.base()}/${encodeURIComponent(brandId)}`,
3612
+ auth: auth2,
3613
+ body: patch
3614
+ });
3615
+ }
3616
+ /** Delete a brand by id. */
3617
+ async deleteBrand(brandId, auth2 = SERVICE14) {
3618
+ await this.ctx.http.request({
3619
+ method: "DELETE",
3620
+ path: `${this.base()}/${encodeURIComponent(brandId)}`,
3621
+ auth: auth2
3622
+ });
3623
+ }
3624
+ };
3625
+
3626
+ // src/services/label.ts
3627
+ var SERVICE15 = { kind: "service" };
3628
+ var LabelService = class {
3629
+ constructor(ctx) {
3630
+ this.ctx = ctx;
3631
+ }
3632
+ ctx;
3633
+ base() {
3634
+ return `/label/labels`;
3635
+ }
3636
+ /** List all labels. */
3637
+ async listLabels(query = {}, auth2 = SERVICE15) {
3638
+ return this.ctx.http.request({
3639
+ method: "GET",
3640
+ path: this.base(),
3641
+ auth: auth2,
3642
+ ...Object.keys(query).length ? { query } : {}
3643
+ });
3644
+ }
3645
+ /** Retrieve one label by id. */
3646
+ async getLabel(labelId, auth2 = SERVICE15) {
3647
+ return this.ctx.http.request({
3648
+ method: "GET",
3649
+ path: `${this.base()}/${encodeURIComponent(labelId)}`,
3650
+ auth: auth2
3651
+ });
3652
+ }
3653
+ /** Create a label. */
3654
+ async createLabel(input, auth2 = SERVICE15) {
3655
+ return this.ctx.http.request({
3656
+ method: "POST",
3657
+ path: this.base(),
3658
+ auth: auth2,
3659
+ body: input
3660
+ });
3661
+ }
3662
+ /** Replace a label by id. */
3663
+ async updateLabel(labelId, input, auth2 = SERVICE15) {
3664
+ return this.ctx.http.request({
3665
+ method: "PUT",
3666
+ path: `${this.base()}/${encodeURIComponent(labelId)}`,
3667
+ auth: auth2,
3668
+ body: input
3669
+ });
3670
+ }
3671
+ /** Partially update a label by id. */
3672
+ async patchLabel(labelId, patch, auth2 = SERVICE15) {
3673
+ return this.ctx.http.request({
3674
+ method: "PATCH",
3675
+ path: `${this.base()}/${encodeURIComponent(labelId)}`,
3676
+ auth: auth2,
3677
+ body: patch
3678
+ });
3679
+ }
3680
+ /** Delete a label by id. */
3681
+ async deleteLabel(labelId, auth2 = SERVICE15) {
3682
+ await this.ctx.http.request({
3683
+ method: "DELETE",
3684
+ path: `${this.base()}/${encodeURIComponent(labelId)}`,
3685
+ auth: auth2
3686
+ });
3687
+ }
3688
+ };
3689
+
3690
+ // src/services/country.ts
3691
+ var SERVICE16 = { kind: "service" };
3692
+ var CountryService = class {
3693
+ constructor(ctx) {
3694
+ this.ctx = ctx;
3695
+ }
3696
+ ctx;
3697
+ base() {
3698
+ return `/country/${this.ctx.tenant}`;
3699
+ }
3700
+ /** List all countries. */
3701
+ async listCountries(query = {}, auth2 = SERVICE16) {
3702
+ return this.ctx.http.request({
3703
+ method: "GET",
3704
+ path: `${this.base()}/countries`,
3705
+ auth: auth2,
3706
+ ...Object.keys(query).length ? { query } : {}
3707
+ });
3708
+ }
3709
+ /** Retrieve one country by code. */
3710
+ async getCountry(countryCode, auth2 = SERVICE16) {
3711
+ return this.ctx.http.request({
3712
+ method: "GET",
3713
+ path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
3714
+ auth: auth2
3715
+ });
3716
+ }
3717
+ /** Partially update a country by code. Resolves once accepted (no response body). */
3718
+ async patchCountry(countryCode, patch, auth2 = SERVICE16) {
3719
+ await this.ctx.http.request({
3720
+ method: "PATCH",
3721
+ path: `${this.base()}/countries/${encodeURIComponent(countryCode)}`,
3722
+ auth: auth2,
3723
+ body: patch
3724
+ });
3725
+ }
3726
+ /** List all regions. */
3727
+ async listRegions(query = {}, auth2 = SERVICE16) {
3728
+ return this.ctx.http.request({
3729
+ method: "GET",
3730
+ path: `${this.base()}/regions`,
3731
+ auth: auth2,
3732
+ ...Object.keys(query).length ? { query } : {}
3733
+ });
3734
+ }
3735
+ /** Retrieve one region by code. */
3736
+ async getRegion(regionCode, auth2 = SERVICE16) {
3737
+ return this.ctx.http.request({
3738
+ method: "GET",
3739
+ path: `${this.base()}/regions/${encodeURIComponent(regionCode)}`,
3740
+ auth: auth2
3741
+ });
3742
+ }
3743
+ };
3744
+
3745
+ // src/services/currency.ts
3746
+ var SERVICE17 = { kind: "service" };
3747
+ var CurrencyService = class {
3748
+ constructor(ctx) {
3749
+ this.ctx = ctx;
3750
+ }
3751
+ ctx;
3752
+ base() {
3753
+ return `/currency/${this.ctx.tenant}`;
3754
+ }
3755
+ // --- Currencies ---
3756
+ /** List all currencies. */
3757
+ async listCurrencies(query = {}, auth2 = SERVICE17) {
3758
+ return this.ctx.http.request({
3759
+ method: "GET",
3760
+ path: `${this.base()}/currencies`,
3761
+ auth: auth2,
3762
+ ...Object.keys(query).length ? { query } : {}
3763
+ });
3764
+ }
3765
+ /** Retrieve one currency by code. */
3766
+ async getCurrency(code, auth2 = SERVICE17) {
3767
+ return this.ctx.http.request({
3768
+ method: "GET",
3769
+ path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
3770
+ auth: auth2
3771
+ });
3772
+ }
3773
+ /** Create a currency. */
3774
+ async createCurrency(input, auth2 = SERVICE17) {
3775
+ return this.ctx.http.request({
3776
+ method: "POST",
3777
+ path: `${this.base()}/currencies`,
3778
+ auth: auth2,
3779
+ body: input
3780
+ });
3781
+ }
3782
+ /** Update a currency by code. */
3783
+ async updateCurrency(code, input, auth2 = SERVICE17) {
3784
+ return this.ctx.http.request({
3785
+ method: "PUT",
3786
+ path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
3787
+ auth: auth2,
3788
+ body: input
3789
+ });
3790
+ }
3791
+ /** Delete a currency by code. */
3792
+ async deleteCurrency(code, auth2 = SERVICE17) {
3793
+ await this.ctx.http.request({
3794
+ method: "DELETE",
3795
+ path: `${this.base()}/currencies/${encodeURIComponent(code)}`,
3796
+ auth: auth2
3797
+ });
3798
+ }
3799
+ // --- Exchange rates ---
3800
+ /** List all exchange rates. */
3801
+ async listExchangeRates(query = {}, auth2 = SERVICE17) {
3802
+ return this.ctx.http.request({
3803
+ method: "GET",
3804
+ path: `${this.base()}/exchanges`,
3805
+ auth: auth2,
3806
+ ...Object.keys(query).length ? { query } : {}
3807
+ });
3808
+ }
3809
+ /** Retrieve one exchange rate by code. */
3810
+ async getExchangeRate(code, auth2 = SERVICE17) {
3811
+ return this.ctx.http.request({
3812
+ method: "GET",
3813
+ path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
3814
+ auth: auth2
3815
+ });
3816
+ }
3817
+ /** Create an exchange rate. */
3818
+ async createExchangeRate(input, auth2 = SERVICE17) {
3819
+ return this.ctx.http.request({
3820
+ method: "POST",
3821
+ path: `${this.base()}/exchanges`,
3822
+ auth: auth2,
3823
+ body: input
3824
+ });
3825
+ }
3826
+ /** Update an exchange rate by code. */
3827
+ async updateExchangeRate(code, input, auth2 = SERVICE17) {
3828
+ return this.ctx.http.request({
3829
+ method: "PUT",
3830
+ path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
3831
+ auth: auth2,
3832
+ body: input
3833
+ });
3834
+ }
3835
+ /** Delete an exchange rate by code. */
3836
+ async deleteExchangeRate(code, auth2 = SERVICE17) {
3837
+ await this.ctx.http.request({
3838
+ method: "DELETE",
3839
+ path: `${this.base()}/exchanges/${encodeURIComponent(code)}`,
3840
+ auth: auth2
3841
+ });
3842
+ }
3843
+ };
3844
+
3845
+ // src/services/shipping.ts
3846
+ var SERVICE18 = { kind: "service" };
3847
+ var ShippingService = class {
3848
+ constructor(ctx) {
3849
+ this.ctx = ctx;
3850
+ }
3851
+ ctx;
3852
+ base() {
3853
+ return `/shipping/${this.ctx.tenant}`;
3854
+ }
3855
+ siteBase(site) {
3856
+ return `${this.base()}/${encodeURIComponent(site)}`;
3857
+ }
3858
+ // --- Sites ---
3859
+ /** Find shipping-related sites by postal code (`POST /findSite`). */
3860
+ async findSites(input, auth2 = SERVICE18) {
3861
+ return this.ctx.http.request({
3862
+ method: "POST",
3863
+ path: `${this.base()}/findSite`,
3864
+ auth: auth2,
3865
+ body: input
3866
+ });
3867
+ }
3868
+ // --- Zones ---
3869
+ /** List shipping zones for a site. */
3870
+ async listZones(site, query = {}, auth2 = SERVICE18) {
3871
+ return this.ctx.http.request({
3872
+ method: "GET",
3873
+ path: `${this.siteBase(site)}/zones`,
3874
+ auth: auth2,
3875
+ ...Object.keys(query).length ? { query } : {}
3876
+ });
3877
+ }
3878
+ /** Retrieve one shipping zone. */
3879
+ async getZone(site, zoneId, auth2 = SERVICE18) {
3880
+ return this.ctx.http.request({
3881
+ method: "GET",
3882
+ path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
3883
+ auth: auth2
3884
+ });
3885
+ }
3886
+ /** Create a shipping zone. */
3887
+ async createZone(site, zone, auth2 = SERVICE18) {
3888
+ return this.ctx.http.request({
3889
+ method: "POST",
3890
+ path: `${this.siteBase(site)}/zones`,
3891
+ auth: auth2,
3892
+ body: zone
3893
+ });
3894
+ }
3895
+ /** Replace a shipping zone. */
3896
+ async updateZone(site, zoneId, zone, auth2 = SERVICE18) {
3897
+ await this.ctx.http.request({
3898
+ method: "PUT",
3899
+ path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
3900
+ auth: auth2,
3901
+ body: zone
3902
+ });
3903
+ }
3904
+ /** Partially update a shipping zone. */
3905
+ async patchZone(site, zoneId, patch, auth2 = SERVICE18) {
3906
+ await this.ctx.http.request({
3907
+ method: "PATCH",
3908
+ path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
3909
+ auth: auth2,
3910
+ body: patch
3911
+ });
3912
+ }
3913
+ /** Delete a shipping zone. */
3914
+ async deleteZone(site, zoneId, auth2 = SERVICE18) {
3915
+ await this.ctx.http.request({
3916
+ method: "DELETE",
3917
+ path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}`,
3918
+ auth: auth2
3919
+ });
3920
+ }
3921
+ // --- Methods (per zone) ---
3922
+ /** List shipping methods of a zone. */
3923
+ async listMethods(site, zoneId, query = {}, auth2 = SERVICE18) {
3924
+ return this.ctx.http.request({
3925
+ method: "GET",
3926
+ path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
3927
+ auth: auth2,
3928
+ ...Object.keys(query).length ? { query } : {}
3929
+ });
3930
+ }
3931
+ /** Retrieve one shipping method. */
3932
+ async getMethod(site, zoneId, methodId, auth2 = SERVICE18) {
3933
+ return this.ctx.http.request({
3934
+ method: "GET",
3935
+ path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
3936
+ auth: auth2
3937
+ });
3938
+ }
3939
+ /** Create a shipping method in a zone. */
3940
+ async createMethod(site, zoneId, method, auth2 = SERVICE18) {
3941
+ return this.ctx.http.request({
3942
+ method: "POST",
3943
+ path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods`,
3944
+ auth: auth2,
3945
+ body: method
3946
+ });
3947
+ }
3948
+ /** Replace a shipping method. */
3949
+ async updateMethod(site, zoneId, methodId, method, auth2 = SERVICE18) {
3950
+ await this.ctx.http.request({
3951
+ method: "PUT",
3952
+ path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
3953
+ auth: auth2,
3954
+ body: method
3955
+ });
3956
+ }
3957
+ /** Partially update a shipping method. */
3958
+ async patchMethod(site, zoneId, methodId, patch, auth2 = SERVICE18) {
3959
+ await this.ctx.http.request({
3960
+ method: "PATCH",
3961
+ path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
3962
+ auth: auth2,
3963
+ body: patch
3964
+ });
3965
+ }
3966
+ /** Delete a shipping method. */
3967
+ async deleteMethod(site, zoneId, methodId, auth2 = SERVICE18) {
3968
+ await this.ctx.http.request({
3969
+ method: "DELETE",
3970
+ path: `${this.siteBase(site)}/zones/${encodeURIComponent(zoneId)}/methods/${encodeURIComponent(methodId)}`,
3971
+ auth: auth2
3972
+ });
3973
+ }
3974
+ // --- Cost / quote ---
3975
+ /** Calculate the final shipping cost (`POST /quote`). */
3976
+ async quote(site, input, auth2 = SERVICE18) {
3977
+ return this.ctx.http.request({
3978
+ method: "POST",
3979
+ path: `${this.siteBase(site)}/quote`,
3980
+ auth: auth2,
3981
+ body: input
3982
+ });
3983
+ }
3984
+ /** Calculate the minimum shipping cost (`POST /quote/minimum`). */
3985
+ async quoteMinimum(site, input, auth2 = SERVICE18) {
3986
+ return this.ctx.http.request({
3987
+ method: "POST",
3988
+ path: `${this.siteBase(site)}/quote/minimum`,
3989
+ auth: auth2,
3990
+ body: input
3991
+ });
3992
+ }
3993
+ /** Calculate the shipping cost for a given slot (`POST /quote/slot`). */
3994
+ async quoteSlot(site, input, auth2 = SERVICE18) {
3995
+ return this.ctx.http.request({
3996
+ method: "POST",
3997
+ path: `${this.siteBase(site)}/quote/slot`,
3998
+ auth: auth2,
3999
+ body: input
4000
+ });
4001
+ }
4002
+ // --- Groups ---
4003
+ /** List shipping groups for a site. */
4004
+ async listGroups(site, query = {}, auth2 = SERVICE18) {
4005
+ return this.ctx.http.request({
4006
+ method: "GET",
4007
+ path: `${this.siteBase(site)}/groups`,
4008
+ auth: auth2,
4009
+ ...Object.keys(query).length ? { query } : {}
4010
+ });
4011
+ }
4012
+ /** Retrieve one shipping group. */
4013
+ async getGroup(site, groupId, auth2 = SERVICE18) {
4014
+ return this.ctx.http.request({
4015
+ method: "GET",
4016
+ path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
4017
+ auth: auth2
4018
+ });
4019
+ }
4020
+ /** Create a shipping group. */
4021
+ async createGroup(site, group, auth2 = SERVICE18) {
4022
+ return this.ctx.http.request({
4023
+ method: "POST",
4024
+ path: `${this.siteBase(site)}/groups`,
4025
+ auth: auth2,
4026
+ body: group
4027
+ });
4028
+ }
4029
+ /** Replace a shipping group. */
4030
+ async updateGroup(site, groupId, group, auth2 = SERVICE18) {
4031
+ await this.ctx.http.request({
4032
+ method: "PUT",
4033
+ path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
4034
+ auth: auth2,
4035
+ body: group
4036
+ });
4037
+ }
4038
+ /** Delete a shipping group. */
4039
+ async deleteGroup(site, groupId, auth2 = SERVICE18) {
4040
+ await this.ctx.http.request({
4041
+ method: "DELETE",
4042
+ path: `${this.siteBase(site)}/groups/${encodeURIComponent(groupId)}`,
4043
+ auth: auth2
4044
+ });
4045
+ }
4046
+ // --- Customer-group relations ---
4047
+ /** List customer-group relations for a site. */
4048
+ async listCgRelations(site, query = {}, auth2 = SERVICE18) {
4049
+ return this.ctx.http.request({
4050
+ method: "GET",
4051
+ path: `${this.siteBase(site)}/cgrelations`,
4052
+ auth: auth2,
4053
+ ...Object.keys(query).length ? { query } : {}
4054
+ });
4055
+ }
4056
+ /** Retrieve a customer's customer-group relations. */
4057
+ async getCgRelations(site, customerId, auth2 = SERVICE18) {
4058
+ return this.ctx.http.request({
4059
+ method: "GET",
4060
+ path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
4061
+ auth: auth2
4062
+ });
4063
+ }
4064
+ /** Create a customer-group relation. */
4065
+ async createCgRelation(site, relation, auth2 = SERVICE18) {
4066
+ return this.ctx.http.request({
4067
+ method: "POST",
4068
+ path: `${this.siteBase(site)}/cgrelations`,
4069
+ auth: auth2,
4070
+ body: relation
4071
+ });
4072
+ }
4073
+ /** Update a customer's customer-group relations. */
4074
+ async updateCgRelations(site, customerId, relation, auth2 = SERVICE18) {
4075
+ await this.ctx.http.request({
4076
+ method: "PUT",
4077
+ path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
4078
+ auth: auth2,
4079
+ body: relation
4080
+ });
4081
+ }
4082
+ /** Delete a customer's customer-group relation. */
4083
+ async deleteCgRelation(site, customerId, auth2 = SERVICE18) {
4084
+ await this.ctx.http.request({
4085
+ method: "DELETE",
4086
+ path: `${this.siteBase(site)}/cgrelations/${encodeURIComponent(customerId)}`,
4087
+ auth: auth2
4088
+ });
4089
+ }
4090
+ // --- Phase 2: delivery windows ---
4091
+ /** Retrieve delivery windows for a delivery area + cart. */
4092
+ async getAreaDeliveryWindows(deliveryAreaId, cartId, auth2 = SERVICE18) {
4093
+ return this.ctx.http.request({
4094
+ method: "GET",
4095
+ path: `${this.base()}/areaDeliveryTimes/${encodeURIComponent(deliveryAreaId)}/${encodeURIComponent(cartId)}`,
4096
+ auth: auth2
4097
+ });
4098
+ }
4099
+ /** Retrieve delivery windows for a cart. */
4100
+ async getCartDeliveryWindows(cartId, auth2 = SERVICE18) {
4101
+ return this.ctx.http.request({
4102
+ method: "GET",
4103
+ path: `${this.base()}/actualDeliveryWindows/${encodeURIComponent(cartId)}`,
4104
+ auth: auth2
4105
+ });
4106
+ }
4107
+ /** Increment the delivery-window counter. */
4108
+ async incrementDeliveryWindowCounter(input, auth2 = SERVICE18) {
4109
+ await this.ctx.http.request({
4110
+ method: "POST",
4111
+ path: `${this.base()}/actualDeliveryWindows/incrementCounter`,
4112
+ auth: auth2,
4113
+ body: input
4114
+ });
4115
+ }
4116
+ /** Validate a delivery window. Resolves when valid; throws otherwise. */
4117
+ async validateDeliveryWindow(input, auth2 = SERVICE18) {
4118
+ await this.ctx.http.request({
4119
+ method: "POST",
4120
+ path: `${this.base()}/deliveryWindowValidation`,
4121
+ auth: auth2,
4122
+ body: input
4123
+ });
4124
+ }
4125
+ // --- Phase 2: delivery times ---
4126
+ /** List all delivery times. */
4127
+ async listDeliveryTimes(query = {}, auth2 = SERVICE18) {
4128
+ return this.ctx.http.request({
4129
+ method: "GET",
4130
+ path: `${this.base()}/delivery-times`,
4131
+ auth: auth2,
4132
+ ...Object.keys(query).length ? { query } : {}
4133
+ });
4134
+ }
4135
+ /** Retrieve one delivery time. */
4136
+ async getDeliveryTime(deliveryTimeId, auth2 = SERVICE18) {
4137
+ return this.ctx.http.request({
4138
+ method: "GET",
4139
+ path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
4140
+ auth: auth2
4141
+ });
4142
+ }
4143
+ /** Create a delivery time. */
4144
+ async createDeliveryTime(input, auth2 = SERVICE18) {
4145
+ return this.ctx.http.request({
4146
+ method: "POST",
4147
+ path: `${this.base()}/delivery-times`,
4148
+ auth: auth2,
4149
+ body: input
4150
+ });
4151
+ }
4152
+ /** Create multiple delivery times (`POST /delivery-times/bulk`). */
4153
+ async createDeliveryTimesBulk(inputs, auth2 = SERVICE18) {
4154
+ return this.ctx.http.request({
4155
+ method: "POST",
4156
+ path: `${this.base()}/delivery-times/bulk`,
4157
+ auth: auth2,
4158
+ body: inputs
4159
+ });
4160
+ }
4161
+ /** Replace a delivery time. */
4162
+ async updateDeliveryTime(deliveryTimeId, input, auth2 = SERVICE18) {
4163
+ await this.ctx.http.request({
4164
+ method: "PUT",
4165
+ path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
4166
+ auth: auth2,
4167
+ body: input
4168
+ });
4169
+ }
4170
+ /** Partially update a delivery time (JSON-Patch op array). */
4171
+ async patchDeliveryTime(deliveryTimeId, ops, auth2 = SERVICE18) {
4172
+ await this.ctx.http.request({
4173
+ method: "PATCH",
4174
+ path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
4175
+ auth: auth2,
4176
+ body: ops
4177
+ });
4178
+ }
4179
+ /** Delete a delivery time. */
4180
+ async deleteDeliveryTime(deliveryTimeId, auth2 = SERVICE18) {
4181
+ await this.ctx.http.request({
4182
+ method: "DELETE",
4183
+ path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}`,
4184
+ auth: auth2
4185
+ });
4186
+ }
4187
+ // --- Phase 2: delivery time slots ---
4188
+ /** List slots of a delivery time. */
4189
+ async listSlots(deliveryTimeId, auth2 = SERVICE18) {
4190
+ return this.ctx.http.request({
4191
+ method: "GET",
4192
+ path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
4193
+ auth: auth2
4194
+ });
4195
+ }
4196
+ /** Retrieve one slot. */
4197
+ async getSlot(deliveryTimeId, slotId, auth2 = SERVICE18) {
4198
+ return this.ctx.http.request({
4199
+ method: "GET",
4200
+ path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
4201
+ auth: auth2
4202
+ });
4203
+ }
4204
+ /** Create a slot in a delivery time. */
4205
+ async createSlot(deliveryTimeId, input, auth2 = SERVICE18) {
4206
+ return this.ctx.http.request({
4207
+ method: "POST",
4208
+ path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
4209
+ auth: auth2,
4210
+ body: input
4211
+ });
4212
+ }
4213
+ /** Replace a slot. */
4214
+ async updateSlot(deliveryTimeId, slotId, input, auth2 = SERVICE18) {
4215
+ await this.ctx.http.request({
4216
+ method: "PUT",
4217
+ path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
4218
+ auth: auth2,
4219
+ body: input
4220
+ });
4221
+ }
4222
+ /** Partially update a slot (JSON-Patch op array). */
4223
+ async patchSlot(deliveryTimeId, slotId, ops, auth2 = SERVICE18) {
4224
+ await this.ctx.http.request({
4225
+ method: "PATCH",
4226
+ path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
4227
+ auth: auth2,
4228
+ body: ops
4229
+ });
4230
+ }
4231
+ /** Delete a slot. */
4232
+ async deleteSlot(deliveryTimeId, slotId, auth2 = SERVICE18) {
4233
+ await this.ctx.http.request({
4234
+ method: "DELETE",
4235
+ path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots/${encodeURIComponent(slotId)}`,
4236
+ auth: auth2
4237
+ });
4238
+ }
4239
+ /** Delete all slots of a delivery time. */
4240
+ async deleteAllSlots(deliveryTimeId, auth2 = SERVICE18) {
4241
+ await this.ctx.http.request({
4242
+ method: "DELETE",
4243
+ path: `${this.base()}/delivery-times/${encodeURIComponent(deliveryTimeId)}/slots`,
4244
+ auth: auth2
4245
+ });
4246
+ }
4247
+ // --- Phase 2: delivery cycles ---
4248
+ /** Generate a delivery cycle (`POST /delivery-cycles/generate`). Returns the cycle id. */
4249
+ async generateDeliveryCycle(input, auth2 = SERVICE18) {
4250
+ return this.ctx.http.request({
4251
+ method: "POST",
4252
+ path: `${this.base()}/delivery-cycles/generate`,
4253
+ auth: auth2,
4254
+ body: input
4255
+ });
4256
+ }
4257
+ };
4258
+
4259
+ // src/services/returns.ts
4260
+ var SERVICE19 = { kind: "service" };
4261
+ var ReturnsService = class {
4262
+ constructor(ctx) {
4263
+ this.ctx = ctx;
4264
+ }
4265
+ ctx;
4266
+ base() {
4267
+ return `/return/${this.ctx.tenant}/returns`;
4268
+ }
4269
+ /** List returns (paged; supports `pageSize`/`pageNumber`/`sort`/`q`). */
4270
+ async listReturns(query = {}, auth2 = SERVICE19) {
4271
+ return this.ctx.http.request({
4272
+ method: "GET",
4273
+ path: this.base(),
4274
+ auth: auth2,
4275
+ ...Object.keys(query).length ? { query } : {}
4276
+ });
4277
+ }
4278
+ /** Retrieve one return by id. */
4279
+ async getReturn(returnId, auth2 = SERVICE19) {
4280
+ return this.ctx.http.request({
4281
+ method: "GET",
4282
+ path: `${this.base()}/${encodeURIComponent(returnId)}`,
4283
+ auth: auth2
4284
+ });
4285
+ }
4286
+ /** Create a return. Returns the created `{ id }`. */
4287
+ async createReturn(input, auth2 = SERVICE19) {
4288
+ return this.ctx.http.request({
4289
+ method: "POST",
4290
+ path: this.base(),
4291
+ auth: auth2,
4292
+ body: input
4293
+ });
4294
+ }
4295
+ /** Replace a return by id (`PUT`). */
4296
+ async updateReturn(returnId, input, auth2 = SERVICE19) {
4297
+ await this.ctx.http.request({
4298
+ method: "PUT",
4299
+ path: `${this.base()}/${encodeURIComponent(returnId)}`,
4300
+ auth: auth2,
4301
+ body: input
4302
+ });
4303
+ }
4304
+ /** Partially update a return by id (`PATCH`, JSON-Patch op-array). */
4305
+ async patchReturn(returnId, ops, auth2 = SERVICE19) {
4306
+ await this.ctx.http.request({
4307
+ method: "PATCH",
4308
+ path: `${this.base()}/${encodeURIComponent(returnId)}`,
4309
+ auth: auth2,
4310
+ body: ops
4311
+ });
4312
+ }
4313
+ /** Delete a return by id. */
4314
+ async deleteReturn(returnId, auth2 = SERVICE19) {
4315
+ await this.ctx.http.request({
4316
+ method: "DELETE",
4317
+ path: `${this.base()}/${encodeURIComponent(returnId)}`,
4318
+ auth: auth2
4319
+ });
4320
+ }
4321
+ };
4322
+
4323
+ // src/services/sepa-export.ts
4324
+ var SERVICE20 = { kind: "service" };
4325
+ var SepaExportService = class {
4326
+ constructor(ctx) {
4327
+ this.ctx = ctx;
4328
+ }
4329
+ ctx;
4330
+ base() {
4331
+ return `/sepa-export/${this.ctx.tenant}`;
4332
+ }
4333
+ /** Retrieve a SEPA export file by id. Returns the raw file content (text). */
4334
+ async getFile(fileId, auth2 = SERVICE20) {
4335
+ const path = `${this.base()}/files/${encodeURIComponent(fileId)}`;
4336
+ const res = await this.ctx.http.requestRaw({ method: "GET", path, auth: auth2 });
4337
+ if (!res.ok) {
4338
+ const errBody = await res.text().catch(() => void 0);
4339
+ throw errorFromResponse(res.status, `GET ${path} \u2192 ${res.status}`, errBody);
4340
+ }
4341
+ return res.text();
4342
+ }
4343
+ /** List export jobs. */
4344
+ async listJobs(query = {}, auth2 = SERVICE20) {
4345
+ return this.ctx.http.request({
4346
+ method: "GET",
4347
+ path: `${this.base()}/jobs`,
4348
+ auth: auth2,
4349
+ ...Object.keys(query).length ? { query } : {}
4350
+ });
4351
+ }
4352
+ /** Create an export job. */
4353
+ async createJob(input, auth2 = SERVICE20) {
4354
+ return this.ctx.http.request({
4355
+ method: "POST",
4356
+ path: `${this.base()}/jobs`,
4357
+ auth: auth2,
4358
+ body: input
4359
+ });
4360
+ }
4361
+ };
4362
+
4363
+ // src/services/indexing.ts
4364
+ var SERVICE21 = { kind: "service" };
4365
+ var IndexingService = class {
4366
+ constructor(ctx) {
4367
+ this.ctx = ctx;
4368
+ }
4369
+ ctx;
4370
+ base() {
4371
+ return `/indexing/${this.ctx.tenant}`;
4372
+ }
4373
+ /** List indexing configurations. */
4374
+ async listConfigurations(auth2 = SERVICE21) {
4375
+ return this.ctx.http.request({ method: "GET", path: `${this.base()}/configurations`, auth: auth2 });
4376
+ }
4377
+ /** Get a configuration by provider name. */
4378
+ async getConfiguration(provider, auth2 = SERVICE21) {
4379
+ return this.ctx.http.request({
4380
+ method: "GET",
4381
+ path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
4382
+ auth: auth2
4383
+ });
4384
+ }
4385
+ /** Create a configuration. */
4386
+ async createConfiguration(input, auth2 = SERVICE21) {
4387
+ return this.ctx.http.request({
4388
+ method: "POST",
4389
+ path: `${this.base()}/configurations`,
4390
+ auth: auth2,
4391
+ body: input
4392
+ });
4393
+ }
4394
+ /** Update a configuration by provider name. */
4395
+ async updateConfiguration(provider, input, auth2 = SERVICE21) {
4396
+ await this.ctx.http.request({
4397
+ method: "PUT",
4398
+ path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
4399
+ auth: auth2,
4400
+ body: input
4401
+ });
4402
+ }
4403
+ /** Delete a configuration by provider name. */
4404
+ async deleteConfiguration(provider, auth2 = SERVICE21) {
4405
+ await this.ctx.http.request({
4406
+ method: "DELETE",
4407
+ path: `${this.base()}/configurations/${encodeURIComponent(provider)}`,
4408
+ auth: auth2
4409
+ });
4410
+ }
4411
+ /** List public indexing configurations. */
4412
+ async listPublicConfigurations(auth2 = SERVICE21) {
4413
+ return this.ctx.http.request({ method: "GET", path: `${this.base()}/public/configurations`, auth: auth2 });
4414
+ }
4415
+ /** Get a public configuration by provider name. */
4416
+ async getPublicConfiguration(provider, auth2 = SERVICE21) {
4417
+ return this.ctx.http.request({
4418
+ method: "GET",
4419
+ path: `${this.base()}/public/configurations/${encodeURIComponent(provider)}`,
4420
+ auth: auth2
4421
+ });
4422
+ }
4423
+ /** Trigger a reindex. */
4424
+ async reindex(input, auth2 = SERVICE21) {
4425
+ await this.ctx.http.request({ method: "POST", path: `${this.base()}/reindex`, auth: auth2, body: input });
4426
+ }
4427
+ };
4428
+
4429
+ // src/services/unit-handling.ts
4430
+ var SERVICE22 = { kind: "service" };
4431
+ var UnitHandlingService = class {
4432
+ constructor(ctx) {
4433
+ this.ctx = ctx;
4434
+ }
4435
+ ctx;
4436
+ base() {
4437
+ return `/unit-handling/${this.ctx.tenant}`;
4438
+ }
4439
+ /** Find units (filter/sort/page). */
4440
+ async listUnits(query = {}, auth2 = SERVICE22) {
4441
+ return this.ctx.http.request({
4442
+ method: "GET",
4443
+ path: `${this.base()}/units`,
4444
+ auth: auth2,
4445
+ ...Object.keys(query).length ? { query } : {}
4446
+ });
4447
+ }
4448
+ /** Retrieve a unit by code. */
4449
+ async getUnit(unitCode, auth2 = SERVICE22) {
4450
+ return this.ctx.http.request({
4451
+ method: "GET",
4452
+ path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
4453
+ auth: auth2
4454
+ });
4455
+ }
4456
+ /** Add a new unit. */
4457
+ async createUnit(input, auth2 = SERVICE22) {
4458
+ return this.ctx.http.request({ method: "POST", path: `${this.base()}/units`, auth: auth2, body: input });
4459
+ }
4460
+ /** Update a unit by code. */
4461
+ async updateUnit(unitCode, input, auth2 = SERVICE22) {
4462
+ await this.ctx.http.request({
4463
+ method: "PUT",
4464
+ path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
4465
+ auth: auth2,
4466
+ body: input
4467
+ });
4468
+ }
4469
+ /** Delete a unit by code. */
4470
+ async deleteUnit(unitCode, auth2 = SERVICE22) {
4471
+ await this.ctx.http.request({
4472
+ method: "DELETE",
4473
+ path: `${this.base()}/units/${encodeURIComponent(unitCode)}`,
4474
+ auth: auth2
4475
+ });
4476
+ }
4477
+ /** Delete multiple units by code (bulk). The codes are sent as the request body. */
4478
+ async deleteUnits(codes, auth2 = SERVICE22) {
4479
+ await this.ctx.http.request({
4480
+ method: "DELETE",
4481
+ path: `${this.base()}/units`,
4482
+ auth: auth2,
4483
+ body: codes
4484
+ });
4485
+ }
4486
+ /** Fetch a conversion factor (`PUT /units/conversion-factor-commands`). */
4487
+ async getConversionFactor(input, auth2 = SERVICE22) {
4488
+ return this.ctx.http.request({
4489
+ method: "PUT",
4490
+ path: `${this.base()}/units/conversion-factor-commands`,
4491
+ auth: auth2,
4492
+ body: input
4493
+ });
4494
+ }
4495
+ /** Convert a value between units (`PUT /units/convert-unit-commands`). */
4496
+ async convertUnit(input, auth2 = SERVICE22) {
4497
+ return this.ctx.http.request({
4498
+ method: "PUT",
4499
+ path: `${this.base()}/units/convert-unit-commands`,
4500
+ auth: auth2,
4501
+ body: input
4502
+ });
4503
+ }
4504
+ /** List all unit types. */
4505
+ async listUnitTypes(auth2 = SERVICE22) {
4506
+ return this.ctx.http.request({ method: "GET", path: `${this.base()}/types`, auth: auth2 });
4507
+ }
4508
+ };
4509
+
4510
+ // src/services/catalog.ts
4511
+ var SERVICE23 = { kind: "service" };
4512
+ var CatalogService = class {
4513
+ constructor(ctx) {
4514
+ this.ctx = ctx;
4515
+ }
4516
+ ctx;
4517
+ base() {
4518
+ return `/catalog/${this.ctx.tenant}/catalogs`;
4519
+ }
4520
+ /** List catalogs (filtered/sorted). */
4521
+ async listCatalogs(query = {}, auth2 = SERVICE23) {
4522
+ return this.ctx.http.request({
4523
+ method: "GET",
4524
+ path: this.base(),
4525
+ auth: auth2,
4526
+ ...Object.keys(query).length ? { query } : {}
4527
+ });
4528
+ }
4529
+ /** Retrieve a catalog by id. */
4530
+ async getCatalog(catalogId, auth2 = SERVICE23) {
4531
+ return this.ctx.http.request({
4532
+ method: "GET",
4533
+ path: `${this.base()}/${encodeURIComponent(catalogId)}`,
4534
+ auth: auth2
4535
+ });
4536
+ }
4537
+ /** Retrieve all catalogs that contain a category. */
4538
+ async getCatalogsForCategory(categoryId, auth2 = SERVICE23) {
4539
+ return this.ctx.http.request({
4540
+ method: "GET",
4541
+ path: `${this.base()}/categories/${encodeURIComponent(categoryId)}`,
4542
+ auth: auth2
4543
+ });
4544
+ }
4545
+ /** Create a catalog. */
4546
+ async createCatalog(input, auth2 = SERVICE23) {
4547
+ return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
4548
+ }
4549
+ /** Upsert a catalog by id (`PUT`). */
4550
+ async updateCatalog(catalogId, input, auth2 = SERVICE23) {
4551
+ return this.ctx.http.request({
4552
+ method: "PUT",
4553
+ path: `${this.base()}/${encodeURIComponent(catalogId)}`,
4554
+ auth: auth2,
4555
+ body: input
4556
+ });
4557
+ }
4558
+ /** Partially update a catalog by id (`PATCH`). */
4559
+ async patchCatalog(catalogId, patch, auth2 = SERVICE23) {
4560
+ await this.ctx.http.request({
4561
+ method: "PATCH",
4562
+ path: `${this.base()}/${encodeURIComponent(catalogId)}`,
4563
+ auth: auth2,
4564
+ body: patch
4565
+ });
4566
+ }
4567
+ /** Remove a catalog by id. */
4568
+ async deleteCatalog(catalogId, auth2 = SERVICE23) {
4569
+ await this.ctx.http.request({
4570
+ method: "DELETE",
4571
+ path: `${this.base()}/${encodeURIComponent(catalogId)}`,
4572
+ auth: auth2
4573
+ });
4574
+ }
4575
+ };
4576
+
4577
+ // src/services/vendor.ts
4578
+ var SERVICE24 = { kind: "service" };
4579
+ var VendorService = class {
4580
+ constructor(ctx) {
4581
+ this.ctx = ctx;
4582
+ }
4583
+ ctx;
4584
+ base() {
4585
+ return `/vendor/${this.ctx.tenant}`;
4586
+ }
4587
+ // --- Vendors ---
4588
+ /** List all vendors. */
4589
+ async listVendors(query = {}, auth2 = SERVICE24) {
4590
+ return this.ctx.http.request({
4591
+ method: "GET",
4592
+ path: `${this.base()}/vendors`,
4593
+ auth: auth2,
4594
+ ...Object.keys(query).length ? { query } : {}
4595
+ });
4596
+ }
4597
+ /** Retrieve a vendor by id. */
4598
+ async getVendor(vendorId, auth2 = SERVICE24) {
4599
+ return this.ctx.http.request({
4600
+ method: "GET",
4601
+ path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
4602
+ auth: auth2
4603
+ });
4604
+ }
4605
+ /** Search vendors (`POST /vendors/search`). */
4606
+ async searchVendors(query, auth2 = SERVICE24) {
4607
+ return this.ctx.http.request({
4608
+ method: "POST",
4609
+ path: `${this.base()}/vendors/search`,
4610
+ auth: auth2,
4611
+ body: query
4612
+ });
4613
+ }
4614
+ /** Create a vendor. */
4615
+ async createVendor(input, auth2 = SERVICE24) {
4616
+ return this.ctx.http.request({ method: "POST", path: `${this.base()}/vendors`, auth: auth2, body: input });
4617
+ }
4618
+ /** Upsert a vendor by id (`PUT`). */
4619
+ async updateVendor(vendorId, input, auth2 = SERVICE24) {
4620
+ await this.ctx.http.request({
4621
+ method: "PUT",
4622
+ path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
4623
+ auth: auth2,
4624
+ body: input
4625
+ });
4626
+ }
4627
+ /** Delete a vendor by id. */
4628
+ async deleteVendor(vendorId, auth2 = SERVICE24) {
4629
+ await this.ctx.http.request({
4630
+ method: "DELETE",
4631
+ path: `${this.base()}/vendors/${encodeURIComponent(vendorId)}`,
4632
+ auth: auth2
4633
+ });
4634
+ }
4635
+ // --- Vendor locations ---
4636
+ /** List all vendor locations. */
4637
+ async listVendorLocations(query = {}, auth2 = SERVICE24) {
4638
+ return this.ctx.http.request({
4639
+ method: "GET",
4640
+ path: `${this.base()}/locations`,
4641
+ auth: auth2,
4642
+ ...Object.keys(query).length ? { query } : {}
4643
+ });
4644
+ }
4645
+ /** Retrieve a vendor location by id. */
4646
+ async getVendorLocation(locationId, auth2 = SERVICE24) {
4647
+ return this.ctx.http.request({
4648
+ method: "GET",
4649
+ path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
4650
+ auth: auth2
4651
+ });
4652
+ }
4653
+ /** Create a vendor location. */
4654
+ async createVendorLocation(input, auth2 = SERVICE24) {
4655
+ return this.ctx.http.request({ method: "POST", path: `${this.base()}/locations`, auth: auth2, body: input });
4656
+ }
4657
+ /** Upsert a vendor location by id (`PUT`). */
4658
+ async updateVendorLocation(locationId, input, auth2 = SERVICE24) {
4659
+ await this.ctx.http.request({
4660
+ method: "PUT",
4661
+ path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
4662
+ auth: auth2,
4663
+ body: input
4664
+ });
4665
+ }
4666
+ /** Delete a vendor location by id. */
4667
+ async deleteVendorLocation(locationId, auth2 = SERVICE24) {
4668
+ await this.ctx.http.request({
4669
+ method: "DELETE",
4670
+ path: `${this.base()}/locations/${encodeURIComponent(locationId)}`,
4671
+ auth: auth2
4672
+ });
4673
+ }
4674
+ };
4675
+
4676
+ // src/services/pick-pack.ts
4677
+ var SERVICE25 = { kind: "service" };
4678
+ var PickPackService = class {
4679
+ constructor(ctx) {
4680
+ this.ctx = ctx;
4681
+ }
4682
+ ctx;
4683
+ base() {
4684
+ return `/pick-pack/${this.ctx.tenant}`;
4685
+ }
4686
+ orderPath(orderId) {
4687
+ return `${this.base()}/orders/${encodeURIComponent(orderId)}`;
4688
+ }
4689
+ /** List packlist orders. */
4690
+ async listOrders(query = {}, auth2 = SERVICE25) {
4691
+ return this.ctx.http.request({
4692
+ method: "GET",
4693
+ path: `${this.base()}/orders`,
4694
+ auth: auth2,
4695
+ ...Object.keys(query).length ? { query } : {}
4696
+ });
4697
+ }
4698
+ /** Retrieve a packlist order by id. */
4699
+ async getOrder(orderId, auth2 = SERVICE25) {
4700
+ return this.ctx.http.request({ method: "GET", path: this.orderPath(orderId), auth: auth2 });
4701
+ }
4702
+ /** Update an order's status (`PATCH`). Returns an acknowledgement. */
4703
+ async updateOrder(orderId, change, auth2 = SERVICE25) {
4704
+ return this.ctx.http.request({ method: "PATCH", path: this.orderPath(orderId), auth: auth2, body: change });
4705
+ }
4706
+ /** Finish an order. Returns an acknowledgement. */
4707
+ async finishOrder(orderId, auth2 = SERVICE25) {
4708
+ return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/finish`, auth: auth2 });
4709
+ }
4710
+ /** List order cycles (ids). */
4711
+ async listOrderCycles(query = {}, auth2 = SERVICE25) {
4712
+ return this.ctx.http.request({
4713
+ method: "GET",
4714
+ path: `${this.base()}/orderCycles`,
4715
+ auth: auth2,
4716
+ ...Object.keys(query).length ? { query } : {}
4717
+ });
4718
+ }
4719
+ /** Add an assignee to an order. Returns an acknowledgement. */
4720
+ async addAssignee(orderId, assignee, auth2 = SERVICE25) {
4721
+ return this.ctx.http.request({ method: "POST", path: `${this.orderPath(orderId)}/assignees`, auth: auth2, body: assignee });
4722
+ }
4723
+ /** Remove an assignee from an order. */
4724
+ async removeAssignee(orderId, assigneeId, auth2 = SERVICE25) {
4725
+ await this.ctx.http.request({
4726
+ method: "DELETE",
4727
+ path: `${this.orderPath(orderId)}/assignees/${encodeURIComponent(assigneeId)}`,
4728
+ auth: auth2
4729
+ });
4730
+ }
4731
+ /** Update packaging products for an order (`PUT`). Returns an acknowledgement. */
4732
+ async updatePackaging(orderId, change, auth2 = SERVICE25) {
4733
+ return this.ctx.http.request({ method: "PUT", path: `${this.orderPath(orderId)}/packaging`, auth: auth2, body: change });
4734
+ }
4735
+ /** Create a packing event. Returns an acknowledgement. */
4736
+ async createEvent(event, auth2 = SERVICE25) {
4737
+ return this.ctx.http.request({ method: "POST", path: `${this.base()}/events`, auth: auth2, body: event });
4738
+ }
4739
+ /** List packing events. */
4740
+ async listEvents(query = {}, auth2 = SERVICE25) {
4741
+ return this.ctx.http.request({
4742
+ method: "GET",
4743
+ path: `${this.base()}/events`,
4744
+ auth: auth2,
4745
+ ...Object.keys(query).length ? { query } : {}
4746
+ });
4747
+ }
4748
+ /** Trigger an order recalculation. Returns the created job's id. */
4749
+ async triggerRecalculation(input, auth2 = SERVICE25) {
4750
+ return this.ctx.http.request({
4751
+ method: "POST",
4752
+ path: `${this.base()}/jobs/recalculations`,
4753
+ auth: auth2,
4754
+ body: input
4755
+ });
4756
+ }
4757
+ /** Retrieve a recalculation job by id. */
4758
+ async getRecalculationJob(jobId, auth2 = SERVICE25) {
4759
+ return this.ctx.http.request({
4760
+ method: "GET",
4761
+ path: `${this.base()}/jobs/recalculations/${encodeURIComponent(jobId)}`,
4762
+ auth: auth2
4763
+ });
4764
+ }
4765
+ };
4766
+
4767
+ // src/services/customer-admin.ts
4768
+ var SERVICE26 = { kind: "service" };
4769
+ var CustomerAdminService = class {
4770
+ constructor(ctx) {
4771
+ this.ctx = ctx;
4772
+ }
4773
+ ctx;
4774
+ base() {
4775
+ return `/customer/${this.ctx.tenant}/customers`;
4776
+ }
4777
+ customerPath(customerNumber) {
4778
+ return `${this.base()}/${encodeURIComponent(customerNumber)}`;
4779
+ }
4780
+ addressPath(customerNumber, addressId) {
4781
+ return `${this.customerPath(customerNumber)}/addresses/${encodeURIComponent(addressId)}`;
4782
+ }
4783
+ // --- Customers ---
4784
+ /** List customers. */
4785
+ async listCustomers(query = {}, auth2 = SERVICE26) {
4786
+ return this.ctx.http.request({
4787
+ method: "GET",
4788
+ path: this.base(),
4789
+ auth: auth2,
4790
+ ...Object.keys(query).length ? { query } : {}
4791
+ });
4792
+ }
4793
+ /** Search customers (`POST /customers/search`). */
4794
+ async searchCustomers(query, auth2 = SERVICE26) {
4795
+ return this.ctx.http.request({ method: "POST", path: `${this.base()}/search`, auth: auth2, body: query });
4796
+ }
4797
+ /** Retrieve a customer profile by number. */
4798
+ async getCustomer(customerNumber, auth2 = SERVICE26) {
4799
+ return this.ctx.http.request({ method: "GET", path: this.customerPath(customerNumber), auth: auth2 });
4800
+ }
4801
+ /** Create a customer. */
4802
+ async createCustomer(input, auth2 = SERVICE26) {
4803
+ return this.ctx.http.request({ method: "POST", path: this.base(), auth: auth2, body: input });
4804
+ }
4805
+ /** Upsert a customer profile by number (`PUT`). */
4806
+ async upsertCustomer(customerNumber, input, auth2 = SERVICE26) {
4807
+ return this.ctx.http.request({ method: "PUT", path: this.customerPath(customerNumber), auth: auth2, body: input });
4808
+ }
4809
+ /** Partially update a customer profile (`PATCH`). */
4810
+ async patchCustomer(customerNumber, patch, auth2 = SERVICE26) {
4811
+ await this.ctx.http.request({ method: "PATCH", path: this.customerPath(customerNumber), auth: auth2, body: patch });
4812
+ }
4813
+ /** Delete a customer profile. */
4814
+ async deleteCustomer(customerNumber, auth2 = SERVICE26) {
4815
+ await this.ctx.http.request({ method: "DELETE", path: this.customerPath(customerNumber), auth: auth2 });
4816
+ }
4817
+ // --- Addresses ---
4818
+ /** List a customer's addresses. */
4819
+ async listAddresses(customerNumber, auth2 = SERVICE26) {
4820
+ return this.ctx.http.request({
4821
+ method: "GET",
4822
+ path: `${this.customerPath(customerNumber)}/addresses`,
4823
+ auth: auth2
4824
+ });
4825
+ }
4826
+ /** Retrieve one address. */
4827
+ async getAddress(customerNumber, addressId, auth2 = SERVICE26) {
4828
+ return this.ctx.http.request({ method: "GET", path: this.addressPath(customerNumber, addressId), auth: auth2 });
4829
+ }
4830
+ /** Add an address. */
4831
+ async addAddress(customerNumber, input, auth2 = SERVICE26) {
4832
+ return this.ctx.http.request({
4833
+ method: "POST",
4834
+ path: `${this.customerPath(customerNumber)}/addresses`,
4835
+ auth: auth2,
4836
+ body: input
4837
+ });
4838
+ }
4839
+ /** Upsert an address by id (`PUT`). */
4840
+ async upsertAddress(customerNumber, addressId, input, auth2 = SERVICE26) {
4841
+ return this.ctx.http.request({ method: "PUT", path: this.addressPath(customerNumber, addressId), auth: auth2, body: input });
4842
+ }
4843
+ /** Partially update an address by id (`PATCH`). */
4844
+ async patchAddress(customerNumber, addressId, patch, auth2 = SERVICE26) {
4845
+ await this.ctx.http.request({ method: "PATCH", path: this.addressPath(customerNumber, addressId), auth: auth2, body: patch });
4846
+ }
4847
+ /** Delete an address by id. */
4848
+ async deleteAddress(customerNumber, addressId, auth2 = SERVICE26) {
4849
+ await this.ctx.http.request({ method: "DELETE", path: this.addressPath(customerNumber, addressId), auth: auth2 });
4850
+ }
4851
+ /** Add tags to an address (`?tags=` query). */
4852
+ async addAddressTags(customerNumber, addressId, tags, auth2 = SERVICE26) {
4853
+ await this.ctx.http.request({
4854
+ method: "POST",
4855
+ path: `${this.addressPath(customerNumber, addressId)}/tags`,
4856
+ auth: auth2,
4857
+ query: { tags: tags.join(",") }
4858
+ });
4859
+ }
4860
+ /** Remove tags from an address (`?tags=` query). */
4861
+ async removeAddressTags(customerNumber, addressId, tags, auth2 = SERVICE26) {
4862
+ await this.ctx.http.request({
4863
+ method: "DELETE",
4864
+ path: `${this.addressPath(customerNumber, addressId)}/tags`,
4865
+ auth: auth2,
4866
+ query: { tags: tags.join(",") }
4867
+ });
4868
+ }
4869
+ };
4870
+
4871
+ // src/services/approval.ts
4872
+ var SERVICE27 = { kind: "service" };
4873
+ var ApprovalService = class {
4874
+ constructor(ctx) {
4875
+ this.ctx = ctx;
4876
+ }
4877
+ ctx;
4878
+ base() {
4879
+ return `/approval/${this.ctx.tenant}`;
4880
+ }
4881
+ /** List approvals (paged via `pageNumber`/`pageSize`/`sort`/`q`). Returns an array. */
4882
+ async listApprovals(query = {}, auth2 = SERVICE27) {
4883
+ return this.ctx.http.request({
4884
+ method: "GET",
4885
+ path: `${this.base()}/approvals`,
4886
+ auth: auth2,
4887
+ ...Object.keys(query).length ? { query } : {}
4888
+ });
4889
+ }
4890
+ /** Retrieve a single approval by id. */
4891
+ async getApproval(approvalId, auth2 = SERVICE27) {
4892
+ return this.ctx.http.request({
4893
+ method: "GET",
4894
+ path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
4895
+ auth: auth2
4896
+ });
4897
+ }
4898
+ /** Create an approval request (cart or quote). Returns the created `{ id }`. */
4899
+ async createApproval(input, auth2 = SERVICE27) {
4900
+ return this.ctx.http.request({
4901
+ method: "POST",
4902
+ path: `${this.base()}/approvals`,
4903
+ auth: auth2,
4904
+ body: input
4905
+ });
4906
+ }
4907
+ /** Approve/reject/amend an approval via a JSON-Patch op-array (`PATCH`). */
4908
+ async updateApproval(approvalId, ops, auth2 = SERVICE27) {
4909
+ await this.ctx.http.request({
4910
+ method: "PATCH",
4911
+ path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
4912
+ auth: auth2,
4913
+ body: ops
4914
+ });
4915
+ }
4916
+ /** Delete an approval by id. */
4917
+ async deleteApproval(approvalId, auth2 = SERVICE27) {
4918
+ await this.ctx.http.request({
4919
+ method: "DELETE",
4920
+ path: `${this.base()}/approvals/${encodeURIComponent(approvalId)}`,
4921
+ auth: auth2
4922
+ });
4923
+ }
4924
+ /** Check whether an operation on a resource is permitted / needs approval. */
4925
+ async checkPermitted(input, auth2 = SERVICE27) {
4926
+ return this.ctx.http.request({
4927
+ method: "POST",
4928
+ path: `${this.base()}/approval/permitted`,
4929
+ auth: auth2,
4930
+ body: input
4931
+ });
4932
+ }
4933
+ /** Search for users eligible to approve a resource. Returns an array. */
4934
+ async searchApprovers(input, auth2 = SERVICE27) {
4935
+ return this.ctx.http.request({
4936
+ method: "POST",
4937
+ path: `${this.base()}/search/users`,
4938
+ auth: auth2,
4939
+ body: input
4940
+ });
4941
+ }
4942
+ };
4943
+
3225
4944
  // package.json
3226
- var version = "2.3.0";
4945
+ var version = "2.5.0";
3227
4946
 
3228
4947
  // src/version.ts
3229
4948
  var SDK_VERSION = version;
@@ -3257,6 +4976,23 @@ var EmporixClient = class {
3257
4976
  webhooks;
3258
4977
  schemas;
3259
4978
  ai;
4979
+ taxes;
4980
+ coupons;
4981
+ rewardPoints;
4982
+ brands;
4983
+ labels;
4984
+ countries;
4985
+ currencies;
4986
+ shipping;
4987
+ returns;
4988
+ sepaExport;
4989
+ indexing;
4990
+ units;
4991
+ catalogs;
4992
+ vendors;
4993
+ pickPack;
4994
+ customerAdmin;
4995
+ approvals;
3260
4996
  /** The validated tenant this client is bound to. */
3261
4997
  tenant;
3262
4998
  /**
@@ -3336,6 +5072,23 @@ var EmporixClient = class {
3336
5072
  this.webhooks = new WebhookService(mk("webhook"));
3337
5073
  this.schemas = new SchemaService(mk("schema"));
3338
5074
  this.ai = new AiService(mk("ai"));
5075
+ this.taxes = new TaxService(mk("tax"));
5076
+ this.coupons = new CouponService(mk("coupon"));
5077
+ this.rewardPoints = new RewardPointsService(mk("reward-points"));
5078
+ this.brands = new BrandService(mk("brand"));
5079
+ this.labels = new LabelService(mk("label"));
5080
+ this.countries = new CountryService(mk("country"));
5081
+ this.currencies = new CurrencyService(mk("currency"));
5082
+ this.shipping = new ShippingService(mk("shipping"));
5083
+ this.returns = new ReturnsService(mk("returns"));
5084
+ this.sepaExport = new SepaExportService(mk("sepa-export"));
5085
+ this.indexing = new IndexingService(mk("indexing"));
5086
+ this.units = new UnitHandlingService(mk("unit-handling"));
5087
+ this.catalogs = new CatalogService(mk("catalog"));
5088
+ this.vendors = new VendorService(mk("vendor"));
5089
+ this.pickPack = new PickPackService(mk("pick-pack"));
5090
+ this.customerAdmin = new CustomerAdminService(mk("customer-admin"));
5091
+ this.approvals = new ApprovalService(mk("approval"));
3339
5092
  }
3340
5093
  /** Sets the runtime log level globally or for one service. */
3341
5094
  setLogLevel(level, opts = {}) {
@@ -3348,13 +5101,20 @@ var EmporixClient = class {
3348
5101
  };
3349
5102
 
3350
5103
  exports.AiService = AiService;
5104
+ exports.ApprovalService = ApprovalService;
3351
5105
  exports.AvailabilityService = AvailabilityService;
5106
+ exports.BrandService = BrandService;
3352
5107
  exports.CartService = CartService;
5108
+ exports.CatalogService = CatalogService;
3353
5109
  exports.CategoryService = CategoryService;
3354
5110
  exports.CheckoutService = CheckoutService;
3355
5111
  exports.ClientConfigService = ClientConfigService;
3356
5112
  exports.CompaniesService = CompaniesService;
3357
5113
  exports.ContactsService = ContactsService;
5114
+ exports.CountryService = CountryService;
5115
+ exports.CouponService = CouponService;
5116
+ exports.CurrencyService = CurrencyService;
5117
+ exports.CustomerAdminService = CustomerAdminService;
3358
5118
  exports.CustomerGroupsService = CustomerGroupsService;
3359
5119
  exports.CustomerService = CustomerService;
3360
5120
  exports.DEFAULT_HOST = DEFAULT_HOST;
@@ -3369,23 +5129,33 @@ exports.EmporixServerError = EmporixServerError;
3369
5129
  exports.EmporixValidationError = EmporixValidationError;
3370
5130
  exports.FeeService = FeeService;
3371
5131
  exports.HttpClient = HttpClient;
5132
+ exports.IndexingService = IndexingService;
3372
5133
  exports.LEVEL = LEVEL;
5134
+ exports.LabelService = LabelService;
3373
5135
  exports.LevelResolver = LevelResolver;
3374
5136
  exports.LocationsService = LocationsService;
3375
5137
  exports.MediaService = MediaService;
3376
5138
  exports.OrdersService = OrdersService;
3377
5139
  exports.PaymentGatewayService = PaymentGatewayService;
5140
+ exports.PickPackService = PickPackService;
3378
5141
  exports.PriceService = PriceService;
3379
5142
  exports.ProductService = ProductService;
3380
5143
  exports.RagIndexerService = RagIndexerService;
5144
+ exports.ReturnsService = ReturnsService;
5145
+ exports.RewardPointsService = RewardPointsService;
3381
5146
  exports.SalesOrdersService = SalesOrdersService;
3382
5147
  exports.SchemaService = SchemaService;
3383
5148
  exports.SegmentService = SegmentService;
5149
+ exports.SepaExportService = SepaExportService;
3384
5150
  exports.SequentialIdService = SequentialIdService;
3385
5151
  exports.SessionContextService = SessionContextService;
5152
+ exports.ShippingService = ShippingService;
3386
5153
  exports.ShoppingListService = ShoppingListService;
3387
5154
  exports.SiteService = SiteService;
5155
+ exports.TaxService = TaxService;
3388
5156
  exports.TenantConfigService = TenantConfigService;
5157
+ exports.UnitHandlingService = UnitHandlingService;
5158
+ exports.VendorService = VendorService;
3389
5159
  exports.WebhookService = WebhookService;
3390
5160
  exports.auth = auth;
3391
5161
  exports.createConsoleLogger = createConsoleLogger;