@moonbase.sh/api 0.4.70 → 0.4.71

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
@@ -124,8 +124,8 @@ var discountSchema = import_zod.z.discriminatedUnion("type", [
124
124
  flatAmountOffDiscountSchema
125
125
  ]);
126
126
  var dateTimeSpanSchema = import_zod.z.object({
127
- from: import_zod.z.coerce.date().nullable(),
128
- to: import_zod.z.coerce.date().nullable()
127
+ from: import_zod.z.coerce.date().nullish(),
128
+ to: import_zod.z.coerce.date().nullish()
129
129
  });
130
130
  var exclusivitySchema = import_zod.z.discriminatedUnion("type", [
131
131
  import_zod.z.object({ type: import_zod.z.literal("Everyone") }),
@@ -1105,6 +1105,7 @@ var couponSchema = import_zod12.z.object({
1105
1105
  applicableBundles: bundleSchema.array(),
1106
1106
  applicableProductVariations: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.string().array()),
1107
1107
  applicableBundleVariations: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.string().array()),
1108
+ validity: dateTimeSpanSchema.nullish(),
1108
1109
  isDeleted: import_zod12.z.boolean(),
1109
1110
  lastUpdated: entityChangeSchema,
1110
1111
  created: entityChangeSchema
@@ -1113,11 +1114,13 @@ var createCouponRequestSchema = import_zod12.z.object({
1113
1114
  name: import_zod12.z.string(),
1114
1115
  description: import_zod12.z.string(),
1115
1116
  applicableProducts: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.string().array()).optional().describe("Restricts the coupon to specific products, needs to be a map of product ID to array of applicable pricing variations, empty array if any variation is applicable."),
1116
- applicableBundles: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.string().array()).optional().describe("Restricts the coupon to specific bundles, needs to be a map of bundle ID to array of applicable pricing variations, empty array if any variation is applicable.")
1117
+ applicableBundles: import_zod12.z.record(import_zod12.z.string(), import_zod12.z.string().array()).optional().describe("Restricts the coupon to specific bundles, needs to be a map of bundle ID to array of applicable pricing variations, empty array if any variation is applicable."),
1118
+ validity: dateTimeSpanSchema.nullish().describe("Restricts the coupon to a specific time period.")
1117
1119
  });
1118
1120
  var couponCodeSchema = import_zod12.z.object({
1119
1121
  code: import_zod12.z.string(),
1120
- numberOfRedemptions: import_zod12.z.number()
1122
+ numberOfRedemptions: import_zod12.z.number(),
1123
+ validity: dateTimeSpanSchema.nullish()
1121
1124
  });
1122
1125
 
1123
1126
  // src/index.ts
package/dist/index.d.cts CHANGED
@@ -3339,14 +3339,14 @@ declare const discountSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3339
3339
  total: Record<string, number>;
3340
3340
  }>]>;
3341
3341
  declare const dateTimeSpanSchema: z.ZodObject<{
3342
- from: z.ZodNullable<z.ZodDate>;
3343
- to: z.ZodNullable<z.ZodDate>;
3342
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3343
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3344
3344
  }, "strip", z.ZodTypeAny, {
3345
- from: Date | null;
3346
- to: Date | null;
3345
+ from?: Date | null | undefined;
3346
+ to?: Date | null | undefined;
3347
3347
  }, {
3348
- from: Date | null;
3349
- to: Date | null;
3348
+ from?: Date | null | undefined;
3349
+ to?: Date | null | undefined;
3350
3350
  }>;
3351
3351
  declare const pricingDiscountSchema: z.ZodObject<{
3352
3352
  name: z.ZodString;
@@ -3457,14 +3457,14 @@ declare const pricingDiscountSchema: z.ZodObject<{
3457
3457
  }>]>>>;
3458
3458
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
3459
3459
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3460
- from: z.ZodNullable<z.ZodDate>;
3461
- to: z.ZodNullable<z.ZodDate>;
3460
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3461
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3462
3462
  }, "strip", z.ZodTypeAny, {
3463
- from: Date | null;
3464
- to: Date | null;
3463
+ from?: Date | null | undefined;
3464
+ to?: Date | null | undefined;
3465
3465
  }, {
3466
- from: Date | null;
3467
- to: Date | null;
3466
+ from?: Date | null | undefined;
3467
+ to?: Date | null | undefined;
3468
3468
  }>>>;
3469
3469
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3470
3470
  }, "strip", z.ZodTypeAny, {
@@ -3508,8 +3508,8 @@ declare const pricingDiscountSchema: z.ZodObject<{
3508
3508
  } | null | undefined;
3509
3509
  applicableVariationIds?: string[] | null | undefined;
3510
3510
  validity?: {
3511
- from: Date | null;
3512
- to: Date | null;
3511
+ from?: Date | null | undefined;
3512
+ to?: Date | null | undefined;
3513
3513
  } | null | undefined;
3514
3514
  recurringPaymentUseCount?: number | null | undefined;
3515
3515
  }, {
@@ -3553,8 +3553,8 @@ declare const pricingDiscountSchema: z.ZodObject<{
3553
3553
  } | null | undefined;
3554
3554
  applicableVariationIds?: string[] | null | undefined;
3555
3555
  validity?: {
3556
- from: Date | null;
3557
- to: Date | null;
3556
+ from?: Date | null | undefined;
3557
+ to?: Date | null | undefined;
3558
3558
  } | null | undefined;
3559
3559
  recurringPaymentUseCount?: number | null | undefined;
3560
3560
  }>;
@@ -3671,6 +3671,7 @@ declare function quantifiable<T extends z.ZodType<object>>(itemSchema: T): z.Zod
3671
3671
 
3672
3672
  type PricingVariation = z.infer<typeof pricingVariationSchema>;
3673
3673
  type PricingDiscount = z.infer<typeof pricingDiscountSchema>;
3674
+ type DateTimeSpan = z.infer<typeof dateTimeSpanSchema>;
3674
3675
  interface Page<T> {
3675
3676
  items: Array<T>;
3676
3677
  hasMore: boolean;
@@ -4557,14 +4558,14 @@ declare const productLineItemSchema: z.ZodObject<{
4557
4558
  }>]>>>;
4558
4559
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
4559
4560
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
4560
- from: z.ZodNullable<z.ZodDate>;
4561
- to: z.ZodNullable<z.ZodDate>;
4561
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
4562
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
4562
4563
  }, "strip", z.ZodTypeAny, {
4563
- from: Date | null;
4564
- to: Date | null;
4564
+ from?: Date | null | undefined;
4565
+ to?: Date | null | undefined;
4565
4566
  }, {
4566
- from: Date | null;
4567
- to: Date | null;
4567
+ from?: Date | null | undefined;
4568
+ to?: Date | null | undefined;
4568
4569
  }>>>;
4569
4570
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4570
4571
  }, "strip", z.ZodTypeAny, {
@@ -4608,8 +4609,8 @@ declare const productLineItemSchema: z.ZodObject<{
4608
4609
  } | null | undefined;
4609
4610
  applicableVariationIds?: string[] | null | undefined;
4610
4611
  validity?: {
4611
- from: Date | null;
4612
- to: Date | null;
4612
+ from?: Date | null | undefined;
4613
+ to?: Date | null | undefined;
4613
4614
  } | null | undefined;
4614
4615
  recurringPaymentUseCount?: number | null | undefined;
4615
4616
  }, {
@@ -4653,8 +4654,8 @@ declare const productLineItemSchema: z.ZodObject<{
4653
4654
  } | null | undefined;
4654
4655
  applicableVariationIds?: string[] | null | undefined;
4655
4656
  validity?: {
4656
- from: Date | null;
4657
- to: Date | null;
4657
+ from?: Date | null | undefined;
4658
+ to?: Date | null | undefined;
4658
4659
  } | null | undefined;
4659
4660
  recurringPaymentUseCount?: number | null | undefined;
4660
4661
  }>>;
