shred-api-client 2.4.13-rc.3 → 2.4.14

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
@@ -270,6 +270,34 @@ declare const PlanSchema: z.ZodObject<{
270
270
  currency: string;
271
271
  subscriptionItemId: string;
272
272
  }>;
273
+ declare const SpecialOfferSchema: z.ZodObject<{
274
+ id: z.ZodString;
275
+ freeProjectsAllowed: z.ZodDefault<z.ZodNumber>;
276
+ windowHours: z.ZodNumber;
277
+ couponId: z.ZodString;
278
+ title: z.ZodString;
279
+ description: z.ZodString;
280
+ ctaLabel: z.ZodString;
281
+ enabled: z.ZodDefault<z.ZodBoolean>;
282
+ }, "strip", z.ZodTypeAny, {
283
+ id: string;
284
+ title: string;
285
+ description: string;
286
+ freeProjectsAllowed: number;
287
+ windowHours: number;
288
+ couponId: string;
289
+ ctaLabel: string;
290
+ enabled: boolean;
291
+ }, {
292
+ id: string;
293
+ title: string;
294
+ description: string;
295
+ windowHours: number;
296
+ couponId: string;
297
+ ctaLabel: string;
298
+ freeProjectsAllowed?: number | undefined;
299
+ enabled?: boolean | undefined;
300
+ }>;
273
301
  declare const ProductSchema: z.ZodObject<{
274
302
  id: z.ZodString;
275
303
  name: z.ZodString;
@@ -567,6 +595,7 @@ declare const SubscriptionSummarySchema: z.ZodObject<{
567
595
  productName: string;
568
596
  }>;
569
597
  type Subscription = z.infer<typeof SubscriptionSchema>;
598
+ type SpecialOffer = z.infer<typeof SpecialOfferSchema>;
570
599
  type SubscriptionSummary = z.infer<typeof SubscriptionSummarySchema>;
571
600
  type Charge = z.infer<typeof ChargeSchema>;
572
601
  type Plan = z.infer<typeof PlanSchema>;
@@ -584,6 +613,7 @@ interface IAPI$9 {
584
613
  updatePlan: (ctx: Context, planId: string) => Promise<boolean>;
585
614
  createCheckout: (planId: string | null, ctx: Context, callbackUrl?: string) => Promise<string>;
586
615
  getSubscriptionsSummary: (ctx: Context) => Promise<SubscriptionSummary[]>;
616
+ getSpecialOffer: (ctx: Context) => Promise<SpecialOffer | null>;
587
617
  }
588
618
  declare const Endpoints$8: {
589
619
  GetPortal: {
@@ -598,6 +628,10 @@ declare const Endpoints$8: {
598
628
  uri: string;
599
629
  method: string;
600
630
  };
631
+ GetSpecialOffer: {
632
+ uri: string;
633
+ method: string;
634
+ };
601
635
  GetCharges: {
602
636
  uri: string;
603
637
  method: string;
@@ -646,12 +680,13 @@ type index$b_Plan = Plan;
646
680
  declare const index$b_PlanSchema: typeof PlanSchema;
647
681
  type index$b_Product = Product;
648
682
  declare const index$b_ProductSchema: typeof ProductSchema;
683
+ type index$b_SpecialOffer = SpecialOffer;
649
684
  declare const index$b_SubscriptionSchema: typeof SubscriptionSchema;
650
685
  declare const index$b_SubscriptionTypeSchema: typeof SubscriptionTypeSchema;
651
686
  type index$b_Type = Type;
652
687
  declare const index$b_Type: typeof Type;
653
688
  declare namespace index$b {
654
- export { type index$b_Charge as Charge, index$b_ChargeSchema as ChargeSchema, Endpoints$8 as Endpoints, type Subscription as Entity, type IAPI$9 as IAPI, type index$b_Plan as Plan, index$b_PlanSchema as PlanSchema, type index$b_Product as Product, index$b_ProductSchema as ProductSchema, index$b_SubscriptionSchema as SubscriptionSchema, index$b_SubscriptionTypeSchema as SubscriptionTypeSchema, type SubscriptionSummary as Summary, index$b_Type as Type };
689
+ export { type index$b_Charge as Charge, index$b_ChargeSchema as ChargeSchema, Endpoints$8 as Endpoints, type Subscription as Entity, type IAPI$9 as IAPI, type index$b_Plan as Plan, index$b_PlanSchema as PlanSchema, type index$b_Product as Product, index$b_ProductSchema as ProductSchema, type index$b_SpecialOffer as SpecialOffer, index$b_SubscriptionSchema as SubscriptionSchema, index$b_SubscriptionTypeSchema as SubscriptionTypeSchema, type SubscriptionSummary as Summary, index$b_Type as Type };
655
690
  }
656
691
 
657
692
  declare enum Role {
@@ -733,6 +768,19 @@ declare const UserSchema: z.ZodObject<{
733
768
  tenantId: z.ZodOptional<z.ZodString>;
734
769
  editorId: z.ZodOptional<z.ZodString>;
735
770
  timezone: z.ZodOptional<z.ZodString>;
771
+ offer: z.ZodOptional<z.ZodObject<{
772
+ expiresAt: z.ZodOptional<z.ZodNumber>;
773
+ activatedAt: z.ZodOptional<z.ZodNumber>;
774
+ promoCodeId: z.ZodOptional<z.ZodString>;
775
+ }, "strip", z.ZodTypeAny, {
776
+ expiresAt?: number | undefined;
777
+ activatedAt?: number | undefined;
778
+ promoCodeId?: string | undefined;
779
+ }, {
780
+ expiresAt?: number | undefined;
781
+ activatedAt?: number | undefined;
782
+ promoCodeId?: string | undefined;
783
+ }>>;
736
784
  experienceId: z.ZodOptional<z.ZodString>;
737
785
  customerId: z.ZodString;
738
786
  role: z.ZodNativeEnum<typeof Role>;
@@ -758,6 +806,11 @@ declare const UserSchema: z.ZodObject<{
758
806
  profession?: string | undefined;
759
807
  photoUrl?: string | undefined;
760
808
  editorId?: string | undefined;
809
+ offer?: {
810
+ expiresAt?: number | undefined;
811
+ activatedAt?: number | undefined;
812
+ promoCodeId?: string | undefined;
813
+ } | undefined;
761
814
  experienceId?: string | undefined;
762
815
  }, {
763
816
  email: string;
@@ -781,6 +834,11 @@ declare const UserSchema: z.ZodObject<{
781
834
  profession?: string | undefined;
782
835
  photoUrl?: string | undefined;
783
836
  editorId?: string | undefined;
837
+ offer?: {
838
+ expiresAt?: number | undefined;
839
+ activatedAt?: number | undefined;
840
+ promoCodeId?: string | undefined;
841
+ } | undefined;
784
842
  experienceId?: string | undefined;
785
843
  }>;
786
844
  type User = z.infer<typeof UserSchema>;
@@ -801,12 +859,8 @@ type QueryOrderBy<T> = {
801
859
  type QueryFilterOp = "==" | "!=" | ">" | "<" | ">=" | "<=" | "in" | "not-in" | "array-contains" | "array-contains-any" | "between";
802
860
  type QueryWhere<T> = {
803
861
  field: keyof T | "modified";
804
- operation: Exclude<QueryFilterOp, "between">;
805
- value: T[keyof T] | T[keyof T][];
806
- } | {
807
- field: keyof T | "modified";
808
- operation: "between";
809
- value: {
862
+ operation: QueryFilterOp;
863
+ value: T[keyof T] | T[keyof T][] | {
810
864
  from: number;
811
865
  to: number;
812
866
  };
@@ -2278,11 +2332,12 @@ declare const NotificationDetailSchema: z.ZodObject<Pick<{
2278
2332
  }>>;
2279
2333
  metadata: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
2280
2334
  error: z.ZodOptional<z.ZodString>;
2281
- }, "userId" | "title" | "body" | "cta" | "metadata">, "strip", z.ZodTypeAny, {
2335
+ }, "userId" | "title" | "body" | "type" | "cta" | "metadata">, "strip", z.ZodTypeAny, {
2282
2336
  userId: string;
2283
2337
  title: string;
2284
2338
  body: string;
2285
2339
  metadata: Record<string, string | number>;
2340
+ type?: NotificationType | undefined;
2286
2341
  cta?: {
2287
2342
  label: string;
2288
2343
  url: string;
@@ -2292,6 +2347,7 @@ declare const NotificationDetailSchema: z.ZodObject<Pick<{
2292
2347
  title: string;
2293
2348
  body: string;
2294
2349
  metadata: Record<string, string | number>;
2350
+ type?: NotificationType | undefined;
2295
2351
  cta?: {
2296
2352
  label: string;
2297
2353
  url: string;
@@ -2417,11 +2473,12 @@ declare const TriggerSchema: z.ZodObject<{
2417
2473
  }>>;
2418
2474
  metadata: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
2419
2475
  error: z.ZodOptional<z.ZodString>;
2420
- }, "userId" | "title" | "body" | "cta" | "metadata">, "strip", z.ZodTypeAny, {
2476
+ }, "userId" | "title" | "body" | "type" | "cta" | "metadata">, "strip", z.ZodTypeAny, {
2421
2477
  userId: string;
2422
2478
  title: string;
2423
2479
  body: string;
2424
2480
  metadata: Record<string, string | number>;
2481
+ type?: NotificationType | undefined;
2425
2482
  cta?: {
2426
2483
  label: string;
2427
2484
  url: string;
@@ -2431,6 +2488,7 @@ declare const TriggerSchema: z.ZodObject<{
2431
2488
  title: string;
2432
2489
  body: string;
2433
2490
  metadata: Record<string, string | number>;
2491
+ type?: NotificationType | undefined;
2434
2492
  cta?: {
2435
2493
  label: string;
2436
2494
  url: string;
@@ -2547,6 +2605,7 @@ declare const TriggerSchema: z.ZodObject<{
2547
2605
  title: string;
2548
2606
  body: string;
2549
2607
  metadata: Record<string, string | number>;
2608
+ type?: NotificationType | undefined;
2550
2609
  cta?: {
2551
2610
  label: string;
2552
2611
  url: string;
@@ -2598,6 +2657,7 @@ declare const TriggerSchema: z.ZodObject<{
2598
2657
  title: string;
2599
2658
  body: string;
2600
2659
  metadata: Record<string, string | number>;
2660
+ type?: NotificationType | undefined;
2601
2661
  cta?: {
2602
2662
  label: string;
2603
2663
  url: string;
package/dist/index.js CHANGED
@@ -4249,7 +4249,8 @@ var NotificationDetailSchema = NotificationItemSchema.pick({
4249
4249
  body: true,
4250
4250
  userId: true,
4251
4251
  metadata: true,
4252
- cta: true
4252
+ cta: true,
4253
+ type: true
4253
4254
  });
4254
4255
  var CriteriaSchema = external_exports.object({
4255
4256
  type: external_exports.nativeEnum(CriteriaType),
@@ -4539,6 +4540,17 @@ var SubscriptionAPI = class {
4539
4540
  );
4540
4541
  return data;
4541
4542
  }
4543
+ async getSpecialOffer(ctx) {
4544
+ const endpointInfo = subscription_exports.Endpoints.GetSpecialOffer;
4545
+ const data = await this.clientHTTP.makeRequest(
4546
+ this.env,
4547
+ endpointInfo.uri,
4548
+ endpointInfo.method,
4549
+ null,
4550
+ ctx
4551
+ );
4552
+ return data;
4553
+ }
4542
4554
  async getSubscription(context, userId) {
4543
4555
  const endpointInfo = subscription_exports.Endpoints.GetActiveSubscription;
4544
4556
  let uri = endpointInfo.uri;
@@ -5903,6 +5915,16 @@ var PlanSchema = external_exports.object({
5903
5915
  metadata: external_exports.record(external_exports.string(), external_exports.string()),
5904
5916
  subscriptionItemId: external_exports.string()
5905
5917
  });
5918
+ var SpecialOfferSchema = external_exports.object({
5919
+ id: external_exports.string(),
5920
+ freeProjectsAllowed: external_exports.number().default(15),
5921
+ windowHours: external_exports.number(),
5922
+ couponId: external_exports.string(),
5923
+ title: external_exports.string(),
5924
+ description: external_exports.string(),
5925
+ ctaLabel: external_exports.string(),
5926
+ enabled: external_exports.boolean().default(true)
5927
+ });
5906
5928
  var DescriptionSchema = external_exports.object({
5907
5929
  description: external_exports.string(),
5908
5930
  subtitle: external_exports.string()
@@ -6062,6 +6084,11 @@ var UserSchema = external_exports.object({
6062
6084
  tenantId: external_exports.string().optional(),
6063
6085
  editorId: external_exports.string().optional(),
6064
6086
  timezone: external_exports.string().optional(),
6087
+ offer: external_exports.object({
6088
+ expiresAt: external_exports.number().optional(),
6089
+ activatedAt: external_exports.number().optional(),
6090
+ promoCodeId: external_exports.string().optional()
6091
+ }).optional(),
6065
6092
  experienceId: external_exports.string().optional(),
6066
6093
  customerId: external_exports.string(),
6067
6094
  role: external_exports.nativeEnum(Role)
@@ -6113,6 +6140,10 @@ var Endpoints10 = {
6113
6140
  uri: "/subscriptions/active/",
6114
6141
  method: "GET"
6115
6142
  },
6143
+ GetSpecialOffer: {
6144
+ uri: "/subscriptions/specialOffer/",
6145
+ method: "GET"
6146
+ },
6116
6147
  GetCharges: {
6117
6148
  uri: "/subscriptions/payment/charge/list/",
6118
6149
  method: "GET"