@voucherify/sdk 2.4.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +145 -0
- package/README.md +239 -5
- package/dist/Categories.d.ts +1 -1
- package/dist/Exports.d.ts +4 -0
- package/dist/Loyalties.d.ts +65 -4
- package/dist/ProductCollections.d.ts +26 -0
- package/dist/Promotions.d.ts +3 -1
- package/dist/PromotionsStacks.d.ts +30 -0
- package/dist/Rewards.d.ts +7 -3
- package/dist/ValidationRules.d.ts +4 -0
- package/dist/VoucherifyServerSide.d.ts +2 -0
- package/dist/Vouchers.d.ts +8 -0
- package/dist/types/Categories.d.ts +13 -0
- package/dist/types/Exports.d.ts +119 -0
- package/dist/types/Loyalties.d.ts +436 -4
- package/dist/types/ProductCollections.d.ts +95 -0
- package/dist/types/PromotionsStacks.d.ts +71 -0
- package/dist/types/Rewards.d.ts +101 -1
- package/dist/types/UtilityTypes.d.ts +3 -0
- package/dist/types/ValidationRules.d.ts +21 -0
- package/dist/types/Vouchers.d.ts +138 -0
- package/dist/voucherifysdk.esm.js +275 -9
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/dist/voucherifysdk.umd.development.js +275 -9
- package/dist/voucherifysdk.umd.development.js.map +1 -1
- package/dist/voucherifysdk.umd.production.min.js +1 -1
- package/dist/voucherifysdk.umd.production.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,9 @@ import { OrdersCreateResponse, OrdersItem } from './Orders';
|
|
|
2
2
|
import { ProductsCreateResponse, ProductsCreateSkuResponse } from './Products';
|
|
3
3
|
import { SimpleCustomer } from './Customers';
|
|
4
4
|
import { ValidationRulesCreateAssignmentResponse } from './ValidationRules';
|
|
5
|
-
import { VouchersResponse } from './Vouchers';
|
|
5
|
+
import { VouchersExportTransactionsRequestBody, VouchersExportTransactionsResponseBody, VouchersResponse } from './Vouchers';
|
|
6
|
+
import { Reward, RewardAssignment } from './Rewards';
|
|
7
|
+
import { Category } from './Categories';
|
|
6
8
|
interface LoyaltiesVoucher {
|
|
7
9
|
code_config?: {
|
|
8
10
|
length?: number;
|
|
@@ -465,11 +467,215 @@ export interface LoyaltyPointsTransfer {
|
|
|
465
467
|
code: string;
|
|
466
468
|
points: number;
|
|
467
469
|
}
|
|
468
|
-
export declare type
|
|
469
|
-
|
|
470
|
-
|
|
470
|
+
export declare type LoyaltiesTransferPointsResponseBody = {
|
|
471
|
+
id: string;
|
|
472
|
+
code: string;
|
|
473
|
+
campaign: string;
|
|
474
|
+
campaign_id: string;
|
|
475
|
+
category: string | null;
|
|
476
|
+
category_id: string | null;
|
|
477
|
+
categories: Category[];
|
|
478
|
+
type: 'LOYALTY_CARD';
|
|
479
|
+
loyalty_card: {
|
|
480
|
+
points: number;
|
|
481
|
+
balance: number;
|
|
482
|
+
next_expiration_date?: string;
|
|
483
|
+
next_expiration_points?: number;
|
|
484
|
+
};
|
|
485
|
+
start_date: string | null;
|
|
486
|
+
expiration_date: string | null;
|
|
487
|
+
validity_timeframe: {
|
|
488
|
+
interval?: string;
|
|
489
|
+
duration?: string;
|
|
490
|
+
} | null;
|
|
491
|
+
validity_day_of_week: number[] | null;
|
|
492
|
+
publish?: {
|
|
493
|
+
object: 'list';
|
|
494
|
+
count?: number;
|
|
495
|
+
entries?: string[];
|
|
496
|
+
url?: string;
|
|
497
|
+
};
|
|
498
|
+
redemption?: {
|
|
499
|
+
quantity: number | null;
|
|
500
|
+
redeemed_points?: number;
|
|
501
|
+
redeemed_quantity?: number;
|
|
502
|
+
redemption_entries?: string[];
|
|
503
|
+
object?: 'list';
|
|
504
|
+
url?: string;
|
|
505
|
+
};
|
|
471
506
|
active: boolean;
|
|
507
|
+
additional_info: string | null;
|
|
508
|
+
metadata: Record<string, unknown>;
|
|
509
|
+
is_referral_code: boolean;
|
|
510
|
+
holder_id?: string;
|
|
511
|
+
updated_at?: string;
|
|
512
|
+
created_at: string;
|
|
472
513
|
};
|
|
514
|
+
export declare type LoyaltiesTransferPointsRequestBody = LoyaltiesTransferPoints[];
|
|
515
|
+
export interface LoyaltiesListMemberRewardsRequestQuery {
|
|
516
|
+
affordable_only?: boolean;
|
|
517
|
+
limit?: number;
|
|
518
|
+
page?: number;
|
|
519
|
+
}
|
|
520
|
+
export interface LoyaltiesListMemberRewardsResponseBody {
|
|
521
|
+
object: 'list';
|
|
522
|
+
data_ref: 'data';
|
|
523
|
+
data: {
|
|
524
|
+
reward: Reward;
|
|
525
|
+
assignment: RewardAssignment;
|
|
526
|
+
object: 'loyalty_reward';
|
|
527
|
+
}[];
|
|
528
|
+
total: number;
|
|
529
|
+
}
|
|
530
|
+
export interface LoyaltiesGetPointsExpirationRequestQuery {
|
|
531
|
+
limit?: number;
|
|
532
|
+
page?: number;
|
|
533
|
+
}
|
|
534
|
+
export interface LoyaltiesGetPointsExpirationResponseBody {
|
|
535
|
+
object: 'list';
|
|
536
|
+
data_ref: 'data';
|
|
537
|
+
data: {
|
|
538
|
+
id: string;
|
|
539
|
+
voucher_id: string;
|
|
540
|
+
campaign_id: string;
|
|
541
|
+
bucket: {
|
|
542
|
+
total_points: number;
|
|
543
|
+
};
|
|
544
|
+
created_at: string;
|
|
545
|
+
status: string;
|
|
546
|
+
expires_at: string;
|
|
547
|
+
updated_at?: string;
|
|
548
|
+
object: 'loyalty_points_bucket';
|
|
549
|
+
}[];
|
|
550
|
+
total: number;
|
|
551
|
+
}
|
|
552
|
+
export interface LoyaltiesListCardTransactionsRequestQuery {
|
|
553
|
+
limit?: number;
|
|
554
|
+
page?: number;
|
|
555
|
+
}
|
|
556
|
+
export interface LoyaltiesListCardTransactionsResponseBody {
|
|
557
|
+
object: 'list';
|
|
558
|
+
data_ref: 'data';
|
|
559
|
+
data: LoyaltyCardTransaction[];
|
|
560
|
+
has_more: boolean;
|
|
561
|
+
}
|
|
562
|
+
export declare type LoyaltiesExportCardTransactionsRequestBody = VouchersExportTransactionsRequestBody;
|
|
563
|
+
export interface LoyaltiesAddOrRemoveCardBalanceRequestBody {
|
|
564
|
+
points: number;
|
|
565
|
+
expiration_date?: string;
|
|
566
|
+
expiration_type?: PointsExpirationTypes;
|
|
567
|
+
reason?: string;
|
|
568
|
+
source_id?: string;
|
|
569
|
+
}
|
|
570
|
+
export interface LoyaltiesAddOrRemoveCardBalanceResponseBody {
|
|
571
|
+
points?: number;
|
|
572
|
+
amount?: number;
|
|
573
|
+
total: number;
|
|
574
|
+
balance: number;
|
|
575
|
+
type: 'LOYALTY_CARD' | 'GIFT_VOUCHER';
|
|
576
|
+
object: 'balance';
|
|
577
|
+
related_object: {
|
|
578
|
+
type: 'voucher';
|
|
579
|
+
id: string;
|
|
580
|
+
};
|
|
581
|
+
operation_type?: 'MANUAL' | 'AUTOMATIC';
|
|
582
|
+
}
|
|
583
|
+
export declare type LoyaltiesCreateTiersRequestBody = (LoyaltyTierBase & {
|
|
584
|
+
metadata?: Record<string, unknown>;
|
|
585
|
+
})[];
|
|
586
|
+
export declare type LoyaltiesCreateTiersResponseBody = LoyaltyTier[];
|
|
587
|
+
export declare type LoyaltiesGetRewardDetailsResponseBody = Reward;
|
|
588
|
+
export interface LoyaltiesListTiersRequestQuery {
|
|
589
|
+
limit?: number;
|
|
590
|
+
page?: number;
|
|
591
|
+
order?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at';
|
|
592
|
+
}
|
|
593
|
+
export interface LoyaltiesListLoyaltyTierEarningRulesRequestQuery {
|
|
594
|
+
limit?: number;
|
|
595
|
+
page?: number;
|
|
596
|
+
}
|
|
597
|
+
export declare type LoyaltiesGetTierResponseBody = LoyaltyTier;
|
|
598
|
+
export interface LoyaltiesListTiersResponseBody {
|
|
599
|
+
object: 'list';
|
|
600
|
+
data_ref: 'data';
|
|
601
|
+
data: LoyaltyTier[];
|
|
602
|
+
total: number;
|
|
603
|
+
}
|
|
604
|
+
export interface LoyaltiesListMemberLoyaltyTiersResponseBody {
|
|
605
|
+
object: 'list';
|
|
606
|
+
data_ref: 'data';
|
|
607
|
+
data: LoyaltyTier[];
|
|
608
|
+
total: number;
|
|
609
|
+
}
|
|
610
|
+
export interface LoyaltiesListMemberRewardsRequestQuery {
|
|
611
|
+
affordable_only?: boolean;
|
|
612
|
+
limit?: number;
|
|
613
|
+
page?: number;
|
|
614
|
+
}
|
|
615
|
+
export interface LoyaltiesListMemberRewardsResponseBody {
|
|
616
|
+
object: 'list';
|
|
617
|
+
data_ref: 'data';
|
|
618
|
+
data: {
|
|
619
|
+
reward: Reward;
|
|
620
|
+
assignment: RewardAssignment;
|
|
621
|
+
object: 'loyalty_reward';
|
|
622
|
+
}[];
|
|
623
|
+
total: number;
|
|
624
|
+
}
|
|
625
|
+
export interface LoyaltiesGetPointsExpirationRequestQuery {
|
|
626
|
+
limit?: number;
|
|
627
|
+
page?: number;
|
|
628
|
+
}
|
|
629
|
+
export interface LoyaltiesGetPointsExpirationResponseBody {
|
|
630
|
+
object: 'list';
|
|
631
|
+
data_ref: 'data';
|
|
632
|
+
data: {
|
|
633
|
+
id: string;
|
|
634
|
+
voucher_id: string;
|
|
635
|
+
campaign_id: string;
|
|
636
|
+
bucket: {
|
|
637
|
+
total_points: number;
|
|
638
|
+
};
|
|
639
|
+
created_at: string;
|
|
640
|
+
status: string;
|
|
641
|
+
expires_at: string;
|
|
642
|
+
updated_at?: string;
|
|
643
|
+
object: 'loyalty_points_bucket';
|
|
644
|
+
}[];
|
|
645
|
+
total: number;
|
|
646
|
+
}
|
|
647
|
+
export interface LoyaltiesListCardTransactionsRequestQuery {
|
|
648
|
+
limit?: number;
|
|
649
|
+
page?: number;
|
|
650
|
+
}
|
|
651
|
+
export interface LoyaltiesListCardTransactionsResponseBody {
|
|
652
|
+
object: 'list';
|
|
653
|
+
data_ref: 'data';
|
|
654
|
+
data: LoyaltyCardTransaction[];
|
|
655
|
+
has_more: boolean;
|
|
656
|
+
}
|
|
657
|
+
export declare type LoyaltiesExportCardTransactionsResponseBody = VouchersExportTransactionsResponseBody;
|
|
658
|
+
export interface LoyaltiesAddOrRemoveCardBalanceRequestBody {
|
|
659
|
+
points: number;
|
|
660
|
+
expiration_date?: string;
|
|
661
|
+
expiration_type?: PointsExpirationTypes;
|
|
662
|
+
reason?: string;
|
|
663
|
+
source_id?: string;
|
|
664
|
+
}
|
|
665
|
+
export interface LoyaltiesAddOrRemoveCardBalanceResponseBody {
|
|
666
|
+
points?: number;
|
|
667
|
+
amount?: number;
|
|
668
|
+
total: number;
|
|
669
|
+
balance: number;
|
|
670
|
+
type: 'LOYALTY_CARD' | 'GIFT_VOUCHER';
|
|
671
|
+
object: 'balance';
|
|
672
|
+
related_object: {
|
|
673
|
+
type: 'voucher';
|
|
674
|
+
id: string;
|
|
675
|
+
};
|
|
676
|
+
operation_type?: 'MANUAL' | 'AUTOMATIC';
|
|
677
|
+
}
|
|
678
|
+
export declare type LoyaltiesGetEarningRuleResponseBody = EarningRule;
|
|
473
679
|
export declare type LoyaltiesEnableEarningRulesResponseBody = EarningRuleBase & {
|
|
474
680
|
updated_at: string | null;
|
|
475
681
|
active: true;
|
|
@@ -478,6 +684,198 @@ export declare type LoyaltiesDisableEarningRulesResponseBody = EarningRuleBase &
|
|
|
478
684
|
updated_at: string | null;
|
|
479
685
|
active: false;
|
|
480
686
|
};
|
|
687
|
+
export declare type LoyaltiesListLoyaltyTierEarningRulesResponseBody = {
|
|
688
|
+
object: 'list';
|
|
689
|
+
data_ref: 'data';
|
|
690
|
+
data: EarningRule[];
|
|
691
|
+
total: number;
|
|
692
|
+
};
|
|
693
|
+
export declare type LoyaltiesGetRewardAssignmentResponseBody = RewardAssignment;
|
|
694
|
+
export interface LoyaltiesListLoyaltyTierRewardsResponseBody {
|
|
695
|
+
object: 'list';
|
|
696
|
+
data_ref: 'data';
|
|
697
|
+
total: number;
|
|
698
|
+
data: {
|
|
699
|
+
reward: {
|
|
700
|
+
id: string;
|
|
701
|
+
name: string;
|
|
702
|
+
stock: number | null;
|
|
703
|
+
redeemed: number | null;
|
|
704
|
+
attributes?: {
|
|
705
|
+
image_url?: string;
|
|
706
|
+
description?: string;
|
|
707
|
+
};
|
|
708
|
+
metadata: Record<string, undefined>;
|
|
709
|
+
created_at: string;
|
|
710
|
+
updated_at: string | null;
|
|
711
|
+
object: 'reward';
|
|
712
|
+
} & LoyaltyTierRewardItemParameters;
|
|
713
|
+
assignment: RewardAssignment;
|
|
714
|
+
object: 'loyalty_tier_reward';
|
|
715
|
+
}[];
|
|
716
|
+
}
|
|
717
|
+
export interface LoyaltyTierBase {
|
|
718
|
+
name: string;
|
|
719
|
+
earning_rules?: Record<string, MappingMultiply | MappingFixed>;
|
|
720
|
+
rewards?: Record<string, MappingMultiply | MappingFixed>;
|
|
721
|
+
points: {
|
|
722
|
+
from?: number;
|
|
723
|
+
to?: number;
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
export declare type LoyaltyTier = LoyaltyTierBase & {
|
|
727
|
+
id: string;
|
|
728
|
+
campaign_id: string;
|
|
729
|
+
metadata: Record<string, unknown> | null;
|
|
730
|
+
created_at: string;
|
|
731
|
+
updated_at?: string | null;
|
|
732
|
+
config: {
|
|
733
|
+
points: {
|
|
734
|
+
from?: number;
|
|
735
|
+
to?: number;
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
expiration?: {
|
|
739
|
+
customer_id: string;
|
|
740
|
+
campaign_id: string;
|
|
741
|
+
tier_id: string;
|
|
742
|
+
start_date?: string;
|
|
743
|
+
expiration_date?: string;
|
|
744
|
+
created_at: string;
|
|
745
|
+
updated_at?: string;
|
|
746
|
+
};
|
|
747
|
+
object: 'loyalty_tier';
|
|
748
|
+
};
|
|
749
|
+
interface MappingMultiply {
|
|
750
|
+
type: 'MULTIPLY';
|
|
751
|
+
multiplier: number;
|
|
752
|
+
}
|
|
753
|
+
interface MappingFixed {
|
|
754
|
+
type: 'CUSTOM';
|
|
755
|
+
points: number;
|
|
756
|
+
}
|
|
757
|
+
export interface SimpleLoyaltyVoucher {
|
|
758
|
+
id: string;
|
|
759
|
+
code: string;
|
|
760
|
+
loyalty_card: {
|
|
761
|
+
points: number;
|
|
762
|
+
balance: number;
|
|
763
|
+
next_expiration_date?: string;
|
|
764
|
+
next_expiration_points?: string;
|
|
765
|
+
};
|
|
766
|
+
type: 'LOYALTY_CARD';
|
|
767
|
+
campaign: string;
|
|
768
|
+
campaign_id: string;
|
|
769
|
+
is_referral_code?: boolean;
|
|
770
|
+
holder_id?: string;
|
|
771
|
+
referrer_id?: string;
|
|
772
|
+
created_at?: string;
|
|
773
|
+
object: 'voucher';
|
|
774
|
+
}
|
|
775
|
+
export interface LoyaltiesTransferPoints {
|
|
776
|
+
code: string;
|
|
777
|
+
points: number;
|
|
778
|
+
reason?: string;
|
|
779
|
+
source_id: string;
|
|
780
|
+
}
|
|
781
|
+
export declare type LoyaltyCardTransactionsFields = 'id' | 'campaign_id' | 'voucher_id' | 'type' | 'source_id' | 'reason' | 'source' | 'balance' | 'amount' | 'related_transaction_id' | 'created_at' | 'details';
|
|
782
|
+
export declare type LoyaltyCardTransactionsType = 'POINTS_ACCRUAL' | 'POINTS_CANCELLATION' | 'POINTS_REDEMPTION' | 'POINTS_REFUND' | 'POINTS_ADDITION' | 'POINTS_REMOVAL' | 'POINTS_EXPIRATION' | 'POINTS_TRANSFER_IN' | 'POINTS_TRANSFER_OUT';
|
|
783
|
+
export declare type EarningRule = EarningRuleBase & {
|
|
784
|
+
validation_rule_id: string | null;
|
|
785
|
+
updated_at: string | null;
|
|
786
|
+
active: boolean;
|
|
787
|
+
};
|
|
788
|
+
export declare type PointsExpirationTypes = 'PROGRAM_RULES' | 'CUSTOM_DATE' | 'NON_EXPIRING';
|
|
789
|
+
export interface LoyaltyCardTransaction {
|
|
790
|
+
id: string;
|
|
791
|
+
source_id: string | null;
|
|
792
|
+
voucher_id: string;
|
|
793
|
+
campaign_id: string;
|
|
794
|
+
source: string | null;
|
|
795
|
+
reason: string | null;
|
|
796
|
+
type: LoyaltyCardTransactionsType;
|
|
797
|
+
details: {
|
|
798
|
+
balance: {
|
|
799
|
+
type: 'loyalty_card';
|
|
800
|
+
total: number;
|
|
801
|
+
object: 'balance';
|
|
802
|
+
points: number;
|
|
803
|
+
balance: number;
|
|
804
|
+
related_object: {
|
|
805
|
+
id: string;
|
|
806
|
+
type: 'voucher';
|
|
807
|
+
};
|
|
808
|
+
};
|
|
809
|
+
order?: {
|
|
810
|
+
id: string;
|
|
811
|
+
source_id: string;
|
|
812
|
+
};
|
|
813
|
+
event?: {
|
|
814
|
+
id: string;
|
|
815
|
+
type: string;
|
|
816
|
+
};
|
|
817
|
+
earning_rule?: {
|
|
818
|
+
id: string;
|
|
819
|
+
source: {
|
|
820
|
+
banner: string;
|
|
821
|
+
};
|
|
822
|
+
};
|
|
823
|
+
segment?: {
|
|
824
|
+
id: string;
|
|
825
|
+
name: string;
|
|
826
|
+
};
|
|
827
|
+
loyalty_tier?: {
|
|
828
|
+
id: string;
|
|
829
|
+
name: string;
|
|
830
|
+
};
|
|
831
|
+
redemption?: {
|
|
832
|
+
id: string;
|
|
833
|
+
};
|
|
834
|
+
rollback?: {
|
|
835
|
+
id: string;
|
|
836
|
+
};
|
|
837
|
+
reward?: {
|
|
838
|
+
id: string;
|
|
839
|
+
name: string;
|
|
840
|
+
};
|
|
841
|
+
custom_event?: {
|
|
842
|
+
id: string;
|
|
843
|
+
type: string;
|
|
844
|
+
};
|
|
845
|
+
event_schema?: {
|
|
846
|
+
id: string;
|
|
847
|
+
name: string;
|
|
848
|
+
};
|
|
849
|
+
source_voucher?: SimpleLoyaltyVoucher;
|
|
850
|
+
destination_voucher?: SimpleLoyaltyVoucher;
|
|
851
|
+
};
|
|
852
|
+
related_transaction_id: string | null;
|
|
853
|
+
created_at: string;
|
|
854
|
+
}
|
|
855
|
+
export interface SimpleLoyaltyVoucher {
|
|
856
|
+
id: string;
|
|
857
|
+
code: string;
|
|
858
|
+
loyalty_card: {
|
|
859
|
+
points: number;
|
|
860
|
+
balance: number;
|
|
861
|
+
next_expiration_date?: string;
|
|
862
|
+
next_expiration_points?: string;
|
|
863
|
+
};
|
|
864
|
+
type: 'LOYALTY_CARD';
|
|
865
|
+
campaign: string;
|
|
866
|
+
campaign_id: string;
|
|
867
|
+
is_referral_code?: boolean;
|
|
868
|
+
holder_id?: string;
|
|
869
|
+
referrer_id?: string;
|
|
870
|
+
created_at?: string;
|
|
871
|
+
object: 'voucher';
|
|
872
|
+
}
|
|
873
|
+
export interface LoyaltiesTransferPoints {
|
|
874
|
+
code: string;
|
|
875
|
+
points: number;
|
|
876
|
+
reason?: string;
|
|
877
|
+
source_id: string;
|
|
878
|
+
}
|
|
481
879
|
export interface EarningRuleBase {
|
|
482
880
|
id: string;
|
|
483
881
|
created_at: string;
|
|
@@ -605,4 +1003,38 @@ export interface EarningRuleProportionalCustomEvent {
|
|
|
605
1003
|
};
|
|
606
1004
|
};
|
|
607
1005
|
}
|
|
1006
|
+
export declare type LoyaltyTierRewardItemParameters = LoyaltyTierRewardItemCampaignParameters | LoyaltyTierRewardItemCoinParameters | LoyaltyTierRewardItemMaterialParameters;
|
|
1007
|
+
export interface LoyaltyTierRewardItemCampaignParameters {
|
|
1008
|
+
type: 'CAMPAIGN';
|
|
1009
|
+
parameters: {
|
|
1010
|
+
campaign: LoyaltyTierRewardItemCampaignDiscountCoupons | LoyaltyTierRewardItemCampaignGiftVouchersAndLoyaltyProgram;
|
|
1011
|
+
};
|
|
1012
|
+
}
|
|
1013
|
+
export interface LoyaltyTierRewardItemCoinParameters {
|
|
1014
|
+
type: 'COIN';
|
|
1015
|
+
parameters: {
|
|
1016
|
+
coin: {
|
|
1017
|
+
exchange_ratio: number;
|
|
1018
|
+
points_ratio: number;
|
|
1019
|
+
};
|
|
1020
|
+
};
|
|
1021
|
+
}
|
|
1022
|
+
export interface LoyaltyTierRewardItemMaterialParameters {
|
|
1023
|
+
type: 'MATERIAL';
|
|
1024
|
+
parameters: {
|
|
1025
|
+
product: {
|
|
1026
|
+
id: string;
|
|
1027
|
+
sku_id: string | null;
|
|
1028
|
+
};
|
|
1029
|
+
};
|
|
1030
|
+
}
|
|
1031
|
+
export interface LoyaltyTierRewardItemCampaignDiscountCoupons {
|
|
1032
|
+
id: string;
|
|
1033
|
+
type: string;
|
|
1034
|
+
}
|
|
1035
|
+
export interface LoyaltyTierRewardItemCampaignGiftVouchersAndLoyaltyProgram {
|
|
1036
|
+
id: string;
|
|
1037
|
+
balance: number;
|
|
1038
|
+
type: string;
|
|
1039
|
+
}
|
|
608
1040
|
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { WithRequiredProperty } from './UtilityTypes';
|
|
2
|
+
export interface ProductIdentity {
|
|
3
|
+
id?: string;
|
|
4
|
+
object?: 'product';
|
|
5
|
+
}
|
|
6
|
+
export interface SkuIdentity {
|
|
7
|
+
id?: string;
|
|
8
|
+
product_id?: string;
|
|
9
|
+
object?: 'sku';
|
|
10
|
+
}
|
|
11
|
+
export interface ProductBase {
|
|
12
|
+
name?: string | null;
|
|
13
|
+
price?: number | null;
|
|
14
|
+
attributes?: string[];
|
|
15
|
+
metadata?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
export interface SkuBase {
|
|
18
|
+
sku?: string | null;
|
|
19
|
+
price?: number | null;
|
|
20
|
+
attributes?: Record<string, unknown>;
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
product?: Required<ProductIdentity> & Required<ProductBase> & {
|
|
23
|
+
source_id: string | null;
|
|
24
|
+
object: 'product';
|
|
25
|
+
};
|
|
26
|
+
image_url?: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface ProductSaved {
|
|
29
|
+
created_at?: string;
|
|
30
|
+
updated_at?: string | null;
|
|
31
|
+
image_url?: string | null;
|
|
32
|
+
object?: 'product';
|
|
33
|
+
}
|
|
34
|
+
export interface SkuSaved {
|
|
35
|
+
created_at?: string;
|
|
36
|
+
updated_at?: string | null;
|
|
37
|
+
image_url?: string | null;
|
|
38
|
+
object?: 'sku';
|
|
39
|
+
}
|
|
40
|
+
export declare type ProductOrSkuIdentity = Required<SkuIdentity> | Required<ProductIdentity>;
|
|
41
|
+
export interface ProductCollectionIdentity {
|
|
42
|
+
id?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface ProductCollectionSaved {
|
|
45
|
+
created_at?: string;
|
|
46
|
+
object?: 'products_collection';
|
|
47
|
+
}
|
|
48
|
+
export declare type ProductCollectionBase = StaticProductCollectionBase | DynamicProductCollectionBase;
|
|
49
|
+
export interface StaticProductCollectionBase {
|
|
50
|
+
name?: string;
|
|
51
|
+
type?: 'STATIC';
|
|
52
|
+
products?: ProductOrSkuIdentity[];
|
|
53
|
+
}
|
|
54
|
+
export interface DynamicProductCollectionBase {
|
|
55
|
+
name?: string;
|
|
56
|
+
type?: 'AUTO_UPDATE';
|
|
57
|
+
filter?: Filter;
|
|
58
|
+
}
|
|
59
|
+
export declare type ProductCollection = ProductCollectionBase & ProductCollectionIdentity & ProductCollectionSaved;
|
|
60
|
+
export declare type Filter = {
|
|
61
|
+
junction: Junction;
|
|
62
|
+
} & Partial<Record<AllowedFiltersKeys, {
|
|
63
|
+
conditions: Partial<Record<FiltersCondition, unknown>>;
|
|
64
|
+
}>>;
|
|
65
|
+
export declare type Junction = 'and' | 'AND' | 'or' | 'OR';
|
|
66
|
+
export declare type AllowedFiltersKeys = 'id' | 'name' | 'attributes' | 'source_id' | 'price' | 'image_url' | 'product_id' | 'skus' | 'created_at' | 'updated_at' | 'object' | `metadata.${string}`;
|
|
67
|
+
export declare type FiltersCondition = '$in' | '$not_in' | '$is' | '$is_days_ago' | '$is_days_in_future' | '$is_not' | '$has_value' | '$is_unknown' | '$contains' | '$not_contain' | '$starts_with' | '$ends_with' | '$more_than' | '$less_than' | '$more_than_ago' | '$less_than_ago' | '$more_than_future' | '$less_than_future' | '$more_than_equal' | '$less_than_equal' | '$after' | '$before' | '$count' | '$count_less' | '$count_more';
|
|
68
|
+
export declare type ProductCollectionsCreateRequestBody = WithRequiredProperty<StaticProductCollectionBase, 'name' | 'type'> | Required<DynamicProductCollectionBase>;
|
|
69
|
+
export declare type ProductCollectionsCreateResponseBody = Required<ProductCollectionBase> & Required<ProductCollectionIdentity> & Required<ProductCollectionSaved>;
|
|
70
|
+
export interface ProductCollectionsListRequestQuery {
|
|
71
|
+
limit?: number;
|
|
72
|
+
page?: number;
|
|
73
|
+
order?: 'created_at' | '-created_at';
|
|
74
|
+
}
|
|
75
|
+
export interface ProductCollectionsListResponseBody {
|
|
76
|
+
object: 'list';
|
|
77
|
+
data_ref: 'data';
|
|
78
|
+
data: Required<ProductCollection>[];
|
|
79
|
+
total: number;
|
|
80
|
+
}
|
|
81
|
+
export declare type ProductCollectionsGetResponseBody = Required<ProductCollection>;
|
|
82
|
+
export interface ProductCollectionsListProductsRequestQuery {
|
|
83
|
+
limit?: number;
|
|
84
|
+
page?: number;
|
|
85
|
+
}
|
|
86
|
+
export interface ProductCollectionsListProductsResponseBody {
|
|
87
|
+
object: 'list';
|
|
88
|
+
data_ref: 'data';
|
|
89
|
+
data: ((Required<SkuIdentity> & Required<SkuSaved> & Required<SkuBase> & {
|
|
90
|
+
source_id: string | null;
|
|
91
|
+
}) | (Required<ProductIdentity> & Required<ProductSaved> & Required<ProductBase> & {
|
|
92
|
+
source_id: string | null;
|
|
93
|
+
}))[];
|
|
94
|
+
total: number;
|
|
95
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Category } from './Categories';
|
|
2
|
+
export interface PromotionsStacksListInCampaignResponseBody {
|
|
3
|
+
object: 'list';
|
|
4
|
+
data_ref: 'data';
|
|
5
|
+
data: PromotionStack[];
|
|
6
|
+
total: number;
|
|
7
|
+
}
|
|
8
|
+
export interface PromotionsStacksListResponseBody {
|
|
9
|
+
object: 'list';
|
|
10
|
+
data_ref: 'data';
|
|
11
|
+
data: PromotionStack[];
|
|
12
|
+
total: number;
|
|
13
|
+
}
|
|
14
|
+
export interface PromotionsStacksListRequestQuery {
|
|
15
|
+
limit?: number;
|
|
16
|
+
page?: number;
|
|
17
|
+
order?: 'created_at' | '-created_at' | 'updated_at' | '-updated_at' | 'name' | '-name';
|
|
18
|
+
created_at?: {
|
|
19
|
+
before?: string;
|
|
20
|
+
after?: string;
|
|
21
|
+
};
|
|
22
|
+
updated_at?: {
|
|
23
|
+
before?: string;
|
|
24
|
+
after?: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export declare type PromotionsStacksGetResponseBody = PromotionStack;
|
|
28
|
+
export declare type PromotionsStacksUpdateRequestBody = {
|
|
29
|
+
name: string;
|
|
30
|
+
tiers?: {
|
|
31
|
+
ids?: string[];
|
|
32
|
+
hierarchy_mode?: 'MANUAL';
|
|
33
|
+
};
|
|
34
|
+
category_id?: string;
|
|
35
|
+
};
|
|
36
|
+
export declare type PromotionsStacksUpdateResponseBody = PromotionStackBase & {
|
|
37
|
+
id: string;
|
|
38
|
+
created_at: string;
|
|
39
|
+
updated_at: string;
|
|
40
|
+
campaign_id: string;
|
|
41
|
+
object: 'promotion_stack';
|
|
42
|
+
category_id: string | null;
|
|
43
|
+
categories: Category[];
|
|
44
|
+
};
|
|
45
|
+
export declare type PromotionsStacksCreateInCampaignRequestBody = PromotionStackBase & {
|
|
46
|
+
category_id?: string;
|
|
47
|
+
};
|
|
48
|
+
export declare type PromotionsStacksCreateInCampaignResponseBody = PromotionStackBase & {
|
|
49
|
+
id: string;
|
|
50
|
+
created_at: string;
|
|
51
|
+
campaign_id: string;
|
|
52
|
+
object: 'promotion_stack';
|
|
53
|
+
category_id: string | null;
|
|
54
|
+
categories: Category[];
|
|
55
|
+
};
|
|
56
|
+
export interface PromotionStackBase {
|
|
57
|
+
name: string;
|
|
58
|
+
tiers: {
|
|
59
|
+
ids: string[];
|
|
60
|
+
hierarchy_mode?: 'MANUAL';
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export declare type PromotionStack = PromotionStackBase & {
|
|
64
|
+
id: string;
|
|
65
|
+
created_at: string;
|
|
66
|
+
updated_at?: string;
|
|
67
|
+
campaign_id: string;
|
|
68
|
+
object: 'promotion_stack';
|
|
69
|
+
category_id: string | null;
|
|
70
|
+
categories: Category[];
|
|
71
|
+
};
|