@tearleads/client-sdk 0.1.94 → 0.1.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/client/root/index.d.ts +14 -2
  2. package/client/root/index.js +11 -1
  3. package/client/root/index.js.map +1 -1
  4. package/client/session/index.js +7 -4
  5. package/client/session/index.js.map +1 -1
  6. package/client/session/sessionLoginRefusal.js +17 -0
  7. package/client/session/sessionLoginRefusal.js.map +1 -1
  8. package/index.d.ts +1 -1
  9. package/index.js +1 -1
  10. package/index.js.map +1 -1
  11. package/internal/api-client/ApiClient.d.ts +8 -2
  12. package/internal/api-client/ApiClient.js +20 -3
  13. package/internal/api-client/ApiClient.js.map +1 -1
  14. package/internal/api-client/accountSuspension.d.ts +12 -0
  15. package/internal/api-client/accountSuspension.js +23 -0
  16. package/internal/api-client/accountSuspension.js.map +1 -0
  17. package/internal/api-client/index.d.ts +1 -0
  18. package/internal/api-client/index.js +1 -0
  19. package/internal/api-client/index.js.map +1 -1
  20. package/internal/validators/operation/auth.d.ts +104 -2
  21. package/internal/validators/operation/auth.js +2 -1
  22. package/internal/validators/operation/auth.js.map +1 -1
  23. package/internal/validators/operation/index.d.ts +2 -0
  24. package/internal/validators/operation/index.js +2 -0
  25. package/internal/validators/operation/index.js.map +1 -1
  26. package/internal/validators/operation/registry.d.ts +6 -0
  27. package/internal/validators/operation/registry.js +6 -0
  28. package/internal/validators/operation/registry.js.map +1 -1
  29. package/internal/validators/operation/root.d.ts +8 -0
  30. package/internal/validators/operation/rootOrganizations.d.ts +4 -0
  31. package/internal/validators/operation/rootRevenuecat.d.ts +462 -0
  32. package/internal/validators/operation/rootRevenuecat.js +53 -0
  33. package/internal/validators/operation/rootRevenuecat.js.map +1 -0
  34. package/internal/validators/operation/rootSuspension.d.ts +352 -0
  35. package/internal/validators/operation/rootSuspension.js +45 -0
  36. package/internal/validators/operation/rootSuspension.js.map +1 -0
  37. package/internal/validators/response/auth/index.d.ts +1 -1
  38. package/internal/validators/response/auth/index.js +1 -1
  39. package/internal/validators/response/auth/index.js.map +1 -1
  40. package/internal/validators/response/auth/verify.d.ts +15 -0
  41. package/internal/validators/response/auth/verify.js +9 -0
  42. package/internal/validators/response/auth/verify.js.map +1 -1
  43. package/internal/validators/response/index.d.ts +3 -2
  44. package/internal/validators/response/index.js +3 -2
  45. package/internal/validators/response/index.js.map +1 -1
  46. package/internal/validators/response/root.d.ts +60 -0
  47. package/internal/validators/response/root.js +9 -0
  48. package/internal/validators/response/root.js.map +1 -1
  49. package/internal/validators/response/rootAudit.d.ts +2 -2
  50. package/internal/validators/response/rootAudit.js +4 -0
  51. package/internal/validators/response/rootAudit.js.map +1 -1
  52. package/internal/validators/response/rootOrganizations.d.ts +8 -0
  53. package/internal/validators/response/rootRevenuecat.d.ts +375 -0
  54. package/internal/validators/response/rootRevenuecat.js +65 -0
  55. package/internal/validators/response/rootRevenuecat.js.map +1 -0
  56. package/package.json +1 -1
  57. package/workflows/root/index.d.ts +2 -0
  58. package/workflows/root/index.js +2 -0
  59. package/workflows/root/index.js.map +1 -1
  60. package/workflows/root/revenuecat.d.ts +21 -0
  61. package/workflows/root/revenuecat.js +8 -0
  62. package/workflows/root/revenuecat.js.map +1 -0
  63. package/workflows/root/suspension.d.ts +13 -0
  64. package/workflows/root/suspension.js +17 -0
  65. package/workflows/root/suspension.js.map +1 -0