@@ -4858,8 +4859,8 @@ declare const productLineItemSchema: z.ZodObject<{
4858
4859
  } | null | undefined;
4859
4860
  applicableVariationIds?: string[] | null | undefined;
4860
4861
  validity?: {
4861
- from: Date | null;
4862
- to: Date | null;
4862
+ from?: Date | null | undefined;
4863
+ to?: Date | null | undefined;
4863
4864
  } | null | undefined;
4864
4865
  recurringPaymentUseCount?: number | null | undefined;
4865
4866
  } | undefined;
@@ -4995,8 +4996,8 @@ declare const productLineItemSchema: z.ZodObject<{
4995
4996
  } | null | undefined;
4996
4997
  applicableVariationIds?: string[] | null | undefined;
4997
4998
  validity?: {
4998
- from: Date | null;
4999
- to: Date | null;
4999
+ from?: Date | null | undefined;
5000
+ to?: Date | null | undefined;
5000
5001
  } | null | undefined;
5001
5002
  recurringPaymentUseCount?: number | null | undefined;
5002
5003
  } | undefined;
@@ -5391,14 +5392,14 @@ declare const bundleLineItemSchema: z.ZodObject<{
5391
5392
  }>]>>>;
5392
5393
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
5393
5394
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
5394
- from: z.ZodNullable<z.ZodDate>;
5395
- to: z.ZodNullable<z.ZodDate>;
5395
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
5396
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
5396
5397
  }, "strip", z.ZodTypeAny, {
5397
- from: Date | null;
5398
- to: Date | null;
5398
+ from?: Date | null | undefined;
5399
+ to?: Date | null | undefined;
5399
5400
  }, {
5400
- from: Date | null;
5401
- to: Date | null;
5401
+ from?: Date | null | undefined;
5402
+ to?: Date | null | undefined;
5402
5403
  }>>>;
5403
5404
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
5404
5405
  }, "strip", z.ZodTypeAny, {
@@ -5442,8 +5443,8 @@ declare const bundleLineItemSchema: z.ZodObject<{
5442
5443
  } | null | undefined;
5443
5444
  applicableVariationIds?: string[] | null | undefined;
5444
5445
  validity?: {
5445
- from: Date | null;
5446
- to: Date | null;
5446
+ from?: Date | null | undefined;
5447
+ to?: Date | null | undefined;
5447
5448
  } | null | undefined;
5448
5449
  recurringPaymentUseCount?: number | null | undefined;
5449
5450
  }, {
@@ -5487,8 +5488,8 @@ declare const bundleLineItemSchema: z.ZodObject<{
5487
5488
  } | null | undefined;
5488
5489
  applicableVariationIds?: string[] | null | undefined;
5489
5490
  validity?: {
5490
- from: Date | null;
5491
- to: Date | null;
5491
+ from?: Date | null | undefined;
5492
+ to?: Date | null | undefined;
5492
5493
  } | null | undefined;
5493
5494
  recurringPaymentUseCount?: number | null | undefined;
5494
5495
  }>>;
@@ -5692,8 +5693,8 @@ declare const bundleLineItemSchema: z.ZodObject<{
5692
5693
  } | null | undefined;
5693
5694
  applicableVariationIds?: string[] | null | undefined;
5694
5695
  validity?: {
5695
- from: Date | null;
5696
- to: Date | null;
5696
+ from?: Date | null | undefined;
5697
+ to?: Date | null | undefined;
5697
5698
  } | null | undefined;
5698
5699
  recurringPaymentUseCount?: number | null | undefined;
5699
5700
  } | undefined;
@@ -5829,8 +5830,8 @@ declare const bundleLineItemSchema: z.ZodObject<{
5829
5830
  } | null | undefined;
5830
5831
  applicableVariationIds?: string[] | null | undefined;
5831
5832
  validity?: {
5832
- from: Date | null;
5833
- to: Date | null;
5833
+ from?: Date | null | undefined;
5834
+ to?: Date | null | undefined;
5834
5835
  } | null | undefined;
5835
5836
  recurringPaymentUseCount?: number | null | undefined;
5836
5837
  } | undefined;
@@ -6225,14 +6226,14 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
6225
6226
  }>]>>>;
6226
6227
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
6227
6228
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
6228
- from: z.ZodNullable<z.ZodDate>;
6229
- to: z.ZodNullable<z.ZodDate>;
6229
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
6230
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
6230
6231
  }, "strip", z.ZodTypeAny, {
6231
- from: Date | null;
6232
- to: Date | null;
6232
+ from?: Date | null | undefined;
6233
+ to?: Date | null | undefined;
6233
6234
  }, {
6234
- from: Date | null;
6235
- to: Date | null;
6235
+ from?: Date | null | undefined;
6236
+ to?: Date | null | undefined;
6236
6237
  }>>>;
6237
6238
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
6238
6239
  }, "strip", z.ZodTypeAny, {
@@ -6276,8 +6277,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
6276
6277
  } | null | undefined;
6277
6278
  applicableVariationIds?: string[] | null | undefined;
6278
6279
  validity?: {
6279
- from: Date | null;
6280
- to: Date | null;
6280
+ from?: Date | null | undefined;
6281
+ to?: Date | null | undefined;
6281
6282
  } | null | undefined;
6282
6283
  recurringPaymentUseCount?: number | null | undefined;
6283
6284
  }, {
@@ -6321,8 +6322,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
6321
6322
  } | null | undefined;
6322
6323
  applicableVariationIds?: string[] | null | undefined;
6323
6324
  validity?: {
6324
- from: Date | null;
6325
- to: Date | null;
6325
+ from?: Date | null | undefined;
6326
+ to?: Date | null | undefined;
6326
6327
  } | null | undefined;
6327
6328
  recurringPaymentUseCount?: number | null | undefined;
6328
6329
  }>>;
@@ -6526,8 +6527,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
6526
6527
  } | null | undefined;
6527
6528
  applicableVariationIds?: string[] | null | undefined;
6528
6529
  validity?: {
6529
- from: Date | null;
6530
- to: Date | null;
6530
+ from?: Date | null | undefined;
6531
+ to?: Date | null | undefined;
6531
6532
  } | null | undefined;
6532
6533
  recurringPaymentUseCount?: number | null | undefined;
6533
6534
  } | undefined;
@@ -6663,8 +6664,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
6663
6664
  } | null | undefined;
6664
6665
  applicableVariationIds?: string[] | null | undefined;
6665
6666
  validity?: {
6666
- from: Date | null;
6667
- to: Date | null;
6667
+ from?: Date | null | undefined;
6668
+ to?: Date | null | undefined;
6668
6669
  } | null | undefined;
6669
6670
  recurringPaymentUseCount?: number | null | undefined;
6670
6671
  } | undefined;
@@ -7058,14 +7059,14 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
7058
7059
  }>]>>>;
7059
7060
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
7060
7061
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
7061
- from: z.ZodNullable<z.ZodDate>;
7062
- to: z.ZodNullable<z.ZodDate>;
7062
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
7063
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
7063
7064
  }, "strip", z.ZodTypeAny, {
7064
- from: Date | null;
7065
- to: Date | null;
7065
+ from?: Date | null | undefined;
7066
+ to?: Date | null | undefined;
7066
7067
  }, {
7067
- from: Date | null;
7068
- to: Date | null;
7068
+ from?: Date | null | undefined;
7069
+ to?: Date | null | undefined;
7069
7070
  }>>>;
7070
7071
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7071
7072
  }, "strip", z.ZodTypeAny, {
@@ -7109,8 +7110,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
7109
7110
  } | null | undefined;
7110
7111
  applicableVariationIds?: string[] | null | undefined;
7111
7112
  validity?: {
7112
- from: Date | null;
7113
- to: Date | null;
7113
+ from?: Date | null | undefined;
7114
+ to?: Date | null | undefined;
7114
7115
  } | null | undefined;
