@moonbase.sh/storefront 0.2.114 → 0.2.116

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/moonbase.js CHANGED
@@ -3492,25 +3492,96 @@ var qd = v.object({
3492
3492
  async confirmEmailChange(e, t) {
3493
3493
  await this.api.authenticatedFetch(`/api/customer/identity/confirm-email-change?email=${encodeURIComponent(e)}&code=${encodeURIComponent(t.replaceAll(" ", "+"))}`, null, { method: "POST" });
3494
3494
  }
3495
- }, Gd = {};
3496
- Hd(Gd, {
3497
- completedOrderSchema: () => Qd,
3498
- openBundleLineItem: () => Xd,
3499
- openOrderLineItem: () => Ql,
3495
+ }, Gd = /* @__PURE__ */ ((e) => (e.Active = "Active", e.Revoked = "Revoked", e))(Gd || {}), Kd = /* @__PURE__ */ ((e) => (e.Active = "Active", e.Revoked = "Revoked", e))(Kd || {}), Ql = /* @__PURE__ */ ((e) => (e.Online = "Online", e.Offline = "Offline", e))(Ql || {}), ec = v.object({
3496
+ id: v.string(),
3497
+ status: v.nativeEnum(Gd),
3498
+ product: ml,
3499
+ activeNumberOfActivations: v.number(),
3500
+ maxNumberOfActivations: v.number(),
3501
+ createdAt: v.coerce.date()
3502
+ }), Yd = v.object({
3503
+ id: v.string(),
3504
+ licenseId: v.string(),
3505
+ name: v.string(),
3506
+ status: v.nativeEnum(Kd),
3507
+ activationMethod: v.nativeEnum(Ql),
3508
+ lastValidatedAt: v.coerce.date().nullable()
3509
+ }), w0 = class {
3510
+ constructor(e, t) {
3511
+ this.api = e, this.configuration = t;
3512
+ }
3513
+ async activate(e, t) {
3514
+ const n = await this.api.authenticatedFetch(`/api/customer/inventory/activate?method=${t}${this.configuration.includeManifests ? "&includeManifests=true" : ""}`, ec, {
3515
+ method: "POST",
3516
+ body: e,
3517
+ contentType: "text/plain"
3518
+ });
3519
+ return {
3520
+ license: n.data,
3521
+ url: v.string().parse(n.headers.location)
3522
+ };
3523
+ }
3524
+ }, E0 = class {
3525
+ constructor(e, t) {
3526
+ this.api = e, this.configuration = t;
3527
+ }
3528
+ async get(e) {
3529
+ return (await this.api.authenticatedFetch(e || `/api/customer/inventory/licenses${this.configuration.includeManifests ? "?includeManifests=true" : ""}`, us(ec))).data;
3530
+ }
3531
+ async getActivations(e, t) {
3532
+ return (await this.api.authenticatedFetch(
3533
+ t || `/api/customer/inventory/licenses/${e}/activations`,
3534
+ us(Yd)
3535
+ )).data;
3536
+ }
3537
+ async revokeActivation(e, t) {
3538
+ await this.api.authenticatedFetch(`/api/customer/inventory/licenses/${e}/activations/${t}/revoke`, null, { method: "POST" });
3539
+ }
3540
+ }, x0 = class {
3541
+ constructor(e, t) {
3542
+ this.api = e, this.configuration = t;
3543
+ }
3544
+ async get(e, t) {
3545
+ return (await this.api.fetch(`/api/customer/inventory/products/${e}${t ? `?version=${t}${this.configuration.includeManifests ? "&includeManifests=true" : ""}` : this.configuration.includeManifests ? "?includeManifests=true" : ""}`, ml)).data;
3546
+ }
3547
+ async getOwned(e) {
3548
+ return (await this.api.authenticatedFetch(e || `/api/customer/inventory/products${this.configuration.includeManifests ? "?includeManifests=true" : ""}`, us(ml))).data;
3549
+ }
3550
+ async getLicenses(e, t) {
3551
+ return (await this.api.authenticatedFetch(t || `/api/customer/inventory/products/${e}/licenses${this.configuration.includeManifests ? "?includeManifests=true" : ""}`, us(ec))).data;
3552
+ }
3553
+ async getActivations(e, t) {
3554
+ return (await this.api.authenticatedFetch(t || `/api/customer/inventory/products/${e}/licenses/activations`, us(Yd))).data;
3555
+ }
3556
+ async getDownloadUrl(e) {
3557
+ const t = new URL(e);
3558
+ return t.searchParams.append("redirect", "false"), (await this.api.fetch(t.pathname + t.search, v.object({
3559
+ location: v.string()
3560
+ }))).data.location;
3561
+ }
3562
+ }, k0 = class {
3563
+ constructor(e, t) {
3564
+ this.licenses = new E0(e, t), this.products = new x0(e, t), this.activation = new w0(e, t);
3565
+ }
3566
+ }, Jd = {};
3567
+ Hd(Jd, {
3568
+ completedOrderSchema: () => nf,
3569
+ openBundleLineItem: () => tf,
3570
+ openOrderLineItem: () => tc,
3500
3571
  openOrderSchema: () => Bi,
3501
- openProductLineItem: () => Jd,
3502
- orderSchema: () => ef
3572
+ openProductLineItem: () => ef,
3573
+ orderSchema: () => rf
3503
3574
  });
3504
- var _o = /* @__PURE__ */ ((e) => (e.Open = "Open", e.PaymentProcessing = "PaymentProcessing", e.Completed = "Completed", e.Failed = "Failed", e))(_o || {}), Kd = v.object({
3575
+ var _o = /* @__PURE__ */ ((e) => (e.Open = "Open", e.PaymentProcessing = "PaymentProcessing", e.Completed = "Completed", e.Failed = "Failed", e))(_o || {}), Xd = v.object({
3505
3576
  code: v.string(),
3506
3577
  name: v.string(),
3507
3578
  description: v.string()
3508
- }), Yd = v.object({
3579
+ }), Qd = v.object({
3509
3580
  id: v.string(),
3510
3581
  name: v.string(),
3511
3582
  tagline: v.string(),
3512
3583
  iconUrl: v.string().nullable()
3513
- }), Jd = v.object({
3584
+ }), ef = v.object({
3514
3585
  id: v.string(),
3515
3586
  type: v.literal("Product"),
3516
3587
  productId: v.string(),
@@ -3518,17 +3589,17 @@ var _o = /* @__PURE__ */ ((e) => (e.Open = "Open", e.PaymentProcessing = "Paymen
3518
3589
  variationId: v.string(),
3519
3590
  price: Ao.optional(),
3520
3591
  variation: Do.optional(),
3521
- product: Yd.optional(),
3592
+ product: Qd.optional(),
3522
3593
  appliedDiscount: Jl.optional()
3523
- }), w0 = v.object({
3594
+ }), O0 = v.object({
3524
3595
  id: v.string(),
3525
3596
  name: v.string(),
3526
3597
  tagline: v.string(),
3527
3598
  iconUrl: v.string().nullable(),
3528
- products: Yd.and(v.object({
3599
+ products: Qd.and(v.object({
3529
3600
  included: v.boolean().optional()
3530
3601
  })).array()
3531
- }), Xd = v.object({
3602
+ }), tf = v.object({
3532
3603
  id: v.string(),
3533
3604
  type: v.literal("Bundle"),
3534
3605
  bundleId: v.string(),
@@ -3537,11 +3608,11 @@ var _o = /* @__PURE__ */ ((e) => (e.Open = "Open", e.PaymentProcessing = "Paymen
3537
3608
  partial: v.boolean().optional(),
3538
3609
  price: Ao.optional(),
3539
3610
  variation: Do.optional(),
3540
- bundle: w0.optional(),
3611
+ bundle: O0.optional(),
3541
3612
  appliedDiscount: Jl.optional()
3542
- }), Ql = v.discriminatedUnion("type", [
3543
- Jd,
3544
- Xd
3613
+ }), tc = v.discriminatedUnion("type", [
3614
+ ef,
3615
+ tf
3545
3616
  ]), Bi = v.object({
3546
3617
  id: v.string(),
3547
3618
  status: v.literal(
@@ -3549,45 +3620,45 @@ var _o = /* @__PURE__ */ ((e) => (e.Open = "Open", e.PaymentProcessing = "Paymen
3549
3620
  /* Open */
3550
3621
  ),
3551
3622
  currency: v.string(),
3552
- items: Ql.array(),
3553
- couponsApplied: Kd.array(),
3623
+ items: tc.array(),
3624
+ couponsApplied: Xd.array(),
3554
3625
  checkoutUrl: v.string().optional(),
3555
3626
  embeddedCheckoutUrl: v.string().optional()
3556
3627
  }), Go = v.object({
3557
3628
  currency: v.string(),
3558
3629
  amount: v.number()
3559
- }), E0 = v.object({
3630
+ }), N0 = v.object({
3560
3631
  original: Go,
3561
3632
  discount: Go,
3562
3633
  subtotal: Go,
3563
3634
  taxes: Go,
3564
3635
  due: Go
3565
- }), x0 = v.object({
3636
+ }), S0 = v.object({
3566
3637
  name: v.string().nullable(),
3567
3638
  businessName: v.string().nullable(),
3568
3639
  taxId: v.string().nullable(),
3569
3640
  email: v.string().nullable(),
3570
3641
  address: qd.nullable()
3571
- }), Qd = v.object({
3642
+ }), nf = v.object({
3572
3643
  id: v.string(),
3573
3644
  status: v.literal(
3574
3645
  "Completed"
3575
3646
  /* Completed */
3576
3647
  ),
3577
3648
  currency: v.string(),
3578
- customer: x0,
3579
- total: E0,
3580
- items: Ql.array(),
3581
- couponsApplied: Kd.array()
3582
- }), ef = v.discriminatedUnion("status", [
3649
+ customer: S0,
3650
+ total: N0,
3651
+ items: tc.array(),
3652
+ couponsApplied: Xd.array()
3653
+ }), rf = v.discriminatedUnion("status", [
3583
3654
  Bi,
3584
- Qd
3585
- ]), k0 = class {
3655
+ nf
3656
+ ]), C0 = class {
3586
3657
  constructor(e) {
3587
3658
  this.api = e;
3588
3659
  }
3589
3660
  async get(e) {
3590
- return (await this.api.fetch(`/api/customer/orders/${e}`, ef)).data;
3661
+ return (await this.api.fetch(`/api/customer/orders/${e}`, rf)).data;
3591
3662
  }
3592
3663
  async pushContent(e, t, n) {
3593
3664
  const r = {
@@ -3622,7 +3693,7 @@ function vl(e) {
3622
3693
  [n]: r
3623
3694
  }), {});
3624
3695
  }
3625
- var O0 = class {
3696
+ var T0 = class {
3626
3697
  constructor(e, t) {
3627
3698
  this.api = e, this.configuration = t;
3628
3699
  }
@@ -3633,7 +3704,7 @@ var O0 = class {
3633
3704
  } : vl(e));
3634
3705
  return (await this.api.fetch(`/api/customer/storefront?${t.toString()}`, p0)).data;
3635
3706
  }
3636
- }, N0 = class {
3707
+ }, P0 = class {
3637
3708
  constructor(e, t) {
3638
3709
  this.baseUrl = e, this.tokenStore = t;
3639
3710
  }
@@ -3676,7 +3747,7 @@ var O0 = class {
3676
3747
  }), new Io("Bad response", "Could not parse server response", i.status);
3677
3748
  }
3678
3749
  }
3679
- }, tf = class is {
3750
+ }, of = class is {
3680
3751
  constructor(t) {
3681
3752
  if (this.configuration = t, this.tokens = null, this.refreshTimeoutId = null, this.refreshPromise = null, typeof window < "u") {
3682
3753
  window.addEventListener("storage", (r) => this.handleStorageUpdate(r));
@@ -3743,8 +3814,19 @@ var O0 = class {
3743
3814
  }
3744
3815
  }
3745
3816
  };
3746
- tf.storageKey = "moonbase_auth";
3747
- var S0 = tf, iu = v.object({
3817
+ of.storageKey = "moonbase_auth";
3818
+ var $0 = of, A0 = v.object({
3819
+ id: v.string(),
3820
+ name: v.string(),
3821
+ logoUrl: v.string().nullable()
3822
+ }), D0 = class {
3823
+ constructor(e) {
3824
+ this.api = e;
3825
+ }
3826
+ async get() {
3827
+ return (await this.api.fetch("/api/public/vendors/current", A0)).data;
3828
+ }
3829
+ }, iu = v.object({
3748
3830
  id: v.string(),
3749
3831
  name: v.string(),
3750
3832
  description: v.string(),
@@ -3752,7 +3834,7 @@ var S0 = tf, iu = v.object({
3752
3834
  redeemed: v.boolean(),
3753
3835
  redeemsProducts: ou(aa).array(),
3754
3836
  redeemsBundles: ou(Wd).array()
3755
- }), C0 = class {
3837
+ }), I0 = class {
3756
3838
  constructor(e) {
3757
3839
  this.api = e;
3758
3840
  }
@@ -3768,97 +3850,15 @@ var S0 = tf, iu = v.object({
3768
3850
  }
3769
3851
  )).data;
3770
3852
  }
3771
- }, nf = /* @__PURE__ */ ((e) => (e.Active = "Active", e.Revoked = "Revoked", e))(nf || {}), rf = /* @__PURE__ */ ((e) => (e.Active = "Active", e.Revoked = "Revoked", e))(rf || {}), ec = /* @__PURE__ */ ((e) => (e.Online = "Online", e.Offline = "Offline", e))(ec || {}), tc = v.object({
3772
- id: v.string(),
3773
- status: v.nativeEnum(nf),
3774
- product: ml,
3775
- activeNumberOfActivations: v.number(),
3776
- maxNumberOfActivations: v.number(),
3777
- createdAt: v.coerce.date()
3778
- }), of = v.object({
3779
- id: v.string(),
3780
- licenseId: v.string(),
3781
- name: v.string(),
3782
- status: v.nativeEnum(rf),
3783
- activationMethod: v.nativeEnum(ec),
3784
- lastValidatedAt: v.coerce.date().nullable()
3785
- }), T0 = class {
3786
- constructor(e, t) {
3787
- this.api = e, this.configuration = t;
3788
- }
3789
- async activate(e, t) {
3790
- const n = await this.api.authenticatedFetch(`/api/customer/inventory/activate?method=${t}${this.configuration.includeManifests ? "&includeManifests=true" : ""}`, tc, {
3791
- method: "POST",
3792
- body: e,
3793
- contentType: "text/plain"
3794
- });
3795
- return {
3796
- license: n.data,
3797
- url: v.string().parse(n.headers.location)
3798
- };
3799
- }
3800
- }, P0 = class {
3801
- constructor(e, t) {
3802
- this.api = e, this.configuration = t;
3803
- }
3804
- async get(e) {
3805
- return (await this.api.authenticatedFetch(e || `/api/customer/inventory/licenses${this.configuration.includeManifests ? "?includeManifests=true" : ""}`, us(tc))).data;
3806
- }
3807
- async getActivations(e, t) {
3808
- return (await this.api.authenticatedFetch(
3809
- t || `/api/customer/inventory/licenses/${e}/activations`,
3810
- us(of)
3811
- )).data;
3812
- }
3813
- async revokeActivation(e, t) {
3814
- await this.api.authenticatedFetch(`/api/customer/inventory/licenses/${e}/activations/${t}/revoke`, null, { method: "POST" });
3815
- }
3816
- }, $0 = class {
3817
- constructor(e, t) {
3818
- this.api = e, this.configuration = t;
3819
- }
3820
- async get(e, t) {
3821
- return (await this.api.fetch(`/api/customer/inventory/products/${e}${t ? `?version=${t}${this.configuration.includeManifests ? "&includeManifests=true" : ""}` : this.configuration.includeManifests ? "?includeManifests=true" : ""}`, ml)).data;
3822
- }
3823
- async getOwned(e) {
3824
- return (await this.api.authenticatedFetch(e || `/api/customer/inventory/products${this.configuration.includeManifests ? "?includeManifests=true" : ""}`, us(ml))).data;
3825
- }
3826
- async getLicenses(e, t) {
3827
- return (await this.api.authenticatedFetch(t || `/api/customer/inventory/products/${e}/licenses${this.configuration.includeManifests ? "?includeManifests=true" : ""}`, us(tc))).data;
3828
- }
3829
- async getActivations(e, t) {
3830
- return (await this.api.authenticatedFetch(t || `/api/customer/inventory/products/${e}/licenses/activations`, us(of))).data;
3831
- }
3832
- async getDownloadUrl(e) {
3833
- const t = new URL(e);
3834
- return t.searchParams.append("redirect", "false"), (await this.api.fetch(t.pathname + t.search, v.object({
3835
- location: v.string()
3836
- }))).data.location;
3837
- }
3838
- }, A0 = class {
3839
- constructor(e, t) {
3840
- this.licenses = new P0(e, t), this.products = new $0(e, t), this.activation = new T0(e, t);
3841
- }
3842
- }, D0 = v.object({
3843
- id: v.string(),
3844
- name: v.string(),
3845
- logoUrl: v.string().nullable()
3846
- }), I0 = class {
3847
- constructor(e) {
3848
- this.api = e;
3849
- }
3850
- async get() {
3851
- return (await this.api.fetch("/api/public/vendors/current", D0)).data;
3852
- }
3853
3853
  }, sf = {};
3854
3854
  Hd(sf, {
3855
- orders: () => Gd
3855
+ orders: () => Jd
3856
3856
  });
3857
3857
  var V0 = class {
3858
3858
  constructor(e) {
3859
- this.configuration = e, this.configuration.endpoint = this.configuration.endpoint.replace(/\/$/, ""), this.tokenStore = new S0(e);
3860
- const t = new N0(this.configuration.endpoint, this.tokenStore);
3861
- this.storefront = new O0(t, this.configuration), this.identity = new _0(t, this.tokenStore), this.vouchers = new C0(t), this.orders = new k0(t), this.inventory = new A0(t, this.configuration), this.activationRequests = new m0(t), this.vendor = new I0(t);
3859
+ this.configuration = e, this.configuration.endpoint = this.configuration.endpoint.replace(/\/$/, ""), this.tokenStore = new $0(e);
3860
+ const t = new P0(this.configuration.endpoint, this.tokenStore);
3861
+ this.storefront = new T0(t, this.configuration), this.identity = new _0(t, this.tokenStore), this.vouchers = new I0(t), this.orders = new C0(t), this.inventory = new k0(t, this.configuration), this.activationRequests = new m0(t), this.vendor = new D0(t);
3862
3862
  }
3863
3863
  }, af = {};
3864
3864
  /**
@@ -16982,7 +16982,7 @@ function TE(e, t) {
16982
16982
  const ct = /* @__PURE__ */ rr(SE, [["render", TE]]), PE = { class: "moonbase:about" }, $E = /* @__PURE__ */ he({
16983
16983
  __name: "About",
16984
16984
  setup(e) {
16985
- const t = Me(), n = "0.2.114";
16985
+ const t = Me(), n = "0.2.116";
16986
16986
  return (r, o) => (E(), U("div", PE, [
16987
16987
  o[2] || (o[2] = Ch('<svg viewBox="0 0 512 512" height="56px" width="56px"><g><path fill="currentColor" d="m493.17795,174.6135c6.257,75.3 -30.577,150.948 -100.579,190.758c-66.292,37.697 -145.001,33.405 -205.402,-4.415c0.409,-1.248 0.638,-2.577 0.638,-3.96c0,-7.026 -5.717,-12.743 -12.743,-12.743c-2.876,0 -5.524,0.969 -7.659,2.582c-18.813,-15.259 -35.159,-34.207 -47.856,-56.534c-54.663,-96.122 -21.054,-218.358 75.069,-273.021a201.218,201.218 0 0 1 33.302,-15.124c-32.428,3.667 -64.663,13.809 -94.827,30.962c-104.526,59.443 -149.511,183.241 -113.473,293.249c-3.376,3.057 -5.513,7.459 -5.513,12.362c0,9.207 7.491,16.698 16.698,16.698c0.136,0 0.267,-0.017 0.401,-0.02a252.205,252.205 0 0 0 8.683,16.691c67.869,119.344 219.635,161.073 338.98,93.204a250.416,250.416 0 0 0 32.893,-22.333c1.045,0.331 2.157,0.513 3.311,0.513c6.047,0 10.968,-4.921 10.968,-10.968c0,-0.605 -0.063,-1.196 -0.157,-1.775c69.545,-64.988 96.008,-165.054 67.266,-256.126m-446.526,25.112a5.071,5.071 0 0 1 -5.066,-5.066a5.072,5.072 0 0 1 5.066,-5.067a5.073,5.073 0 0 1 5.066,5.067a5.072,5.072 0 0 1 -5.066,5.066m-15.819,153.944c-8.238,0 -14.94,-6.702 -14.94,-14.94c0,-8.239 6.702,-14.941 14.94,-14.941c8.239,0 14.941,6.702 14.941,14.941c-0.001,8.238 -6.703,14.94 -14.941,14.94m144.258,-7.659c6.057,0 10.985,4.928 10.985,10.986c0,6.058 -4.928,10.985 -10.985,10.985c-6.058,0 -10.986,-4.928 -10.986,-10.985c0.001,-6.059 4.928,-10.986 10.986,-10.986m70.829,133.004c-5.079,0 -9.21,-4.132 -9.21,-9.21c0,-5.079 4.131,-9.21 9.21,-9.21c5.078,0 9.209,4.131 9.209,9.21c0,5.078 -4.13,9.21 -9.209,9.21m169.18,-37.289c-5.078,0 -9.209,-4.132 -9.209,-9.21s4.131,-9.209 9.209,-9.209s9.21,4.131 9.21,9.209s-4.132,9.21 -9.21,9.21"></path><path fill="currentColor" d="m144.78195,275.9675c46.746,82.201 151.278,110.943 233.48,64.197c59.864,-34.044 91.363,-98.736 86.013,-163.13a170.094,170.094 0 0 0 -5.515,-31.052c-23.045,0.567 -63.864,10.137 -104.194,61.671c-52.045,66.5 -186.285,49.153 -228.855,17.372c3.503,17.443 9.796,34.632 19.071,50.942m233.513,-65.677a8.663,8.663 0 1 1 -8.663,8.663a8.662,8.662 0 0 1 8.663,-8.663m-37.006,62.618c7.02,0 12.712,5.691 12.712,12.712s-5.692,12.712 -12.712,12.712c-7.021,0 -12.712,-5.691 -12.712,-12.712s5.691,-12.712 12.712,-12.712m-102.544,12.712a6.78,6.78 0 1 1 0,13.56a6.78,6.78 0 0 1 0,-13.56"></path><ellipse fill="currentColor" ry="7.3075" rx="7.3075" cy="152.05851" cx="251.33138"></ellipse><ellipse fill="currentColor" ry="5.35076" rx="5.35076" cy="210.31151" cx="204.89499"></ellipse><ellipse fill="currentColor" ry="12.09273" rx="12.09273" cy="200.15625" cx="302.28597"></ellipse></g></svg>', 1)),
16988
16988
  k(g(fp), { as: "h3" }, {
@@ -19808,7 +19808,7 @@ const Z5 = { class: "moonbase:product-licenses" }, q5 = {
19808
19808
  ]),
19809
19809
  _: 2
19810
19810
  }, [
19811
- u.activationMethod === g(ec).Online ? {
19811
+ u.activationMethod === g(Ql).Online ? {
19812
19812
  name: "addon",
19813
19813
  fn: V(() => [
19814
19814
  ee("div", Q5, [