sare26 commited on
Commit
312c2e2
·
verified ·
1 Parent(s): 0c4c050

Upload 83 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. lib/api-client-react/dist/custom-fetch.d.ts +57 -0
  2. lib/api-client-react/dist/custom-fetch.d.ts.map +1 -0
  3. lib/api-client-react/dist/generated/api.d.ts +221 -0
  4. lib/api-client-react/dist/generated/api.d.ts.map +1 -0
  5. lib/api-client-react/dist/generated/api.schemas.d.ts +62 -0
  6. lib/api-client-react/dist/generated/api.schemas.d.ts.map +1 -0
  7. lib/api-client-react/dist/index.d.ts +5 -0
  8. lib/api-client-react/dist/index.d.ts.map +1 -0
  9. lib/api-client-react/package.json +15 -0
  10. lib/api-client-react/src/custom-fetch.ts +371 -0
  11. lib/api-client-react/src/generated/api.schemas.ts +70 -0
  12. lib/api-client-react/src/generated/api.ts +756 -0
  13. lib/api-client-react/src/index.ts +4 -0
  14. lib/api-client-react/tsconfig.json +12 -0
  15. lib/api-client-react/tsconfig.tsbuildinfo +1 -0
  16. lib/api-spec/openapi.yaml +265 -0
  17. lib/api-spec/orval.config.ts +72 -0
  18. lib/api-spec/package.json +11 -0
  19. lib/api-zod/dist/generated/api.d.ts +199 -0
  20. lib/api-zod/dist/generated/api.d.ts.map +1 -0
  21. lib/api-zod/dist/generated/types/activateSubscriptionBody.d.ts +11 -0
  22. lib/api-zod/dist/generated/types/activateSubscriptionBody.d.ts.map +1 -0
  23. lib/api-zod/dist/generated/types/createSavedListBody.d.ts +17 -0
  24. lib/api-zod/dist/generated/types/createSavedListBody.d.ts.map +1 -0
  25. lib/api-zod/dist/generated/types/createSubscriptionResponse.d.ts +12 -0
  26. lib/api-zod/dist/generated/types/createSubscriptionResponse.d.ts.map +1 -0
  27. lib/api-zod/dist/generated/types/healthStatus.d.ts +11 -0
  28. lib/api-zod/dist/generated/types/healthStatus.d.ts.map +1 -0
  29. lib/api-zod/dist/generated/types/index.d.ts +18 -0
  30. lib/api-zod/dist/generated/types/index.d.ts.map +1 -0
  31. lib/api-zod/dist/generated/types/listSavedListsResponse.d.ts +10 -0
  32. lib/api-zod/dist/generated/types/listSavedListsResponse.d.ts.map +1 -0
  33. lib/api-zod/dist/generated/types/meResponse.d.ts +15 -0
  34. lib/api-zod/dist/generated/types/meResponse.d.ts.map +1 -0
  35. lib/api-zod/dist/generated/types/paypalWebhookBody.d.ts +11 -0
  36. lib/api-zod/dist/generated/types/paypalWebhookBody.d.ts.map +1 -0
  37. lib/api-zod/dist/generated/types/savedList.d.ts +14 -0
  38. lib/api-zod/dist/generated/types/savedList.d.ts.map +1 -0
  39. lib/api-zod/dist/generated/types/subscriptionState.d.ts +19 -0
  40. lib/api-zod/dist/generated/types/subscriptionState.d.ts.map +1 -0
  41. lib/api-zod/dist/generated/types/subscriptionStateStatus.d.ts +17 -0
  42. lib/api-zod/dist/generated/types/subscriptionStateStatus.d.ts.map +1 -0
  43. lib/api-zod/dist/index.d.ts +2 -0
  44. lib/api-zod/dist/index.d.ts.map +1 -0
  45. lib/api-zod/package.json +12 -0
  46. lib/api-zod/src/generated/api.ts +122 -0
  47. lib/api-zod/src/generated/types/activateSubscriptionBody.ts +11 -0
  48. lib/api-zod/src/generated/types/createSavedListBody.ts +17 -0
  49. lib/api-zod/src/generated/types/createSubscriptionResponse.ts +12 -0
  50. lib/api-zod/src/generated/types/healthStatus.ts +11 -0