7115
7116
  recurringPaymentUseCount?: number | null | undefined;
7116
7117
  }, {
@@ -7154,8 +7155,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
7154
7155
  } | null | undefined;
7155
7156
  applicableVariationIds?: string[] | null | undefined;
7156
7157
  validity?: {
7157
- from: Date | null;
7158
- to: Date | null;
7158
+ from?: Date | null | undefined;
7159
+ to?: Date | null | undefined;
7159
7160
  } | null | undefined;
7160
7161
  recurringPaymentUseCount?: number | null | undefined;
7161
7162
  }>>;
@@ -7359,8 +7360,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
7359
7360
  } | null | undefined;
7360
7361
  applicableVariationIds?: string[] | null | undefined;
7361
7362
  validity?: {
7362
- from: Date | null;
7363
- to: Date | null;
7363
+ from?: Date | null | undefined;
7364
+ to?: Date | null | undefined;
7364
7365
  } | null | undefined;
7365
7366
  recurringPaymentUseCount?: number | null | undefined;
7366
7367
  } | undefined;
@@ -7496,8 +7497,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
7496
7497
  } | null | undefined;
7497
7498
  applicableVariationIds?: string[] | null | undefined;
7498
7499
  validity?: {
7499
- from: Date | null;
7500
- to: Date | null;
7500
+ from?: Date | null | undefined;
7501
+ to?: Date | null | undefined;
7501
7502
  } | null | undefined;
7502
7503
  recurringPaymentUseCount?: number | null | undefined;
7503
7504
  } | undefined;
@@ -8440,14 +8441,14 @@ declare const orderSchema: z.ZodObject<{
8440
8441
  }>]>>>;
8441
8442
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
8442
8443
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
8443
- from: z.ZodNullable<z.ZodDate>;
8444
- to: z.ZodNullable<z.ZodDate>;
8444
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
8445
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
8445
8446
  }, "strip", z.ZodTypeAny, {
8446
- from: Date | null;
8447
- to: Date | null;
8447
+ from?: Date | null | undefined;
8448
+ to?: Date | null | undefined;
8448
8449
  }, {
8449
- from: Date | null;
8450
- to: Date | null;
8450
+ from?: Date | null | undefined;
8451
+ to?: Date | null | undefined;
8451
8452
  }>>>;
8452
8453
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8453
8454
  }, "strip", z.ZodTypeAny, {
@@ -8491,8 +8492,8 @@ declare const orderSchema: z.ZodObject<{
8491
8492
  } | null | undefined;
8492
8493
  applicableVariationIds?: string[] | null | undefined;
8493
8494
  validity?: {
8494
- from: Date | null;
8495
- to: Date | null;
8495
+ from?: Date | null | undefined;
8496
+ to?: Date | null | undefined;
8496
8497
  } | null | undefined;
8497
8498
  recurringPaymentUseCount?: number | null | undefined;
8498
8499
  }, {
@@ -8536,8 +8537,8 @@ declare const orderSchema: z.ZodObject<{
8536
8537
  } | null | undefined;
8537
8538
  applicableVariationIds?: string[] | null | undefined;
8538
8539
  validity?: {
8539
- from: Date | null;
8540
- to: Date | null;
8540
+ from?: Date | null | undefined;
8541
+ to?: Date | null | undefined;
8541
8542
  } | null | undefined;
8542
8543
  recurringPaymentUseCount?: number | null | undefined;
8543
8544
  }>>;
@@ -8741,8 +8742,8 @@ declare const orderSchema: z.ZodObject<{
8741
8742
  } | null | undefined;
8742
8743
  applicableVariationIds?: string[] | null | undefined;
8743
8744
  validity?: {
8744
- from: Date | null;
8745
- to: Date | null;
8745
+ from?: Date | null | undefined;
8746
+ to?: Date | null | undefined;
8746
8747
  } | null | undefined;
8747
8748
  recurringPaymentUseCount?: number | null | undefined;
8748
8749
  } | undefined;
@@ -8878,8 +8879,8 @@ declare const orderSchema: z.ZodObject<{
8878
8879
  } | null | undefined;
8879
8880
  applicableVariationIds?: string[] | null | undefined;
8880
8881
  validity?: {
8881
- from: Date | null;
8882
- to: Date | null;
8882
+ from?: Date | null | undefined;
8883
+ to?: Date | null | undefined;
8883
8884
  } | null | undefined;
8884
8885
  recurringPaymentUseCount?: number | null | undefined;
8885
8886
  } | undefined;
@@ -9273,14 +9274,14 @@ declare const orderSchema: z.ZodObject<{
9273
9274
  }>]>>>;
9274
9275
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
9275
9276
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
9276
- from: z.ZodNullable<z.ZodDate>;
9277
- to: z.ZodNullable<z.ZodDate>;
9277
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
9278
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
9278
9279
  }, "strip", z.ZodTypeAny, {
9279
- from: Date | null;
9280
- to: Date | null;
9280
+ from?: Date | null | undefined;
9281
+ to?: Date | null | undefined;
9281
9282
  }, {
9282
- from: Date | null;
9283
- to: Date | null;
9283
+ from?: Date | null | undefined;
9284
+ to?: Date | null | undefined;
9284
9285
  }>>>;
9285
9286
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
9286
9287
  }, "strip", z.ZodTypeAny, {
@@ -9324,8 +9325,8 @@ declare const orderSchema: z.ZodObject<{
9324
9325
  } | null | undefined;
9325
9326
  applicableVariationIds?: string[] | null | undefined;
9326
9327
  validity?: {
9327
- from: Date | null;
9328
- to: Date | null;
9328
+ from?: Date | null | undefined;
9329
+ to?: Date | null | undefined;
9329
9330
  } | null | undefined;
9330
9331
  recurringPaymentUseCount?: number | null | undefined;
9331
9332
  }, {
@@ -9369,8 +9370,8 @@ declare const orderSchema: z.ZodObject<{
9369
9370
  } | null | undefined;
9370
9371
  applicableVariationIds?: string[] | null | undefined;
9371
9372
  validity?: {
9372
- from: Date | null;
9373
- to: Date | null;
9373
+ from?: Date | null | undefined;
9374
+ to?: Date | null | undefined;
9374
9375
  } | null | undefined;
9375
9376
  recurringPaymentUseCount?: number | null | undefined;
9376
9377
  }>>;
@@ -9574,8 +9575,8 @@ declare const orderSchema: z.ZodObject<{
9574
9575
  } | null | undefined;
9575
9576
  applicableVariationIds?: string[] | null | undefined;
9576
9577
  validity?: {
9577
- from: Date | null;
9578
- to: Date | null;
9578
+ from?: Date | null | undefined;
9579
+ to?: Date | null | undefined;
9579
9580
  } | null | undefined;
9580
9581
  recurringPaymentUseCount?: number | null | undefined;
9581
9582
  } | undefined;
@@ -9711,8 +9712,8 @@ declare const orderSchema: z.ZodObject<{
9711
9712
  } | null | undefined;
9712
9713
  applicableVariationIds?: string[] | null | undefined;
9713
9714
  validity?: {
9714
- from: Date | null;
9715
- to: Date | null;
9715
+ from?: Date | null | undefined;
9716
+ to?: Date | null | undefined;
9716
9717
  } | null | undefined;
9717
9718
  recurringPaymentUseCount?: number | null | undefined;
9718
9719
  } | undefined;
@@ -9934,8 +9935,8 @@ declare const orderSchema: z.ZodObject<{
9934
9935
  } | null | undefined;
9935
9936
  applicableVariationIds?: string[] | null | undefined;
9936
9937
  validity?: {
9937
- from: Date | null;
9938
- to: Date | null;
9938
+ from?: Date | null | undefined;
9939
+ to?: Date | null | undefined;
9939
9940
  } | null | undefined;
