@viu/emporix-sdk 2.3.0 → 2.4.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,1293 @@ 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
+
3225
4510
  // package.json
3226
- var version = "2.3.0";
4511
+ var version = "2.4.0";
3227
4512
 
3228
4513
  // src/version.ts
3229
4514
  var SDK_VERSION = version;
@@ -3257,6 +4542,18 @@ var EmporixClient = class {
3257
4542
  webhooks;
3258
4543
  schemas;
3259
4544
  ai;
4545
+ taxes;
4546
+ coupons;
4547
+ rewardPoints;
4548
+ brands;
4549
+ labels;
4550
+ countries;
4551
+ currencies;
4552
+ shipping;
4553
+ returns;
4554
+ sepaExport;
4555
+ indexing;
4556
+ units;
3260
4557
  /** The validated tenant this client is bound to. */
3261
4558
  tenant;
3262
4559
  /**
@@ -3336,6 +4633,18 @@ var EmporixClient = class {
3336
4633
  this.webhooks = new WebhookService(mk("webhook"));
3337
4634
  this.schemas = new SchemaService(mk("schema"));
3338
4635
  this.ai = new AiService(mk("ai"));
4636
+ this.taxes = new TaxService(mk("tax"));
4637
+ this.coupons = new CouponService(mk("coupon"));
4638
+ this.rewardPoints = new RewardPointsService(mk("reward-points"));
4639
+ this.brands = new BrandService(mk("brand"));
4640
+ this.labels = new LabelService(mk("label"));
4641
+ this.countries = new CountryService(mk("country"));
4642
+ this.currencies = new CurrencyService(mk("currency"));
4643
+ this.shipping = new ShippingService(mk("shipping"));
4644
+ this.returns = new ReturnsService(mk("returns"));
4645
+ this.sepaExport = new SepaExportService(mk("sepa-export"));
4646
+ this.indexing = new IndexingService(mk("indexing"));
4647
+ this.units = new UnitHandlingService(mk("unit-handling"));
3339
4648
  }
3340
4649
  /** Sets the runtime log level globally or for one service. */
3341
4650
  setLogLevel(level, opts = {}) {
@@ -3349,12 +4658,16 @@ var EmporixClient = class {
3349
4658
 
3350
4659
  exports.AiService = AiService;
3351
4660
  exports.AvailabilityService = AvailabilityService;
4661
+ exports.BrandService = BrandService;
3352
4662
  exports.CartService = CartService;
3353
4663
  exports.CategoryService = CategoryService;
3354
4664
  exports.CheckoutService = CheckoutService;
3355
4665
  exports.ClientConfigService = ClientConfigService;
3356
4666
  exports.CompaniesService = CompaniesService;
3357
4667
  exports.ContactsService = ContactsService;
4668
+ exports.CountryService = CountryService;
4669
+ exports.CouponService = CouponService;
4670
+ exports.CurrencyService = CurrencyService;
3358
4671
  exports.CustomerGroupsService = CustomerGroupsService;
3359
4672
  exports.CustomerService = CustomerService;
3360
4673
  exports.DEFAULT_HOST = DEFAULT_HOST;
@@ -3369,7 +4682,9 @@ exports.EmporixServerError = EmporixServerError;
3369
4682
  exports.EmporixValidationError = EmporixValidationError;
3370
4683
  exports.FeeService = FeeService;
3371
4684
  exports.HttpClient = HttpClient;
4685
+ exports.IndexingService = IndexingService;
3372
4686
  exports.LEVEL = LEVEL;
4687
+ exports.LabelService = LabelService;
3373
4688
  exports.LevelResolver = LevelResolver;
3374
4689
  exports.LocationsService = LocationsService;
3375
4690
  exports.MediaService = MediaService;
@@ -3378,14 +4693,20 @@ exports.PaymentGatewayService = PaymentGatewayService;
3378
4693
  exports.PriceService = PriceService;
3379
4694
  exports.ProductService = ProductService;
3380
4695
  exports.RagIndexerService = RagIndexerService;
4696
+ exports.ReturnsService = ReturnsService;
4697
+ exports.RewardPointsService = RewardPointsService;
3381
4698
  exports.SalesOrdersService = SalesOrdersService;
3382
4699
  exports.SchemaService = SchemaService;
3383
4700
  exports.SegmentService = SegmentService;
4701
+ exports.SepaExportService = SepaExportService;
3384
4702
  exports.SequentialIdService = SequentialIdService;
3385
4703
  exports.SessionContextService = SessionContextService;
4704
+ exports.ShippingService = ShippingService;
3386
4705
  exports.ShoppingListService = ShoppingListService;
3387
4706
  exports.SiteService = SiteService;
4707
+ exports.TaxService = TaxService;
3388
4708
  exports.TenantConfigService = TenantConfigService;
4709
+ exports.UnitHandlingService = UnitHandlingService;
3389
4710
  exports.WebhookService = WebhookService;
3390
4711
  exports.auth = auth;
3391
4712
  exports.createConsoleLogger = createConsoleLogger;