@moonbase.sh/vue 0.2.143 → 0.3.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
@@ -616,6 +616,7 @@ function useCart(context) {
616
616
  return { amount: total, currency };
617
617
  }),
618
618
  addToCart: (item, variation) => {
619
+ var _a, _b;
619
620
  item = (0, import_vue6.unref)(item);
620
621
  variation != null ? variation : variation = item.defaultVariation;
621
622
  if (!variation)
@@ -633,7 +634,8 @@ function useCart(context) {
633
634
  variation,
634
635
  variationId: variation.id,
635
636
  price: variation.price,
636
- appliedDiscount: variation.discount
637
+ appliedDiscount: variation.discount,
638
+ isDefaultVariation: variation.id === ((_a = item.defaultVariation) == null ? void 0 : _a.id)
637
639
  };
638
640
  storefront.currentOrder.value.items.push(lineItem);
639
641
  } else if (item.type === "product") {
@@ -646,7 +648,8 @@ function useCart(context) {
646
648
  variation,
647
649
  variationId: variation.id,
648
650
  price: variation.price,
649
- appliedDiscount: variation.discount
651
+ appliedDiscount: variation.discount,
652
+ isDefaultVariation: variation.id === ((_b = item.defaultVariation) == null ? void 0 : _b.id)
650
653
  };
651
654
  storefront.currentOrder.value.items.push(lineItem);
652
655
  } else {
package/dist/index.d.cts CHANGED
@@ -177,12 +177,20 @@ declare function useCart(context?: StorefrontContext): {
177
177
  tagline: string;
178
178
  iconUrl: string | null;
179
179
  } | undefined;
180
+ isDefaultVariation?: boolean | null | undefined;
181
+ isSubcriptionPayment?: boolean | null | undefined;
180
182
  variation?: {
181
183
  id: string;
182
184
  name: string;
183
185
  originalPrice: Record<string, number>;
184
186
  price: Record<string, number>;
185
187
  hasDiscount: boolean;
188
+ recurrence: {
189
+ type: "OneOff";
190
+ } | {
191
+ type: "Recurring";
192
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
193
+ };
186
194
  discount?: {
187
195
  type: "PercentageOffDiscount";
188
196
  name: string;
@@ -198,9 +206,9 @@ declare function useCart(context?: StorefrontContext): {
198
206
  total?: Record<string, number> | undefined;
199
207
  } | undefined;
200
208
  pricingTiers?: {
201
- minQuantity: number;
202
209
  originalPrice: Record<string, number>;
203
210
  price: Record<string, number>;
211
+ minQuantity: number;
204
212
  }[] | null | undefined;
205
213
  } | undefined;
206
214
  appliedDiscount?: {
@@ -239,12 +247,20 @@ declare function useCart(context?: StorefrontContext): {
239
247
  included?: boolean | undefined;
240
248
  })[];
241
249
  } | undefined;
250
+ isDefaultVariation?: boolean | null | undefined;
251
+ isSubcriptionPayment?: boolean | null | undefined;
242
252
  variation?: {
243
253
  id: string;
244
254
  name: string;
245
255
  originalPrice: Record<string, number>;
246
256
  price: Record<string, number>;
247
257
  hasDiscount: boolean;
258
+ recurrence: {
259
+ type: "OneOff";
260
+ } | {
261
+ type: "Recurring";
262
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
263
+ };
248
264
  discount?: {
249
265
  type: "PercentageOffDiscount";
250
266
  name: string;
@@ -260,9 +276,9 @@ declare function useCart(context?: StorefrontContext): {
260
276
  total?: Record<string, number> | undefined;
261
277
  } | undefined;
262
278
  pricingTiers?: {
263
- minQuantity: number;
264
279
  originalPrice: Record<string, number>;
265
280
  price: Record<string, number>;
281
+ minQuantity: number;
266
282
  }[] | null | undefined;
267
283
  } | undefined;
268
284
  appliedDiscount?: {
@@ -356,6 +372,7 @@ declare function useInventory(context?: StorefrontContext): {
356
372
  name: string;
357
373
  licenseId: string;
358
374
  activationMethod: ActivationMethod;
375
+ firstValidatedAt: Date;
359
376
  lastValidatedAt: Date | null;
360
377
  }>>;
361
378
  getProduct: (productId: string, version?: string) => Promise<{
@@ -471,6 +488,7 @@ declare function useInventory(context?: StorefrontContext): {
471
488
  name: string;
472
489
  licenseId: string;
473
490
  activationMethod: ActivationMethod;
491
+ firstValidatedAt: Date;
474
492
  lastValidatedAt: Date | null;
475
493
  }>>;
476
494
  revokeActivation: (activation: Activation) => Promise<void>;
@@ -569,6 +587,12 @@ declare function useVoucher(context?: StorefrontContext): {
569
587
  originalPrice: Record<string, number>;
570
588
  price: Record<string, number>;
571
589
  hasDiscount: boolean;
590
+ recurrence: {
591
+ type: "OneOff";
592
+ } | {
593
+ type: "Recurring";
594
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
595
+ };
572
596
  discount?: {
573
597
  type: "PercentageOffDiscount";
574
598
  name: string;
@@ -584,9 +608,9 @@ declare function useVoucher(context?: StorefrontContext): {
584
608
  total?: Record<string, number> | undefined;
585
609
  } | undefined;
586
610
  pricingTiers?: {
587
- minQuantity: number;
588
611
  originalPrice: Record<string, number>;
589
612
  price: Record<string, number>;
613
+ minQuantity: number;
590
614
  }[] | null | undefined;
591
615
  } | undefined;
592
616
  variations?: {
@@ -595,6 +619,12 @@ declare function useVoucher(context?: StorefrontContext): {
595
619
  originalPrice: Record<string, number>;
596
620
  price: Record<string, number>;
597
621
  hasDiscount: boolean;
622
+ recurrence: {
623
+ type: "OneOff";
624
+ } | {
625
+ type: "Recurring";
626
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
627
+ };
598
628
  discount?: {
599
629
  type: "PercentageOffDiscount";
600
630
  name: string;
@@ -610,9 +640,9 @@ declare function useVoucher(context?: StorefrontContext): {
610
640
  total?: Record<string, number> | undefined;
611
641
  } | undefined;
612
642
  pricingTiers?: {
613
- minQuantity: number;
614
643
  originalPrice: Record<string, number>;
615
644
  price: Record<string, number>;
645
+ minQuantity: number;
616
646
  }[] | null | undefined;
617
647
  }[] | undefined;
618
648
  };
@@ -658,6 +688,12 @@ declare function useVoucher(context?: StorefrontContext): {
658
688
  originalPrice: Record<string, number>;
659
689
  price: Record<string, number>;
660
690
  hasDiscount: boolean;
691
+ recurrence: {
692
+ type: "OneOff";
693
+ } | {
694
+ type: "Recurring";
695
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
696
+ };
661
697
  discount?: {
662
698
  type: "PercentageOffDiscount";
663
699
  name: string;
@@ -673,9 +709,9 @@ declare function useVoucher(context?: StorefrontContext): {
673
709
  total?: Record<string, number> | undefined;
674
710
  } | undefined;
675
711
  pricingTiers?: {
676
- minQuantity: number;
677
712
  originalPrice: Record<string, number>;
678
713
  price: Record<string, number>;
714
+ minQuantity: number;
679
715
  }[] | null | undefined;
680
716
  } | undefined;
681
717
  variations?: {
@@ -684,6 +720,12 @@ declare function useVoucher(context?: StorefrontContext): {
684
720
  originalPrice: Record<string, number>;
685
721
  price: Record<string, number>;
686
722
  hasDiscount: boolean;
723
+ recurrence: {
724
+ type: "OneOff";
725
+ } | {
726
+ type: "Recurring";
727
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
728
+ };
687
729
  discount?: {
688
730
  type: "PercentageOffDiscount";
689
731
  name: string;
@@ -699,9 +741,9 @@ declare function useVoucher(context?: StorefrontContext): {
699
741
  total?: Record<string, number> | undefined;
700
742
  } | undefined;
701
743
  pricingTiers?: {
702
- minQuantity: number;
703
744
  originalPrice: Record<string, number>;
704
745
  price: Record<string, number>;
746
+ minQuantity: number;
705
747
  }[] | null | undefined;
706
748
  }[] | undefined;
707
749
  } & {
@@ -713,6 +755,12 @@ declare function useVoucher(context?: StorefrontContext): {
713
755
  originalPrice: Record<string, number>;
714
756
  price: Record<string, number>;
715
757
  hasDiscount: boolean;
758
+ recurrence: {
759
+ type: "OneOff";
760
+ } | {
761
+ type: "Recurring";
762
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
763
+ };
716
764
  discount?: {
717
765
  type: "PercentageOffDiscount";
718
766
  name: string;
@@ -728,9 +776,9 @@ declare function useVoucher(context?: StorefrontContext): {
728
776
  total?: Record<string, number> | undefined;
729
777
  } | undefined;
730
778
  pricingTiers?: {
731
- minQuantity: number;
732
779
  originalPrice: Record<string, number>;
733
780
  price: Record<string, number>;
781
+ minQuantity: number;
734
782
  }[] | null | undefined;
735
783
  } | undefined;
736
784
  variations?: {
@@ -739,6 +787,12 @@ declare function useVoucher(context?: StorefrontContext): {
739
787
  originalPrice: Record<string, number>;
740
788
  price: Record<string, number>;
741
789
  hasDiscount: boolean;
790
+ recurrence: {
791
+ type: "OneOff";
792
+ } | {
793
+ type: "Recurring";
794
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
795
+ };
742
796
  discount?: {
743
797
  type: "PercentageOffDiscount";
744
798
  name: string;
@@ -754,9 +808,9 @@ declare function useVoucher(context?: StorefrontContext): {
754
808
  total?: Record<string, number> | undefined;
755
809
  } | undefined;
756
810
  pricingTiers?: {
757
- minQuantity: number;
758
811
  originalPrice: Record<string, number>;
759
812
  price: Record<string, number>;
813
+ minQuantity: number;
760
814
  }[] | null | undefined;
761
815
  }[] | undefined;
762
816
  };
@@ -800,6 +854,12 @@ declare function useVoucher(context?: StorefrontContext): {
800
854
  originalPrice: Record<string, number>;
801
855
  price: Record<string, number>;
802
856
  hasDiscount: boolean;
857
+ recurrence: {
858
+ type: "OneOff";
859
+ } | {
860
+ type: "Recurring";
861
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
862
+ };
803
863
  discount?: {
804
864
  type: "PercentageOffDiscount";
805
865
  name: string;
@@ -815,9 +875,9 @@ declare function useVoucher(context?: StorefrontContext): {
815
875
  total?: Record<string, number> | undefined;
816
876
  } | undefined;
817
877
  pricingTiers?: {
818
- minQuantity: number;
819
878
  originalPrice: Record<string, number>;
820
879
  price: Record<string, number>;
880
+ minQuantity: number;
821
881
  }[] | null | undefined;
822
882
  } | undefined;
823
883
  variations?: {
@@ -826,6 +886,12 @@ declare function useVoucher(context?: StorefrontContext): {
826
886
  originalPrice: Record<string, number>;
827
887
  price: Record<string, number>;
828
888
  hasDiscount: boolean;
889
+ recurrence: {
890
+ type: "OneOff";
891
+ } | {
892
+ type: "Recurring";
893
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
894
+ };
829
895
  discount?: {
830
896
  type: "PercentageOffDiscount";
831
897
  name: string;
@@ -841,9 +907,9 @@ declare function useVoucher(context?: StorefrontContext): {
841
907
  total?: Record<string, number> | undefined;
842
908
  } | undefined;
843
909
  pricingTiers?: {
844
- minQuantity: number;
845
910
  originalPrice: Record<string, number>;
846
911
  price: Record<string, number>;
912
+ minQuantity: number;
847
913
  }[] | null | undefined;
848
914
  }[] | undefined;
849
915
  };
@@ -889,6 +955,12 @@ declare function useVoucher(context?: StorefrontContext): {
889
955
  originalPrice: Record<string, number>;
890
956
  price: Record<string, number>;
891
957
  hasDiscount: boolean;
958
+ recurrence: {
959
+ type: "OneOff";
960
+ } | {
961
+ type: "Recurring";
962
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
963
+ };
892
964
  discount?: {
893
965
  type: "PercentageOffDiscount";
894
966
  name: string;
@@ -904,9 +976,9 @@ declare function useVoucher(context?: StorefrontContext): {
904
976
  total?: Record<string, number> | undefined;
905
977
  } | undefined;
906
978
  pricingTiers?: {
907
- minQuantity: number;
908
979
  originalPrice: Record<string, number>;
909
980
  price: Record<string, number>;
981
+ minQuantity: number;
910
982
  }[] | null | undefined;
911
983
  } | undefined;
912
984
  variations?: {
@@ -915,6 +987,12 @@ declare function useVoucher(context?: StorefrontContext): {
915
987
  originalPrice: Record<string, number>;
916
988
  price: Record<string, number>;
917
989
  hasDiscount: boolean;
990
+ recurrence: {
991
+ type: "OneOff";
992
+ } | {
993
+ type: "Recurring";
994
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
995
+ };
918
996
  discount?: {
919
997
  type: "PercentageOffDiscount";
920
998
  name: string;
@@ -930,9 +1008,9 @@ declare function useVoucher(context?: StorefrontContext): {
930
1008
  total?: Record<string, number> | undefined;
931
1009
  } | undefined;
932
1010
  pricingTiers?: {
933
- minQuantity: number;
934
1011
  originalPrice: Record<string, number>;
935
1012
  price: Record<string, number>;
1013
+ minQuantity: number;
936
1014
  }[] | null | undefined;
937
1015
  }[] | undefined;
938
1016
  } & {
@@ -944,6 +1022,12 @@ declare function useVoucher(context?: StorefrontContext): {
944
1022
  originalPrice: Record<string, number>;
945
1023
  price: Record<string, number>;
946
1024
  hasDiscount: boolean;
1025
+ recurrence: {
1026
+ type: "OneOff";
1027
+ } | {
1028
+ type: "Recurring";
1029
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
1030
+ };
947
1031
  discount?: {
948
1032
  type: "PercentageOffDiscount";
949
1033
  name: string;
@@ -959,9 +1043,9 @@ declare function useVoucher(context?: StorefrontContext): {
959
1043
  total?: Record<string, number> | undefined;
960
1044
  } | undefined;
961
1045
  pricingTiers?: {
962
- minQuantity: number;
963
1046
  originalPrice: Record<string, number>;
964
1047
  price: Record<string, number>;
1048
+ minQuantity: number;
965
1049
  }[] | null | undefined;
966
1050
  } | undefined;
967
1051
  variations?: {
@@ -970,6 +1054,12 @@ declare function useVoucher(context?: StorefrontContext): {
970
1054
  originalPrice: Record<string, number>;
971
1055
  price: Record<string, number>;
972
1056
  hasDiscount: boolean;
1057
+ recurrence: {
1058
+ type: "OneOff";
1059
+ } | {
1060
+ type: "Recurring";
1061
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
1062
+ };
973
1063
  discount?: {
974
1064
  type: "PercentageOffDiscount";
975
1065
  name: string;
@@ -985,9 +1075,9 @@ declare function useVoucher(context?: StorefrontContext): {
985
1075
  total?: Record<string, number> | undefined;
986
1076
  } | undefined;
987
1077
  pricingTiers?: {
988
- minQuantity: number;
989
1078
  originalPrice: Record<string, number>;
990
1079
  price: Record<string, number>;
1080
+ minQuantity: number;
991
1081
  }[] | null | undefined;
992
1082
  }[] | undefined;
993
1083
  };
package/dist/index.d.ts CHANGED
@@ -177,12 +177,20 @@ declare function useCart(context?: StorefrontContext): {
177
177
  tagline: string;
178
178
  iconUrl: string | null;
179
179
  } | undefined;
180
+ isDefaultVariation?: boolean | null | undefined;
181
+ isSubcriptionPayment?: boolean | null | undefined;
180
182
  variation?: {
181
183
  id: string;
182
184
  name: string;
183
185
  originalPrice: Record<string, number>;
184
186
  price: Record<string, number>;
185
187
  hasDiscount: boolean;
188
+ recurrence: {
189
+ type: "OneOff";
190
+ } | {
191
+ type: "Recurring";
192
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
193
+ };
186
194
  discount?: {
187
195
  type: "PercentageOffDiscount";
188
196
  name: string;
@@ -198,9 +206,9 @@ declare function useCart(context?: StorefrontContext): {
198
206
  total?: Record<string, number> | undefined;
199
207
  } | undefined;
200
208
  pricingTiers?: {
201
- minQuantity: number;
202
209
  originalPrice: Record<string, number>;
203
210
  price: Record<string, number>;
211
+ minQuantity: number;
204
212
  }[] | null | undefined;
205
213
  } | undefined;
206
214
  appliedDiscount?: {
@@ -239,12 +247,20 @@ declare function useCart(context?: StorefrontContext): {
239
247
  included?: boolean | undefined;
240
248
  })[];
241
249
  } | undefined;
250
+ isDefaultVariation?: boolean | null | undefined;
251
+ isSubcriptionPayment?: boolean | null | undefined;
242
252
  variation?: {
243
253
  id: string;
244
254
  name: string;
245
255
  originalPrice: Record<string, number>;
246
256
  price: Record<string, number>;
247
257
  hasDiscount: boolean;
258
+ recurrence: {
259
+ type: "OneOff";
260
+ } | {
261
+ type: "Recurring";
262
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
263
+ };
248
264
  discount?: {
249
265
  type: "PercentageOffDiscount";
250
266
  name: string;
@@ -260,9 +276,9 @@ declare function useCart(context?: StorefrontContext): {
260
276
  total?: Record<string, number> | undefined;
261
277
  } | undefined;
262
278
  pricingTiers?: {
263
- minQuantity: number;
264
279
  originalPrice: Record<string, number>;
265
280
  price: Record<string, number>;
281
+ minQuantity: number;
266
282
  }[] | null | undefined;
267
283
  } | undefined;
268
284
  appliedDiscount?: {
@@ -356,6 +372,7 @@ declare function useInventory(context?: StorefrontContext): {
356
372
  name: string;
357
373
  licenseId: string;
358
374
  activationMethod: ActivationMethod;
375
+ firstValidatedAt: Date;
359
376
  lastValidatedAt: Date | null;
360
377
  }>>;
361
378
  getProduct: (productId: string, version?: string) => Promise<{
@@ -471,6 +488,7 @@ declare function useInventory(context?: StorefrontContext): {
471
488
  name: string;
472
489
  licenseId: string;
473
490
  activationMethod: ActivationMethod;
491
+ firstValidatedAt: Date;
474
492
  lastValidatedAt: Date | null;
475
493
  }>>;
476
494
  revokeActivation: (activation: Activation) => Promise<void>;
@@ -569,6 +587,12 @@ declare function useVoucher(context?: StorefrontContext): {
569
587
  originalPrice: Record<string, number>;
570
588
  price: Record<string, number>;
571
589
  hasDiscount: boolean;
590
+ recurrence: {
591
+ type: "OneOff";
592
+ } | {
593
+ type: "Recurring";
594
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
595
+ };
572
596
  discount?: {
573
597
  type: "PercentageOffDiscount";
574
598
  name: string;
@@ -584,9 +608,9 @@ declare function useVoucher(context?: StorefrontContext): {
584
608
  total?: Record<string, number> | undefined;
585
609
  } | undefined;
586
610
  pricingTiers?: {
587
- minQuantity: number;
588
611
  originalPrice: Record<string, number>;
589
612
  price: Record<string, number>;
613
+ minQuantity: number;
590
614
  }[] | null | undefined;
591
615
  } | undefined;
592
616
  variations?: {
@@ -595,6 +619,12 @@ declare function useVoucher(context?: StorefrontContext): {
595
619
  originalPrice: Record<string, number>;
596
620
  price: Record<string, number>;
597
621
  hasDiscount: boolean;
622
+ recurrence: {
623
+ type: "OneOff";
624
+ } | {
625
+ type: "Recurring";
626
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
627
+ };
598
628
  discount?: {
599
629
  type: "PercentageOffDiscount";
600
630
  name: string;
@@ -610,9 +640,9 @@ declare function useVoucher(context?: StorefrontContext): {
610
640
  total?: Record<string, number> | undefined;
611
641
  } | undefined;
612
642
  pricingTiers?: {
613
- minQuantity: number;
614
643
  originalPrice: Record<string, number>;
615
644
  price: Record<string, number>;
645
+ minQuantity: number;
616
646
  }[] | null | undefined;
617
647
  }[] | undefined;
618
648
  };
@@ -658,6 +688,12 @@ declare function useVoucher(context?: StorefrontContext): {
658
688
  originalPrice: Record<string, number>;
659
689
  price: Record<string, number>;
660
690
  hasDiscount: boolean;
691
+ recurrence: {
692
+ type: "OneOff";
693
+ } | {
694
+ type: "Recurring";
695
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
696
+ };
661
697
  discount?: {
662
698
  type: "PercentageOffDiscount";
663
699
  name: string;
@@ -673,9 +709,9 @@ declare function useVoucher(context?: StorefrontContext): {
673
709
  total?: Record<string, number> | undefined;
674
710
  } | undefined;
675
711
  pricingTiers?: {
676
- minQuantity: number;
677
712
  originalPrice: Record<string, number>;
678
713
  price: Record<string, number>;
714
+ minQuantity: number;
679
715
  }[] | null | undefined;
680
716
  } | undefined;
681
717
  variations?: {
@@ -684,6 +720,12 @@ declare function useVoucher(context?: StorefrontContext): {
684
720
  originalPrice: Record<string, number>;
685
721
  price: Record<string, number>;
686
722
  hasDiscount: boolean;
723
+ recurrence: {
724
+ type: "OneOff";
725
+ } | {
726
+ type: "Recurring";
727
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
728
+ };
687
729
  discount?: {
688
730
  type: "PercentageOffDiscount";
689
731
  name: string;
@@ -699,9 +741,9 @@ declare function useVoucher(context?: StorefrontContext): {
699
741
  total?: Record<string, number> | undefined;
700
742
  } | undefined;
701
743
  pricingTiers?: {
702
- minQuantity: number;
703
744
  originalPrice: Record<string, number>;
704
745
  price: Record<string, number>;
746
+ minQuantity: number;
705
747
  }[] | null | undefined;
706
748
  }[] | undefined;
707
749
  } & {
@@ -713,6 +755,12 @@ declare function useVoucher(context?: StorefrontContext): {
713
755
  originalPrice: Record<string, number>;
714
756
  price: Record<string, number>;
715
757
  hasDiscount: boolean;
758
+ recurrence: {
759
+ type: "OneOff";
760
+ } | {
761
+ type: "Recurring";
762
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
763
+ };
716
764
  discount?: {
717
765
  type: "PercentageOffDiscount";
718
766
  name: string;
@@ -728,9 +776,9 @@ declare function useVoucher(context?: StorefrontContext): {
728
776
  total?: Record<string, number> | undefined;
729
777
  } | undefined;
730
778
  pricingTiers?: {
731
- minQuantity: number;
732
779
  originalPrice: Record<string, number>;
733
780
  price: Record<string, number>;
781
+ minQuantity: number;
734
782
  }[] | null | undefined;
735
783
  } | undefined;
736
784
  variations?: {
@@ -739,6 +787,12 @@ declare function useVoucher(context?: StorefrontContext): {
739
787
  originalPrice: Record<string, number>;
740
788
  price: Record<string, number>;
741
789
  hasDiscount: boolean;
790
+ recurrence: {
791
+ type: "OneOff";
792
+ } | {
793
+ type: "Recurring";
794
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
795
+ };
742
796
  discount?: {
743
797
  type: "PercentageOffDiscount";
744
798
  name: string;
@@ -754,9 +808,9 @@ declare function useVoucher(context?: StorefrontContext): {
754
808
  total?: Record<string, number> | undefined;
755
809
  } | undefined;
756
810
  pricingTiers?: {
757
- minQuantity: number;
758
811
  originalPrice: Record<string, number>;
759
812
  price: Record<string, number>;
813
+ minQuantity: number;
760
814
  }[] | null | undefined;
761
815
  }[] | undefined;
762
816
  };
@@ -800,6 +854,12 @@ declare function useVoucher(context?: StorefrontContext): {
800
854
  originalPrice: Record<string, number>;
801
855
  price: Record<string, number>;
802
856
  hasDiscount: boolean;
857
+ recurrence: {
858
+ type: "OneOff";
859
+ } | {
860
+ type: "Recurring";
861
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
862
+ };
803
863
  discount?: {
804
864
  type: "PercentageOffDiscount";
805
865
  name: string;
@@ -815,9 +875,9 @@ declare function useVoucher(context?: StorefrontContext): {
815
875
  total?: Record<string, number> | undefined;
816
876
  } | undefined;
817
877
  pricingTiers?: {
818
- minQuantity: number;
819
878
  originalPrice: Record<string, number>;
820
879
  price: Record<string, number>;
880
+ minQuantity: number;
821
881
  }[] | null | undefined;
822
882
  } | undefined;
823
883
  variations?: {
@@ -826,6 +886,12 @@ declare function useVoucher(context?: StorefrontContext): {
826
886
  originalPrice: Record<string, number>;
827
887
  price: Record<string, number>;
828
888
  hasDiscount: boolean;
889
+ recurrence: {
890
+ type: "OneOff";
891
+ } | {
892
+ type: "Recurring";
893
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
894
+ };
829
895
  discount?: {
830
896
  type: "PercentageOffDiscount";
831
897
  name: string;
@@ -841,9 +907,9 @@ declare function useVoucher(context?: StorefrontContext): {
841
907
  total?: Record<string, number> | undefined;
842
908
  } | undefined;
843
909
  pricingTiers?: {
844
- minQuantity: number;
845
910
  originalPrice: Record<string, number>;
846
911
  price: Record<string, number>;
912
+ minQuantity: number;
847
913
  }[] | null | undefined;
848
914
  }[] | undefined;
849
915
  };
@@ -889,6 +955,12 @@ declare function useVoucher(context?: StorefrontContext): {
889
955
  originalPrice: Record<string, number>;
890
956
  price: Record<string, number>;
891
957
  hasDiscount: boolean;
958
+ recurrence: {
959
+ type: "OneOff";
960
+ } | {
961
+ type: "Recurring";
962
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
963
+ };
892
964
  discount?: {
893
965
  type: "PercentageOffDiscount";
894
966
  name: string;
@@ -904,9 +976,9 @@ declare function useVoucher(context?: StorefrontContext): {
904
976
  total?: Record<string, number> | undefined;
905
977
  } | undefined;
906
978
  pricingTiers?: {
907
- minQuantity: number;
908
979
  originalPrice: Record<string, number>;
909
980
  price: Record<string, number>;
981
+ minQuantity: number;
910
982
  }[] | null | undefined;
911
983
  } | undefined;
912
984
  variations?: {
@@ -915,6 +987,12 @@ declare function useVoucher(context?: StorefrontContext): {
915
987
  originalPrice: Record<string, number>;
916
988
  price: Record<string, number>;
917
989
  hasDiscount: boolean;
990
+ recurrence: {
991
+ type: "OneOff";
992
+ } | {
993
+ type: "Recurring";
994
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
995
+ };
918
996
  discount?: {
919
997
  type: "PercentageOffDiscount";
920
998
  name: string;
@@ -930,9 +1008,9 @@ declare function useVoucher(context?: StorefrontContext): {
930
1008
  total?: Record<string, number> | undefined;
931
1009
  } | undefined;
932
1010
  pricingTiers?: {
933
- minQuantity: number;
934
1011
  originalPrice: Record<string, number>;
935
1012
  price: Record<string, number>;
1013
+ minQuantity: number;
936
1014
  }[] | null | undefined;
937
1015
  }[] | undefined;
938
1016
  } & {
@@ -944,6 +1022,12 @@ declare function useVoucher(context?: StorefrontContext): {
944
1022
  originalPrice: Record<string, number>;
945
1023
  price: Record<string, number>;
946
1024
  hasDiscount: boolean;
1025
+ recurrence: {
1026
+ type: "OneOff";
1027
+ } | {
1028
+ type: "Recurring";
1029
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
1030
+ };
947
1031
  discount?: {
948
1032
  type: "PercentageOffDiscount";
949
1033
  name: string;
@@ -959,9 +1043,9 @@ declare function useVoucher(context?: StorefrontContext): {
959
1043
  total?: Record<string, number> | undefined;
960
1044
  } | undefined;
961
1045
  pricingTiers?: {
962
- minQuantity: number;
963
1046
  originalPrice: Record<string, number>;
964
1047
  price: Record<string, number>;
1048
+ minQuantity: number;
965
1049
  }[] | null | undefined;
966
1050
  } | undefined;
967
1051
  variations?: {
@@ -970,6 +1054,12 @@ declare function useVoucher(context?: StorefrontContext): {
970
1054
  originalPrice: Record<string, number>;
971
1055
  price: Record<string, number>;
972
1056
  hasDiscount: boolean;
1057
+ recurrence: {
1058
+ type: "OneOff";
1059
+ } | {
1060
+ type: "Recurring";
1061
+ cycleLength: _moonbase_sh_storefront_api.CycleLength;
1062
+ };
973
1063
  discount?: {
974
1064
  type: "PercentageOffDiscount";
975
1065
  name: string;
@@ -985,9 +1075,9 @@ declare function useVoucher(context?: StorefrontContext): {
985
1075
  total?: Record<string, number> | undefined;
986
1076
  } | undefined;
987
1077
  pricingTiers?: {
988
- minQuantity: number;
989
1078
  originalPrice: Record<string, number>;
990
1079
  price: Record<string, number>;
1080
+ minQuantity: number;
991
1081
  }[] | null | undefined;
992
1082
  }[] | undefined;
993
1083
  };
package/dist/index.js CHANGED
@@ -584,6 +584,7 @@ function useCart(context) {
584
584
  return { amount: total, currency };
585
585
  }),
586
586
  addToCart: (item, variation) => {
587
+ var _a, _b;
587
588
  item = unref(item);
588
589
  variation != null ? variation : variation = item.defaultVariation;
589
590
  if (!variation)
@@ -601,7 +602,8 @@ function useCart(context) {
601
602
  variation,
602
603
  variationId: variation.id,
603
604
  price: variation.price,
604
- appliedDiscount: variation.discount
605
+ appliedDiscount: variation.discount,
606
+ isDefaultVariation: variation.id === ((_a = item.defaultVariation) == null ? void 0 : _a.id)
605
607
  };
606
608
  storefront.currentOrder.value.items.push(lineItem);
607
609
  } else if (item.type === "product") {
@@ -614,7 +616,8 @@ function useCart(context) {
614
616
  variation,
615
617
  variationId: variation.id,
616
618
  price: variation.price,
617
- appliedDiscount: variation.discount
619
+ appliedDiscount: variation.discount,
620
+ isDefaultVariation: variation.id === ((_b = item.defaultVariation) == null ? void 0 : _b.id)
618
621
  };
619
622
  storefront.currentOrder.value.items.push(lineItem);
620
623
  } else {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/vue",
3
3
  "type": "module",
4
- "version": "0.2.143",
4
+ "version": "0.3.0",
5
5
  "description": "Package to let you build vue.js storefronts with Moonbase.sh as payment and delivery provider",
6
6
  "author": "Tobias Lønnerød Madsen <m@dsen.tv>",
7
7
  "license": "MIT",
@@ -19,7 +19,7 @@
19
19
  "@vue/devtools-api": "^6.6.3",
20
20
  "uuid": "^9.0.1",
21
21
  "zod": "^3.23.8",
22
- "@moonbase.sh/storefront-api": "0.2.143"
22
+ "@moonbase.sh/storefront-api": "0.3.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/uuid": "^9.0.8",