9940
9941
  recurringPaymentUseCount?: number | null | undefined;
9941
9942
  } | undefined;
@@ -10071,8 +10072,8 @@ declare const orderSchema: z.ZodObject<{
10071
10072
  } | null | undefined;
10072
10073
  applicableVariationIds?: string[] | null | undefined;
10073
10074
  validity?: {
10074
- from: Date | null;
10075
- to: Date | null;
10075
+ from?: Date | null | undefined;
10076
+ to?: Date | null | undefined;
10076
10077
  } | null | undefined;
10077
10078
  recurringPaymentUseCount?: number | null | undefined;
10078
10079
  } | undefined;
@@ -10335,8 +10336,8 @@ declare const orderSchema: z.ZodObject<{
10335
10336
  } | null | undefined;
10336
10337
  applicableVariationIds?: string[] | null | undefined;
10337
10338
  validity?: {
10338
- from: Date | null;
10339
- to: Date | null;
10339
+ from?: Date | null | undefined;
10340
+ to?: Date | null | undefined;
10340
10341
  } | null | undefined;
10341
10342
  recurringPaymentUseCount?: number | null | undefined;
10342
10343
  } | undefined;
@@ -10472,8 +10473,8 @@ declare const orderSchema: z.ZodObject<{
10472
10473
  } | null | undefined;
10473
10474
  applicableVariationIds?: string[] | null | undefined;
10474
10475
  validity?: {
10475
- from: Date | null;
10476
- to: Date | null;
10476
+ from?: Date | null | undefined;
10477
+ to?: Date | null | undefined;
10477
10478
  } | null | undefined;
10478
10479
  recurringPaymentUseCount?: number | null | undefined;
10479
10480
  } | undefined;
@@ -11831,6 +11832,16 @@ declare const couponSchema: z.ZodObject<{
11831
11832
  }>, "many">;
11832
11833
  applicableProductVariations: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
11833
11834
  applicableBundleVariations: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
11835
+ validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
11836
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
11837
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
11838
+ }, "strip", z.ZodTypeAny, {
11839
+ from?: Date | null | undefined;
11840
+ to?: Date | null | undefined;
11841
+ }, {
11842
+ from?: Date | null | undefined;
11843
+ to?: Date | null | undefined;
11844
+ }>>>;
11834
11845
  isDeleted: z.ZodBoolean;
11835
11846
  lastUpdated: z.ZodObject<{
11836
11847
  at: z.ZodDate;
@@ -11946,6 +11957,10 @@ declare const couponSchema: z.ZodObject<{
11946
11957
  }[];
11947
11958
  applicableProductVariations: Record<string, string[]>;
11948
11959
  applicableBundleVariations: Record<string, string[]>;
11960
+ validity?: {
11961
+ from?: Date | null | undefined;
11962
+ to?: Date | null | undefined;
11963
+ } | null | undefined;
11949
11964
  }, {
11950
11965
  id: string;
11951
11966
  name: string;
@@ -12000,32 +12015,72 @@ declare const couponSchema: z.ZodObject<{
12000
12015
  }[];
12001
12016
  applicableProductVariations: Record<string, string[]>;
12002
12017
  applicableBundleVariations: Record<string, string[]>;
12018
+ validity?: {
12019
+ from?: Date | null | undefined;
12020
+ to?: Date | null | undefined;
12021
+ } | null | undefined;
12003
12022
  }>;
12004
12023
  declare const createCouponRequestSchema: z.ZodObject<{
12005
12024
  name: z.ZodString;
12006
12025
  description: z.ZodString;
12007
12026
  applicableProducts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
12008
12027
  applicableBundles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
12028
+ validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
12029
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
12030
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
12031
+ }, "strip", z.ZodTypeAny, {
12032
+ from?: Date | null | undefined;
12033
+ to?: Date | null | undefined;
12034
+ }, {
12035
+ from?: Date | null | undefined;
12036
+ to?: Date | null | undefined;
12037
+ }>>>;
12009
12038
  }, "strip", z.ZodTypeAny, {
12010
12039
  name: string;
12011
12040
  description: string;
12041
+ validity?: {
12042
+ from?: Date | null | undefined;
12043
+ to?: Date | null | undefined;
12044
+ } | null | undefined;
12012
12045
  applicableProducts?: Record<string, string[]> | undefined;
12013
12046
  applicableBundles?: Record<string, string[]> | undefined;
12014
12047
  }, {
12015
12048
  name: string;
12016
12049
  description: string;
12050
+ validity?: {
12051
+ from?: Date | null | undefined;
12052
+ to?: Date | null | undefined;
12053
+ } | null | undefined;
12017
12054
  applicableProducts?: Record<string, string[]> | undefined;
12018
12055
  applicableBundles?: Record<string, string[]> | undefined;
12019
12056
  }>;
12020
12057
  declare const couponCodeSchema: z.ZodObject<{
12021
12058
  code: z.ZodString;
12022
12059
  numberOfRedemptions: z.ZodNumber;
12060
+ validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
12061
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
12062
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
12063
+ }, "strip", z.ZodTypeAny, {
12064
+ from?: Date | null | undefined;
12065
+ to?: Date | null | undefined;
12066
+ }, {
12067
+ from?: Date | null | undefined;
12068
+ to?: Date | null | undefined;
12069
+ }>>>;
12023
12070
  }, "strip", z.ZodTypeAny, {
12024
12071
  code: string;
12025
12072
  numberOfRedemptions: number;
12073
+ validity?: {
12074
+ from?: Date | null | undefined;
12075
+ to?: Date | null | undefined;
12076
+ } | null | undefined;
12026
12077
  }, {
12027
12078
  code: string;
12028
12079
  numberOfRedemptions: number;
12080
+ validity?: {
12081
+ from?: Date | null | undefined;
12082
+ to?: Date | null | undefined;
12083
+ } | null | undefined;
12029
12084
  }>;
12030
12085
 
12031
12086
  declare const schemas$1_couponCodeSchema: typeof couponCodeSchema;
@@ -12067,4 +12122,4 @@ declare class MoonbaseClient {
12067
12122
  orders: OrderEndpoints;
12068
12123
  }
12069
12124
 
12070
- export { ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Bundle, ConflictError, type CouponSnapshot, type CreateVoucherRequest, type Customer, type CustomerSnapshot, CycleLength, type ImportCustomerRequest, type ImportLicenseRequest, type ImportSubscriptionRequest, type ImportTrialRequest, type License, type LicenseActivation, LicenseStatus, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type Order, OrderStatus, type Page, Platform, type PrepareOrderRequest, type PricingDiscount, type PricingVariation, type Product, type ProductRelease, ProductStatus, type ProvisionLicensesRequest, type Quantifiable, type Subscription, SubscriptionStatus, type Trial, TrialStatus, type UrchingTrackingModule, type Voucher, type VoucherCode, objectToQuery, schemas };
12125
+ export { ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Bundle, ConflictError, type CouponSnapshot, type CreateVoucherRequest, type Customer, type CustomerSnapshot, CycleLength, type DateTimeSpan, type ImportCustomerRequest, type ImportLicenseRequest, type ImportSubscriptionRequest, type ImportTrialRequest, type License, type LicenseActivation, LicenseStatus, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type Order, OrderStatus, type Page, Platform, type PrepareOrderRequest, type PricingDiscount, type PricingVariation, type Product, type ProductRelease, ProductStatus, type ProvisionLicensesRequest, type Quantifiable, type Subscription, SubscriptionStatus, type Trial, TrialStatus, type UrchingTrackingModule, type Voucher, type VoucherCode, objectToQuery, schemas };
package/dist/index.d.ts CHANGED
@@ -3339,14 +3339,14 @@ declare const discountSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
3339
3339
  total: Record<string, number>;
3340
3340
  }>]>;
