shred-api-client 2.5.5 → 2.6.1

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.d.ts CHANGED
@@ -566,11 +566,31 @@ declare const SubscriptionSummarySchema: z.ZodObject<{
566
566
  productId: string;
567
567
  productName: string;
568
568
  }>;
569
+ declare const PromoCodeSchema: z.ZodObject<{
570
+ id: z.ZodString;
571
+ code: z.ZodString;
572
+ percentOff: z.ZodOptional<z.ZodNumber>;
573
+ amountOff: z.ZodOptional<z.ZodNumber>;
574
+ currency: z.ZodOptional<z.ZodString>;
575
+ }, "strip", z.ZodTypeAny, {
576
+ id: string;
577
+ code: string;
578
+ currency?: string | undefined;
579
+ percentOff?: number | undefined;
580
+ amountOff?: number | undefined;
581
+ }, {
582
+ id: string;
583
+ code: string;
584
+ currency?: string | undefined;
585
+ percentOff?: number | undefined;
586
+ amountOff?: number | undefined;
587
+ }>;
569
588
  type Subscription = z.infer<typeof SubscriptionSchema>;
570
589
  type SubscriptionSummary = z.infer<typeof SubscriptionSummarySchema>;
571
590
  type Charge = z.infer<typeof ChargeSchema>;
572
591
  type Plan = z.infer<typeof PlanSchema>;
573
592
  type Product = z.infer<typeof ProductSchema>;
593
+ type PromoCode = z.infer<typeof PromoCodeSchema>;
574
594
 
575
595
  interface IAPI$b {
576
596
  getCharges: (ctx: Context) => Promise<Charge[]>;
@@ -584,6 +604,7 @@ interface IAPI$b {
584
604
  updatePlan: (ctx: Context, planId: string) => Promise<boolean>;
585
605
  createCheckout: (planId: string | null, ctx: Context, callbackUrl?: string) => Promise<string>;
586
606
  getSubscriptionsSummary: (ctx: Context) => Promise<SubscriptionSummary[]>;
607
+ listPromoCodes: (ctx: Context) => Promise<PromoCode[]>;
587
608
  }
588
609
  declare const Endpoints$a: {
589
610
  GetPortal: {
@@ -638,6 +659,10 @@ declare const Endpoints$a: {
638
659
  uri: string;
639
660
  method: string;
640
661
  };
662
+ ListPromoCodes: {
663
+ uri: string;
664
+ method: string;
665
+ };
641
666
  };
642
667
 
643
668
  type index$d_Charge = Charge;
@@ -646,12 +671,13 @@ type index$d_Plan = Plan;
646
671
  declare const index$d_PlanSchema: typeof PlanSchema;
647
672
  type index$d_Product = Product;
648
673
  declare const index$d_ProductSchema: typeof ProductSchema;
674
+ type index$d_PromoCode = PromoCode;
649
675
  declare const index$d_SubscriptionSchema: typeof SubscriptionSchema;
650
676
  declare const index$d_SubscriptionTypeSchema: typeof SubscriptionTypeSchema;
651
677
  type index$d_Type = Type;
652
678
  declare const index$d_Type: typeof Type;
653
679
  declare namespace index$d {
654
- export { type index$d_Charge as Charge, index$d_ChargeSchema as ChargeSchema, Endpoints$a as Endpoints, type Subscription as Entity, type IAPI$b as IAPI, type index$d_Plan as Plan, index$d_PlanSchema as PlanSchema, type index$d_Product as Product, index$d_ProductSchema as ProductSchema, index$d_SubscriptionSchema as SubscriptionSchema, index$d_SubscriptionTypeSchema as SubscriptionTypeSchema, type SubscriptionSummary as Summary, index$d_Type as Type };
680
+ export { type index$d_Charge as Charge, index$d_ChargeSchema as ChargeSchema, Endpoints$a as Endpoints, type Subscription as Entity, type IAPI$b as IAPI, type index$d_Plan as Plan, index$d_PlanSchema as PlanSchema, type index$d_Product as Product, index$d_ProductSchema as ProductSchema, type index$d_PromoCode as PromoCode, index$d_SubscriptionSchema as SubscriptionSchema, index$d_SubscriptionTypeSchema as SubscriptionTypeSchema, type SubscriptionSummary as Summary, index$d_Type as Type };
655
681
  }
656
682
 
657
683
  declare enum Role {
@@ -860,7 +886,7 @@ interface IAPI$a {
860
886
  confirmCode: (email: string, code: number, keepCode?: boolean) => Promise<boolean>;
861
887
  changePassword: (email: string, pass: string, passConfirm: string, code: number) => Promise<boolean>;
862
888
  changeEmail: (ctx: Context, email: string, code: number) => Promise<boolean>;
863
- authenticate: (email: string, password: string, system: System) => Promise<string>;
889
+ authenticate: (email: string, password: string, system: System | System[]) => Promise<string>;
864
890
  update: (context: Context, update: Partial<Update$1>) => Promise<boolean>;
865
891
  setup: (context: Context) => Promise<boolean>;
866
892
  getBindedUsers: (ctx: Context) => Promise<User[]>;
package/dist/index.js CHANGED
@@ -4667,6 +4667,17 @@ var SubscriptionAPI = class {
4667
4667
  );
4668
4668
  return data;
4669
4669
  }
4670
+ async listPromoCodes(ctx) {
4671
+ const endpointInfo = subscription_exports.Endpoints.ListPromoCodes;
4672
+ const data = await this.clientHTTP.makeRequest(
4673
+ this.env,
4674
+ endpointInfo.uri,
4675
+ endpointInfo.method,
4676
+ null,
4677
+ ctx
4678
+ );
4679
+ return data;
4680
+ }
4670
4681
  async createCheckout(planId, ctx, callbackUrl) {
4671
4682
  const endpointInfo = subscription_exports.Endpoints.Checkout;
4672
4683
  const data = await this.clientHTTP.makeRequest(
@@ -6125,6 +6136,13 @@ var SubscriptionSummarySchema = external_exports.object({
6125
6136
  productName: external_exports.string(),
6126
6137
  email: external_exports.string()
6127
6138
  });
6139
+ var PromoCodeSchema = external_exports.object({
6140
+ id: external_exports.string(),
6141
+ code: external_exports.string(),
6142
+ percentOff: external_exports.number().optional(),
6143
+ amountOff: external_exports.number().optional(),
6144
+ currency: external_exports.string().optional()
6145
+ });
6128
6146
 
6129
6147
  // src/model/tenant/Tenant.schema.ts
6130
6148
  var PreferencesSchema = external_exports.object({
@@ -6352,6 +6370,10 @@ var Endpoints12 = {
6352
6370
  GetSubscriptionSummary: {
6353
6371
  uri: "/subscriptions/summary/list/",
6354
6372
  method: "GET"
6373
+ },
6374
+ ListPromoCodes: {
6375
+ uri: "/subscriptions/promo-codes/list/",
6376
+ method: "GET"
6355
6377
  }
6356
6378
  };
6357
6379