File size: 2,735 Bytes
312c2e2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/**
 * Generated by orval v8.5.3 🍺
 * Do not edit manually.
 * Api
 * API specification for FB Group Publisher PRO
 * OpenAPI spec version: 0.1.0
 */
import * as zod from "zod";

/**
 * @summary Health check
 */
export const HealthCheckResponse = zod.object({
  status: zod.string(),
});

/**
 * @summary Get current user with subscription state
 */
export const GetMeResponse = zod.object({
  userId: zod.string(),
  email: zod.string().nullish(),
  subscription: zod.object({
    status: zod.enum([
      "none",
      "trialing",
      "active",
      "cancelled",
      "suspended",
      "expired",
    ]),
    trialEnd: zod.coerce.date().nullish(),
    currentPeriodEnd: zod.coerce.date().nullish(),
    paypalSubscriptionId: zod.string().nullish(),
    hasAccess: zod.boolean(),
  }),
});

/**
 * @summary Create PayPal subscription, returns approval URL
 */
export const CreateSubscriptionResponse = zod.object({
  subscriptionId: zod.string(),
  approvalUrl: zod.string(),
});

/**
 * @summary Activate subscription after PayPal approval
 */
export const ActivateSubscriptionBody = zod.object({
  subscriptionId: zod.string(),
});

export const ActivateSubscriptionResponse = zod.object({
  status: zod.enum([
    "none",
    "trialing",
    "active",
    "cancelled",
    "suspended",
    "expired",
  ]),
  trialEnd: zod.coerce.date().nullish(),
  currentPeriodEnd: zod.coerce.date().nullish(),
  paypalSubscriptionId: zod.string().nullish(),
  hasAccess: zod.boolean(),
});

/**
 * @summary Cancel current subscription
 */
export const CancelSubscriptionResponse = zod.object({
  status: zod.enum([
    "none",
    "trialing",
    "active",
    "cancelled",
    "suspended",
    "expired",
  ]),
  trialEnd: zod.coerce.date().nullish(),
  currentPeriodEnd: zod.coerce.date().nullish(),
  paypalSubscriptionId: zod.string().nullish(),
  hasAccess: zod.boolean(),
});

/**
 * @summary PayPal webhook receiver
 */
export const PaypalWebhookBody = zod.record(zod.string(), zod.unknown());

export const PaypalWebhookResponse = zod.object({
  status: zod.string(),
});

/**
 * @summary List saved group lists
 */
export const ListSavedListsResponseItem = zod.object({
  id: zod.number(),
  name: zod.string(),
  groupIds: zod.array(zod.string()),
  createdAt: zod.coerce.date(),
});
export const ListSavedListsResponse = zod.array(ListSavedListsResponseItem);

/**
 * @summary Save a group list
 */
export const createSavedListBodyNameMax = 80;

export const CreateSavedListBody = zod.object({
  name: zod.string().min(1).max(createSavedListBodyNameMax),
  groupIds: zod.array(zod.string()).min(1),
});

/**
 * @summary Delete a saved list
 */
export const DeleteSavedListParams = zod.object({
  id: zod.coerce.number(),
});