3341
3341
  declare const dateTimeSpanSchema: z.ZodObject<{
3342
- from: z.ZodNullable<z.ZodDate>;
3343
- to: z.ZodNullable<z.ZodDate>;
3342
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3343
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3344
3344
  }, "strip", z.ZodTypeAny, {
3345
- from: Date | null;
3346
- to: Date | null;
3345
+ from?: Date | null | undefined;
3346
+ to?: Date | null | undefined;
3347
3347
  }, {
3348
- from: Date | null;
3349
- to: Date | null;
3348
+ from?: Date | null | undefined;
3349
+ to?: Date | null | undefined;
3350
3350
  }>;
3351
3351
  declare const pricingDiscountSchema: z.ZodObject<{
3352
3352
  name: z.ZodString;
@@ -3457,14 +3457,14 @@ declare const pricingDiscountSchema: z.ZodObject<{
3457
3457
  }>]>>>;
3458
3458
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
3459
3459
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3460
- from: z.ZodNullable<z.ZodDate>;
3461
- to: z.ZodNullable<z.ZodDate>;
3460
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3461
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
3462
3462
  }, "strip", z.ZodTypeAny, {
3463
- from: Date | null;
3464
- to: Date | null;
3463
+ from?: Date | null | undefined;
3464
+ to?: Date | null | undefined;
3465
3465
  }, {
3466
- from: Date | null;
3467
- to: Date | null;
3466
+ from?: Date | null | undefined;
3467
+ to?: Date | null | undefined;
3468
3468
  }>>>;
3469
3469
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3470
3470
  }, "strip", z.ZodTypeAny, {
@@ -3508,8 +3508,8 @@ declare const pricingDiscountSchema: z.ZodObject<{
3508
3508
  } | null | undefined;
3509
3509
  applicableVariationIds?: string[] | null | undefined;
3510
3510
  validity?: {
3511
- from: Date | null;
3512
- to: Date | null;
3511
+ from?: Date | null | undefined;
3512
+ to?: Date | null | undefined;
3513
3513
  } | null | undefined;
3514
3514
  recurringPaymentUseCount?: number | null | undefined;
3515
3515
  }, {
@@ -3553,8 +3553,8 @@ declare const pricingDiscountSchema: z.ZodObject<{
3553
3553
  } | null | undefined;
3554
3554
  applicableVariationIds?: string[] | null | undefined;
3555
3555
  validity?: {
3556
- from: Date | null;
3557
- to: Date | null;
3556
+ from?: Date | null | undefined;
3557
+ to?: Date | null | undefined;
3558
3558
  } | null | undefined;
3559
3559
  recurringPaymentUseCount?: number | null | undefined;
3560
3560
  }>;
@@ -3671,6 +3671,7 @@ declare function quantifiable<T extends z.ZodType<object>>(itemSchema: T): z.Zod
3671
3671
 
3672
3672
  type PricingVariation = z.infer<typeof pricingVariationSchema>;
3673
3673
  type PricingDiscount = z.infer<typeof pricingDiscountSchema>;
3674
+ type DateTimeSpan = z.infer<typeof dateTimeSpanSchema>;
3674
3675
  interface Page<T> {
3675
3676
  items: Array<T>;
3676
3677
  hasMore: boolean;
@@ -4557,14 +4558,14 @@ declare const productLineItemSchema: z.ZodObject<{
4557
4558
  }>]>>>;
4558
4559
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
4559
4560
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
4560
- from: z.ZodNullable<z.ZodDate>;
4561
- to: z.ZodNullable<z.ZodDate>;
4561
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
4562
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
4562
4563
  }, "strip", z.ZodTypeAny, {
4563
- from: Date | null;
4564
- to: Date | null;
4564
+ from?: Date | null | undefined;
4565
+ to?: Date | null | undefined;
4565
4566
  }, {
4566
- from: Date | null;
4567
- to: Date | null;
4567
+ from?: Date | null | undefined;
4568
+ to?: Date | null | undefined;
4568
4569
  }>>>;
4569
4570
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
4570
4571
  }, "strip", z.ZodTypeAny, {
@@ -4608,8 +4609,8 @@ declare const productLineItemSchema: z.ZodObject<{
4608
4609
  } | null | undefined;
4609
4610
  applicableVariationIds?: string[] | null | undefined;
4610
4611
  validity?: {
4611
- from: Date | null;
4612
- to: Date | null;
4612
+ from?: Date | null | undefined;
4613
+ to?: Date | null | undefined;
4613
4614
  } | null | undefined;
4614
4615
  recurringPaymentUseCount?: number | null | undefined;
4615
4616
  }, {
@@ -4653,8 +4654,8 @@ declare const productLineItemSchema: z.ZodObject<{
4653
4654
  } | null | undefined;
4654
4655
  applicableVariationIds?: string[] | null | undefined;
4655
4656
  validity?: {
4656
- from: Date | null;
4657
- to: Date | null;
4657
+ from?: Date | null | undefined;
4658
+ to?: Date | null | undefined;
4658
4659
  } | null | undefined;
4659
4660
  recurringPaymentUseCount?: number | null | undefined;
4660
4661
  }>>;
@@ -4858,8 +4859,8 @@ declare const productLineItemSchema: z.ZodObject<{
4858
4859
  } | null | undefined;
4859
4860
  applicableVariationIds?: string[] | null | undefined;
4860
4861
  validity?: {
4861
- from: Date | null;
4862
- to: Date | null;
4862
+ from?: Date | null | undefined;
4863
+ to?: Date | null | undefined;
4863
4864
  } | null | undefined;
4864
4865
  recurringPaymentUseCount?: number | null | undefined;
4865
4866
  } | undefined;
@@ -4995,8 +4996,8 @@ declare const productLineItemSchema: z.ZodObject<{
4995
4996
  } | null | undefined;
4996
4997
  applicableVariationIds?: string[] | null | undefined;
4997
4998
  validity?: {
4998
- from: Date | null;
4999
- to: Date | null;
4999
+ from?: Date | null | undefined;
5000
+ to?: Date | null | undefined;
5000
5001
  } | null | undefined;
5001
5002
  recurringPaymentUseCount?: number | null | undefined;
5002
5003
  } | undefined;
@@ -5391,14 +5392,14 @@ declare const bundleLineItemSchema: z.ZodObject<{
5391
5392
  }>]>>>;
5392
5393
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
5393
5394
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
5394
- from: z.ZodNullable<z.ZodDate>;
5395
- to: z.ZodNullable<z.ZodDate>;
5395
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
5396
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
5396
5397
  }, "strip", z.ZodTypeAny, {
5397
- from: Date | null;
5398
- to: Date | null;
5398
+ from?: Date | null | undefined;
5399
+ to?: Date | null | undefined;
5399
5400
  }, {
5400
- from: Date | null;
5401
- to: Date | null;
5401
+ from?: Date | null | undefined;
5402
+ to?: Date | null | undefined;
5402
5403
  }>>>;
5403
5404
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
5404
5405
  }, "strip", z.ZodTypeAny, {
@@ -5442,8 +5443,8 @@ declare const bundleLineItemSchema: z.ZodObject<{
5442
5443
  } | null | undefined;
5443
5444
  applicableVariationIds?: string[] | null | undefined;
5444
5445
  validity?: {
5445
- from: Date | null;
5446
- to: Date | null;
5446
+ from?: Date | null | undefined;
5447
+ to?: Date | null | undefined;
5447
5448
  } | null | undefined;
5448
5449
  recurringPaymentUseCount?: number | null | undefined;
5449
5450
  }, {
@@ -5487,8 +5488,8 @@ declare const bundleLineItemSchema: z.ZodObject<{
5487
5488
  } | null | undefined;
5488
5489
  applicableVariationIds?: string[] | null | undefined;
5489
5490
  validity?: {
5490
- from: Date | null;
5491
- to: Date | null;
5491
+ from?: Date | null | undefined;
5492
+ to?: Date | null | undefined;
5492
5493
  } | null | undefined;
5493
5494
  recurringPaymentUseCount?: number | null | undefined;
5494
5495
  }>>;