@@ -0,0 +1,462 @@
1
+ import { z } from "zod";
2
+ import { ErrorResponseSchema } from "../response/index.js";
3
+ declare const RootRevenuecatEventsQuerySchema: z.ZodType<{
4
+ cursor?: string | undefined;
5
+ limit?: string | number | undefined;
6
+ }, {
7
+ cursor?: string | undefined;
8
+ limit?: string | number | undefined;
9
+ }, z.core.$ZodTypeInternals<{
10
+ cursor?: string | undefined;
11
+ limit?: string | number | undefined;
12
+ }, {
13
+ cursor?: string | undefined;
14
+ limit?: string | number | undefined;
15
+ }>>;
16
+ export type RootRevenuecatEventsQuery = z.infer<typeof RootRevenuecatEventsQuerySchema>;
17
+ declare const RootRevenuecatEventsReportQuerySchema: z.ZodType<{
18
+ disposition?: "ignored" | "unmatched" | "both" | undefined;
19
+ cursor?: string | undefined;
20
+ limit?: string | number | undefined;
21
+ }, {
22
+ disposition?: "ignored" | "unmatched" | "both" | undefined;
23
+ cursor?: string | undefined;
24
+ limit?: string | number | undefined;
25
+ }, z.core.$ZodTypeInternals<{
26
+ disposition?: "ignored" | "unmatched" | "both" | undefined;
27
+ cursor?: string | undefined;
28
+ limit?: string | number | undefined;
29
+ }, {
30
+ disposition?: "ignored" | "unmatched" | "both" | undefined;
31
+ cursor?: string | undefined;
32
+ limit?: string | number | undefined;
33
+ }>>;
34
+ export type RootRevenuecatEventsReportQuery = z.infer<typeof RootRevenuecatEventsReportQuerySchema>;
35
+ /**
36
+ * An organization's stored RevenueCat webhook deliveries, newest first: the
37
+ * ones resolved to it (applied or ignored) and the transfers that moved a
38
+ * purchase away from it.
39
+ */
40
+ export declare const listRootOrganizationRevenuecatEventsOperation: Omit<{
41
+ readonly auth: "session";
42
+ readonly failureResponses: {
43
+ readonly 400: z.ZodType<{
44
+ error: string;
45
+ }, {
46
+ error: string;
47
+ }, z.core.$ZodTypeInternals<{
48
+ error: string;
49
+ }, {
50
+ error: string;
51
+ }>>;
52
+ readonly 401: z.ZodType<{
53
+ error: string;
54
+ code?: "session_refresh_required" | undefined;
55
+ }, {
56
+ error: string;
57
+ code?: "session_refresh_required" | undefined;
58
+ }, z.core.$ZodTypeInternals<{
59
+ error: string;
60
+ code?: "session_refresh_required" | undefined;
61
+ }, {
62
+ error: string;
63
+ code?: "session_refresh_required" | undefined;
64
+ }>>;
65
+ readonly 403: z.ZodType<{
66
+ error: string;
67
+ }, {
68
+ error: string;
69
+ }, z.core.$ZodTypeInternals<{
70
+ error: string;
71
+ }, {
72
+ error: string;
73
+ }>>;
74
+ readonly 500: z.ZodType<{
75
+ error: string;
76
+ }, {
77
+ error: string;
78
+ }, z.core.$ZodTypeInternals<{
79
+ error: string;
80
+ }, {
81
+ error: string;
82
+ }>>;
83
+ };
84
+ readonly failureStatuses: readonly [400, 401, 403, 500];
85
+ readonly id: "root.organizations.revenuecatEvents.list";
86
+ readonly method: "GET";
87
+ readonly params: z.ZodObject<{
88
+ organizationId: z.ZodCustom<string, string>;
89
+ }, z.core.$strict>;
90
+ readonly path: "/root/organizations/{organizationId}/revenuecat-events";
91
+ readonly query: z.ZodType<{
92
+ cursor?: string | undefined;
93
+ limit?: string | number | undefined;
94
+ }, {
95
+ cursor?: string | undefined;
96
+ limit?: string | number | undefined;
97
+ }, z.core.$ZodTypeInternals<{
98
+ cursor?: string | undefined;
99
+ limit?: string | number | undefined;
100
+ }, {
101
+ cursor?: string | undefined;
102
+ limit?: string | number | undefined;
103
+ }>>;
104
+ readonly responses: {
105
+ readonly 200: z.ZodType<{
106
+ events: {
107
+ role: "target" | "source";
108
+ id: string;
109
+ eventId: string;
110
+ eventType: string;
111
+ outcome: string;
112
+ appUserId: string;
113
+ organizationId: string | null;
114
+ sourceOrganizationId: string | null;
115
+ store: string | null;
116
+ environment: string | null;
117
+ productId: string | null;
118
+ periodType: string | null;
119
+ transactionId: string | null;
120
+ originalTransactionId: string | null;
121
+ currency: string | null;
122
+ priceInPurchasedCurrencyMinor: number | null;
123
+ purchasedAt: string | null;
124
+ expirationAt: string | null;
125
+ eventTimestamp: string;
126
+ createdAt: string;
127
+ }[];
128
+ nextCursor: string | null;
129
+ }, {
130
+ events: {
131
+ role: "target" | "source";
132
+ id: string;
133
+ eventId: string;
134
+ eventType: string;
135
+ outcome: string;
136
+ appUserId: string;
137
+ organizationId: string | null;
138
+ sourceOrganizationId: string | null;
139
+ store: string | null;
140
+ environment: string | null;
141
+ productId: string | null;
142
+ periodType: string | null;
143
+ transactionId: string | null;
144
+ originalTransactionId: string | null;
145
+ currency: string | null;
146
+ priceInPurchasedCurrencyMinor: number | null;
147
+ purchasedAt: string | null;
148
+ expirationAt: string | null;
149
+ eventTimestamp: string;
150
+ createdAt: string;
151
+ }[];
152
+ nextCursor: string | null;
153
+ }, z.core.$ZodTypeInternals<{
154
+ events: {
155
+ role: "target" | "source";
156
+ id: string;
157
+ eventId: string;
158
+ eventType: string;
159
+ outcome: string;
160
+ appUserId: string;
161
+ organizationId: string | null;
162
+ sourceOrganizationId: string | null;
163
+ store: string | null;
164
+ environment: string | null;
165
+ productId: string | null;
166
+ periodType: string | null;
167
+ transactionId: string | null;
168
+ originalTransactionId: string | null;
169
+ currency: string | null;
170
+ priceInPurchasedCurrencyMinor: number | null;
171
+ purchasedAt: string | null;
172
+ expirationAt: string | null;
173
+ eventTimestamp: string;
174
+ createdAt: string;
175
+ }[];
176
+ nextCursor: string | null;
177
+ }, {
178
+ events: {
179
+ role: "target" | "source";
180
+ id: string;
181
+ eventId: string;
182
+ eventType: string;
183
+ outcome: string;
184
+ appUserId: string;
185
+ organizationId: string | null;
186
+ sourceOrganizationId: string | null;
187
+ store: string | null;
188
+ environment: string | null;
189
+ productId: string | null;
190
+ periodType: string | null;
191
+ transactionId: string | null;
192
+ originalTransactionId: string | null;
193
+ currency: string | null;
194
+ priceInPurchasedCurrencyMinor: number | null;
195
+ purchasedAt: string | null;
196
+ expirationAt: string | null;
197
+ eventTimestamp: string;
198
+ createdAt: string;
199
+ }[];
200
+ nextCursor: string | null;
201
+ }>>;
202
+ };
203
+ }, "failureResponses" | "failureStatuses"> & {
204
+ readonly failureResponses: {
205
+ readonly 400: z.ZodType<{
206
+ error: string;
207
+ }, {
208
+ error: string;
209
+ }, z.core.$ZodTypeInternals<{
210
+ error: string;
211
+ }, {
212
+ error: string;
213
+ }>>;
214
+ readonly 401: z.ZodType<{
215
+ error: string;
216
+ code?: "session_refresh_required" | undefined;
217
+ }, {
218
+ error: string;
219
+ code?: "session_refresh_required" | undefined;
220
+ }, z.core.$ZodTypeInternals<{
221
+ error: string;
222
+ code?: "session_refresh_required" | undefined;
223
+ }, {
224
+ error: string;
225
+ code?: "session_refresh_required" | undefined;
226
+ }>>;
227
+ readonly 403: z.ZodType<{
228
+ error: string;
229
+ }, {
230
+ error: string;
231
+ }, z.core.$ZodTypeInternals<{
232
+ error: string;
233
+ }, {
234
+ error: string;
235
+ }>>;
236
+ readonly 500: z.ZodType<{
237
+ error: string;
238
+ }, {
239
+ error: string;
240
+ }, z.core.$ZodTypeInternals<{
241
+ error: string;
242
+ }, {
243
+ error: string;
244
+ }>>;
245
+ } & {
246
+ readonly 503: typeof ErrorResponseSchema;
247
+ };
248
+ readonly failureStatuses: readonly [400, 401, 403, 500] | readonly [400, 401, 403, 500, 503];
249
+ };
250
+ /**
251
+ * Deliveries across every organization that resolved to none, or that the
252
+ * handler ignored, newest first.
253
+ */
254
+ export declare const listRootRevenuecatEventsReportOperation: Omit<{
255
+ readonly auth: "session";
256
+ readonly failureResponses: {
257
+ readonly 400: z.ZodType<{
258
+ error: string;
259
+ }, {
260
+ error: string;
261
+ }, z.core.$ZodTypeInternals<{
262
+ error: string;
263
+ }, {
264
+ error: string;
265
+ }>>;
266
+ readonly 401: z.ZodType<{
267
+ error: string;
268
+ code?: "session_refresh_required" | undefined;
269
+ }, {
270
+ error: string;
271
+ code?: "session_refresh_required" | undefined;
272
+ }, z.core.$ZodTypeInternals<{
273
+ error: string;
274
+ code?: "session_refresh_required" | undefined;
275
+ }, {
276
+ error: string;
277
+ code?: "session_refresh_required" | undefined;
278
+ }>>;
279
+ readonly 403: z.ZodType<{
280
+ error: string;
281
+ }, {
282
+ error: string;
283
+ }, z.core.$ZodTypeInternals<{
284
+ error: string;
285
+ }, {
286
+ error: string;
287
+ }>>;
288
+ readonly 500: z.ZodType<{
289
+ error: string;
290
+ }, {
291
+ error: string;
292
+ }, z.core.$ZodTypeInternals<{
293
+ error: string;
294
+ }, {
295
+ error: string;
296
+ }>>;
297
+ };
298
+ readonly failureStatuses: readonly [400, 401, 403, 500];
299
+ readonly id: "root.reports.revenuecatEvents.list";
300
+ readonly method: "GET";
301
+ readonly params: z.ZodObject<{}, z.core.$strict>;
302
+ readonly path: "/root/reports/revenuecat-events";
303
+ readonly query: z.ZodType<{
304
+ disposition?: "ignored" | "unmatched" | "both" | undefined;
305
+ cursor?: string | undefined;
306
+ limit?: string | number | undefined;
307
+ }, {
308
+ disposition?: "ignored" | "unmatched" | "both" | undefined;
309
+ cursor?: string | undefined;
310
+ limit?: string | number | undefined;
311
+ }, z.core.$ZodTypeInternals<{
312
+ disposition?: "ignored" | "unmatched" | "both" | undefined;
313
+ cursor?: string | undefined;
314
+ limit?: string | number | undefined;
315
+ }, {
316
+ disposition?: "ignored" | "unmatched" | "both" | undefined;
317
+ cursor?: string | undefined;
318
+ limit?: string | number | undefined;
319
+ }>>;
320
+ readonly responses: {
321
+ readonly 200: z.ZodType<{
322
+ events: {
323
+ id: string;
324
+ eventId: string;
325
+ eventType: string;
326
+ outcome: string;
327
+ appUserId: string;
328
+ organizationId: string | null;
329
+ sourceOrganizationId: string | null;
330
+ store: string | null;
331
+ environment: string | null;
332
+ productId: string | null;
333
+ periodType: string | null;
334
+ transactionId: string | null;
335
+ originalTransactionId: string | null;
336
+ currency: string | null;
337
+ priceInPurchasedCurrencyMinor: number | null;
338
+ purchasedAt: string | null;
339
+ expirationAt: string | null;
340
+ eventTimestamp: string;
341
+ createdAt: string;
342
+ }[];
343
+ nextCursor: string | null;
344
+ }, {
345
+ events: {
346
+ id: string;
347
+ eventId: string;
348
+ eventType: string;
349
+ outcome: string;
350
+ appUserId: string;
351
+ organizationId: string | null;
352
+ sourceOrganizationId: string | null;
353
+ store: string | null;
354
+ environment: string | null;
355
+ productId: string | null;
356
+ periodType: string | null;
357
+ transactionId: string | null;
358
+ originalTransactionId: string | null;
359
+ currency: string | null;
360
+ priceInPurchasedCurrencyMinor: number | null;
361
+ purchasedAt: string | null;
362
+ expirationAt: string | null;
363
+ eventTimestamp: string;
364
+ createdAt: string;
365
+ }[];
366
+ nextCursor: string | null;
367
+ }, z.core.$ZodTypeInternals<{
368
+ events: {
369
+ id: string;
370
+ eventId: string;
371
+ eventType: string;
372
+ outcome: string;
373
+ appUserId: string;
374
+ organizationId: string | null;
375
+ sourceOrganizationId: string | null;
376
+ store: string | null;
377
+ environment: string | null;
378
+ productId: string | null;
379
+ periodType: string | null;
380
+ transactionId: string | null;
381
+ originalTransactionId: string | null;
382
+ currency: string | null;
383
+ priceInPurchasedCurrencyMinor: number | null;
384
+ purchasedAt: string | null;
385
+ expirationAt: string | null;
386
+ eventTimestamp: string;
387
+ createdAt: string;
388
+ }[];
389
+ nextCursor: string | null;
390
+ }, {
391
+ events: {
392
+ id: string;
393
+ eventId: string;
394
+ eventType: string;
395
+ outcome: string;
396
+ appUserId: string;
397
+ organizationId: string | null;
398
+ sourceOrganizationId: string | null;
399
+ store: string | null;
400
+ environment: string | null;
401
+ productId: string | null;
402
+ periodType: string | null;
403
+ transactionId: string | null;
404
+ originalTransactionId: string | null;
405
+ currency: string | null;
406
+ priceInPurchasedCurrencyMinor: number | null;
407
+ purchasedAt: string | null;
408
+ expirationAt: string | null;
409
+ eventTimestamp: string;
410
+ createdAt: string;
411
+ }[];
412
+ nextCursor: string | null;
413
+ }>>;
414
+ };
415
+ }, "failureResponses" | "failureStatuses"> & {
416
+ readonly failureResponses: {
417
+ readonly 400: z.ZodType<{
418
+ error: string;
419
+ }, {
420
+ error: string;
421
+ }, z.core.$ZodTypeInternals<{
422
+ error: string;
423
+ }, {
424
+ error: string;
425
+ }>>;
426
+ readonly 401: z.ZodType<{
427
+ error: string;
428
+ code?: "session_refresh_required" | undefined;
429
+ }, {
430
+ error: string;
431
+ code?: "session_refresh_required" | undefined;
432
+ }, z.core.$ZodTypeInternals<{
433
+ error: string;
434
+ code?: "session_refresh_required" | undefined;
435
+ }, {
436
+ error: string;
437
+ code?: "session_refresh_required" | undefined;
438
+ }>>;
439
+ readonly 403: z.ZodType<{
440
+ error: string;
441
+ }, {
442
+ error: string;
443
+ }, z.core.$ZodTypeInternals<{
444
+ error: string;
445
+ }, {
446
+ error: string;
447
+ }>>;
448
+ readonly 500: z.ZodType<{
449
+ error: string;
450
+ }, {
451
+ error: string;
452
+ }, z.core.$ZodTypeInternals<{
453
+ error: string;
454
+ }, {
455
+ error: string;
456
+ }>>;
457
+ } & {
458
+ readonly 503: typeof ErrorResponseSchema;
459
+ };
460
+ readonly failureStatuses: readonly [400, 401, 403, 500] | readonly [400, 401, 403, 500, 503];
461
+ };
462
+ export {};
@@ -0,0 +1,53 @@
1
+ import { z } from "zod";
2
+ import { ErrorResponseSchema, RootOrganizationRevenuecatEventsResponseSchema, RootRevenuecatDispositionSchema, RootRevenuecatEventsReportResponseSchema, SessionFailureResponseSchema, } from "../response/index.js";
3
+ import { loosePlainObject, uuidV4StringSchema } from "../schema.js";
4
+ import { defineJsonOperation } from "./definition.js";
5
+ import { rootIdentityPageLimitSchema } from "./root.js";
6
+ const pageShape = {
7
+ cursor: z.string().min(1).optional(),
8
+ limit: rootIdentityPageLimitSchema().optional(),
9
+ };
10
+ const RootRevenuecatEventsQuerySchema = loosePlainObject(pageShape);
11
+ const RootRevenuecatEventsReportQuerySchema = loosePlainObject({
12
+ ...pageShape,
13
+ /** Which deliveries to list; both when omitted. */
14
+ disposition: RootRevenuecatDispositionSchema.optional(),
15
+ });
16
+ const failureResponses = {
17
+ 400: ErrorResponseSchema,
18
+ 401: SessionFailureResponseSchema,
19
+ 403: ErrorResponseSchema,
20
+ 500: ErrorResponseSchema,
21
+ };
22
+ /**
23
+ * An organization's stored RevenueCat webhook deliveries, newest first: the
24
+ * ones resolved to it (applied or ignored) and the transfers that moved a
25
+ * purchase away from it.
26
+ */
27
+ export const listRootOrganizationRevenuecatEventsOperation = defineJsonOperation({
28
+ auth: "session",
29
+ failureResponses,
30
+ failureStatuses: [400, 401, 403, 500],
31
+ id: "root.organizations.revenuecatEvents.list",
32
+ method: "GET",
33
+ params: z.strictObject({ organizationId: uuidV4StringSchema }),
34
+ path: "/root/organizations/{organizationId}/revenuecat-events",
35
+ query: RootRevenuecatEventsQuerySchema,
36
+ responses: { 200: RootOrganizationRevenuecatEventsResponseSchema },
37
+ });
38
+ /**
39
+ * Deliveries across every organization that resolved to none, or that the
40
+ * handler ignored, newest first.
41
+ */
42
+ export const listRootRevenuecatEventsReportOperation = defineJsonOperation({
43
+ auth: "session",
44
+ failureResponses,
45
+ failureStatuses: [400, 401, 403, 500],
46
+ id: "root.reports.revenuecatEvents.list",
47
+ method: "GET",
48
+ params: z.strictObject({}),
49
+ path: "/root/reports/revenuecat-events",
50
+ query: RootRevenuecatEventsReportQuerySchema,
51
+ responses: { 200: RootRevenuecatEventsReportResponseSchema },
52
+ });
53
+ //# sourceMappingURL=rootRevenuecat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rootRevenuecat.js","sourceRoot":"","sources":["rootRevenuecat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,8CAA8C,EAC9C,+BAA+B,EAC/B,wCAAwC,EACxC,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,QAAQ,CAAC;AAErD,MAAM,SAAS,GAAG;IAChB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACpC,KAAK,EAAE,2BAA2B,EAAE,CAAC,QAAQ,EAAE;CAChD,CAAC;AACF,MAAM,+BAA+B,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;AAIpE,MAAM,qCAAqC,GAAG,gBAAgB,CAAC;IAC7D,GAAG,SAAS;IACZ,mDAAmD;IACnD,WAAW,EAAE,+BAA+B,CAAC,QAAQ,EAAE;CACxD,CAAC,CAAC;AAIH,MAAM,gBAAgB,GAAG;IACvB,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,4BAA4B;IACjC,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,mBAAmB;CAChB,CAAC;AAEX;;;;GAIG;AACH,MAAM,CAAC,MAAM,6CAA6C,GACxD,mBAAmB,CAAC;IAClB,IAAI,EAAE,SAAS;IACf,gBAAgB;IAChB,eAAe,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IACrC,EAAE,EAAE,0CAA0C;IAC9C,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC;IAC9D,IAAI,EAAE,wDAAwD;IAC9D,KAAK,EAAE,+BAA+B;IACtC,SAAS,EAAE,EAAE,GAAG,EAAE,8CAA8C,EAAE;CACnE,CAAC,CAAC;AAEL;;;GAGG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,mBAAmB,CAAC;IACzE,IAAI,EAAE,SAAS;IACf,gBAAgB;IAChB,eAAe,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IACrC,EAAE,EAAE,oCAAoC;IACxC,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC;IAC1B,IAAI,EAAE,iCAAiC;IACvC,KAAK,EAAE,qCAAqC;IAC5C,SAAS,EAAE,EAAE,GAAG,EAAE,wCAAwC,EAAE;CAC7D,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n ErrorResponseSchema,\n RootOrganizationRevenuecatEventsResponseSchema,\n RootRevenuecatDispositionSchema,\n RootRevenuecatEventsReportResponseSchema,\n SessionFailureResponseSchema,\n} from \"../response\";\nimport { loosePlainObject, uuidV4StringSchema } from \"../schema\";\nimport { defineJsonOperation } from \"./definition\";\nimport { rootIdentityPageLimitSchema } from \"./root\";\n\nconst pageShape = {\n cursor: z.string().min(1).optional(),\n limit: rootIdentityPageLimitSchema().optional(),\n};\nconst RootRevenuecatEventsQuerySchema = loosePlainObject(pageShape);\nexport type RootRevenuecatEventsQuery = z.infer<\n typeof RootRevenuecatEventsQuerySchema\n>;\nconst RootRevenuecatEventsReportQuerySchema = loosePlainObject({\n ...pageShape,\n /** Which deliveries to list; both when omitted. */\n disposition: RootRevenuecatDispositionSchema.optional(),\n});\nexport type RootRevenuecatEventsReportQuery = z.infer<\n typeof RootRevenuecatEventsReportQuerySchema\n>;\nconst failureResponses = {\n 400: ErrorResponseSchema,\n 401: SessionFailureResponseSchema,\n 403: ErrorResponseSchema,\n 500: ErrorResponseSchema,\n} as const;\n\n/**\n * An organization's stored RevenueCat webhook deliveries, newest first: the\n * ones resolved to it (applied or ignored) and the transfers that moved a\n * purchase away from it.\n */\nexport const listRootOrganizationRevenuecatEventsOperation =\n defineJsonOperation({\n auth: \"session\",\n failureResponses,\n failureStatuses: [400, 401, 403, 500],\n id: \"root.organizations.revenuecatEvents.list\",\n method: \"GET\",\n params: z.strictObject({ organizationId: uuidV4StringSchema }),\n path: \"/root/organizations/{organizationId}/revenuecat-events\",\n query: RootRevenuecatEventsQuerySchema,\n responses: { 200: RootOrganizationRevenuecatEventsResponseSchema },\n });\n\n/**\n * Deliveries across every organization that resolved to none, or that the\n * handler ignored, newest first.\n */\nexport const listRootRevenuecatEventsReportOperation = defineJsonOperation({\n auth: \"session\",\n failureResponses,\n failureStatuses: [400, 401, 403, 500],\n id: \"root.reports.revenuecatEvents.list\",\n method: \"GET\",\n params: z.strictObject({}),\n path: \"/root/reports/revenuecat-events\",\n query: RootRevenuecatEventsReportQuerySchema,\n responses: { 200: RootRevenuecatEventsReportResponseSchema },\n});\n"]}