lib/api-client-react/dist/custom-fetch.d.ts ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type CustomFetchOptions = RequestInit & {
2
+ responseType?: "json" | "text" | "blob" | "auto";
3
+ };
4
+ export type ErrorType<T = unknown> = ApiError<T>;
5
+ export type BodyType<T> = T;
6
+ export type AuthTokenGetter = () => Promise<string | null> | string | null;
7
+ /**
8
+ * Set a base URL that is prepended to every relative request URL
9
+ * (i.e. paths that start with `/`).
10
+ *
11
+ * Useful for Expo bundles that need to call a remote API server.
12
+ * Pass `null` to clear the base URL.
13
+ */
14
+ export declare function setBaseUrl(url: string | null): void;
15
+ /**
16
+ * Register a getter that supplies a bearer auth token. Before every fetch
17
+ * the getter is invoked; when it returns a non-null string, an
18
+ * `Authorization: Bearer <token>` header is attached to the request.
19
+ *
20
+ * Useful for Expo bundles making token-gated API calls.
21
+ * Pass `null` to clear the getter.
22
+ *
23
+ * NOTE: This function should never be used in web applications where session
24
+ * token cookies are automatically associated with API calls by the browser.
25
+ */
26
+ export declare function setAuthTokenGetter(getter: AuthTokenGetter | null): void;
27
+ export declare class ApiError<T = unknown> extends Error {
28
+ readonly name = "ApiError";
29
+ readonly status: number;
30
+ readonly statusText: string;
31
+ readonly data: T | null;
32
+ readonly headers: Headers;
33
+ readonly response: Response;
34
+ readonly method: string;
35
+ readonly url: string;
36
+ constructor(response: Response, data: T | null, requestInfo: {
37
+ method: string;
38
+ url: string;
39
+ });
40
+ }
41
+ export declare class ResponseParseError extends Error {
42
+ readonly name = "ResponseParseError";
43
+ readonly status: number;
44
+ readonly statusText: string;
45
+ readonly headers: Headers;
46
+ readonly response: Response;
47
+ readonly method: string;
48
+ readonly url: string;
49
+ readonly rawBody: string;
50
+ readonly cause: unknown;
51
+ constructor(response: Response, rawBody: string, cause: unknown, requestInfo: {
52
+ method: string;
53
+ url: string;
54
+ });
55
+ }
56
+ export declare function customFetch<T = unknown>(input: RequestInfo | URL, options?: CustomFetchOptions): Promise<T>;
57
+ //# sourceMappingURL=custom-fetch.d.ts.map
lib/api-client-react/dist/custom-fetch.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"custom-fetch.d.ts","sourceRoot":"","sources":["../src/custom-fetch.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG;IAC7C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MA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,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;gBAGtB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,OAAO,EACd,WAAW,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE;CAiB/C;AA2FD,wBAAsB,WAAW,CAAC,CAAC,GAAG,OAAO,EAC3C,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,CAAC,CAAC,CA2CZ"}
lib/api-client-react/dist/generated/api.d.ts ADDED
@@ -0,0 +1,221 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import type { QueryKey, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
2
+ import type { ActivateSubscriptionBody, CreateSavedListBody, CreateSubscriptionResponse, HealthStatus, ListSavedListsResponse, MeResponse, PaypalWebhookBody, SavedList, SubscriptionState } from "./api.schemas";
3
+ import { customFetch } from "../custom-fetch";
4
+ import type { ErrorType, BodyType } from "../custom-fetch";
5
+ type AwaitedInput<T> = PromiseLike<T> | T;
6
+ type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
7
+ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
8
+ /**
9
+ * @summary Health check
10
+ */
11
+ export declare const getHealthCheckUrl: () => string;
12
+ export declare const healthCheck: (options?: RequestInit) => Promise<HealthStatus>;
13
+ export declare const getHealthCheckQueryKey: () => readonly ["/api/healthz"];
14
+ export declare const getHealthCheckQueryOptions: <TData = Awaited<ReturnType<typeof healthCheck>>, TError = ErrorType<unknown>>(options?: {
15
+ query?: UseQueryOptions<Awaited<ReturnType<typeof healthCheck>>, TError, TData>;
16
+ request?: SecondParameter<typeof customFetch>;
17
+ }) => UseQueryOptions<Awaited<ReturnType<typeof healthCheck>>, TError, TData> & {
18
+ queryKey: QueryKey;
19
+ };
20
+ export type HealthCheckQueryResult = NonNullable<Awaited<ReturnType<typeof healthCheck>>>;
21
+ export type HealthCheckQueryError = ErrorType<unknown>;
22
+ /**
23
+ * @summary Health check
24
+ */
25
+ export declare function useHealthCheck<TData = Awaited<ReturnType<typeof healthCheck>>, TError = ErrorType<unknown>>(options?: {
26
+ query?: UseQueryOptions<Awaited<ReturnType<typeof healthCheck>>, TError, TData>;
27
+ request?: SecondParameter<typeof customFetch>;
28
+ }): UseQueryResult<TData, TError> & {
29
+ queryKey: QueryKey;
30
+ };
31
+ /**
32
+ * @summary Get current user with subscription state
33
+ */
34
+ export declare const getGetMeUrl: () => string;
35
+ export declare const getMe: (options?: RequestInit) => Promise<MeResponse>;
36
+ export declare const getGetMeQueryKey: () => readonly ["/api/me"];
37
+ export declare const getGetMeQueryOptions: <TData = Awaited<ReturnType<typeof getMe>>, TError = ErrorType<void>>(options?: {
38
+ query?: UseQueryOptions<Awaited<ReturnType<typeof getMe>>, TError, TData>;
39
+ request?: SecondParameter<typeof customFetch>;
40
+ }) => UseQueryOptions<Awaited<ReturnType<typeof getMe>>, TError, TData> & {
41
+ queryKey: QueryKey;
42
+ };
43
+ export type GetMeQueryResult = NonNullable<Awaited<ReturnType<typeof getMe>>>;
44
+ export type GetMeQueryError = ErrorType<void>;
45
+ /**
46
+ * @summary Get current user with subscription state
47
+ */
48
+ export declare function useGetMe<TData = Awaited<ReturnType<typeof getMe>>, TError = ErrorType<void>>(options?: {
49
+ query?: UseQueryOptions<Awaited<ReturnType<typeof getMe>>, TError, TData>;
50
+ request?: SecondParameter<typeof customFetch>;
51
+ }): UseQueryResult<TData, TError> & {
52
+ queryKey: QueryKey;
53
+ };
54
+ /**
55
+ * @summary Create PayPal subscription, returns approval URL
56
+ */
57
+ export declare const getCreateSubscriptionUrl: () => string;
58
+ export declare const createSubscription: (options?: RequestInit) => Promise<CreateSubscriptionResponse>;
59
+ export declare const getCreateSubscriptionMutationOptions: <TError = ErrorType<void>, TContext = unknown>(options?: {
60
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createSubscription>>, TError, void, TContext>;
61
+ request?: SecondParameter<typeof customFetch>;
62
+ }) => UseMutationOptions<Awaited<ReturnType<typeof createSubscription>>, TError, void, TContext>;
63
+ export type CreateSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof createSubscription>>>;
64
+ export type CreateSubscriptionMutationError = ErrorType<void>;
65
+ /**
66
+ * @summary Create PayPal subscription, returns approval URL
67
+ */
68
+ export declare const useCreateSubscription: <TError = ErrorType<void>, TContext = unknown>(options?: {
69
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createSubscription>>, TError, void, TContext>;
70
+ request?: SecondParameter<typeof customFetch>;
71
+ }) => UseMutationResult<Awaited<ReturnType<typeof createSubscription>>, TError, void, TContext>;
72
+ /**
73
+ * @summary Activate subscription after PayPal approval
74
+ */
75
+ export declare const getActivateSubscriptionUrl: () => string;
76
+ export declare const activateSubscription: (activateSubscriptionBody: ActivateSubscriptionBody, options?: RequestInit) => Promise<SubscriptionState>;
77
+ export declare const getActivateSubscriptionMutationOptions: <TError = ErrorType<unknown>, TContext = unknown>(options?: {
78
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof activateSubscription>>, TError, {
79
+ data: BodyType<ActivateSubscriptionBody>;
80
+ }, TContext>;
81
+ request?: SecondParameter<typeof customFetch>;
82
+ }) => UseMutationOptions<Awaited<ReturnType<typeof activateSubscription>>, TError, {
83
+ data: BodyType<ActivateSubscriptionBody>;
84
+ }, TContext>;
85
+ export type ActivateSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof activateSubscription>>>;
86
+ export type ActivateSubscriptionMutationBody = BodyType<ActivateSubscriptionBody>;
87
+ export type ActivateSubscriptionMutationError = ErrorType<unknown>;
88
+ /**
89
+ * @summary Activate subscription after PayPal approval
90
+ */
91
+ export declare const useActivateSubscription: <TError = ErrorType<unknown>, TContext = unknown>(options?: {
92
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof activateSubscription>>, TError, {
93
+ data: BodyType<ActivateSubscriptionBody>;
94
+ }, TContext>;
95
+ request?: SecondParameter<typeof customFetch>;
96
+ }) => UseMutationResult<Awaited<ReturnType<typeof activateSubscription>>, TError, {
97
+ data: BodyType<ActivateSubscriptionBody>;
98
+ }, TContext>;
99
+ /**
100
+ * @summary Cancel current subscription
101
+ */
102
+ export declare const getCancelSubscriptionUrl: () => string;
103
+ export declare const cancelSubscription: (options?: RequestInit) => Promise<SubscriptionState>;
104
+ export declare const getCancelSubscriptionMutationOptions: <TError = ErrorType<unknown>, TContext = unknown>(options?: {
105
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof cancelSubscription>>, TError, void, TContext>;
106
+ request?: SecondParameter<typeof customFetch>;
107
+ }) => UseMutationOptions<Awaited<ReturnType<typeof cancelSubscription>>, TError, void, TContext>;
108
+ export type CancelSubscriptionMutationResult = NonNullable<Awaited<ReturnType<typeof cancelSubscription>>>;
109
+ export type CancelSubscriptionMutationError = ErrorType<unknown>;
110
+ /**
111
+ * @summary Cancel current subscription
112
+ */
113
+ export declare const useCancelSubscription: <TError = ErrorType<unknown>, TContext = unknown>(options?: {
114
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof cancelSubscription>>, TError, void, TContext>;
115
+ request?: SecondParameter<typeof customFetch>;
116
+ }) => UseMutationResult<Awaited<ReturnType<typeof cancelSubscription>>, TError, void, TContext>;
117
+ /**
118
+ * @summary PayPal webhook receiver
119
+ */
120
+ export declare const getPaypalWebhookUrl: () => string;
121
+ export declare const paypalWebhook: (paypalWebhookBody: PaypalWebhookBody, options?: RequestInit) => Promise<HealthStatus>;
122
+ export declare const getPaypalWebhookMutationOptions: <TError = ErrorType<unknown>, TContext = unknown>(options?: {
123
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof paypalWebhook>>, TError, {
124
+ data: BodyType<PaypalWebhookBody>;
125
+ }, TContext>;
126
+ request?: SecondParameter<typeof customFetch>;
127
+ }) => UseMutationOptions<Awaited<ReturnType<typeof paypalWebhook>>, TError, {
128
+ data: BodyType<PaypalWebhookBody>;
129
+ }, TContext>;
130
+ export type PaypalWebhookMutationResult = NonNullable<Awaited<ReturnType<typeof paypalWebhook>>>;
131
+ export type PaypalWebhookMutationBody = BodyType<PaypalWebhookBody>;
132
+ export type PaypalWebhookMutationError = ErrorType<unknown>;
133
+ /**
134
+ * @summary PayPal webhook receiver
135
+ */
136
+ export declare const usePaypalWebhook: <TError = ErrorType<unknown>, TContext = unknown>(options?: {
137
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof paypalWebhook>>, TError, {
138
+ data: BodyType<PaypalWebhookBody>;
139
+ }, TContext>;
140
+ request?: SecondParameter<typeof customFetch>;
141
+ }) => UseMutationResult<Awaited<ReturnType<typeof paypalWebhook>>, TError, {
142
+ data: BodyType<PaypalWebhookBody>;
143
+ }, TContext>;
144
+ /**
145
+ * @summary List saved group lists
146
+ */
147
+ export declare const getListSavedListsUrl: () => string;
148
+ export declare const listSavedLists: (options?: RequestInit) => Promise<ListSavedListsResponse>;
149
+ export declare const getListSavedListsQueryKey: () => readonly ["/api/saved-lists"];
150
+ export declare const getListSavedListsQueryOptions: <TData = Awaited<ReturnType<typeof listSavedLists>>, TError = ErrorType<void>>(options?: {
151
+ query?: UseQueryOptions<Awaited<ReturnType<typeof listSavedLists>>, TError, TData>;
152
+ request?: SecondParameter<typeof customFetch>;
153
+ }) => UseQueryOptions<Awaited<ReturnType<typeof listSavedLists>>, TError, TData> & {
154
+ queryKey: QueryKey;
155
+ };
156
+ export type ListSavedListsQueryResult = NonNullable<Awaited<ReturnType<typeof listSavedLists>>>;
157
+ export type ListSavedListsQueryError = ErrorType<void>;
158
+ /**
159
+ * @summary List saved group lists
160
+ */
161
+ export declare function useListSavedLists<TData = Awaited<ReturnType<typeof listSavedLists>>, TError = ErrorType<void>>(options?: {
162
+ query?: UseQueryOptions<Awaited<ReturnType<typeof listSavedLists>>, TError, TData>;
163
+ request?: SecondParameter<typeof customFetch>;
164
+ }): UseQueryResult<TData, TError> & {
165
+ queryKey: QueryKey;
166
+ };
167
+ /**
168
+ * @summary Save a group list
169
+ */
170
+ export declare const getCreateSavedListUrl: () => string;
171
+ export declare const createSavedList: (createSavedListBody: CreateSavedListBody, options?: RequestInit) => Promise<SavedList>;
172
+ export declare const getCreateSavedListMutationOptions: <TError = ErrorType<unknown>, TContext = unknown>(options?: {
173
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createSavedList>>, TError, {
174
+ data: BodyType<CreateSavedListBody>;
175
+ }, TContext>;
176
+ request?: SecondParameter<typeof customFetch>;
177
+ }) => UseMutationOptions<Awaited<ReturnType<typeof createSavedList>>, TError, {
178
+ data: BodyType<CreateSavedListBody>;
179
+ }, TContext>;
180
+ export type CreateSavedListMutationResult = NonNullable<Awaited<ReturnType<typeof createSavedList>>>;
181
+ export type CreateSavedListMutationBody = BodyType<CreateSavedListBody>;
182
+ export type CreateSavedListMutationError = ErrorType<unknown>;
183
+ /**
184
+ * @summary Save a group list
185
+ */
186
+ export declare const useCreateSavedList: <TError = ErrorType<unknown>, TContext = unknown>(options?: {
187
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof createSavedList>>, TError, {
188
+ data: BodyType<CreateSavedListBody>;
189
+ }, TContext>;
190
+ request?: SecondParameter<typeof customFetch>;
191
+ }) => UseMutationResult<Awaited<ReturnType<typeof createSavedList>>, TError, {
192
+ data: BodyType<CreateSavedListBody>;
193
+ }, TContext>;
194
+ /**
195
+ * @summary Delete a saved list
196
+ */
197
+ export declare const getDeleteSavedListUrl: (id: number) => string;
198
+ export declare const deleteSavedList: (id: number, options?: RequestInit) => Promise<void>;
199
+ export declare const getDeleteSavedListMutationOptions: <TError = ErrorType<unknown>, TContext = unknown>(options?: {
200
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteSavedList>>, TError, {
201
+ id: number;
202
+ }, TContext>;
203
+ request?: SecondParameter<typeof customFetch>;
204
+ }) => UseMutationOptions<Awaited<ReturnType<typeof deleteSavedList>>, TError, {
205
+ id: number;
206
+ }, TContext>;
207
+ export type DeleteSavedListMutationResult = NonNullable<Awaited<ReturnType<typeof deleteSavedList>>>;
208
+ export type DeleteSavedListMutationError = ErrorType<unknown>;
209
+ /**
210
+ * @summary Delete a saved list
211
+ */
212
+ export declare const useDeleteSavedList: <TError = ErrorType<unknown>, TContext = unknown>(options?: {
213
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof deleteSavedList>>, TError, {
214
+ id: number;
215
+ }, TContext>;
216
+ request?: SecondParameter<typeof customFetch>;
217
+ }) => UseMutationResult<Awaited<ReturnType<typeof deleteSavedList>>, TError, {
218
+ id: number;
219
+ }, TContext>;
220
+ export {};
221
+ //# sourceMappingURL=api.d.ts.map
lib/api-client-react/dist/generated/api.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"api.d.ts","sour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AO,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,EAC3C,MAAM,EACN;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EACd,QAAQ,CACT,CAAC;IACF,OAAO,CAAC,EAAE,eAAe,CAAC,OAAO,WAAW,CAAC,CAAC;CAC/C,KAAG,iBAAiB,CACnB,OAAO,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,EAC3C,MAAM,EACN;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EACd,QAAQ,CAGT,CAAC"}
lib/api-client-react/dist/generated/api.schemas.d.ts ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface HealthStatus {
9
+ status: string;
10
+ }
11
+ export type SubscriptionStateStatus = (typeof SubscriptionStateStatus)[keyof typeof SubscriptionStateStatus];
12
+ export declare const SubscriptionStateStatus: {
13
+ readonly none: "none";
14
+ readonly trialing: "trialing";
15
+ readonly active: "active";
16
+ readonly cancelled: "cancelled";
17
+ readonly suspended: "suspended";
18
+ readonly expired: "expired";
19
+ };
20
+ export interface SubscriptionState {
21
+ status: SubscriptionStateStatus;
22
+ /** @nullable */
23
+ trialEnd?: string | null;
24
+ /** @nullable */
25
+ currentPeriodEnd?: string | null;
26
+ /** @nullable */
27
+ paypalSubscriptionId?: string | null;
28
+ hasAccess: boolean;
29
+ }
30
+ export interface MeResponse {
31
+ userId: string;
32
+ /** @nullable */
33
+ email?: string | null;
34
+ subscription: SubscriptionState;
35
+ }
36
+ export interface CreateSubscriptionResponse {
37
+ subscriptionId: string;
38
+ approvalUrl: string;
39
+ }
40
+ export interface ActivateSubscriptionBody {
41
+ subscriptionId: string;
42
+ }
43
+ export interface SavedList {
44
+ id: number;
45
+ name: string;
46
+ groupIds: string[];
47
+ createdAt: string;
48
+ }
49
+ export type ListSavedListsResponse = SavedList[];
50
+ export interface CreateSavedListBody {
51
+ /**
52
+ * @minLength 1
53
+ * @maxLength 80
54
+ */
55
+ name: string;
56
+ /** @minItems 1 */
57
+ groupIds: string[];
58
+ }
59
+ export type PaypalWebhookBody = {
60
+ [key: string]: unknown;
61
+ };
62
+ //# sourceMappingURL=api.schemas.d.ts.map
lib/api-client-react/dist/generated/api.schemas.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"api.schemas.d.ts","sourceRoot":"","sources":["../../src/generated/api.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAEzE,eAAO,MAAM,uBAAuB;;;;;;;CAO1B,CAAC;AAEX,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,uBAAuB,CAAC;IAChC,gBAAgB;IAChB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gBAAgB;IAChB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,gBAAgB;IAChB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,iBAAiB,CAAC;CACjC;AAED,MAAM,WAAW,0BAA0B;IACzC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,sBAAsB,GAAG,SAAS,EAAE,CAAC;AAEjD,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC"}
lib/api-client-react/dist/index.d.ts ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ export * from "./generated/api";
2
+ export * from "./generated/api.schemas";
3
+ export { setBaseUrl, setAuthTokenGetter } from "./custom-fetch";
4
+ export type { AuthTokenGetter } from "./custom-fetch";
5
+ //# sourceMappingURL=index.d.ts.map
lib/api-client-react/dist/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAChE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
lib/api-client-react/package.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@workspace/api-client-react",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "exports": {
7
+ ".": "./src/index.ts"
8
+ },
9
+ "dependencies": {
10
+ "@tanstack/react-query": "catalog:"
11
+ },
12
+ "peerDependencies": {
13
+ "react": ">=18"
14
+ }
15
+ }
lib/api-client-react/src/custom-fetch.ts ADDED
@@ -0,0 +1,371 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ export type CustomFetchOptions = RequestInit & {
2
+ responseType?: "json" | "text" | "blob" | "auto";
3
+ };
4
+
5
+ export type ErrorType<T = unknown> = ApiError<T>;
6
+
7
+ export type BodyType<T> = T;
8
+
9
+ export type AuthTokenGetter = () => Promise<string | null> | string | null;
10
+
11
+ const NO_BODY_STATUS = new Set([204, 205, 304]);
12
+ const DEFAULT_JSON_ACCEPT = "application/json, application/problem+json";
13
+
14
+ // ---------------------------------------------------------------------------
15
+ // Module-level configuration
16
+ // ---------------------------------------------------------------------------
17
+
18
+ let _baseUrl: string | null = null;
19
+ let _authTokenGetter: AuthTokenGetter | null = null;
20
+
21
+ /**
22
+ * Set a base URL that is prepended to every relative request URL
23
+ * (i.e. paths that start with `/`).
24
+ *
25
+ * Useful for Expo bundles that need to call a remote API server.
26
+ * Pass `null` to clear the base URL.
27
+ */
28
+ export function setBaseUrl(url: string | null): void {
29
+ _baseUrl = url ? url.replace(/\/+$/, "") : null;
30
+ }
31
+
32
+ /**
33
+ * Register a getter that supplies a bearer auth token. Before every fetch
34
+ * the getter is invoked; when it returns a non-null string, an
35
+ * `Authorization: Bearer <token>` header is attached to the request.
36
+ *
37
+ * Useful for Expo bundles making token-gated API calls.
38
+ * Pass `null` to clear the getter.
39
+ *
40
+ * NOTE: This function should never be used in web applications where session
41
+ * token cookies are automatically associated with API calls by the browser.
42
+ */
43
+ export function setAuthTokenGetter(getter: AuthTokenGetter | null): void {
44
+ _authTokenGetter = getter;
45
+ }
46
+
47
+ function isRequest(input: RequestInfo | URL): input is Request {
48
+ return typeof Request !== "undefined" && input instanceof Request;
49
+ }
50
+
51
+ function resolveMethod(input: RequestInfo | URL, explicitMethod?: string): string {
52
+ if (explicitMethod) return explicitMethod.toUpperCase();
53
+ if (isRequest(input)) return input.method.toUpperCase();
54
+ return "GET";
55
+ }
56
+
57
+ // Use loose check for URL — some runtimes (e.g. React Native) polyfill URL
58
+ // differently, so `instanceof URL` can fail.
59
+ function isUrl(input: RequestInfo | URL): input is URL {
60
+ return typeof URL !== "undefined" && input instanceof URL;
61
+ }
62
+
63
+ function applyBaseUrl(input: RequestInfo | URL): RequestInfo | URL {
64
+ if (!_baseUrl) return input;
65
+ const url = resolveUrl(input);
66
+ // Only prepend to relative paths (starting with /)
67
+ if (!url.startsWith("/")) return input;
68
+
69
+ const absolute = `${_baseUrl}${url}`;
70
+ if (typeof input === "string") return absolute;
71
+ if (isUrl(input)) return new URL(absolute);
72
+ return new Request(absolute, input as Request);
73
+ }
74
+
75
+ function resolveUrl(input: RequestInfo | URL): string {
76
+ if (typeof input === "string") return input;
77
+ if (isUrl(input)) return input.toString();
78
+ return input.url;
79
+ }
80
+
81
+ function mergeHeaders(...sources: Array<HeadersInit | undefined>): Headers {
82
+ const headers = new Headers();
83
+
84
+ for (const source of sources) {
85
+ if (!source) continue;
86
+ new Headers(source).forEach((value, key) => {
87
+ headers.set(key, value);
88
+ });
89
+ }
90
+
91
+ return headers;
92
+ }
93
+
94
+ function getMediaType(headers: Headers): string | null {
95
+ const value = headers.get("content-type");
96
+ return value ? value.split(";", 1)[0].trim().toLowerCase() : null;
97
+ }
98
+
99
+ function isJsonMediaType(mediaType: string | null): boolean {
100
+ return mediaType === "application/json" || Boolean(mediaType?.endsWith("+json"));
101
+ }
102
+
103
+ function isTextMediaType(mediaType: string | null): boolean {
104
+ return Boolean(
105
+ mediaType &&
106
+ (mediaType.startsWith("text/") ||
107
+ mediaType === "application/xml" ||
108
+ mediaType === "text/xml" ||
109
+ mediaType.endsWith("+xml") ||
110
+ mediaType === "application/x-www-form-urlencoded"),
111
+ );
112
+ }
113
+
114
+ // Use strict equality: in browsers, `response.body` is `null` when the
115
+ // response genuinely has no content. In React Native, `response.body` is
116
+ // always `undefined` because the ReadableStream API is not implemented —
117
+ // even when the response carries a full payload readable via `.text()` or
118
+ // `.json()`. Loose equality (`== null`) matches both `null` and `undefined`,
119
+ // which causes every React Native response to be treated as empty.
120
+ function hasNoBody(response: Response, method: string): boolean {
121
+ if (method === "HEAD") return true;
122
+ if (NO_BODY_STATUS.has(response.status)) return true;
123
+ if (response.headers.get("content-length") === "0") return true;
124
+ if (response.body === null) return true;
125
+ return false;
126
+ }
127
+
128
+ function stripBom(text: string): string {
129
+ return text.charCodeAt(0) === 0xfeff ? text.slice(1) : text;
130
+ }
131
+
132
+ function looksLikeJson(text: string): boolean {
133
+ const trimmed = text.trimStart();
134
+ return trimmed.startsWith("{") || trimmed.startsWith("[");
135
+ }
136
+
137
+ function getStringField(value: unknown, key: string): string | undefined {
138
+ if (!value || typeof value !== "object") return undefined;
139
+
140
+ const candidate = (value as Record<string, unknown>)[key];
141
+ if (typeof candidate !== "string") return undefined;
142
+
143
+ const trimmed = candidate.trim();
144
+ return trimmed === "" ? undefined : trimmed;
145
+ }
146
+
147
+ function truncate(text: string, maxLength = 300): string {
148
+ return text.length > maxLength ? `${text.slice(0, maxLength - 1)}…` : text;
149
+ }
150
+
151
+ function buildErrorMessage(response: Response, data: unknown): string {
152
+ const prefix = `HTTP ${response.status} ${response.statusText}`;
153
+
154
+ if (typeof data === "string") {
155
+ const text = data.trim();
156
+ return text ? `${prefix}: ${truncate(text)}` : prefix;
157
+ }
158
+
159
+ const title = getStringField(data, "title");
160
+ const detail = getStringField(data, "detail");
161
+ const message =
162
+ getStringField(data, "message") ??
163
+ getStringField(data, "error_description") ??
164
+ getStringField(data, "error");
165
+
166
+ if (title && detail) return `${prefix}: ${title} — ${detail}`;
167
+ if (detail) return `${prefix}: ${detail}`;
168
+ if (message) return `${prefix}: ${message}`;
169
+ if (title) return `${prefix}: ${title}`;
170
+
171
+ return prefix;
172
+ }
173
+
174
+ export class ApiError<T = unknown> extends Error {
175
+ readonly name = "ApiError";
176
+ readonly status: number;
177
+ readonly statusText: string;
178
+ readonly data: T | null;
179
+ readonly headers: Headers;
180
+ readonly response: Response;
181
+ readonly method: string;
182
+ readonly url: string;
183
+
184
+ constructor(
185
+ response: Response,
186
+ data: T | null,
187
+ requestInfo: { method: string; url: string },
188
+ ) {
189
+ super(buildErrorMessage(response, data));
190
+ Object.setPrototypeOf(this, new.target.prototype);
191
+
192
+ this.status = response.status;
193
+ this.statusText = response.statusText;
194
+ this.data = data;
195
+ this.headers = response.headers;
196
+ this.response = response;
197
+ this.method = requestInfo.method;
198
+ this.url = response.url || requestInfo.url;
199
+ }
200
+ }
201
+
202
+ export class ResponseParseError extends Error {
203
+ readonly name = "ResponseParseError";
204
+ readonly status: number;
205
+ readonly statusText: string;
206
+ readonly headers: Headers;
207
+ readonly response: Response;
208
+ readonly method: string;
209
+ readonly url: string;
210
+ readonly rawBody: string;
211
+ readonly cause: unknown;
212
+
213
+ constructor(
214
+ response: Response,
215
+ rawBody: string,
216
+ cause: unknown,
217
+ requestInfo: { method: string; url: string },
218
+ ) {
219
+ super(
220
+ `Failed to parse response from ${requestInfo.method} ${response.url || requestInfo.url} ` +
221
+ `(${response.status} ${response.statusText}) as JSON`,
222
+ );
223
+ Object.setPrototypeOf(this, new.target.prototype);
224
+
225
+ this.status = response.status;
226
+ this.statusText = response.statusText;
227
+ this.headers = response.headers;
228
+ this.response = response;
229
+ this.method = requestInfo.method;
230
+ this.url = response.url || requestInfo.url;
231
+ this.rawBody = rawBody;
232
+ this.cause = cause;
233
+ }
234
+ }
235
+
236
+ async function parseJsonBody(
237
+ response: Response,
238
+ requestInfo: { method: string; url: string },
239
+ ): Promise<unknown> {
240
+ const raw = await response.text();
241
+ const normalized = stripBom(raw);
242
+
243
+ if (normalized.trim() === "") {
244
+ return null;
245
+ }
246
+
247
+ try {
248
+ return JSON.parse(normalized);
249
+ } catch (cause) {
250
+ throw new ResponseParseError(response, raw, cause, requestInfo);
251
+ }
252
+ }
253
+
254
+ async function parseErrorBody(response: Response, method: string): Promise<unknown> {
255
+ if (hasNoBody(response, method)) {
256
+ return null;
257
+ }
258
+
259
+ const mediaType = getMediaType(response.headers);
260
+
261
+ // Fall back to text when blob() is unavailable (e.g. some React Native builds).
262
+ if (mediaType && !isJsonMediaType(mediaType) && !isTextMediaType(mediaType)) {
263
+ return typeof response.blob === "function" ? response.blob() : response.text();
264
+ }
265
+
266
+ const raw = await response.text();
267
+ const normalized = stripBom(raw);
268
+ const trimmed = normalized.trim();
269
+
270
+ if (trimmed === "") {
271
+ return null;
272
+ }
273
+
274
+ if (isJsonMediaType(mediaType) || looksLikeJson(normalized)) {
275
+ try {
276
+ return JSON.parse(normalized);
277
+ } catch {
278
+ return raw;
279
+ }
280
+ }
281
+
282
+ return raw;
283
+ }
284
+
285
+ function inferResponseType(response: Response): "json" | "text" | "blob" {
286
+ const mediaType = getMediaType(response.headers);
287
+
288
+ if (isJsonMediaType(mediaType)) return "json";
289
+ if (isTextMediaType(mediaType) || mediaType == null) return "text";
290
+ return "blob";
291
+ }
292
+
293
+ async function parseSuccessBody(
294
+ response: Response,
295
+ responseType: "json" | "text" | "blob" | "auto",
296
+ requestInfo: { method: string; url: string },
297
+ ): Promise<unknown> {
298
+ if (hasNoBody(response, requestInfo.method)) {
299
+ return null;
300
+ }
301
+
302
+ const effectiveType =
303
+ responseType === "auto" ? inferResponseType(response) : responseType;
304
+
305
+ switch (effectiveType) {
306
+ case "json":
307
+ return parseJsonBody(response, requestInfo);
308
+
309
+ case "text": {
310
+ const text = await response.text();
311
+ return text === "" ? null : text;
312
+ }
313
+
314
+ case "blob":
315
+ if (typeof response.blob !== "function") {
316
+ throw new TypeError(
317
+ "Blob responses are not supported in this runtime. " +
318
+ "Use responseType \"json\" or \"text\" instead.",
319
+ );
320
+ }
321
+ return response.blob();
322
+ }
323
+ }
324
+
325
+ export async function customFetch<T = unknown>(
326
+ input: RequestInfo | URL,
327
+ options: CustomFetchOptions = {},
328
+ ): Promise<T> {
329
+ input = applyBaseUrl(input);
330
+ const { responseType = "auto", headers: headersInit, ...init } = options;
331
+
332
+ const method = resolveMethod(input, init.method);
333
+
334
+ if (init.body != null && (method === "GET" || method === "HEAD")) {
335
+ throw new TypeError(`customFetch: ${method} requests cannot have a body.`);
336
+ }
337
+
338
+ const headers = mergeHeaders(isRequest(input) ? input.headers : undefined, headersInit);
339
+
340
+ if (
341
+ typeof init.body === "string" &&
342
+ !headers.has("content-type") &&
343
+ looksLikeJson(init.body)
344
+ ) {
345
+ headers.set("content-type", "application/json");
346
+ }
347
+
348
+ if (responseType === "json" && !headers.has("accept")) {
349
+ headers.set("accept", DEFAULT_JSON_ACCEPT);
350
+ }
351
+
352
+ // Attach bearer token when an auth getter is configured and no
353
+ // Authorization header has been explicitly provided.
354
+ if (_authTokenGetter && !headers.has("authorization")) {
355
+ const token = await _authTokenGetter();
356
+ if (token) {
357
+ headers.set("authorization", `Bearer ${token}`);
358
+ }
359
+ }
360
+
361
+ const requestInfo = { method, url: resolveUrl(input) };
362
+
363
+ const response = await fetch(input, { ...init, method, headers });
364
+
365
+ if (!response.ok) {
366
+ const errorData = await parseErrorBody(response, method);
367
+ throw new ApiError(response, errorData, requestInfo);
368
+ }
369
+
370
+ return (await parseSuccessBody(response, responseType, requestInfo)) as T;
371
+ }
lib/api-client-react/src/generated/api.schemas.ts ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface HealthStatus {
9
+ status: string;
10
+ }
11
+
12
+ export type SubscriptionStateStatus =
13
+ (typeof SubscriptionStateStatus)[keyof typeof SubscriptionStateStatus];
14
+
15
+ export const SubscriptionStateStatus = {
16
+ none: "none",
17
+ trialing: "trialing",
18
+ active: "active",
19
+ cancelled: "cancelled",
20
+ suspended: "suspended",
21
+ expired: "expired",
22
+ } as const;
23
+
24
+ export interface SubscriptionState {
25
+ status: SubscriptionStateStatus;
26
+ /** @nullable */
27
+ trialEnd?: string | null;
28
+ /** @nullable */
29
+ currentPeriodEnd?: string | null;
30
+ /** @nullable */
31
+ paypalSubscriptionId?: string | null;
32
+ hasAccess: boolean;
33
+ }
34
+
35
+ export interface MeResponse {
36
+ userId: string;
37
+ /** @nullable */
38
+ email?: string | null;
39
+ subscription: SubscriptionState;
40
+ }
41
+
42
+ export interface CreateSubscriptionResponse {
43
+ subscriptionId: string;
44
+ approvalUrl: string;
45
+ }
46
+
47
+ export interface ActivateSubscriptionBody {
48
+ subscriptionId: string;
49
+ }
50
+
51
+ export interface SavedList {
52
+ id: number;
53
+ name: string;
54
+ groupIds: string[];
55
+ createdAt: string;
56
+ }
57
+
58
+ export type ListSavedListsResponse = SavedList[];
59
+
60
+ export interface CreateSavedListBody {
61
+ /**
62
+ * @minLength 1
63
+ * @maxLength 80
64
+ */
65
+ name: string;
66
+ /** @minItems 1 */
67
+ groupIds: string[];
68
+ }
69
+
70
+ export type PaypalWebhookBody = { [key: string]: unknown };
lib/api-client-react/src/generated/api.ts ADDED
@@ -0,0 +1,756 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import { useMutation, useQuery } from "@tanstack/react-query";
9
+ import type {
10
+ MutationFunction,
11
+ QueryFunction,
12
+ QueryKey,
13
+ UseMutationOptions,
14
+ UseMutationResult,
15
+ UseQueryOptions,
16
+ UseQueryResult,
17
+ } from "@tanstack/react-query";
18
+
19
+ import type {
20
+ ActivateSubscriptionBody,
21
+ CreateSavedListBody,
22
+ CreateSubscriptionResponse,
23
+ HealthStatus,
24
+ ListSavedListsResponse,
25
+ MeResponse,
26
+ PaypalWebhookBody,
27
+ SavedList,
28
+ SubscriptionState,
29
+ } from "./api.schemas";
30
+
31
+ import { customFetch } from "../custom-fetch";
32
+ import type { ErrorType, BodyType } from "../custom-fetch";
33
+
34
+ type AwaitedInput<T> = PromiseLike<T> | T;
35
+
36
+ type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
37
+
38
+ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
39
+
40
+ /**
41
+ * @summary Health check
42
+ */
43
+ export const getHealthCheckUrl = () => {
44
+ return `/api/healthz`;
45
+ };
46
+
47
+ export const healthCheck = async (
48
+ options?: RequestInit,
49
+ ): Promise<HealthStatus> => {
50
+ return customFetch<HealthStatus>(getHealthCheckUrl(), {
51
+ ...options,
52
+ method: "GET",
53
+ });
54
+ };
55
+
56
+ export const getHealthCheckQueryKey = () => {
57
+ return [`/api/healthz`] as const;
58
+ };
59
+
60
+ export const getHealthCheckQueryOptions = <
61
+ TData = Awaited<ReturnType<typeof healthCheck>>,
62
+ TError = ErrorType<unknown>,
63
+ >(options?: {
64
+ query?: UseQueryOptions<
65
+ Awaited<ReturnType<typeof healthCheck>>,
66
+ TError,
67
+ TData
68
+ >;
69
+ request?: SecondParameter<typeof customFetch>;
70
+ }) => {
71
+ const { query: queryOptions, request: requestOptions } = options ?? {};
72
+
73
+ const queryKey = queryOptions?.queryKey ?? getHealthCheckQueryKey();
74
+
75
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof healthCheck>>> = ({
76
+ signal,
77
+ }) => healthCheck({ signal, ...requestOptions });
78
+
79
+ return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
80
+ Awaited<ReturnType<typeof healthCheck>>,
81
+ TError,
82
+ TData
83
+ > & { queryKey: QueryKey };
84
+ };
85
+
86
+ export type HealthCheckQueryResult = NonNullable<
87
+ Awaited<ReturnType<typeof healthCheck>>
88
+ >;
89
+ export type HealthCheckQueryError = ErrorType<unknown>;
90
+
91
+ /**
92
+ * @summary Health check
93
+ */
94
+
95
+ export function useHealthCheck<
96
+ TData = Awaited<ReturnType<typeof healthCheck>>,
97
+ TError = ErrorType<unknown>,
98
+ >(options?: {
99
+ query?: UseQueryOptions<
100
+ Awaited<ReturnType<typeof healthCheck>>,
101
+ TError,
102
+ TData
103
+ >;
104
+ request?: SecondParameter<typeof customFetch>;
105
+ }): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
106
+ const queryOptions = getHealthCheckQueryOptions(options);
107
+
108
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
109
+ queryKey: QueryKey;
110
+ };
111
+
112
+ return { ...query, queryKey: queryOptions.queryKey };
113
+ }
114
+
115
+ /**
116
+ * @summary Get current user with subscription state
117
+ */
118
+ export const getGetMeUrl = () => {
119
+ return `/api/me`;
120
+ };
121
+
122
+ export const getMe = async (options?: RequestInit): Promise<MeResponse> => {
123
+ return customFetch<MeResponse>(getGetMeUrl(), {
124
+ ...options,
125
+ method: "GET",
126
+ });
127
+ };
128
+
129
+ export const getGetMeQueryKey = () => {
130
+ return [`/api/me`] as const;
131
+ };
132
+
133
+ export const getGetMeQueryOptions = <
134
+ TData = Awaited<ReturnType<typeof getMe>>,
135
+ TError = ErrorType<void>,
136
+ >(options?: {
137
+ query?: UseQueryOptions<Awaited<ReturnType<typeof getMe>>, TError, TData>;
138
+ request?: SecondParameter<typeof customFetch>;
139
+ }) => {
140
+ const { query: queryOptions, request: requestOptions } = options ?? {};
141
+
142
+ const queryKey = queryOptions?.queryKey ?? getGetMeQueryKey();
143
+
144
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof getMe>>> = ({
145
+ signal,
146
+ }) => getMe({ signal, ...requestOptions });
147
+
148
+ return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
149
+ Awaited<ReturnType<typeof getMe>>,
150
+ TError,
151
+ TData
152
+ > & { queryKey: QueryKey };
153
+ };
154
+
155
+ export type GetMeQueryResult = NonNullable<Awaited<ReturnType<typeof getMe>>>;
156
+ export type GetMeQueryError = ErrorType<void>;
157
+
158
+ /**
159
+ * @summary Get current user with subscription state
160
+ */
161
+
162
+ export function useGetMe<
163
+ TData = Awaited<ReturnType<typeof getMe>>,
164
+ TError = ErrorType<void>,
165
+ >(options?: {
166
+ query?: UseQueryOptions<Awaited<ReturnType<typeof getMe>>, TError, TData>;
167
+ request?: SecondParameter<typeof customFetch>;
168
+ }): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
169
+ const queryOptions = getGetMeQueryOptions(options);
170
+
171
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
172
+ queryKey: QueryKey;
173
+ };
174
+
175
+ return { ...query, queryKey: queryOptions.queryKey };
176
+ }
177
+
178
+ /**
179
+ * @summary Create PayPal subscription, returns approval URL
180
+ */
181
+ export const getCreateSubscriptionUrl = () => {
182
+ return `/api/subscription/create`;
183
+ };
184
+
185
+ export const createSubscription = async (
186
+ options?: RequestInit,
187
+ ): Promise<CreateSubscriptionResponse> => {
188
+ return customFetch<CreateSubscriptionResponse>(getCreateSubscriptionUrl(), {
189
+ ...options,
190
+ method: "POST",
191
+ });
192
+ };
193
+
194
+ export const getCreateSubscriptionMutationOptions = <
195
+ TError = ErrorType<void>,
196
+ TContext = unknown,
197
+ >(options?: {
198
+ mutation?: UseMutationOptions<
199
+ Awaited<ReturnType<typeof createSubscription>>,
200
+ TError,
201
+ void,
202
+ TContext
203
+ >;
204
+ request?: SecondParameter<typeof customFetch>;
205
+ }): UseMutationOptions<
206
+ Awaited<ReturnType<typeof createSubscription>>,
207
+ TError,
208
+ void,
209
+ TContext
210
+ > => {
211
+ const mutationKey = ["createSubscription"];
212
+ const { mutation: mutationOptions, request: requestOptions } = options
213
+ ? options.mutation &&
214
+ "mutationKey" in options.mutation &&
215
+ options.mutation.mutationKey
216
+ ? options
217
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
218
+ : { mutation: { mutationKey }, request: undefined };
219
+
220
+ const mutationFn: MutationFunction<
221
+ Awaited<ReturnType<typeof createSubscription>>,
222
+ void
223
+ > = () => {
224
+ return createSubscription(requestOptions);
225
+ };
226
+
227
+ return { mutationFn, ...mutationOptions };
228
+ };
229
+
230
+ export type CreateSubscriptionMutationResult = NonNullable<
231
+ Awaited<ReturnType<typeof createSubscription>>
232
+ >;
233
+
234
+ export type CreateSubscriptionMutationError = ErrorType<void>;
235
+
236
+ /**
237
+ * @summary Create PayPal subscription, returns approval URL
238
+ */
239
+ export const useCreateSubscription = <
240
+ TError = ErrorType<void>,
241
+ TContext = unknown,
242
+ >(options?: {
243
+ mutation?: UseMutationOptions<
244
+ Awaited<ReturnType<typeof createSubscription>>,
245
+ TError,
246
+ void,
247
+ TContext
248
+ >;
249
+ request?: SecondParameter<typeof customFetch>;
250
+ }): UseMutationResult<
251
+ Awaited<ReturnType<typeof createSubscription>>,
252
+ TError,
253
+ void,
254
+ TContext
255
+ > => {
256
+ return useMutation(getCreateSubscriptionMutationOptions(options));
257
+ };
258
+
259
+ /**
260
+ * @summary Activate subscription after PayPal approval
261
+ */
262
+ export const getActivateSubscriptionUrl = () => {
263
+ return `/api/subscription/activate`;
264
+ };
265
+
266
+ export const activateSubscription = async (
267
+ activateSubscriptionBody: ActivateSubscriptionBody,
268
+ options?: RequestInit,
269
+ ): Promise<SubscriptionState> => {
270
+ return customFetch<SubscriptionState>(getActivateSubscriptionUrl(), {
271
+ ...options,
272
+ method: "POST",
273
+ headers: { "Content-Type": "application/json", ...options?.headers },
274
+ body: JSON.stringify(activateSubscriptionBody),
275
+ });
276
+ };
277
+
278
+ export const getActivateSubscriptionMutationOptions = <
279
+ TError = ErrorType<unknown>,
280
+ TContext = unknown,
281
+ >(options?: {
282
+ mutation?: UseMutationOptions<
283
+ Awaited<ReturnType<typeof activateSubscription>>,
284
+ TError,
285
+ { data: BodyType<ActivateSubscriptionBody> },
286
+ TContext
287
+ >;
288
+ request?: SecondParameter<typeof customFetch>;
289
+ }): UseMutationOptions<
290
+ Awaited<ReturnType<typeof activateSubscription>>,
291
+ TError,
292
+ { data: BodyType<ActivateSubscriptionBody> },
293
+ TContext
294
+ > => {
295
+ const mutationKey = ["activateSubscription"];
296
+ const { mutation: mutationOptions, request: requestOptions } = options
297
+ ? options.mutation &&
298
+ "mutationKey" in options.mutation &&
299
+ options.mutation.mutationKey
300
+ ? options
301
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
302
+ : { mutation: { mutationKey }, request: undefined };
303
+
304
+ const mutationFn: MutationFunction<
305
+ Awaited<ReturnType<typeof activateSubscription>>,
306
+ { data: BodyType<ActivateSubscriptionBody> }
307
+ > = (props) => {
308
+ const { data } = props ?? {};
309
+
310
+ return activateSubscription(data, requestOptions);
311
+ };
312
+
313
+ return { mutationFn, ...mutationOptions };
314
+ };
315
+
316
+ export type ActivateSubscriptionMutationResult = NonNullable<
317
+ Awaited<ReturnType<typeof activateSubscription>>
318
+ >;
319
+ export type ActivateSubscriptionMutationBody =
320
+ BodyType<ActivateSubscriptionBody>;
321
+ export type ActivateSubscriptionMutationError = ErrorType<unknown>;
322
+
323
+ /**
324
+ * @summary Activate subscription after PayPal approval
325
+ */
326
+ export const useActivateSubscription = <
327
+ TError = ErrorType<unknown>,
328
+ TContext = unknown,
329
+ >(options?: {
330
+ mutation?: UseMutationOptions<
331
+ Awaited<ReturnType<typeof activateSubscription>>,
332
+ TError,
333
+ { data: BodyType<ActivateSubscriptionBody> },
334
+ TContext
335
+ >;
336
+ request?: SecondParameter<typeof customFetch>;
337
+ }): UseMutationResult<
338
+ Awaited<ReturnType<typeof activateSubscription>>,
339
+ TError,
340
+ { data: BodyType<ActivateSubscriptionBody> },
341
+ TContext
342
+ > => {
343
+ return useMutation(getActivateSubscriptionMutationOptions(options));
344
+ };
345
+
346
+ /**
347
+ * @summary Cancel current subscription
348
+ */
349
+ export const getCancelSubscriptionUrl = () => {
350
+ return `/api/subscription/cancel`;
351
+ };
352
+
353
+ export const cancelSubscription = async (
354
+ options?: RequestInit,
355
+ ): Promise<SubscriptionState> => {
356
+ return customFetch<SubscriptionState>(getCancelSubscriptionUrl(), {
357
+ ...options,
358
+ method: "POST",
359
+ });
360
+ };
361
+
362
+ export const getCancelSubscriptionMutationOptions = <
363
+ TError = ErrorType<unknown>,
364
+ TContext = unknown,
365
+ >(options?: {
366
+ mutation?: UseMutationOptions<
367
+ Awaited<ReturnType<typeof cancelSubscription>>,
368
+ TError,
369
+ void,
370
+ TContext
371
+ >;
372
+ request?: SecondParameter<typeof customFetch>;
373
+ }): UseMutationOptions<
374
+ Awaited<ReturnType<typeof cancelSubscription>>,
375
+ TError,
376
+ void,
377
+ TContext
378
+ > => {
379
+ const mutationKey = ["cancelSubscription"];
380
+ const { mutation: mutationOptions, request: requestOptions } = options
381
+ ? options.mutation &&
382
+ "mutationKey" in options.mutation &&
383
+ options.mutation.mutationKey
384
+ ? options
385
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
386
+ : { mutation: { mutationKey }, request: undefined };
387
+
388
+ const mutationFn: MutationFunction<
389
+ Awaited<ReturnType<typeof cancelSubscription>>,
390
+ void
391
+ > = () => {
392
+ return cancelSubscription(requestOptions);
393
+ };
394
+
395
+ return { mutationFn, ...mutationOptions };
396
+ };
397
+
398
+ export type CancelSubscriptionMutationResult = NonNullable<
399
+ Awaited<ReturnType<typeof cancelSubscription>>
400
+ >;
401
+
402
+ export type CancelSubscriptionMutationError = ErrorType<unknown>;
403
+
404
+ /**
405
+ * @summary Cancel current subscription
406
+ */
407
+ export const useCancelSubscription = <
408
+ TError = ErrorType<unknown>,
409
+ TContext = unknown,
410
+ >(options?: {
411
+ mutation?: UseMutationOptions<
412
+ Awaited<ReturnType<typeof cancelSubscription>>,
413
+ TError,
414
+ void,
415
+ TContext
416
+ >;
417
+ request?: SecondParameter<typeof customFetch>;
418
+ }): UseMutationResult<
419
+ Awaited<ReturnType<typeof cancelSubscription>>,
420
+ TError,
421
+ void,
422
+ TContext
423
+ > => {
424
+ return useMutation(getCancelSubscriptionMutationOptions(options));
425
+ };
426
+
427
+ /**
428
+ * @summary PayPal webhook receiver
429
+ */
430
+ export const getPaypalWebhookUrl = () => {
431
+ return `/api/paypal/webhook`;
432
+ };
433
+
434
+ export const paypalWebhook = async (
435
+ paypalWebhookBody: PaypalWebhookBody,
436
+ options?: RequestInit,
437
+ ): Promise<HealthStatus> => {
438
+ return customFetch<HealthStatus>(getPaypalWebhookUrl(), {
439
+ ...options,
440
+ method: "POST",
441
+ headers: { "Content-Type": "application/json", ...options?.headers },
442
+ body: JSON.stringify(paypalWebhookBody),
443
+ });
444
+ };
445
+
446
+ export const getPaypalWebhookMutationOptions = <
447
+ TError = ErrorType<unknown>,
448
+ TContext = unknown,
449
+ >(options?: {
450
+ mutation?: UseMutationOptions<
451
+ Awaited<ReturnType<typeof paypalWebhook>>,
452
+ TError,
453
+ { data: BodyType<PaypalWebhookBody> },
454
+ TContext
455
+ >;
456
+ request?: SecondParameter<typeof customFetch>;
457
+ }): UseMutationOptions<
458
+ Awaited<ReturnType<typeof paypalWebhook>>,
459
+ TError,
460
+ { data: BodyType<PaypalWebhookBody> },
461
+ TContext
462
+ > => {
463
+ const mutationKey = ["paypalWebhook"];
464
+ const { mutation: mutationOptions, request: requestOptions } = options
465
+ ? options.mutation &&
466
+ "mutationKey" in options.mutation &&
467
+ options.mutation.mutationKey
468
+ ? options
469
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
470
+ : { mutation: { mutationKey }, request: undefined };
471
+
472
+ const mutationFn: MutationFunction<
473
+ Awaited<ReturnType<typeof paypalWebhook>>,
474
+ { data: BodyType<PaypalWebhookBody> }
475
+ > = (props) => {
476
+ const { data } = props ?? {};
477
+
478
+ return paypalWebhook(data, requestOptions);
479
+ };
480
+
481
+ return { mutationFn, ...mutationOptions };
482
+ };
483
+
484
+ export type PaypalWebhookMutationResult = NonNullable<
485
+ Awaited<ReturnType<typeof paypalWebhook>>
486
+ >;
487
+ export type PaypalWebhookMutationBody = BodyType<PaypalWebhookBody>;
488
+ export type PaypalWebhookMutationError = ErrorType<unknown>;
489
+
490
+ /**
491
+ * @summary PayPal webhook receiver
492
+ */
493
+ export const usePaypalWebhook = <
494
+ TError = ErrorType<unknown>,
495
+ TContext = unknown,
496
+ >(options?: {
497
+ mutation?: UseMutationOptions<
498
+ Awaited<ReturnType<typeof paypalWebhook>>,
499
+ TError,
500
+ { data: BodyType<PaypalWebhookBody> },
501
+ TContext
502
+ >;
503
+ request?: SecondParameter<typeof customFetch>;
504
+ }): UseMutationResult<
505
+ Awaited<ReturnType<typeof paypalWebhook>>,
506
+ TError,
507
+ { data: BodyType<PaypalWebhookBody> },
508
+ TContext
509
+ > => {
510
+ return useMutation(getPaypalWebhookMutationOptions(options));
511
+ };
512
+
513
+ /**
514
+ * @summary List saved group lists
515
+ */
516
+ export const getListSavedListsUrl = () => {
517
+ return `/api/saved-lists`;
518
+ };
519
+
520
+ export const listSavedLists = async (
521
+ options?: RequestInit,
522
+ ): Promise<ListSavedListsResponse> => {
523
+ return customFetch<ListSavedListsResponse>(getListSavedListsUrl(), {
524
+ ...options,
525
+ method: "GET",
526
+ });
527
+ };
528
+
529
+ export const getListSavedListsQueryKey = () => {
530
+ return [`/api/saved-lists`] as const;
531
+ };
532
+
533
+ export const getListSavedListsQueryOptions = <
534
+ TData = Awaited<ReturnType<typeof listSavedLists>>,
535
+ TError = ErrorType<void>,
536
+ >(options?: {
537
+ query?: UseQueryOptions<
538
+ Awaited<ReturnType<typeof listSavedLists>>,
539
+ TError,
540
+ TData
541
+ >;
542
+ request?: SecondParameter<typeof customFetch>;
543
+ }) => {
544
+ const { query: queryOptions, request: requestOptions } = options ?? {};
545
+
546
+ const queryKey = queryOptions?.queryKey ?? getListSavedListsQueryKey();
547
+
548
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof listSavedLists>>> = ({
549
+ signal,
550
+ }) => listSavedLists({ signal, ...requestOptions });
551
+
552
+ return { queryKey, queryFn, ...queryOptions } as UseQueryOptions<
553
+ Awaited<ReturnType<typeof listSavedLists>>,
554
+ TError,
555
+ TData
556
+ > & { queryKey: QueryKey };
557
+ };
558
+
559
+ export type ListSavedListsQueryResult = NonNullable<
560
+ Awaited<ReturnType<typeof listSavedLists>>
561
+ >;
562
+ export type ListSavedListsQueryError = ErrorType<void>;
563
+
564
+ /**
565
+ * @summary List saved group lists
566
+ */
567
+
568
+ export function useListSavedLists<
569
+ TData = Awaited<ReturnType<typeof listSavedLists>>,
570
+ TError = ErrorType<void>,
571
+ >(options?: {
572
+ query?: UseQueryOptions<
573
+ Awaited<ReturnType<typeof listSavedLists>>,
574
+ TError,
575
+ TData
576
+ >;
577
+ request?: SecondParameter<typeof customFetch>;
578
+ }): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
579
+ const queryOptions = getListSavedListsQueryOptions(options);
580
+
581
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & {
582
+ queryKey: QueryKey;
583
+ };
584
+
585
+ return { ...query, queryKey: queryOptions.queryKey };
586
+ }
587
+
588
+ /**
589
+ * @summary Save a group list
590
+ */
591
+ export const getCreateSavedListUrl = () => {
592
+ return `/api/saved-lists`;
593
+ };
594
+
595
+ export const createSavedList = async (
596
+ createSavedListBody: CreateSavedListBody,
597
+ options?: RequestInit,
598
+ ): Promise<SavedList> => {
599
+ return customFetch<SavedList>(getCreateSavedListUrl(), {
600
+ ...options,
601
+ method: "POST",
602
+ headers: { "Content-Type": "application/json", ...options?.headers },
603
+ body: JSON.stringify(createSavedListBody),
604
+ });
605
+ };
606
+
607
+ export const getCreateSavedListMutationOptions = <
608
+ TError = ErrorType<unknown>,
609
+ TContext = unknown,
610
+ >(options?: {
611
+ mutation?: UseMutationOptions<
612
+ Awaited<ReturnType<typeof createSavedList>>,
613
+ TError,
614
+ { data: BodyType<CreateSavedListBody> },
615
+ TContext
616
+ >;
617
+ request?: SecondParameter<typeof customFetch>;
618
+ }): UseMutationOptions<
619
+ Awaited<ReturnType<typeof createSavedList>>,
620
+ TError,
621
+ { data: BodyType<CreateSavedListBody> },
622
+ TContext
623
+ > => {
624
+ const mutationKey = ["createSavedList"];
625
+ const { mutation: mutationOptions, request: requestOptions } = options
626
+ ? options.mutation &&
627
+ "mutationKey" in options.mutation &&
628
+ options.mutation.mutationKey
629
+ ? options
630
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
631
+ : { mutation: { mutationKey }, request: undefined };
632
+
633
+ const mutationFn: MutationFunction<
634
+ Awaited<ReturnType<typeof createSavedList>>,
635
+ { data: BodyType<CreateSavedListBody> }
636
+ > = (props) => {
637
+ const { data } = props ?? {};
638
+
639
+ return createSavedList(data, requestOptions);
640
+ };
641
+
642
+ return { mutationFn, ...mutationOptions };
643
+ };
644
+
645
+ export type CreateSavedListMutationResult = NonNullable<
646
+ Awaited<ReturnType<typeof createSavedList>>
647
+ >;
648
+ export type CreateSavedListMutationBody = BodyType<CreateSavedListBody>;
649
+ export type CreateSavedListMutationError = ErrorType<unknown>;
650
+
651
+ /**
652
+ * @summary Save a group list
653
+ */
654
+ export const useCreateSavedList = <
655
+ TError = ErrorType<unknown>,
656
+ TContext = unknown,
657
+ >(options?: {
658
+ mutation?: UseMutationOptions<
659
+ Awaited<ReturnType<typeof createSavedList>>,
660
+ TError,
661
+ { data: BodyType<CreateSavedListBody> },
662
+ TContext
663
+ >;
664
+ request?: SecondParameter<typeof customFetch>;
665
+ }): UseMutationResult<
666
+ Awaited<ReturnType<typeof createSavedList>>,
667
+ TError,
668
+ { data: BodyType<CreateSavedListBody> },
669
+ TContext
670
+ > => {
671
+ return useMutation(getCreateSavedListMutationOptions(options));
672
+ };
673
+
674
+ /**
675
+ * @summary Delete a saved list
676
+ */
677
+ export const getDeleteSavedListUrl = (id: number) => {
678
+ return `/api/saved-lists/${id}`;
679
+ };
680
+
681
+ export const deleteSavedList = async (
682
+ id: number,
683
+ options?: RequestInit,
684
+ ): Promise<void> => {
685
+ return customFetch<void>(getDeleteSavedListUrl(id), {
686
+ ...options,
687
+ method: "DELETE",
688
+ });
689
+ };
690
+
691
+ export const getDeleteSavedListMutationOptions = <
692
+ TError = ErrorType<unknown>,
693
+ TContext = unknown,
694
+ >(options?: {
695
+ mutation?: UseMutationOptions<
696
+ Awaited<ReturnType<typeof deleteSavedList>>,
697
+ TError,
698
+ { id: number },
699
+ TContext
700
+ >;
701
+ request?: SecondParameter<typeof customFetch>;
702
+ }): UseMutationOptions<
703
+ Awaited<ReturnType<typeof deleteSavedList>>,
704
+ TError,
705
+ { id: number },
706
+ TContext
707
+ > => {
708
+ const mutationKey = ["deleteSavedList"];
709
+ const { mutation: mutationOptions, request: requestOptions } = options
710
+ ? options.mutation &&
711
+ "mutationKey" in options.mutation &&
712
+ options.mutation.mutationKey
713
+ ? options
714
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
715
+ : { mutation: { mutationKey }, request: undefined };
716
+
717
+ const mutationFn: MutationFunction<
718
+ Awaited<ReturnType<typeof deleteSavedList>>,
719
+ { id: number }
720
+ > = (props) => {
721
+ const { id } = props ?? {};
722
+
723
+ return deleteSavedList(id, requestOptions);
724
+ };
725
+
726
+ return { mutationFn, ...mutationOptions };
727
+ };
728
+
729
+ export type DeleteSavedListMutationResult = NonNullable<
730
+ Awaited<ReturnType<typeof deleteSavedList>>
731
+ >;
732
+
733
+ export type DeleteSavedListMutationError = ErrorType<unknown>;
734
+
735
+ /**
736
+ * @summary Delete a saved list
737
+ */
738
+ export const useDeleteSavedList = <
739
+ TError = ErrorType<unknown>,
740
+ TContext = unknown,
741
+ >(options?: {
742
+ mutation?: UseMutationOptions<
743
+ Awaited<ReturnType<typeof deleteSavedList>>,
744
+ TError,
745
+ { id: number },
746
+ TContext
747
+ >;
748
+ request?: SecondParameter<typeof customFetch>;
749
+ }): UseMutationResult<
750
+ Awaited<ReturnType<typeof deleteSavedList>>,
751
+ TError,
752
+ { id: number },
753
+ TContext
754
+ > => {
755
+ return useMutation(getDeleteSavedListMutationOptions(options));
756
+ };
lib/api-client-react/src/index.ts ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ export * from "./generated/api";
2
+ export * from "./generated/api.schemas";
3
+ export { setBaseUrl, setAuthTokenGetter } from "./custom-fetch";
4
+ export type { AuthTokenGetter } from "./custom-fetch";
lib/api-client-react/tsconfig.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "composite": true,
5
+ "declarationMap": true,
6
+ "emitDeclarationOnly": true,
7
+ "outDir": "dist",
8
+ "rootDir": "src",
9
+ "lib": ["dom", "es2022"]
10
+ },
11
+ "include": ["src"]
12
+ }
lib/api-client-react/tsconfig.tsbuildinfo ADDED
@@ -0,0 +1 @@
 
 
1
+ {"fileNames":["../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/custom-fetch.ts","../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/subscribable.d.ts","../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/focusManager.d.ts","../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/removable.d.ts","../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/hydration-BlEVG2Lp.d.ts","../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/infiniteQueryObserver.d.ts","../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/notifyManager.d.ts","../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/onlineManager.d.ts","../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/queriesObserver.d.ts","../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/timeoutManager.d.ts","../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/streamedQuery.d.ts","../../node_modules/.pnpm/@tanstack+query-core@5.90.20/node_modules/@tanstack/query-core/build/modern/index.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/types.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useQueries.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/queryOptions.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useQuery.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useSuspenseQuery.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useSuspenseInfiniteQuery.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useSuspenseQueries.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/usePrefetchInfiniteQuery.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/infiniteQueryOptions.d.ts","../../node_modules/.pnpm/@types+react@19.2.14/node_modules/@types/react/global.d.ts","../../node_modules/.pnpm/csstype@3.2.3/node_modules/csstype/index.d.ts","../../node_modules/.pnpm/@types+react@19.2.14/node_modules/@types/react/index.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.d.ts","../../node_modules/.pnpm/@types+react@19.2.14/node_modules/@types/react/jsx-runtime.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/QueryErrorResetBoundary.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/HydrationBoundary.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useIsFetching.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useMutationState.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useMutation.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/mutationOptions.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/useInfiniteQuery.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/IsRestoringProvider.d.ts","../../node_modules/.pnpm/@tanstack+react-query@5.90.21_react@19.1.0/node_modules/@tanstack/react-query/build/modern/index.d.ts","./src/generated/api.schemas.ts","./src/generated/api.ts","./src/index.ts"],"fileIdsList":[[59,94,95],[59,95,96],[60],[60,62],[60,61,62,63,64,65,66,67,68,69],[60,62,63],[70,83],[83],[83,85],[70,71,72,73,74,75,76,77,78,79,80,83,84,85,86,87,88,89,90,91,92,93],[70,71],[70],[70,71,80],[70,71,73],[81,82]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"3a5605ea89571cca7ea9412a230a40954e3a3f1d94d7a566271480165bf5e03c","signature":"df3e757de5295534b128e5cadadcadd926b7ab0b77ee95965d4fc2d0cee87114"},{"version":"50cf7a23fc93928995caec8d7956206990f82113beeb6b3242dae8124edc3ca0","impliedFormat":99},{"version":"352031ac2e53031b69a09355e09ad7d95361edf32cc827cfe2417d80247a5a50","impliedFormat":99},{"version":"9971931daaf18158fc38266e838d56eb5d9d1f13360b1181bb4735a05f534c03","impliedFormat":99},{"version":"06d635a90365afe107c7e2daaa9851f5d3f062d78ebe4524b1b23b122469a1e2","impliedFormat":99},{"version":"aa103fbc4677b71d3deda20d37088cc2f39c3db8c2566ddf516b56ce7532d00a","impliedFormat":99},{"version":"0c5b705d31420477189618154d1b6a9bb62a34fa6055f56ade1a316f6adb6b3a","impliedFormat":99},{"version":"853b8bdb5da8c8e5d31e4d715a8057d8e96059d6774b13545c3616ed216b890c","impliedFormat":99},{"version":"430f4fa4e99e5e0a7ca2bbdde84abc8536bdfde4fd0de26009db508b8f571bb5","impliedFormat":99},{"version":"fe3c64bf61fcfec9b9861725c6d92de03f33748a01d982760ccfa798d777cf9d","impliedFormat":99},{"version":"1120a39f36c968298e2ca1d8cb1405389f9696f6b49e13b335626a94c16930bb","impliedFormat":99},{"version":"0a049adb920f3b42e1933c037052bcbc5e78b4704ad080bf078353c7f8ed6225","impliedFormat":99},{"version":"af9753433dec6dc41a2d3141804113a4d34f09fb19eb9eea063bd8800aa28db6","impliedFormat":99},{"version":"832f2fd6cf5eeaac22e2bdb0e3d7e2498cd8dd4058b853cd6b42033f126680ee","impliedFormat":99},{"version":"22fe66950a6308b2c6a0e11ed74930e90ba9d8a5fd2910666565007678875c13","impliedFormat":99},{"version":"084c09a35a9611e1777c02343c11ab8b1be48eb4895bbe6da90222979940b4a6","impliedFormat":99},{"version":"4b3049a2c849f0217ff4def308637931661461c329e4cf36aeb31db34c4c0c64","impliedFormat":99},{"version":"6245aa515481727f994d1cf7adfc71e36b5fc48216a92d7e932274cee3268000","impliedFormat":99},{"version":"3550708c55e4b79c5c13870f994461bcec97208e1d6758395a178913bbf05de3","impliedFormat":99},{"version":"660ce583eaa09bb39eef5ad7af9d1b5f027a9d1fbf9f76bf5b9dc9ef1be2830e","impliedFormat":99},{"version":"b7d9ca4e3248f643fa86ff11872623fdc8ed2c6009836bec0e38b163b6faed0c","impliedFormat":99},{"version":"904a01fef87360fa2fd0c2e934af92995b669565fe0bfb546ed0ff23769999cb","impliedFormat":99},{"version":"7e29f41b158de217f94cb9676bf9cbd0cd9b5a46e1985141ed36e075c52bf6ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"dc0a7f107690ee5cd8afc8dbf05c4df78085471ce16bdd9881642ec738bc81fe","impliedFormat":1},{"version":"d4f7a7a5f66b9bc6fbfd53fa08dcf8007ff752064df816da05edfa35abd2c97c","impliedFormat":99},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"1f38ecf63dead74c85180bf18376dc6bc152522ef3aedf7b588cadbbd5877506","impliedFormat":99},{"version":"82fb33c00b1300c19591105fc25ccf78acba220f58d162b120fe3f4292a5605f","impliedFormat":99},{"version":"facde2bec0f59cf92f4635ece51b2c3fa2d0a3bbb67458d24af61e7e6b8f003c","impliedFormat":99},{"version":"4669194e4ca5f7c160833bbb198f25681e629418a6326aba08cf0891821bfe8f","impliedFormat":99},{"version":"db185b403e30e91c5b90f3f2cfa062832d764c9d7df3ad7f5db7e17596344fe8","impliedFormat":99},{"version":"669b62a7169354658d4ae1e043ad8203728655492a8f70a940a11ca5ed4d5029","impliedFormat":99},{"version":"a95cd11c5c8bc03eab4011f8e339a48f9a87293e90c0bf3e9003d7a6f833f557","impliedFormat":99},{"version":"e9bc0db0144701fab1e98c4d595a293c7c840d209b389144142f0adbc36b5ec2","impliedFormat":99},{"version":"9d884b885c4b2d89286685406b45911dcaab03e08e948850e3e41e29af69561c","impliedFormat":99},{"version":"f7dd0c6f41842907e654169eb6b9c7f1782436e00ca8d290915c3497c9281df0","signature":"0f875886f50040c8c51d30d766855ee61e1f574a043ed05d2c85f5e99ae2fecf"},{"version":"8fd738d92b9716b05864c1b57df4f1e58fbe4ac248979653659a5c294394a0f0","signature":"7c8a29be7f4982002f77b5328e2867a20dd82ba11af7e901139ab8d1460d7dc8"},"7974b36e3973a8d0c403589bcf8d8aca7547c5c42c4b73924d05f49de18809e5"],"root":[59,[95,97]],"options":{"alwaysStrict":true,"composite":true,"declarationMap":true,"emitDeclarationOnly":true,"module":99,"noEmitOnError":true,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitOverride":false,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":false,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"strictBindCallApply":true,"strictFunctionTypes":false,"strictNullChecks":true,"strictPropertyInitialization":true,"target":9,"useUnknownInCatchVariables":true},"referencedMap":[[96,1],[97,2],[61,3],[63,4],[70,5],[64,6],[66,3],[67,6],[69,6],[87,7],[93,8],[84,7],[86,9],[94,10],[80,11],[91,11],[73,11],[71,12],[92,13],[88,12],[90,11],[89,12],[79,12],[78,11],[72,11],[74,14],[76,11],[77,11],[75,11],[83,15],[85,8]],"latestChangedDtsFile":"./dist/generated/api.d.ts","version":"5.9.3"}
lib/api-spec/openapi.yaml ADDED
@@ -0,0 +1,265 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ openapi: 3.1.0
2
+ info:
3
+ # Do not change the title, if the title changes, the import paths will be broken
4
+ title: Api
5
+ version: 0.1.0
6
+ description: API specification for FB Group Publisher PRO
7
+ servers:
8
+ - url: /api
9
+ description: Base API path
10
+ tags:
11
+ - name: health
12
+ description: Health operations
13
+ - name: me
14
+ description: Current user
15
+ - name: subscription
16
+ description: PayPal subscription management
17
+ - name: paypal
18
+ description: PayPal webhook
19
+ - name: savedLists
20
+ description: Saved group lists
21
+ paths:
22
+ /healthz:
23
+ get:
24
+ operationId: healthCheck
25
+ tags: [health]
26
+ summary: Health check
27
+ responses:
28
+ "200":
29
+ description: Healthy
30
+ content:
31
+ application/json:
32
+ schema:
33
+ $ref: "#/components/schemas/HealthStatus"
34
+
35
+ /me:
36
+ get:
37
+ operationId: getMe
38
+ tags: [me]
39
+ summary: Get current user with subscription state
40
+ responses:
41
+ "200":
42
+ description: OK
43
+ content:
44
+ application/json:
45
+ schema:
46
+ $ref: "#/components/schemas/MeResponse"
47
+ "401":
48
+ description: Unauthorized
49
+
50
+ /subscription/create:
51
+ post:
52
+ operationId: createSubscription
53
+ tags: [subscription]
54
+ summary: Create PayPal subscription, returns approval URL
55
+ responses:
56
+ "200":
57
+ description: OK
58
+ content:
59
+ application/json:
60
+ schema:
61
+ $ref: "#/components/schemas/CreateSubscriptionResponse"
62
+ "401":
63
+ description: Unauthorized
64
+
65
+ /subscription/activate:
66
+ post:
67
+ operationId: activateSubscription
68
+ tags: [subscription]
69
+ summary: Activate subscription after PayPal approval
70
+ requestBody:
71
+ required: true
72
+ content:
73
+ application/json:
74
+ schema:
75
+ $ref: "#/components/schemas/ActivateSubscriptionBody"
76
+ responses:
77
+ "200":
78
+ description: OK
79
+ content:
80
+ application/json:
81
+ schema:
82
+ $ref: "#/components/schemas/SubscriptionState"
83
+
84
+ /subscription/cancel:
85
+ post:
86
+ operationId: cancelSubscription
87
+ tags: [subscription]
88
+ summary: Cancel current subscription
89
+ responses:
90
+ "200":
91
+ description: OK
92
+ content:
93
+ application/json:
94
+ schema:
95
+ $ref: "#/components/schemas/SubscriptionState"
96
+
97
+ /paypal/webhook:
98
+ post:
99
+ operationId: paypalWebhook
100
+ tags: [paypal]
101
+ summary: PayPal webhook receiver
102
+ requestBody:
103
+ required: true
104
+ content:
105
+ application/json:
106
+ schema:
107
+ type: object
108
+ additionalProperties: true
109
+ responses:
110
+ "200":
111
+ description: OK
112
+ content:
113
+ application/json:
114
+ schema:
115
+ $ref: "#/components/schemas/HealthStatus"
116
+
117
+ /saved-lists:
118
+ get:
119
+ operationId: listSavedLists
120
+ tags: [savedLists]
121
+ summary: List saved group lists
122
+ responses:
123
+ "200":
124
+ description: OK
125
+ content:
126
+ application/json:
127
+ schema:
128
+ $ref: "#/components/schemas/ListSavedListsResponse"
129
+ "401":
130
+ description: Unauthorized
131
+ post:
132
+ operationId: createSavedList
133
+ tags: [savedLists]
134
+ summary: Save a group list
135
+ requestBody:
136
+ required: true
137
+ content:
138
+ application/json:
139
+ schema:
140
+ $ref: "#/components/schemas/CreateSavedListBody"
141
+ responses:
142
+ "201":
143
+ description: Created
144
+ content:
145
+ application/json:
146
+ schema:
147
+ $ref: "#/components/schemas/SavedList"
148
+
149
+ /saved-lists/{id}:
150
+ delete:
151
+ operationId: deleteSavedList
152
+ tags: [savedLists]
153
+ summary: Delete a saved list
154
+ parameters:
155
+ - name: id
156
+ in: path
157
+ required: true
158
+ schema:
159
+ type: integer
160
+ responses:
161
+ "204":
162
+ description: Deleted
163
+
164
+ components:
165
+ schemas:
166
+ HealthStatus:
167
+ type: object
168
+ properties:
169
+ status:
170
+ type: string
171
+ required:
172
+ - status
173
+
174
+ SubscriptionState:
175
+ type: object
176
+ properties:
177
+ status:
178
+ type: string
179
+ enum: [none, trialing, active, cancelled, suspended, expired]
180
+ trialEnd:
181
+ type: [string, "null"]
182
+ format: date-time
183
+ currentPeriodEnd:
184
+ type: [string, "null"]
185
+ format: date-time
186
+ paypalSubscriptionId:
187
+ type: [string, "null"]
188
+ hasAccess:
189
+ type: boolean
190
+ required:
191
+ - status
192
+ - hasAccess
193
+
194
+ MeResponse:
195
+ type: object
196
+ properties:
197
+ userId:
198
+ type: string
199
+ email:
200
+ type: [string, "null"]
201
+ subscription:
202
+ $ref: "#/components/schemas/SubscriptionState"
203
+ required:
204
+ - userId
205
+ - subscription
206
+
207
+ CreateSubscriptionResponse:
208
+ type: object
209
+ properties:
210
+ subscriptionId:
211
+ type: string
212
+ approvalUrl:
213
+ type: string
214
+ required:
215
+ - subscriptionId
216
+ - approvalUrl
217
+
218
+ ActivateSubscriptionBody:
219
+ type: object
220
+ properties:
221
+ subscriptionId:
222
+ type: string
223
+ required:
224
+ - subscriptionId
225
+
226
+ SavedList:
227
+ type: object
228
+ properties:
229
+ id:
230
+ type: integer
231
+ name:
232
+ type: string
233
+ groupIds:
234
+ type: array
235
+ items:
236
+ type: string
237
+ createdAt:
238
+ type: string
239
+ format: date-time
240
+ required:
241
+ - id
242
+ - name
243
+ - groupIds
244
+ - createdAt
245
+
246
+ ListSavedListsResponse:
247
+ type: array
248
+ items:
249
+ $ref: "#/components/schemas/SavedList"
250
+
251
+ CreateSavedListBody:
252
+ type: object
253
+ properties:
254
+ name:
255
+ type: string
256
+ minLength: 1
257
+ maxLength: 80
258
+ groupIds:
259
+ type: array
260
+ items:
261
+ type: string
262
+ minItems: 1
263
+ required:
264
+ - name
265
+ - groupIds
lib/api-spec/orval.config.ts ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { defineConfig, InputTransformerFn } from "orval";
2
+ import path from "path";
3
+
4
+ const root = path.resolve(__dirname, "..", "..");
5
+ const apiClientReactSrc = path.resolve(root, "lib", "api-client-react", "src");
6
+ const apiZodSrc = path.resolve(root, "lib", "api-zod", "src");
7
+
8
+ // Our exports make assumptions about the title of the API being "Api" (i.e. generated output is `api.ts`).
9
+ const titleTransformer: InputTransformerFn = (config) => {
10
+ config.info ??= {};
11
+ config.info.title = "Api";
12
+
13
+ return config;
14
+ };
15
+
16
+ export default defineConfig({
17
+ "api-client-react": {
18
+ input: {
19
+ target: "./openapi.yaml",
20
+ override: {
21
+ transformer: titleTransformer,
22
+ },
23
+ },
24
+ output: {
25
+ workspace: apiClientReactSrc,
26
+ target: "generated",
27
+ client: "react-query",
28
+ mode: "split",
29
+ baseUrl: "/api",
30
+ clean: true,
31
+ prettier: true,
32
+ override: {
33
+ fetch: {
34
+ includeHttpResponseReturnType: false,
35
+ },
36
+ mutator: {
37
+ path: path.resolve(apiClientReactSrc, "custom-fetch.ts"),
38
+ name: "customFetch",
39
+ },
40
+ },
41
+ },
42
+ },
43
+ zod: {
44
+ input: {
45
+ target: "./openapi.yaml",
46
+ override: {
47
+ transformer: titleTransformer,
48
+ },
49
+ },
50
+ output: {
51
+ workspace: apiZodSrc,
52
+ client: "zod",
53
+ target: "generated",
54
+ schemas: { path: "generated/types", type: "typescript" },
55
+ mode: "split",
56
+ clean: true,
57
+ prettier: true,
58
+ override: {
59
+ zod: {
60
+ coerce: {
61
+ query: ['boolean', 'number', 'string'],
62
+ param: ['boolean', 'number', 'string'],
63
+ body: ['bigint', 'date'],
64
+ response: ['bigint', 'date'],
65
+ },
66
+ },
67
+ useDates: true,
68
+ useBigInt: true,
69
+ },
70
+ },
71
+ },
72
+ });
lib/api-spec/package.json ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@workspace/api-spec",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "codegen": "orval --config ./orval.config.ts && pnpm -w run typecheck:libs"
7
+ },
8
+ "devDependencies": {
9
+ "orval": "^8.5.2"
10
+ }
11
+ }
lib/api-zod/dist/generated/api.d.ts ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import * as zod from "zod";
9
+ /**
10
+ * @summary Health check
11
+ */
12
+ export declare const HealthCheckResponse: zod.ZodObject<{
13
+ status: zod.ZodString;
14
+ }, "strip", zod.ZodTypeAny, {
15
+ status: string;
16
+ }, {
17
+ status: string;
18
+ }>;
19
+ /**
20
+ * @summary Get current user with subscription state
21
+ */
22
+ export declare const GetMeResponse: zod.ZodObject<{
23
+ userId: zod.ZodString;
24
+ email: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
25
+ subscription: zod.ZodObject<{
26
+ status: zod.ZodEnum<["none", "trialing", "active", "cancelled", "suspended", "expired"]>;
27
+ trialEnd: zod.ZodOptional<zod.ZodNullable<zod.ZodDate>>;
28
+ currentPeriodEnd: zod.ZodOptional<zod.ZodNullable<zod.ZodDate>>;
29
+ paypalSubscriptionId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
30
+ hasAccess: zod.ZodBoolean;
31
+ }, "strip", zod.ZodTypeAny, {
32
+ status: "none" | "trialing" | "active" | "cancelled" | "suspended" | "expired";
33
+ hasAccess: boolean;
34
+ trialEnd?: Date | null | undefined;
35
+ currentPeriodEnd?: Date | null | undefined;
36
+ paypalSubscriptionId?: string | null | undefined;
37
+ }, {
38
+ status: "none" | "trialing" | "active" | "cancelled" | "suspended" | "expired";
39
+ hasAccess: boolean;
40
+ trialEnd?: Date | null | undefined;
41
+ currentPeriodEnd?: Date | null | undefined;
42
+ paypalSubscriptionId?: string | null | undefined;
43
+ }>;
44
+ }, "strip", zod.ZodTypeAny, {
45
+ userId: string;
46
+ subscription: {
47
+ status: "none" | "trialing" | "active" | "cancelled" | "suspended" | "expired";
48
+ hasAccess: boolean;
49
+ trialEnd?: Date | null | undefined;
50
+ currentPeriodEnd?: Date | null | undefined;
51
+ paypalSubscriptionId?: string | null | undefined;
52
+ };
53
+ email?: string | null | undefined;
54
+ }, {
55
+ userId: string;
56
+ subscription: {
57
+ status: "none" | "trialing" | "active" | "cancelled" | "suspended" | "expired";
58
+ hasAccess: boolean;
59
+ trialEnd?: Date | null | undefined;
60
+ currentPeriodEnd?: Date | null | undefined;
61
+ paypalSubscriptionId?: string | null | undefined;
62
+ };
63
+ email?: string | null | undefined;
64
+ }>;
65
+ /**
66
+ * @summary Create PayPal subscription, returns approval URL
67
+ */
68
+ export declare const CreateSubscriptionResponse: zod.ZodObject<{
69
+ subscriptionId: zod.ZodString;
70
+ approvalUrl: zod.ZodString;
71
+ }, "strip", zod.ZodTypeAny, {
72
+ subscriptionId: string;
73
+ approvalUrl: string;
74
+ }, {
75
+ subscriptionId: string;
76
+ approvalUrl: string;
77
+ }>;
78
+ /**
79
+ * @summary Activate subscription after PayPal approval
80
+ */
81
+ export declare const ActivateSubscriptionBody: zod.ZodObject<{
82
+ subscriptionId: zod.ZodString;
83
+ }, "strip", zod.ZodTypeAny, {
84
+ subscriptionId: string;
85
+ }, {
86
+ subscriptionId: string;
87
+ }>;
88
+ export declare const ActivateSubscriptionResponse: zod.ZodObject<{
89
+ status: zod.ZodEnum<["none", "trialing", "active", "cancelled", "suspended", "expired"]>;
90
+ trialEnd: zod.ZodOptional<zod.ZodNullable<zod.ZodDate>>;
91
+ currentPeriodEnd: zod.ZodOptional<zod.ZodNullable<zod.ZodDate>>;
92
+ paypalSubscriptionId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
93
+ hasAccess: zod.ZodBoolean;
94
+ }, "strip", zod.ZodTypeAny, {
95
+ status: "none" | "trialing" | "active" | "cancelled" | "suspended" | "expired";
96
+ hasAccess: boolean;
97
+ trialEnd?: Date | null | undefined;
98
+ currentPeriodEnd?: Date | null | undefined;
99
+ paypalSubscriptionId?: string | null | undefined;
100
+ }, {
101
+ status: "none" | "trialing" | "active" | "cancelled" | "suspended" | "expired";
102
+ hasAccess: boolean;
103
+ trialEnd?: Date | null | undefined;
104
+ currentPeriodEnd?: Date | null | undefined;
105
+ paypalSubscriptionId?: string | null | undefined;
106
+ }>;
107
+ /**
108
+ * @summary Cancel current subscription
109
+ */
110
+ export declare const CancelSubscriptionResponse: zod.ZodObject<{
111
+ status: zod.ZodEnum<["none", "trialing", "active", "cancelled", "suspended", "expired"]>;
112
+ trialEnd: zod.ZodOptional<zod.ZodNullable<zod.ZodDate>>;
113
+ currentPeriodEnd: zod.ZodOptional<zod.ZodNullable<zod.ZodDate>>;
114
+ paypalSubscriptionId: zod.ZodOptional<zod.ZodNullable<zod.ZodString>>;
115
+ hasAccess: zod.ZodBoolean;
116
+ }, "strip", zod.ZodTypeAny, {
117
+ status: "none" | "trialing" | "active" | "cancelled" | "suspended" | "expired";
118
+ hasAccess: boolean;
119
+ trialEnd?: Date | null | undefined;
120
+ currentPeriodEnd?: Date | null | undefined;
121
+ paypalSubscriptionId?: string | null | undefined;
122
+ }, {
123
+ status: "none" | "trialing" | "active" | "cancelled" | "suspended" | "expired";
124
+ hasAccess: boolean;
125
+ trialEnd?: Date | null | undefined;
126
+ currentPeriodEnd?: Date | null | undefined;
127
+ paypalSubscriptionId?: string | null | undefined;
128
+ }>;
129
+ /**
130
+ * @summary PayPal webhook receiver
131
+ */
132
+ export declare const PaypalWebhookBody: zod.ZodRecord<zod.ZodString, zod.ZodUnknown>;
133
+ export declare const PaypalWebhookResponse: zod.ZodObject<{
134
+ status: zod.ZodString;
135
+ }, "strip", zod.ZodTypeAny, {
136
+ status: string;
137
+ }, {
138
+ status: string;
139
+ }>;
140
+ /**
141
+ * @summary List saved group lists
142
+ */
143
+ export declare const ListSavedListsResponseItem: zod.ZodObject<{
144
+ id: zod.ZodNumber;
145
+ name: zod.ZodString;
146
+ groupIds: zod.ZodArray<zod.ZodString, "many">;
147
+ createdAt: zod.ZodDate;
148
+ }, "strip", zod.ZodTypeAny, {
149
+ id: number;
150
+ name: string;
151
+ groupIds: string[];
152
+ createdAt: Date;
153
+ }, {
154
+ id: number;
155
+ name: string;
156
+ groupIds: string[];
157
+ createdAt: Date;
158
+ }>;
159
+ export declare const ListSavedListsResponse: zod.ZodArray<zod.ZodObject<{
160
+ id: zod.ZodNumber;
161
+ name: zod.ZodString;
162
+ groupIds: zod.ZodArray<zod.ZodString, "many">;
163
+ createdAt: zod.ZodDate;
164
+ }, "strip", zod.ZodTypeAny, {
165
+ id: number;
166
+ name: string;
167
+ groupIds: string[];
168
+ createdAt: Date;
169
+ }, {
170
+ id: number;
171
+ name: string;
172
+ groupIds: string[];
173
+ createdAt: Date;
174
+ }>, "many">;
175
+ /**
176
+ * @summary Save a group list
177
+ */
178
+ export declare const createSavedListBodyNameMax = 80;
179
+ export declare const CreateSavedListBody: zod.ZodObject<{
180
+ name: zod.ZodString;
181
+ groupIds: zod.ZodArray<zod.ZodString, "many">;
182
+ }, "strip", zod.ZodTypeAny, {
183
+ name: string;
184
+ groupIds: string[];
185
+ }, {
186
+ name: string;
187
+ groupIds: string[];
188
+ }>;
189
+ /**
190
+ * @summary Delete a saved list
191
+ */
192
+ export declare const DeleteSavedListParams: zod.ZodObject<{
193
+ id: zod.ZodNumber;
194
+ }, "strip", zod.ZodTypeAny, {
195
+ id: number;
196
+ }, {
197
+ id: number;
198
+ }>;
199
+ //# sourceMappingURL=api.d.ts.map
lib/api-zod/dist/generated/api.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/generated/api.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;EAE9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBxB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;EAGrC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;EAEnC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;EAavC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;EAarC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB,8CAA0C,CAAC;AAEzE,eAAO,MAAM,qBAAqB;;;;;;EAEhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;EAKrC,CAAC;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;WAAwC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;EAEhC,CAAC"}
lib/api-zod/dist/generated/types/activateSubscriptionBody.d.ts ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface ActivateSubscriptionBody {
9
+ subscriptionId: string;
10
+ }
11
+ //# sourceMappingURL=activateSubscriptionBody.d.ts.map
lib/api-zod/dist/generated/types/activateSubscriptionBody.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"activateSubscriptionBody.d.ts","sourceRoot":"","sources":["../../../src/generated/types/activateSubscriptionBody.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,MAAM,CAAC;CACxB"}
lib/api-zod/dist/generated/types/createSavedListBody.d.ts ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface CreateSavedListBody {
9
+ /**
10
+ * @minLength 1
11
+ * @maxLength 80
12
+ */
13
+ name: string;
14
+ /** @minItems 1 */
15
+ groupIds: string[];
16
+ }
17
+ //# sourceMappingURL=createSavedListBody.d.ts.map
lib/api-zod/dist/generated/types/createSavedListBody.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"createSavedListBody.d.ts","sourceRoot":"","sources":["../../../src/generated/types/createSavedListBody.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB;IAClB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
lib/api-zod/dist/generated/types/createSubscriptionResponse.d.ts ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface CreateSubscriptionResponse {
9
+ subscriptionId: string;
10
+ approvalUrl: string;
11
+ }
12
+ //# sourceMappingURL=createSubscriptionResponse.d.ts.map
lib/api-zod/dist/generated/types/createSubscriptionResponse.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"createSubscriptionResponse.d.ts","sourceRoot":"","sources":["../../../src/generated/types/createSubscriptionResponse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,0BAA0B;IACzC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB"}
lib/api-zod/dist/generated/types/healthStatus.d.ts ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface HealthStatus {
9
+ status: string;
10
+ }
11
+ //# sourceMappingURL=healthStatus.d.ts.map
lib/api-zod/dist/generated/types/healthStatus.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"healthStatus.d.ts","sourceRoot":"","sources":["../../../src/generated/types/healthStatus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;CAChB"}
lib/api-zod/dist/generated/types/index.d.ts ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export * from "./activateSubscriptionBody";
9
+ export * from "./createSavedListBody";
10
+ export * from "./createSubscriptionResponse";
11
+ export * from "./healthStatus";
12
+ export * from "./listSavedListsResponse";
13
+ export * from "./meResponse";
14
+ export * from "./paypalWebhookBody";
15
+ export * from "./savedList";
16
+ export * from "./subscriptionState";
17
+ export * from "./subscriptionStateStatus";
18
+ //# sourceMappingURL=index.d.ts.map
lib/api-zod/dist/generated/types/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/generated/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC"}
lib/api-zod/dist/generated/types/listSavedListsResponse.d.ts ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { SavedList } from "./savedList";
9
+ export type ListSavedListsResponse = SavedList[];
10
+ //# sourceMappingURL=listSavedListsResponse.d.ts.map
lib/api-zod/dist/generated/types/listSavedListsResponse.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"listSavedListsResponse.d.ts","sourceRoot":"","sources":["../../../src/generated/types/listSavedListsResponse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,sBAAsB,GAAG,SAAS,EAAE,CAAC"}
lib/api-zod/dist/generated/types/meResponse.d.ts ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { SubscriptionState } from "./subscriptionState";
9
+ export interface MeResponse {
10
+ userId: string;
11
+ /** @nullable */
12
+ email?: string | null;
13
+ subscription: SubscriptionState;
14
+ }
15
+ //# sourceMappingURL=meResponse.d.ts.map
lib/api-zod/dist/generated/types/meResponse.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"meResponse.d.ts","sourceRoot":"","sources":["../../../src/generated/types/meResponse.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,iBAAiB,CAAC;CACjC"}
lib/api-zod/dist/generated/types/paypalWebhookBody.d.ts ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export type PaypalWebhookBody = {
9
+ [key: string]: unknown;
10
+ };
11
+ //# sourceMappingURL=paypalWebhookBody.d.ts.map
lib/api-zod/dist/generated/types/paypalWebhookBody.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"paypalWebhookBody.d.ts","sourceRoot":"","sources":["../../../src/generated/types/paypalWebhookBody.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,iBAAiB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC"}
lib/api-zod/dist/generated/types/savedList.d.ts ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface SavedList {
9
+ id: number;
10
+ name: string;
11
+ groupIds: string[];
12
+ createdAt: Date;
13
+ }
14
+ //# sourceMappingURL=savedList.d.ts.map
lib/api-zod/dist/generated/types/savedList.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"savedList.d.ts","sourceRoot":"","sources":["../../../src/generated/types/savedList.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;CACjB"}
lib/api-zod/dist/generated/types/subscriptionState.d.ts ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { SubscriptionStateStatus } from "./subscriptionStateStatus";
9
+ export interface SubscriptionState {
10
+ status: SubscriptionStateStatus;
11
+ /** @nullable */
12
+ trialEnd?: Date | null;
13
+ /** @nullable */
14
+ currentPeriodEnd?: Date | null;
15
+ /** @nullable */
16
+ paypalSubscriptionId?: string | null;
17
+ hasAccess: boolean;
18
+ }
19
+ //# sourceMappingURL=subscriptionState.d.ts.map
lib/api-zod/dist/generated/types/subscriptionState.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"subscriptionState.d.ts","sourceRoot":"","sources":["../../../src/generated/types/subscriptionState.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzE,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,uBAAuB,CAAC;IAChC,gBAAgB;IAChB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,gBAAgB;IAChB,gBAAgB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC/B,gBAAgB;IAChB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;CACpB"}
lib/api-zod/dist/generated/types/subscriptionStateStatus.d.ts ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export type SubscriptionStateStatus = (typeof SubscriptionStateStatus)[keyof typeof SubscriptionStateStatus];
9
+ export declare const SubscriptionStateStatus: {
10
+ readonly none: "none";
11
+ readonly trialing: "trialing";
12
+ readonly active: "active";
13
+ readonly cancelled: "cancelled";
14
+ readonly suspended: "suspended";
15
+ readonly expired: "expired";
16
+ };
17
+ //# sourceMappingURL=subscriptionStateStatus.d.ts.map
lib/api-zod/dist/generated/types/subscriptionStateStatus.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"subscriptionStateStatus.d.ts","sourceRoot":"","sources":["../../../src/generated/types/subscriptionStateStatus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC;AAEzE,eAAO,MAAM,uBAAuB;;;;;;;CAO1B,CAAC"}
lib/api-zod/dist/index.d.ts ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ export * from "./generated/api";
2
+ //# sourceMappingURL=index.d.ts.map
lib/api-zod/dist/index.d.ts.map ADDED
@@ -0,0 +1 @@
 
 
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
lib/api-zod/package.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@workspace/api-zod",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "exports": {
7
+ ".": "./src/index.ts"
8
+ },
9
+ "dependencies": {
10
+ "zod": "catalog:"
11
+ }
12
+ }
lib/api-zod/src/generated/api.ts ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import * as zod from "zod";
9
+
10
+ /**
11
+ * @summary Health check
12
+ */
13
+ export const HealthCheckResponse = zod.object({
14
+ status: zod.string(),
15
+ });
16
+
17
+ /**
18
+ * @summary Get current user with subscription state
19
+ */
20
+ export const GetMeResponse = zod.object({
21
+ userId: zod.string(),
22
+ email: zod.string().nullish(),
23
+ subscription: zod.object({
24
+ status: zod.enum([
25
+ "none",
26
+ "trialing",
27
+ "active",
28
+ "cancelled",
29
+ "suspended",
30
+ "expired",
31
+ ]),
32
+ trialEnd: zod.coerce.date().nullish(),
33
+ currentPeriodEnd: zod.coerce.date().nullish(),
34
+ paypalSubscriptionId: zod.string().nullish(),
35
+ hasAccess: zod.boolean(),
36
+ }),
37
+ });
38
+
39
+ /**
40
+ * @summary Create PayPal subscription, returns approval URL
41
+ */
42
+ export const CreateSubscriptionResponse = zod.object({
43
+ subscriptionId: zod.string(),
44
+ approvalUrl: zod.string(),
45
+ });
46
+
47
+ /**
48
+ * @summary Activate subscription after PayPal approval
49
+ */
50
+ export const ActivateSubscriptionBody = zod.object({
51
+ subscriptionId: zod.string(),
52
+ });
53
+
54
+ export const ActivateSubscriptionResponse = zod.object({
55
+ status: zod.enum([
56
+ "none",
57
+ "trialing",
58
+ "active",
59
+ "cancelled",
60
+ "suspended",
61
+ "expired",
62
+ ]),
63
+ trialEnd: zod.coerce.date().nullish(),
64
+ currentPeriodEnd: zod.coerce.date().nullish(),
65
+ paypalSubscriptionId: zod.string().nullish(),
66
+ hasAccess: zod.boolean(),
67
+ });
68
+
69
+ /**
70
+ * @summary Cancel current subscription
71
+ */
72
+ export const CancelSubscriptionResponse = zod.object({
73
+ status: zod.enum([
74
+ "none",
75
+ "trialing",
76
+ "active",
77
+ "cancelled",
78
+ "suspended",
79
+ "expired",
80
+ ]),
81
+ trialEnd: zod.coerce.date().nullish(),
82
+ currentPeriodEnd: zod.coerce.date().nullish(),
83
+ paypalSubscriptionId: zod.string().nullish(),
84
+ hasAccess: zod.boolean(),
85
+ });
86
+
87
+ /**
88
+ * @summary PayPal webhook receiver
89
+ */
90
+ export const PaypalWebhookBody = zod.record(zod.string(), zod.unknown());
91
+
92
+ export const PaypalWebhookResponse = zod.object({
93
+ status: zod.string(),
94
+ });
95
+
96
+ /**
97
+ * @summary List saved group lists
98
+ */
99
+ export const ListSavedListsResponseItem = zod.object({
100
+ id: zod.number(),
101
+ name: zod.string(),
102
+ groupIds: zod.array(zod.string()),
103
+ createdAt: zod.coerce.date(),
104
+ });
105
+ export const ListSavedListsResponse = zod.array(ListSavedListsResponseItem);
106
+
107
+ /**
108
+ * @summary Save a group list
109
+ */
110
+ export const createSavedListBodyNameMax = 80;
111
+
112
+ export const CreateSavedListBody = zod.object({
113
+ name: zod.string().min(1).max(createSavedListBodyNameMax),
114
+ groupIds: zod.array(zod.string()).min(1),
115
+ });
116
+
117
+ /**
118
+ * @summary Delete a saved list
119
+ */
120
+ export const DeleteSavedListParams = zod.object({
121
+ id: zod.coerce.number(),
122
+ });
lib/api-zod/src/generated/types/activateSubscriptionBody.ts ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+
9
+ export interface ActivateSubscriptionBody {
10
+ subscriptionId: string;
11
+ }
lib/api-zod/src/generated/types/createSavedListBody.ts ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+
9
+ export interface CreateSavedListBody {
10
+ /**
11
+ * @minLength 1
12
+ * @maxLength 80
13
+ */
14
+ name: string;
15
+ /** @minItems 1 */
16
+ groupIds: string[];
17
+ }
lib/api-zod/src/generated/types/createSubscriptionResponse.ts ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+
9
+ export interface CreateSubscriptionResponse {
10
+ subscriptionId: string;
11
+ approvalUrl: string;
12
+ }
lib/api-zod/src/generated/types/healthStatus.ts ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Generated by orval v8.5.3 🍺
3
+ * Do not edit manually.
4
+ * Api
5
+ * API specification for FB Group Publisher PRO
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+
9
+ export interface HealthStatus {
10
+ status: string;
11
+ }