@@ -5692,8 +5693,8 @@ declare const bundleLineItemSchema: z.ZodObject<{
5692
5693
  } | null | undefined;
5693
5694
  applicableVariationIds?: string[] | null | undefined;
5694
5695
  validity?: {
5695
- from: Date | null;
5696
- to: Date | null;
5696
+ from?: Date | null | undefined;
5697
+ to?: Date | null | undefined;
5697
5698
  } | null | undefined;
5698
5699
  recurringPaymentUseCount?: number | null | undefined;
5699
5700
  } | undefined;
@@ -5829,8 +5830,8 @@ declare const bundleLineItemSchema: z.ZodObject<{
5829
5830
  } | null | undefined;
5830
5831
  applicableVariationIds?: string[] | null | undefined;
5831
5832
  validity?: {
5832
- from: Date | null;
5833
- to: Date | null;
5833
+ from?: Date | null | undefined;
5834
+ to?: Date | null | undefined;
5834
5835
  } | null | undefined;
5835
5836
  recurringPaymentUseCount?: number | null | undefined;
5836
5837
  } | undefined;
@@ -6225,14 +6226,14 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
6225
6226
  }>]>>>;
6226
6227
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
6227
6228
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
6228
- from: z.ZodNullable<z.ZodDate>;
6229
- to: z.ZodNullable<z.ZodDate>;
6229
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
6230
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
6230
6231
  }, "strip", z.ZodTypeAny, {
6231
- from: Date | null;
6232
- to: Date | null;
6232
+ from?: Date | null | undefined;
6233
+ to?: Date | null | undefined;
6233
6234
  }, {
6234
- from: Date | null;
6235
- to: Date | null;
6235
+ from?: Date | null | undefined;
6236
+ to?: Date | null | undefined;
6236
6237
  }>>>;
6237
6238
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
6238
6239
  }, "strip", z.ZodTypeAny, {
@@ -6276,8 +6277,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
6276
6277
  } | null | undefined;
6277
6278
  applicableVariationIds?: string[] | null | undefined;
6278
6279
  validity?: {
6279
- from: Date | null;
6280
- to: Date | null;
6280
+ from?: Date | null | undefined;
6281
+ to?: Date | null | undefined;
6281
6282
  } | null | undefined;
6282
6283
  recurringPaymentUseCount?: number | null | undefined;
6283
6284
  }, {
@@ -6321,8 +6322,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
6321
6322
  } | null | undefined;
6322
6323
  applicableVariationIds?: string[] | null | undefined;
6323
6324
  validity?: {
6324
- from: Date | null;
6325
- to: Date | null;
6325
+ from?: Date | null | undefined;
6326
+ to?: Date | null | undefined;
6326
6327
  } | null | undefined;
6327
6328
  recurringPaymentUseCount?: number | null | undefined;
6328
6329
  }>>;
@@ -6526,8 +6527,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
6526
6527
  } | null | undefined;
6527
6528
  applicableVariationIds?: string[] | null | undefined;
6528
6529
  validity?: {
6529
- from: Date | null;
6530
- to: Date | null;
6530
+ from?: Date | null | undefined;
6531
+ to?: Date | null | undefined;
6531
6532
  } | null | undefined;
6532
6533
  recurringPaymentUseCount?: number | null | undefined;
6533
6534
  } | undefined;
@@ -6663,8 +6664,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
6663
6664
  } | null | undefined;
6664
6665
  applicableVariationIds?: string[] | null | undefined;
6665
6666
  validity?: {
6666
- from: Date | null;
6667
- to: Date | null;
6667
+ from?: Date | null | undefined;
6668
+ to?: Date | null | undefined;
6668
6669
  } | null | undefined;
6669
6670
  recurringPaymentUseCount?: number | null | undefined;
6670
6671
  } | undefined;
@@ -7058,14 +7059,14 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
7058
7059
  }>]>>>;
7059
7060
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
7060
7061
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
7061
- from: z.ZodNullable<z.ZodDate>;
7062
- to: z.ZodNullable<z.ZodDate>;
7062
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
7063
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
7063
7064
  }, "strip", z.ZodTypeAny, {
7064
- from: Date | null;
7065
- to: Date | null;
7065
+ from?: Date | null | undefined;
7066
+ to?: Date | null | undefined;
7066
7067
  }, {
7067
- from: Date | null;
7068
- to: Date | null;
7068
+ from?: Date | null | undefined;
7069
+ to?: Date | null | undefined;
7069
7070
  }>>>;
7070
7071
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
7071
7072
  }, "strip", z.ZodTypeAny, {
@@ -7109,8 +7110,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
7109
7110
  } | null | undefined;
7110
7111
  applicableVariationIds?: string[] | null | undefined;
7111
7112
  validity?: {
7112
- from: Date | null;
7113
- to: Date | null;
7113
+ from?: Date | null | undefined;
7114
+ to?: Date | null | undefined;
7114
7115
  } | null | undefined;
7115
7116
  recurringPaymentUseCount?: number | null | undefined;
7116
7117
  }, {
@@ -7154,8 +7155,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
7154
7155
  } | null | undefined;
7155
7156
  applicableVariationIds?: string[] | null | undefined;
7156
7157
  validity?: {
7157
- from: Date | null;
7158
- to: Date | null;
7158
+ from?: Date | null | undefined;
7159
+ to?: Date | null | undefined;
7159
7160
  } | null | undefined;
7160
7161
  recurringPaymentUseCount?: number | null | undefined;
7161
7162
  }>>;
@@ -7359,8 +7360,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
7359
7360
  } | null | undefined;
7360
7361
  applicableVariationIds?: string[] | null | undefined;
7361
7362
  validity?: {
7362
- from: Date | null;
7363
- to: Date | null;
7363
+ from?: Date | null | undefined;
7364
+ to?: Date | null | undefined;
7364
7365
  } | null | undefined;
7365
7366
  recurringPaymentUseCount?: number | null | undefined;
7366
7367
  } | undefined;
@@ -7496,8 +7497,8 @@ declare const orderLineItemSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<
7496
7497
  } | null | undefined;
7497
7498
  applicableVariationIds?: string[] | null | undefined;
7498
7499
  validity?: {
7499
- from: Date | null;
7500
- to: Date | null;
7500
+ from?: Date | null | undefined;
7501
+ to?: Date | null | undefined;
7501
7502
  } | null | undefined;
7502
7503
  recurringPaymentUseCount?: number | null | undefined;
7503
7504
  } | undefined;
@@ -8440,14 +8441,14 @@ declare const orderSchema: z.ZodObject<{
8440
8441
  }>]>>>;
8441
8442
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
8442
8443
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
8443
- from: z.ZodNullable<z.ZodDate>;
8444
- to: z.ZodNullable<z.ZodDate>;
8444
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
8445
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
8445
8446
  }, "strip", z.ZodTypeAny, {
8446
- from: Date | null;
8447
- to: Date | null;
8447
+ from?: Date | null | undefined;
8448
+ to?: Date | null | undefined;
8448
8449
  }, {
8449
- from: Date | null;
8450
- to: Date | null;
8450
+ from?: Date | null | undefined;
8451
+ to?: Date | null | undefined;
8451
8452
  }>>>;
8452
8453
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
8453
8454
  }, "strip", z.ZodTypeAny, {
@@ -8491,8 +8492,8 @@ declare const orderSchema: z.ZodObject<{
8491
8492
  } | null | undefined;
8492
8493
  applicableVariationIds?: string[] | null | undefined;
8493
8494
  validity?: {
8494
- from: Date | null;
8495
- to: Date | null;
8495
+ from?: Date | null | undefined;
8496
+ to?: Date | null | undefined;
8496
8497
  } | null | undefined;
8497
8498
  recurringPaymentUseCount?: number | null | undefined;
8498
8499
  }, {
@@ -8536,8 +8537,8 @@ declare const orderSchema: z.ZodObject<{
8536
8537
  } | null | undefined;
8537
8538
  applicableVariationIds?: string[] | null | undefined;
8538
8539
  validity?: {
8539
- from: Date | null;
8540
- to: Date | null;
8540
+ from?: Date | null | undefined;
8541
+ to?: Date | null | undefined;
8541
8542
  } | null | undefined;
8542
8543
  recurringPaymentUseCount?: number | null | undefined;
8543
8544
  }>>;
@@ -8741,8 +8742,8 @@ declare const orderSchema: z.ZodObject<{
8741
8742
  } | null | undefined;
8742
8743
  applicableVariationIds?: string[] | null | undefined;
8743
8744
  validity?: {
8744
- from: Date | null;
8745
- to: Date | null;
8745
+ from?: Date | null | undefined;
8746
+ to?: Date | null | undefined;
8746
8747
  } | null | undefined;
8747
8748
  recurringPaymentUseCount?: number | null | undefined;
8748
8749
  } | undefined;
@@ -8878,8 +8879,8 @@ declare const orderSchema: z.ZodObject<{
8878
8879
  } | null | undefined;
8879
8880
  applicableVariationIds?: string[] | null | undefined;
8880
8881
  validity?: {
8881
- from: Date | null;
8882
- to: Date | null;
8882
+ from?: Date | null | undefined;
8883
+ to?: Date | null | undefined;
8883
8884
  } | null | undefined;
8884
8885
  recurringPaymentUseCount?: number | null | undefined;
8885
8886
  } | undefined;
@@ -9273,14 +9274,14 @@ declare const orderSchema: z.ZodObject<{
9273
9274
  }>]>>>;
9274
9275
  applicableVariationIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
9275
9276
  validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
9276
- from: z.ZodNullable<z.ZodDate>;
9277
- to: z.ZodNullable<z.ZodDate>;
9277
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
9278
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
9278
9279
  }, "strip", z.ZodTypeAny, {
9279
- from: Date | null;
9280
- to: Date | null;
9280
+ from?: Date | null | undefined;
9281
+ to?: Date | null | undefined;
9281
9282
  }, {
9282
- from: Date | null;
9283
- to: Date | null;
9283
+ from?: Date | null | undefined;
9284
+ to?: Date | null | undefined;
9284
9285
  }>>>;
9285
9286
  recurringPaymentUseCount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
9286
9287
  }, "strip", z.ZodTypeAny, {
@@ -9324,8 +9325,8 @@ declare const orderSchema: z.ZodObject<{
9324
9325
  } | null | undefined;
9325
9326
  applicableVariationIds?: string[] | null | undefined;
9326
9327
  validity?: {
9327
- from: Date | null;
9328
- to: Date | null;
9328
+ from?: Date | null | undefined;
9329
+ to?: Date | null | undefined;
9329
9330
  } | null | undefined;
9330
9331
  recurringPaymentUseCount?: number | null | undefined;
9331
9332
  }, {
@@ -9369,8 +9370,8 @@ declare const orderSchema: z.ZodObject<{
9369
9370
  } | null | undefined;
9370
9371
  applicableVariationIds?: string[] | null | undefined;
9371
9372
  validity?: {
9372
- from: Date | null;
9373
- to: Date | null;
9373
+ from?: Date | null | undefined;
9374
+ to?: Date | null | undefined;
9374
9375
  } | null | undefined;
9375
9376
  recurringPaymentUseCount?: number | null | undefined;
9376
9377
  }>>;
@@ -9574,8 +9575,8 @@ declare const orderSchema: z.ZodObject<{
9574
9575
  } | null | undefined;
9575
9576
  applicableVariationIds?: string[] | null | undefined;
9576
9577
  validity?: {
9577
- from: Date | null;
9578
- to: Date | null;
9578
+ from?: Date | null | undefined;
9579
+ to?: Date | null | undefined;
9579
9580
  } | null | undefined;
9580
9581
  recurringPaymentUseCount?: number | null | undefined;
9581
9582
  } | undefined;
@@ -9711,8 +9712,8 @@ declare const orderSchema: z.ZodObject<{
9711
9712
  } | null | undefined;
9712
9713
  applicableVariationIds?: string[] | null | undefined;
9713
9714
  validity?: {
9714
- from: Date | null;
9715
- to: Date | null;
9715
+ from?: Date | null | undefined;
9716
+ to?: Date | null | undefined;
9716
9717
  } | null | undefined;
9717
9718
  recurringPaymentUseCount?: number | null | undefined;
9718
9719
  } | undefined;
@@ -9934,8 +9935,8 @@ declare const orderSchema: z.ZodObject<{
9934
9935
  } | null | undefined;
9935
9936
  applicableVariationIds?: string[] | null | undefined;
9936
9937
  validity?: {
9937
- from: Date | null;
9938
- to: Date | null;
9938
+ from?: Date | null | undefined;
9939
+ to?: Date | null | undefined;
9939
9940
  } | null | undefined;
9940
9941
  recurringPaymentUseCount?: number | null | undefined;
9941
9942
  } | undefined;
@@ -10071,8 +10072,8 @@ declare const orderSchema: z.ZodObject<{
10071
10072
  } | null | undefined;
10072
10073
  applicableVariationIds?: string[] | null | undefined;
10073
10074
  validity?: {
10074
- from: Date | null;
10075
- to: Date | null;
10075
+ from?: Date | null | undefined;
10076
+ to?: Date | null | undefined;
10076
10077
  } | null | undefined;
10077
10078
  recurringPaymentUseCount?: number | null | undefined;
10078
10079
  } | undefined;
@@ -10335,8 +10336,8 @@ declare const orderSchema: z.ZodObject<{
10335
10336
  } | null | undefined;
10336
10337
  applicableVariationIds?: string[] | null | undefined;
10337
10338
  validity?: {
10338
- from: Date | null;
10339
- to: Date | null;
10339
+ from?: Date | null | undefined;
10340
+ to?: Date | null | undefined;
10340
10341
  } | null | undefined;
10341
10342
  recurringPaymentUseCount?: number | null | undefined;
10342
10343
  } | undefined;
@@ -10472,8 +10473,8 @@ declare const orderSchema: z.ZodObject<{
10472
10473
  } | null | undefined;
10473
10474
  applicableVariationIds?: string[] | null | undefined;
10474
10475
  validity?: {
10475
- from: Date | null;
10476
- to: Date | null;
10476
+ from?: Date | null | undefined;
10477
+ to?: Date | null | undefined;
10477
10478
  } | null | undefined;
10478
10479
  recurringPaymentUseCount?: number | null | undefined;
10479
10480
  } | undefined;
@@ -11831,6 +11832,16 @@ declare const couponSchema: z.ZodObject<{
11831
11832
  }>, "many">;
11832
11833
  applicableProductVariations: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
11833
11834
  applicableBundleVariations: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
11835
+ validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
11836
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
11837
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
11838
+ }, "strip", z.ZodTypeAny, {
11839
+ from?: Date | null | undefined;
11840
+ to?: Date | null | undefined;
11841
+ }, {
11842
+ from?: Date | null | undefined;
11843
+ to?: Date | null | undefined;
11844
+ }>>>;
11834
11845
  isDeleted: z.ZodBoolean;
11835
11846
  lastUpdated: z.ZodObject<{
11836
11847
  at: z.ZodDate;
@@ -11946,6 +11957,10 @@ declare const couponSchema: z.ZodObject<{
11946
11957
  }[];
11947
11958
  applicableProductVariations: Record<string, string[]>;
11948
11959
  applicableBundleVariations: Record<string, string[]>;
11960
+ validity?: {
11961
+ from?: Date | null | undefined;
11962
+ to?: Date | null | undefined;
11963
+ } | null | undefined;
11949
11964
  }, {
11950
11965
  id: string;
11951
11966
  name: string;
@@ -12000,32 +12015,72 @@ declare const couponSchema: z.ZodObject<{
12000
12015
  }[];
12001
12016
  applicableProductVariations: Record<string, string[]>;
12002
12017
  applicableBundleVariations: Record<string, string[]>;
12018
+ validity?: {
12019
+ from?: Date | null | undefined;
12020
+ to?: Date | null | undefined;
12021
+ } | null | undefined;
12003
12022
  }>;
12004
12023
  declare const createCouponRequestSchema: z.ZodObject<{
12005
12024
  name: z.ZodString;
12006
12025
  description: z.ZodString;
12007
12026
  applicableProducts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
12008
12027
  applicableBundles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
12028
+ validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
12029
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
12030
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
12031
+ }, "strip", z.ZodTypeAny, {
12032
+ from?: Date | null | undefined;
12033
+ to?: Date | null | undefined;
12034
+ }, {
12035
+ from?: Date | null | undefined;
12036
+ to?: Date | null | undefined;
12037
+ }>>>;
12009
12038
  }, "strip", z.ZodTypeAny, {
12010
12039
  name: string;
12011
12040
  description: string;
12041
+ validity?: {
12042
+ from?: Date | null | undefined;
12043
+ to?: Date | null | undefined;
12044
+ } | null | undefined;
12012
12045
  applicableProducts?: Record<string, string[]> | undefined;
12013
12046
  applicableBundles?: Record<string, string[]> | undefined;
12014
12047
  }, {
12015
12048
  name: string;
12016
12049
  description: string;
12050
+ validity?: {
12051
+ from?: Date | null | undefined;
12052
+ to?: Date | null | undefined;
12053
+ } | null | undefined;
12017
12054
  applicableProducts?: Record<string, string[]> | undefined;
12018
12055
  applicableBundles?: Record<string, string[]> | undefined;
12019
12056
  }>;
12020
12057
  declare const couponCodeSchema: z.ZodObject<{
12021
12058
  code: z.ZodString;
12022
12059
  numberOfRedemptions: z.ZodNumber;
12060
+ validity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
12061
+ from: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
12062
+ to: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
12063
+ }, "strip", z.ZodTypeAny, {
12064
+ from?: Date | null | undefined;
12065
+ to?: Date | null | undefined;
12066
+ }, {
12067
+ from?: Date | null | undefined;
12068
+ to?: Date | null | undefined;
12069
+ }>>>;
12023
12070
  }, "strip", z.ZodTypeAny, {
12024
12071
  code: string;
12025
12072
  numberOfRedemptions: number;
12073
+ validity?: {
12074
+ from?: Date | null | undefined;
12075
+ to?: Date | null | undefined;
12076
+ } | null | undefined;
12026
12077
  }, {
12027
12078
  code: string;
12028
12079
  numberOfRedemptions: number;
12080
+ validity?: {
12081
+ from?: Date | null | undefined;
12082
+ to?: Date | null | undefined;
12083
+ } | null | undefined;
12029
12084
  }>;
12030
12085
 
12031
12086
  declare const schemas$1_couponCodeSchema: typeof couponCodeSchema;
@@ -12067,4 +12122,4 @@ declare class MoonbaseClient {
12067
12122
  orders: OrderEndpoints;
12068
12123
  }
12069
12124
 
12070
- export { ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Bundle, ConflictError, type CouponSnapshot, type CreateVoucherRequest, type Customer, type CustomerSnapshot, CycleLength, type ImportCustomerRequest, type ImportLicenseRequest, type ImportSubscriptionRequest, type ImportTrialRequest, type License, type LicenseActivation, LicenseStatus, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type Order, OrderStatus, type Page, Platform, type PrepareOrderRequest, type PricingDiscount, type PricingVariation, type Product, type ProductRelease, ProductStatus, type ProvisionLicensesRequest, type Quantifiable, type Subscription, SubscriptionStatus, type Trial, TrialStatus, type UrchingTrackingModule, type Voucher, type VoucherCode, objectToQuery, schemas };
12125
+ export { ActivationMethod, type ActivationRequest, ActivationRequestStatus, ActivationStatus, type Bundle, ConflictError, type CouponSnapshot, type CreateVoucherRequest, type Customer, type CustomerSnapshot, CycleLength, type DateTimeSpan, type ImportCustomerRequest, type ImportLicenseRequest, type ImportSubscriptionRequest, type ImportTrialRequest, type License, type LicenseActivation, LicenseStatus, MoonbaseApi, MoonbaseClient, type MoonbaseConfiguration, MoonbaseError, NotAuthenticatedError, NotAuthorizedError, NotFoundError, type Order, OrderStatus, type Page, Platform, type PrepareOrderRequest, type PricingDiscount, type PricingVariation, type Product, type ProductRelease, ProductStatus, type ProvisionLicensesRequest, type Quantifiable, type Subscription, SubscriptionStatus, type Trial, TrialStatus, type UrchingTrackingModule, type Voucher, type VoucherCode, objectToQuery, schemas };
package/dist/index.js CHANGED
@@ -76,8 +76,8 @@ var discountSchema = z.discriminatedUnion("type", [
76
76
  flatAmountOffDiscountSchema
77
77
  ]);
78
78
  var dateTimeSpanSchema = z.object({
79
- from: z.coerce.date().nullable(),
80
- to: z.coerce.date().nullable()
79
+ from: z.coerce.date().nullish(),
80
+ to: z.coerce.date().nullish()
81
81
  });
82
82
  var exclusivitySchema = z.discriminatedUnion("type", [
83
83
  z.object({ type: z.literal("Everyone") }),
@@ -1057,6 +1057,7 @@ var couponSchema = z12.object({
1057
1057
  applicableBundles: bundleSchema.array(),
1058
1058
  applicableProductVariations: z12.record(z12.string(), z12.string().array()),
1059
1059
  applicableBundleVariations: z12.record(z12.string(), z12.string().array()),
1060
+ validity: dateTimeSpanSchema.nullish(),
1060
1061
  isDeleted: z12.boolean(),
1061
1062
  lastUpdated: entityChangeSchema,
1062
1063
  created: entityChangeSchema
@@ -1065,11 +1066,13 @@ var createCouponRequestSchema = z12.object({
1065
1066
  name: z12.string(),
1066
1067
  description: z12.string(),
1067
1068
  applicableProducts: z12.record(z12.string(), z12.string().array()).optional().describe("Restricts the coupon to specific products, needs to be a map of product ID to array of applicable pricing variations, empty array if any variation is applicable."),
1068
- applicableBundles: z12.record(z12.string(), z12.string().array()).optional().describe("Restricts the coupon to specific bundles, needs to be a map of bundle ID to array of applicable pricing variations, empty array if any variation is applicable.")
1069
+ applicableBundles: z12.record(z12.string(), z12.string().array()).optional().describe("Restricts the coupon to specific bundles, needs to be a map of bundle ID to array of applicable pricing variations, empty array if any variation is applicable."),
1070
+ validity: dateTimeSpanSchema.nullish().describe("Restricts the coupon to a specific time period.")
1069
1071
  });
1070
1072
  var couponCodeSchema = z12.object({
1071
1073
  code: z12.string(),
1072
- numberOfRedemptions: z12.number()
1074
+ numberOfRedemptions: z12.number(),
1075
+ validity: dateTimeSpanSchema.nullish()
1073
1076
  });
1074
1077
 
1075
1078
  // src/index.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moonbase.sh/api",
3
3
  "type": "module",
4
- "version": "0.4.70",
4
+ "version": "0.4.71",
5
5
  "description": "Package to let you integrate backends with Moonbase.sh as payment and delivery provider",
6
6
  "author": "Tobias Lønnerød Madsen <m@dsen.tv>",
7
7
  "license": "MIT",