@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.
- package/client/root/index.d.ts +14 -2
- package/client/root/index.js +11 -1
- package/client/root/index.js.map +1 -1
- package/client/session/index.js +7 -4
- package/client/session/index.js.map +1 -1
- package/client/session/sessionLoginRefusal.js +17 -0
- package/client/session/sessionLoginRefusal.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/internal/api-client/ApiClient.d.ts +8 -2
- package/internal/api-client/ApiClient.js +20 -3
- package/internal/api-client/ApiClient.js.map +1 -1
- package/internal/api-client/accountSuspension.d.ts +12 -0
- package/internal/api-client/accountSuspension.js +23 -0
- package/internal/api-client/accountSuspension.js.map +1 -0
- package/internal/api-client/index.d.ts +1 -0
- package/internal/api-client/index.js +1 -0
- package/internal/api-client/index.js.map +1 -1
- package/internal/validators/operation/auth.d.ts +104 -2
- package/internal/validators/operation/auth.js +2 -1
- package/internal/validators/operation/auth.js.map +1 -1
- package/internal/validators/operation/index.d.ts +2 -0
- package/internal/validators/operation/index.js +2 -0
- package/internal/validators/operation/index.js.map +1 -1
- package/internal/validators/operation/registry.d.ts +6 -0
- package/internal/validators/operation/registry.js +6 -0
- package/internal/validators/operation/registry.js.map +1 -1
- package/internal/validators/operation/root.d.ts +8 -0
- package/internal/validators/operation/rootOrganizations.d.ts +4 -0
- package/internal/validators/operation/rootRevenuecat.d.ts +462 -0
- package/internal/validators/operation/rootRevenuecat.js +53 -0
- package/internal/validators/operation/rootRevenuecat.js.map +1 -0
- package/internal/validators/operation/rootSuspension.d.ts +352 -0
- package/internal/validators/operation/rootSuspension.js +45 -0
- package/internal/validators/operation/rootSuspension.js.map +1 -0
- package/internal/validators/response/auth/index.d.ts +1 -1
- package/internal/validators/response/auth/index.js +1 -1
- package/internal/validators/response/auth/index.js.map +1 -1
- package/internal/validators/response/auth/verify.d.ts +15 -0
- package/internal/validators/response/auth/verify.js +9 -0
- package/internal/validators/response/auth/verify.js.map +1 -1
- package/internal/validators/response/index.d.ts +3 -2
- package/internal/validators/response/index.js +3 -2
- package/internal/validators/response/index.js.map +1 -1
- package/internal/validators/response/root.d.ts +60 -0
- package/internal/validators/response/root.js +9 -0
- package/internal/validators/response/root.js.map +1 -1
- package/internal/validators/response/rootAudit.d.ts +2 -2
- package/internal/validators/response/rootAudit.js +4 -0
- package/internal/validators/response/rootAudit.js.map +1 -1
- package/internal/validators/response/rootOrganizations.d.ts +8 -0
- package/internal/validators/response/rootRevenuecat.d.ts +375 -0
- package/internal/validators/response/rootRevenuecat.js +65 -0
- package/internal/validators/response/rootRevenuecat.js.map +1 -0
- package/package.json +1 -1
- package/workflows/root/index.d.ts +2 -0
- package/workflows/root/index.js +2 -0
- package/workflows/root/index.js.map +1 -1
- package/workflows/root/revenuecat.d.ts +21 -0
- package/workflows/root/revenuecat.js +8 -0
- package/workflows/root/revenuecat.js.map +1 -0
- package/workflows/root/suspension.d.ts +13 -0
- package/workflows/root/suspension.js +17 -0
- package/workflows/root/suspension.js.map +1 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Which deliveries the RevenueCat report lists: ones that resolved to no
|
|
4
|
+
* organization, ones the handler deliberately ignored, or either.
|
|
5
|
+
*/
|
|
6
|
+
export declare const ROOT_REVENUECAT_DISPOSITIONS: readonly ["unmatched", "ignored", "both"];
|
|
7
|
+
export declare const RootRevenuecatDispositionSchema: z.ZodLiteral<"ignored" | "unmatched" | "both">;
|
|
8
|
+
export type RootRevenuecatDisposition = z.infer<typeof RootRevenuecatDispositionSchema>;
|
|
9
|
+
/** One stored RevenueCat webhook delivery. */
|
|
10
|
+
export declare const RootRevenuecatEventResponseSchema: z.ZodType<{
|
|
11
|
+
id: string;
|
|
12
|
+
eventId: string;
|
|
13
|
+
eventType: string;
|
|
14
|
+
outcome: string;
|
|
15
|
+
appUserId: string;
|
|
16
|
+
organizationId: string | null;
|
|
17
|
+
sourceOrganizationId: string | null;
|
|
18
|
+
store: string | null;
|
|
19
|
+
environment: string | null;
|
|
20
|
+
productId: string | null;
|
|
21
|
+
periodType: string | null;
|
|
22
|
+
transactionId: string | null;
|
|
23
|
+
originalTransactionId: string | null;
|
|
24
|
+
currency: string | null;
|
|
25
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
26
|
+
purchasedAt: string | null;
|
|
27
|
+
expirationAt: string | null;
|
|
28
|
+
eventTimestamp: string;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
}, {
|
|
31
|
+
id: string;
|
|
32
|
+
eventId: string;
|
|
33
|
+
eventType: string;
|
|
34
|
+
outcome: string;
|
|
35
|
+
appUserId: string;
|
|
36
|
+
organizationId: string | null;
|
|
37
|
+
sourceOrganizationId: string | null;
|
|
38
|
+
store: string | null;
|
|
39
|
+
environment: string | null;
|
|
40
|
+
productId: string | null;
|
|
41
|
+
periodType: string | null;
|
|
42
|
+
transactionId: string | null;
|
|
43
|
+
originalTransactionId: string | null;
|
|
44
|
+
currency: string | null;
|
|
45
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
46
|
+
purchasedAt: string | null;
|
|
47
|
+
expirationAt: string | null;
|
|
48
|
+
eventTimestamp: string;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
}, z.core.$ZodTypeInternals<{
|
|
51
|
+
id: string;
|
|
52
|
+
eventId: string;
|
|
53
|
+
eventType: string;
|
|
54
|
+
outcome: string;
|
|
55
|
+
appUserId: string;
|
|
56
|
+
organizationId: string | null;
|
|
57
|
+
sourceOrganizationId: string | null;
|
|
58
|
+
store: string | null;
|
|
59
|
+
environment: string | null;
|
|
60
|
+
productId: string | null;
|
|
61
|
+
periodType: string | null;
|
|
62
|
+
transactionId: string | null;
|
|
63
|
+
originalTransactionId: string | null;
|
|
64
|
+
currency: string | null;
|
|
65
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
66
|
+
purchasedAt: string | null;
|
|
67
|
+
expirationAt: string | null;
|
|
68
|
+
eventTimestamp: string;
|
|
69
|
+
createdAt: string;
|
|
70
|
+
}, {
|
|
71
|
+
id: string;
|
|
72
|
+
eventId: string;
|
|
73
|
+
eventType: string;
|
|
74
|
+
outcome: string;
|
|
75
|
+
appUserId: string;
|
|
76
|
+
organizationId: string | null;
|
|
77
|
+
sourceOrganizationId: string | null;
|
|
78
|
+
store: string | null;
|
|
79
|
+
environment: string | null;
|
|
80
|
+
productId: string | null;
|
|
81
|
+
periodType: string | null;
|
|
82
|
+
transactionId: string | null;
|
|
83
|
+
originalTransactionId: string | null;
|
|
84
|
+
currency: string | null;
|
|
85
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
86
|
+
purchasedAt: string | null;
|
|
87
|
+
expirationAt: string | null;
|
|
88
|
+
eventTimestamp: string;
|
|
89
|
+
createdAt: string;
|
|
90
|
+
}>>;
|
|
91
|
+
export type RootRevenuecatEventResponse = z.infer<typeof RootRevenuecatEventResponseSchema>;
|
|
92
|
+
export declare const ROOT_REVENUECAT_EVENT_ROLES: readonly ["target", "source"];
|
|
93
|
+
/**
|
|
94
|
+
* One delivery as an organization saw it: the organization it resolved to
|
|
95
|
+
* (`target`, whether the handler applied or ignored it), or the previous owner
|
|
96
|
+
* a `TRANSFER` moved the purchase from (`source`).
|
|
97
|
+
*/
|
|
98
|
+
export declare const RootOrganizationRevenuecatEventResponseSchema: z.ZodType<{
|
|
99
|
+
role: "target" | "source";
|
|
100
|
+
id: string;
|
|
101
|
+
eventId: string;
|
|
102
|
+
eventType: string;
|
|
103
|
+
outcome: string;
|
|
104
|
+
appUserId: string;
|
|
105
|
+
organizationId: string | null;
|
|
106
|
+
sourceOrganizationId: string | null;
|
|
107
|
+
store: string | null;
|
|
108
|
+
environment: string | null;
|
|
109
|
+
productId: string | null;
|
|
110
|
+
periodType: string | null;
|
|
111
|
+
transactionId: string | null;
|
|
112
|
+
originalTransactionId: string | null;
|
|
113
|
+
currency: string | null;
|
|
114
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
115
|
+
purchasedAt: string | null;
|
|
116
|
+
expirationAt: string | null;
|
|
117
|
+
eventTimestamp: string;
|
|
118
|
+
createdAt: string;
|
|
119
|
+
}, {
|
|
120
|
+
role: "target" | "source";
|
|
121
|
+
id: string;
|
|
122
|
+
eventId: string;
|
|
123
|
+
eventType: string;
|
|
124
|
+
outcome: string;
|
|
125
|
+
appUserId: string;
|
|
126
|
+
organizationId: string | null;
|
|
127
|
+
sourceOrganizationId: string | null;
|
|
128
|
+
store: string | null;
|
|
129
|
+
environment: string | null;
|
|
130
|
+
productId: string | null;
|
|
131
|
+
periodType: string | null;
|
|
132
|
+
transactionId: string | null;
|
|
133
|
+
originalTransactionId: string | null;
|
|
134
|
+
currency: string | null;
|
|
135
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
136
|
+
purchasedAt: string | null;
|
|
137
|
+
expirationAt: string | null;
|
|
138
|
+
eventTimestamp: string;
|
|
139
|
+
createdAt: string;
|
|
140
|
+
}, z.core.$ZodTypeInternals<{
|
|
141
|
+
role: "target" | "source";
|
|
142
|
+
id: string;
|
|
143
|
+
eventId: string;
|
|
144
|
+
eventType: string;
|
|
145
|
+
outcome: string;
|
|
146
|
+
appUserId: string;
|
|
147
|
+
organizationId: string | null;
|
|
148
|
+
sourceOrganizationId: string | null;
|
|
149
|
+
store: string | null;
|
|
150
|
+
environment: string | null;
|
|
151
|
+
productId: string | null;
|
|
152
|
+
periodType: string | null;
|
|
153
|
+
transactionId: string | null;
|
|
154
|
+
originalTransactionId: string | null;
|
|
155
|
+
currency: string | null;
|
|
156
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
157
|
+
purchasedAt: string | null;
|
|
158
|
+
expirationAt: string | null;
|
|
159
|
+
eventTimestamp: string;
|
|
160
|
+
createdAt: string;
|
|
161
|
+
}, {
|
|
162
|
+
role: "target" | "source";
|
|
163
|
+
id: string;
|
|
164
|
+
eventId: string;
|
|
165
|
+
eventType: string;
|
|
166
|
+
outcome: string;
|
|
167
|
+
appUserId: string;
|
|
168
|
+
organizationId: string | null;
|
|
169
|
+
sourceOrganizationId: string | null;
|
|
170
|
+
store: string | null;
|
|
171
|
+
environment: string | null;
|
|
172
|
+
productId: string | null;
|
|
173
|
+
periodType: string | null;
|
|
174
|
+
transactionId: string | null;
|
|
175
|
+
originalTransactionId: string | null;
|
|
176
|
+
currency: string | null;
|
|
177
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
178
|
+
purchasedAt: string | null;
|
|
179
|
+
expirationAt: string | null;
|
|
180
|
+
eventTimestamp: string;
|
|
181
|
+
createdAt: string;
|
|
182
|
+
}>>;
|
|
183
|
+
export type RootOrganizationRevenuecatEventResponse = z.infer<typeof RootOrganizationRevenuecatEventResponseSchema>;
|
|
184
|
+
export declare const RootOrganizationRevenuecatEventsResponseSchema: z.ZodType<{
|
|
185
|
+
events: {
|
|
186
|
+
role: "target" | "source";
|
|
187
|
+
id: string;
|
|
188
|
+
eventId: string;
|
|
189
|
+
eventType: string;
|
|
190
|
+
outcome: string;
|
|
191
|
+
appUserId: string;
|
|
192
|
+
organizationId: string | null;
|
|
193
|
+
sourceOrganizationId: string | null;
|
|
194
|
+
store: string | null;
|
|
195
|
+
environment: string | null;
|
|
196
|
+
productId: string | null;
|
|
197
|
+
periodType: string | null;
|
|
198
|
+
transactionId: string | null;
|
|
199
|
+
originalTransactionId: string | null;
|
|
200
|
+
currency: string | null;
|
|
201
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
202
|
+
purchasedAt: string | null;
|
|
203
|
+
expirationAt: string | null;
|
|
204
|
+
eventTimestamp: string;
|
|
205
|
+
createdAt: string;
|
|
206
|
+
}[];
|
|
207
|
+
nextCursor: string | null;
|
|
208
|
+
}, {
|
|
209
|
+
events: {
|
|
210
|
+
role: "target" | "source";
|
|
211
|
+
id: string;
|
|
212
|
+
eventId: string;
|
|
213
|
+
eventType: string;
|
|
214
|
+
outcome: string;
|
|
215
|
+
appUserId: string;
|
|
216
|
+
organizationId: string | null;
|
|
217
|
+
sourceOrganizationId: string | null;
|
|
218
|
+
store: string | null;
|
|
219
|
+
environment: string | null;
|
|
220
|
+
productId: string | null;
|
|
221
|
+
periodType: string | null;
|
|
222
|
+
transactionId: string | null;
|
|
223
|
+
originalTransactionId: string | null;
|
|
224
|
+
currency: string | null;
|
|
225
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
226
|
+
purchasedAt: string | null;
|
|
227
|
+
expirationAt: string | null;
|
|
228
|
+
eventTimestamp: string;
|
|
229
|
+
createdAt: string;
|
|
230
|
+
}[];
|
|
231
|
+
nextCursor: string | null;
|
|
232
|
+
}, z.core.$ZodTypeInternals<{
|
|
233
|
+
events: {
|
|
234
|
+
role: "target" | "source";
|
|
235
|
+
id: string;
|
|
236
|
+
eventId: string;
|
|
237
|
+
eventType: string;
|
|
238
|
+
outcome: string;
|
|
239
|
+
appUserId: string;
|
|
240
|
+
organizationId: string | null;
|
|
241
|
+
sourceOrganizationId: string | null;
|
|
242
|
+
store: string | null;
|
|
243
|
+
environment: string | null;
|
|
244
|
+
productId: string | null;
|
|
245
|
+
periodType: string | null;
|
|
246
|
+
transactionId: string | null;
|
|
247
|
+
originalTransactionId: string | null;
|
|
248
|
+
currency: string | null;
|
|
249
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
250
|
+
purchasedAt: string | null;
|
|
251
|
+
expirationAt: string | null;
|
|
252
|
+
eventTimestamp: string;
|
|
253
|
+
createdAt: string;
|
|
254
|
+
}[];
|
|
255
|
+
nextCursor: string | null;
|
|
256
|
+
}, {
|
|
257
|
+
events: {
|
|
258
|
+
role: "target" | "source";
|
|
259
|
+
id: string;
|
|
260
|
+
eventId: string;
|
|
261
|
+
eventType: string;
|
|
262
|
+
outcome: string;
|
|
263
|
+
appUserId: string;
|
|
264
|
+
organizationId: string | null;
|
|
265
|
+
sourceOrganizationId: string | null;
|
|
266
|
+
store: string | null;
|
|
267
|
+
environment: string | null;
|
|
268
|
+
productId: string | null;
|
|
269
|
+
periodType: string | null;
|
|
270
|
+
transactionId: string | null;
|
|
271
|
+
originalTransactionId: string | null;
|
|
272
|
+
currency: string | null;
|
|
273
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
274
|
+
purchasedAt: string | null;
|
|
275
|
+
expirationAt: string | null;
|
|
276
|
+
eventTimestamp: string;
|
|
277
|
+
createdAt: string;
|
|
278
|
+
}[];
|
|
279
|
+
nextCursor: string | null;
|
|
280
|
+
}>>;
|
|
281
|
+
export type RootOrganizationRevenuecatEventsResponse = z.infer<typeof RootOrganizationRevenuecatEventsResponseSchema>;
|
|
282
|
+
export declare const RootRevenuecatEventsReportResponseSchema: z.ZodType<{
|
|
283
|
+
events: {
|
|
284
|
+
id: string;
|
|
285
|
+
eventId: string;
|
|
286
|
+
eventType: string;
|
|
287
|
+
outcome: string;
|
|
288
|
+
appUserId: string;
|
|
289
|
+
organizationId: string | null;
|
|
290
|
+
sourceOrganizationId: string | null;
|
|
291
|
+
store: string | null;
|
|
292
|
+
environment: string | null;
|
|
293
|
+
productId: string | null;
|
|
294
|
+
periodType: string | null;
|
|
295
|
+
transactionId: string | null;
|
|
296
|
+
originalTransactionId: string | null;
|
|
297
|
+
currency: string | null;
|
|
298
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
299
|
+
purchasedAt: string | null;
|
|
300
|
+
expirationAt: string | null;
|
|
301
|
+
eventTimestamp: string;
|
|
302
|
+
createdAt: string;
|
|
303
|
+
}[];
|
|
304
|
+
nextCursor: string | null;
|
|
305
|
+
}, {
|
|
306
|
+
events: {
|
|
307
|
+
id: string;
|
|
308
|
+
eventId: string;
|
|
309
|
+
eventType: string;
|
|
310
|
+
outcome: string;
|
|
311
|
+
appUserId: string;
|
|
312
|
+
organizationId: string | null;
|
|
313
|
+
sourceOrganizationId: string | null;
|
|
314
|
+
store: string | null;
|
|
315
|
+
environment: string | null;
|
|
316
|
+
productId: string | null;
|
|
317
|
+
periodType: string | null;
|
|
318
|
+
transactionId: string | null;
|
|
319
|
+
originalTransactionId: string | null;
|
|
320
|
+
currency: string | null;
|
|
321
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
322
|
+
purchasedAt: string | null;
|
|
323
|
+
expirationAt: string | null;
|
|
324
|
+
eventTimestamp: string;
|
|
325
|
+
createdAt: string;
|
|
326
|
+
}[];
|
|
327
|
+
nextCursor: string | null;
|
|
328
|
+
}, z.core.$ZodTypeInternals<{
|
|
329
|
+
events: {
|
|
330
|
+
id: string;
|
|
331
|
+
eventId: string;
|
|
332
|
+
eventType: string;
|
|
333
|
+
outcome: string;
|
|
334
|
+
appUserId: string;
|
|
335
|
+
organizationId: string | null;
|
|
336
|
+
sourceOrganizationId: string | null;
|
|
337
|
+
store: string | null;
|
|
338
|
+
environment: string | null;
|
|
339
|
+
productId: string | null;
|
|
340
|
+
periodType: string | null;
|
|
341
|
+
transactionId: string | null;
|
|
342
|
+
originalTransactionId: string | null;
|
|
343
|
+
currency: string | null;
|
|
344
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
345
|
+
purchasedAt: string | null;
|
|
346
|
+
expirationAt: string | null;
|
|
347
|
+
eventTimestamp: string;
|
|
348
|
+
createdAt: string;
|
|
349
|
+
}[];
|
|
350
|
+
nextCursor: string | null;
|
|
351
|
+
}, {
|
|
352
|
+
events: {
|
|
353
|
+
id: string;
|
|
354
|
+
eventId: string;
|
|
355
|
+
eventType: string;
|
|
356
|
+
outcome: string;
|
|
357
|
+
appUserId: string;
|
|
358
|
+
organizationId: string | null;
|
|
359
|
+
sourceOrganizationId: string | null;
|
|
360
|
+
store: string | null;
|
|
361
|
+
environment: string | null;
|
|
362
|
+
productId: string | null;
|
|
363
|
+
periodType: string | null;
|
|
364
|
+
transactionId: string | null;
|
|
365
|
+
originalTransactionId: string | null;
|
|
366
|
+
currency: string | null;
|
|
367
|
+
priceInPurchasedCurrencyMinor: number | null;
|
|
368
|
+
purchasedAt: string | null;
|
|
369
|
+
expirationAt: string | null;
|
|
370
|
+
eventTimestamp: string;
|
|
371
|
+
createdAt: string;
|
|
372
|
+
}[];
|
|
373
|
+
nextCursor: string | null;
|
|
374
|
+
}>>;
|
|
375
|
+
export type RootRevenuecatEventsReportResponse = z.infer<typeof RootRevenuecatEventsReportResponseSchema>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { arraySchema, loosePlainObject, nonEmptyStringSchema, safeIntegerSchema, } from "../schema.js";
|
|
3
|
+
/**
|
|
4
|
+
* Which deliveries the RevenueCat report lists: ones that resolved to no
|
|
5
|
+
* organization, ones the handler deliberately ignored, or either.
|
|
6
|
+
*/
|
|
7
|
+
export const ROOT_REVENUECAT_DISPOSITIONS = [
|
|
8
|
+
"unmatched",
|
|
9
|
+
"ignored",
|
|
10
|
+
"both",
|
|
11
|
+
];
|
|
12
|
+
export const RootRevenuecatDispositionSchema = z.literal(ROOT_REVENUECAT_DISPOSITIONS);
|
|
13
|
+
const revenuecatEventShape = {
|
|
14
|
+
/** Server row id; it anchors the next page's cursor. */
|
|
15
|
+
id: nonEmptyStringSchema,
|
|
16
|
+
/** RevenueCat's own event id, as its dashboard shows it. */
|
|
17
|
+
eventId: nonEmptyStringSchema,
|
|
18
|
+
eventType: nonEmptyStringSchema,
|
|
19
|
+
/** How the webhook handler dispositioned the delivery. */
|
|
20
|
+
outcome: nonEmptyStringSchema,
|
|
21
|
+
/** RevenueCat App User ID; the client sets it to the buyer's user id. */
|
|
22
|
+
appUserId: z.string(),
|
|
23
|
+
/** Organization the event resolved to; null when none did. */
|
|
24
|
+
organizationId: nonEmptyStringSchema.nullable(),
|
|
25
|
+
/** Previous owner for a `TRANSFER`. */
|
|
26
|
+
sourceOrganizationId: nonEmptyStringSchema.nullable(),
|
|
27
|
+
store: z.string().nullable(),
|
|
28
|
+
environment: z.string().nullable(),
|
|
29
|
+
productId: z.string().nullable(),
|
|
30
|
+
periodType: z.string().nullable(),
|
|
31
|
+
transactionId: z.string().nullable(),
|
|
32
|
+
originalTransactionId: z.string().nullable(),
|
|
33
|
+
currency: z.string().nullable(),
|
|
34
|
+
/** Store transaction price in the currency's minor unit. */
|
|
35
|
+
priceInPurchasedCurrencyMinor: safeIntegerSchema.nullable(),
|
|
36
|
+
purchasedAt: z.string().nullable(),
|
|
37
|
+
expirationAt: z.string().nullable(),
|
|
38
|
+
/** Provider-reported event time; listings are newest first by it. */
|
|
39
|
+
eventTimestamp: z.string(),
|
|
40
|
+
/** When the server stored the delivery. */
|
|
41
|
+
createdAt: z.string(),
|
|
42
|
+
};
|
|
43
|
+
/** One stored RevenueCat webhook delivery. */
|
|
44
|
+
export const RootRevenuecatEventResponseSchema = loosePlainObject(revenuecatEventShape);
|
|
45
|
+
export const ROOT_REVENUECAT_EVENT_ROLES = ["target", "source"];
|
|
46
|
+
/**
|
|
47
|
+
* One delivery as an organization saw it: the organization it resolved to
|
|
48
|
+
* (`target`, whether the handler applied or ignored it), or the previous owner
|
|
49
|
+
* a `TRANSFER` moved the purchase from (`source`).
|
|
50
|
+
*/
|
|
51
|
+
export const RootOrganizationRevenuecatEventResponseSchema = loosePlainObject({
|
|
52
|
+
...revenuecatEventShape,
|
|
53
|
+
role: z.literal(ROOT_REVENUECAT_EVENT_ROLES),
|
|
54
|
+
});
|
|
55
|
+
export const RootOrganizationRevenuecatEventsResponseSchema = loosePlainObject({
|
|
56
|
+
events: arraySchema(RootOrganizationRevenuecatEventResponseSchema),
|
|
57
|
+
/** Opaque cursor for the next page; null when the listing is exhausted. */
|
|
58
|
+
nextCursor: z.string().nullable(),
|
|
59
|
+
});
|
|
60
|
+
export const RootRevenuecatEventsReportResponseSchema = loosePlainObject({
|
|
61
|
+
events: arraySchema(RootRevenuecatEventResponseSchema),
|
|
62
|
+
/** Opaque cursor for the next page; null when the listing is exhausted. */
|
|
63
|
+
nextCursor: z.string().nullable(),
|
|
64
|
+
});
|
|
65
|
+
//# 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,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AAEnB;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,WAAW;IACX,SAAS;IACT,MAAM;CACE,CAAC;AAEX,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,OAAO,CACtD,4BAA4B,CAC7B,CAAC;AAMF,MAAM,oBAAoB,GAAG;IAC3B,wDAAwD;IACxD,EAAE,EAAE,oBAAoB;IACxB,4DAA4D;IAC5D,OAAO,EAAE,oBAAoB;IAC7B,SAAS,EAAE,oBAAoB;IAC/B,0DAA0D;IAC1D,OAAO,EAAE,oBAAoB;IAC7B,yEAAyE;IACzE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,8DAA8D;IAC9D,cAAc,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IAC/C,uCAAuC;IACvC,oBAAoB,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IACrD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,4DAA4D;IAC5D,6BAA6B,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IAC3D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,qEAAqE;IACrE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,2CAA2C;IAC3C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC;AAEF,8CAA8C;AAC9C,MAAM,CAAC,MAAM,iCAAiC,GAC5C,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;AAMzC,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAEzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,6CAA6C,GAAG,gBAAgB,CAAC;IAC5E,GAAG,oBAAoB;IACvB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC;CAC7C,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,8CAA8C,GAAG,gBAAgB,CAAC;IAC7E,MAAM,EAAE,WAAW,CAAC,6CAA6C,CAAC;IAClE,2EAA2E;IAC3E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,wCAAwC,GAAG,gBAAgB,CAAC;IACvE,MAAM,EAAE,WAAW,CAAC,iCAAiC,CAAC;IACtD,2EAA2E;IAC3E,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC","sourcesContent":["import { z } from \"zod\";\nimport {\n arraySchema,\n loosePlainObject,\n nonEmptyStringSchema,\n safeIntegerSchema,\n} from \"../schema\";\n\n/**\n * Which deliveries the RevenueCat report lists: ones that resolved to no\n * organization, ones the handler deliberately ignored, or either.\n */\nexport const ROOT_REVENUECAT_DISPOSITIONS = [\n \"unmatched\",\n \"ignored\",\n \"both\",\n] as const;\n\nexport const RootRevenuecatDispositionSchema = z.literal(\n ROOT_REVENUECAT_DISPOSITIONS,\n);\n\nexport type RootRevenuecatDisposition = z.infer<\n typeof RootRevenuecatDispositionSchema\n>;\n\nconst revenuecatEventShape = {\n /** Server row id; it anchors the next page's cursor. */\n id: nonEmptyStringSchema,\n /** RevenueCat's own event id, as its dashboard shows it. */\n eventId: nonEmptyStringSchema,\n eventType: nonEmptyStringSchema,\n /** How the webhook handler dispositioned the delivery. */\n outcome: nonEmptyStringSchema,\n /** RevenueCat App User ID; the client sets it to the buyer's user id. */\n appUserId: z.string(),\n /** Organization the event resolved to; null when none did. */\n organizationId: nonEmptyStringSchema.nullable(),\n /** Previous owner for a `TRANSFER`. */\n sourceOrganizationId: nonEmptyStringSchema.nullable(),\n store: z.string().nullable(),\n environment: z.string().nullable(),\n productId: z.string().nullable(),\n periodType: z.string().nullable(),\n transactionId: z.string().nullable(),\n originalTransactionId: z.string().nullable(),\n currency: z.string().nullable(),\n /** Store transaction price in the currency's minor unit. */\n priceInPurchasedCurrencyMinor: safeIntegerSchema.nullable(),\n purchasedAt: z.string().nullable(),\n expirationAt: z.string().nullable(),\n /** Provider-reported event time; listings are newest first by it. */\n eventTimestamp: z.string(),\n /** When the server stored the delivery. */\n createdAt: z.string(),\n};\n\n/** One stored RevenueCat webhook delivery. */\nexport const RootRevenuecatEventResponseSchema =\n loosePlainObject(revenuecatEventShape);\n\nexport type RootRevenuecatEventResponse = z.infer<\n typeof RootRevenuecatEventResponseSchema\n>;\n\nexport const ROOT_REVENUECAT_EVENT_ROLES = [\"target\", \"source\"] as const;\n\n/**\n * One delivery as an organization saw it: the organization it resolved to\n * (`target`, whether the handler applied or ignored it), or the previous owner\n * a `TRANSFER` moved the purchase from (`source`).\n */\nexport const RootOrganizationRevenuecatEventResponseSchema = loosePlainObject({\n ...revenuecatEventShape,\n role: z.literal(ROOT_REVENUECAT_EVENT_ROLES),\n});\n\nexport type RootOrganizationRevenuecatEventResponse = z.infer<\n typeof RootOrganizationRevenuecatEventResponseSchema\n>;\n\nexport const RootOrganizationRevenuecatEventsResponseSchema = loosePlainObject({\n events: arraySchema(RootOrganizationRevenuecatEventResponseSchema),\n /** Opaque cursor for the next page; null when the listing is exhausted. */\n nextCursor: z.string().nullable(),\n});\n\nexport type RootOrganizationRevenuecatEventsResponse = z.infer<\n typeof RootOrganizationRevenuecatEventsResponseSchema\n>;\n\nexport const RootRevenuecatEventsReportResponseSchema = loosePlainObject({\n events: arraySchema(RootRevenuecatEventResponseSchema),\n /** Opaque cursor for the next page; null when the listing is exhausted. */\n nextCursor: z.string().nullable(),\n});\n\nexport type RootRevenuecatEventsReportResponse = z.infer<\n typeof RootRevenuecatEventsReportResponseSchema\n>;\n"]}
|
package/package.json
CHANGED
|
@@ -3,3 +3,5 @@ export { listRootDataUsageReport, loadRootOrganizationDataUsage, type RootDataUs
|
|
|
3
3
|
export { listRootIdentities, listRootIdentityOrganizations, loadRootIdentity, type RootIdentitiesApi, type RootIdentitiesPage, type RootIdentitiesQueryInput, type RootIdentity, type RootIdentityDetail, type RootIdentityOrganization, type RootIdentitySession, type RootRequestOutcome, } from "./identities.js";
|
|
4
4
|
export { loadRootOpsHealthReport, type RootOpsHealthApi, type RootOpsHealthReport, } from "./opsHealth.js";
|
|
5
5
|
export { listRootOrganizationIdentities, listRootOrganizations, loadRootOrganization, type RootOrganization, type RootOrganizationDetail, type RootOrganizationIdentitiesPage, type RootOrganizationIdentity, type RootOrganizationPageQueryInput, type RootOrganizationsApi, type RootOrganizationsPage, type RootOrganizationsQueryInput, } from "./organizations.js";
|
|
6
|
+
export { listRootOrganizationRevenuecatEvents, listRootRevenuecatEventsReport, type RootOrganizationRevenuecatEvent, type RootOrganizationRevenuecatEventsPage, type RootRevenuecatApi, type RootRevenuecatEvent, type RootRevenuecatEventsQueryInput, type RootRevenuecatEventsReportPage, type RootRevenuecatEventsReportQueryInput, } from "./revenuecat.js";
|
|
7
|
+
export { liftRootIdentitySuspension, type RootSuspensionApi, suspendRootIdentity, } from "./suspension.js";
|
package/workflows/root/index.js
CHANGED
|
@@ -3,4 +3,6 @@ export { listRootDataUsageReport, loadRootOrganizationDataUsage, } from "./dataU
|
|
|
3
3
|
export { listRootIdentities, listRootIdentityOrganizations, loadRootIdentity, } from "./identities.js";
|
|
4
4
|
export { loadRootOpsHealthReport, } from "./opsHealth.js";
|
|
5
5
|
export { listRootOrganizationIdentities, listRootOrganizations, loadRootOrganization, } from "./organizations.js";
|
|
6
|
+
export { listRootOrganizationRevenuecatEvents, listRootRevenuecatEventsReport, } from "./revenuecat.js";
|
|
7
|
+
export { liftRootIdentitySuspension, suspendRootIdentity, } from "./suspension.js";
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAKpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,uBAAuB,EACvB,6BAA6B,GAG9B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,gBAAgB,GASjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uBAAuB,GAGxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,GASrB,MAAM,iBAAiB,CAAC","sourcesContent":["export {\n listRootAuditEvents,\n type RootAuditApi,\n type RootAuditEvent,\n type RootAuditEventsPage,\n type RootAuditEventsQueryInput,\n} from \"./audit\";\nexport {\n listRootDataUsageReport,\n loadRootOrganizationDataUsage,\n type RootDataUsageApi,\n type RootDataUsageReportPage,\n} from \"./dataUsage\";\nexport {\n listRootIdentities,\n listRootIdentityOrganizations,\n loadRootIdentity,\n type RootIdentitiesApi,\n type RootIdentitiesPage,\n type RootIdentitiesQueryInput,\n type RootIdentity,\n type RootIdentityDetail,\n type RootIdentityOrganization,\n type RootIdentitySession,\n type RootRequestOutcome,\n} from \"./identities\";\nexport {\n loadRootOpsHealthReport,\n type RootOpsHealthApi,\n type RootOpsHealthReport,\n} from \"./opsHealth\";\nexport {\n listRootOrganizationIdentities,\n listRootOrganizations,\n loadRootOrganization,\n type RootOrganization,\n type RootOrganizationDetail,\n type RootOrganizationIdentitiesPage,\n type RootOrganizationIdentity,\n type RootOrganizationPageQueryInput,\n type RootOrganizationsApi,\n type RootOrganizationsPage,\n type RootOrganizationsQueryInput,\n} from \"./organizations\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,GAKpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,uBAAuB,EACvB,6BAA6B,GAG9B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kBAAkB,EAClB,6BAA6B,EAC7B,gBAAgB,GASjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,uBAAuB,GAGxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,8BAA8B,EAC9B,qBAAqB,EACrB,oBAAoB,GASrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,oCAAoC,EACpC,8BAA8B,GAQ/B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,0BAA0B,EAE1B,mBAAmB,GACpB,MAAM,cAAc,CAAC","sourcesContent":["export {\n listRootAuditEvents,\n type RootAuditApi,\n type RootAuditEvent,\n type RootAuditEventsPage,\n type RootAuditEventsQueryInput,\n} from \"./audit\";\nexport {\n listRootDataUsageReport,\n loadRootOrganizationDataUsage,\n type RootDataUsageApi,\n type RootDataUsageReportPage,\n} from \"./dataUsage\";\nexport {\n listRootIdentities,\n listRootIdentityOrganizations,\n loadRootIdentity,\n type RootIdentitiesApi,\n type RootIdentitiesPage,\n type RootIdentitiesQueryInput,\n type RootIdentity,\n type RootIdentityDetail,\n type RootIdentityOrganization,\n type RootIdentitySession,\n type RootRequestOutcome,\n} from \"./identities\";\nexport {\n loadRootOpsHealthReport,\n type RootOpsHealthApi,\n type RootOpsHealthReport,\n} from \"./opsHealth\";\nexport {\n listRootOrganizationIdentities,\n listRootOrganizations,\n loadRootOrganization,\n type RootOrganization,\n type RootOrganizationDetail,\n type RootOrganizationIdentitiesPage,\n type RootOrganizationIdentity,\n type RootOrganizationPageQueryInput,\n type RootOrganizationsApi,\n type RootOrganizationsPage,\n type RootOrganizationsQueryInput,\n} from \"./organizations\";\nexport {\n listRootOrganizationRevenuecatEvents,\n listRootRevenuecatEventsReport,\n type RootOrganizationRevenuecatEvent,\n type RootOrganizationRevenuecatEventsPage,\n type RootRevenuecatApi,\n type RootRevenuecatEvent,\n type RootRevenuecatEventsQueryInput,\n type RootRevenuecatEventsReportPage,\n type RootRevenuecatEventsReportQueryInput,\n} from \"./revenuecat\";\nexport {\n liftRootIdentitySuspension,\n type RootSuspensionApi,\n suspendRootIdentity,\n} from \"./suspension\";\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RequestResult } from "../../internal/api-client/index.js";
|
|
2
|
+
import type { RootRevenuecatEventsQuery, RootRevenuecatEventsReportQuery } from "../../internal/validators/operation/index.js";
|
|
3
|
+
import type { RootOrganizationRevenuecatEventResponse, RootOrganizationRevenuecatEventsResponse, RootRevenuecatEventResponse, RootRevenuecatEventsReportResponse } from "../../internal/validators/response/index.js";
|
|
4
|
+
import { type RootRequestOutcome } from "./identities.js";
|
|
5
|
+
/** One stored RevenueCat webhook delivery (wire shape). */
|
|
6
|
+
export type RootRevenuecatEvent = RootRevenuecatEventResponse;
|
|
7
|
+
/** A delivery as one organization saw it: resolved to it, or moved from it. */
|
|
8
|
+
export type RootOrganizationRevenuecatEvent = RootOrganizationRevenuecatEventResponse;
|
|
9
|
+
/** A page of an organization's deliveries, newest first. */
|
|
10
|
+
export type RootOrganizationRevenuecatEventsPage = RootOrganizationRevenuecatEventsResponse;
|
|
11
|
+
/** A page of unmatched or ignored deliveries, newest first. */
|
|
12
|
+
export type RootRevenuecatEventsReportPage = RootRevenuecatEventsReportResponse;
|
|
13
|
+
export type RootRevenuecatEventsQueryInput = RootRevenuecatEventsQuery;
|
|
14
|
+
/** Paging and which dispositions to list (both when omitted). */
|
|
15
|
+
export type RootRevenuecatEventsReportQueryInput = RootRevenuecatEventsReportQuery;
|
|
16
|
+
export interface RootRevenuecatApi {
|
|
17
|
+
listRootOrganizationRevenuecatEventsResult(organizationId: string, query?: RootRevenuecatEventsQuery): Promise<RequestResult<RootOrganizationRevenuecatEventsResponse>>;
|
|
18
|
+
listRootRevenuecatEventsReportResult(query?: RootRevenuecatEventsReportQuery): Promise<RequestResult<RootRevenuecatEventsReportResponse>>;
|
|
19
|
+
}
|
|
20
|
+
export declare function listRootOrganizationRevenuecatEvents(api: RootRevenuecatApi, organizationId: string, query?: RootRevenuecatEventsQueryInput): Promise<RootRequestOutcome<RootOrganizationRevenuecatEventsPage>>;
|
|
21
|
+
export declare function listRootRevenuecatEventsReport(api: RootRevenuecatApi, query?: RootRevenuecatEventsReportQueryInput): Promise<RootRequestOutcome<RootRevenuecatEventsReportPage>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { toOutcome } from "./identities.js";
|
|
2
|
+
export async function listRootOrganizationRevenuecatEvents(api, organizationId, query = {}) {
|
|
3
|
+
return toOutcome(await api.listRootOrganizationRevenuecatEventsResult(organizationId, query));
|
|
4
|
+
}
|
|
5
|
+
export async function listRootRevenuecatEventsReport(api, query = {}) {
|
|
6
|
+
return toOutcome(await api.listRootRevenuecatEventsReportResult(query));
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=revenuecat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revenuecat.js","sourceRoot":"","sources":["revenuecat.ts"],"names":[],"mappings":"AAWA,OAAO,EAA2B,SAAS,EAAE,MAAM,cAAc,CAAC;AAgClE,MAAM,CAAC,KAAK,UAAU,oCAAoC,CACxD,GAAsB,EACtB,cAAsB,EACtB,QAAwC,EAAE;IAE1C,OAAO,SAAS,CACd,MAAM,GAAG,CAAC,0CAA0C,CAAC,cAAc,EAAE,KAAK,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,GAAsB,EACtB,QAA8C,EAAE;IAEhD,OAAO,SAAS,CAAC,MAAM,GAAG,CAAC,oCAAoC,CAAC,KAAK,CAAC,CAAC,CAAC;AAC1E,CAAC","sourcesContent":["import type { RequestResult } from \"@tearleads/api-client\";\nimport type {\n RootRevenuecatEventsQuery,\n RootRevenuecatEventsReportQuery,\n} from \"@tearleads/validators/operation\";\nimport type {\n RootOrganizationRevenuecatEventResponse,\n RootOrganizationRevenuecatEventsResponse,\n RootRevenuecatEventResponse,\n RootRevenuecatEventsReportResponse,\n} from \"@tearleads/validators/response\";\nimport { type RootRequestOutcome, toOutcome } from \"./identities\";\n\n/** One stored RevenueCat webhook delivery (wire shape). */\nexport type RootRevenuecatEvent = RootRevenuecatEventResponse;\n\n/** A delivery as one organization saw it: resolved to it, or moved from it. */\nexport type RootOrganizationRevenuecatEvent =\n RootOrganizationRevenuecatEventResponse;\n\n/** A page of an organization's deliveries, newest first. */\nexport type RootOrganizationRevenuecatEventsPage =\n RootOrganizationRevenuecatEventsResponse;\n\n/** A page of unmatched or ignored deliveries, newest first. */\nexport type RootRevenuecatEventsReportPage = RootRevenuecatEventsReportResponse;\n\nexport type RootRevenuecatEventsQueryInput = RootRevenuecatEventsQuery;\n\n/** Paging and which dispositions to list (both when omitted). */\nexport type RootRevenuecatEventsReportQueryInput =\n RootRevenuecatEventsReportQuery;\n\nexport interface RootRevenuecatApi {\n listRootOrganizationRevenuecatEventsResult(\n organizationId: string,\n query?: RootRevenuecatEventsQuery,\n ): Promise<RequestResult<RootOrganizationRevenuecatEventsResponse>>;\n listRootRevenuecatEventsReportResult(\n query?: RootRevenuecatEventsReportQuery,\n ): Promise<RequestResult<RootRevenuecatEventsReportResponse>>;\n}\n\nexport async function listRootOrganizationRevenuecatEvents(\n api: RootRevenuecatApi,\n organizationId: string,\n query: RootRevenuecatEventsQueryInput = {},\n): Promise<RootRequestOutcome<RootOrganizationRevenuecatEventsPage>> {\n return toOutcome(\n await api.listRootOrganizationRevenuecatEventsResult(organizationId, query),\n );\n}\n\nexport async function listRootRevenuecatEventsReport(\n api: RootRevenuecatApi,\n query: RootRevenuecatEventsReportQueryInput = {},\n): Promise<RootRequestOutcome<RootRevenuecatEventsReportPage>> {\n return toOutcome(await api.listRootRevenuecatEventsReportResult(query));\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RequestResult } from "../../internal/api-client/index.js";
|
|
2
|
+
import type { RootIdentitySuspensionResponse } from "../../internal/validators/response/index.js";
|
|
3
|
+
import { type RootIdentity, type RootRequestOutcome } from "./identities.js";
|
|
4
|
+
export interface RootSuspensionApi {
|
|
5
|
+
liftRootIdentitySuspensionResult(userId: string): Promise<RequestResult<RootIdentitySuspensionResponse>>;
|
|
6
|
+
suspendRootIdentityResult(userId: string): Promise<RequestResult<RootIdentitySuspensionResponse>>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Signs the identity out of every device and refuses its sign-in until the
|
|
10
|
+
* suspension is lifted. Root identities are refused with status 409.
|
|
11
|
+
*/
|
|
12
|
+
export declare function suspendRootIdentity(api: RootSuspensionApi, userId: string): Promise<RootRequestOutcome<RootIdentity>>;
|
|
13
|
+
export declare function liftRootIdentitySuspension(api: RootSuspensionApi, userId: string): Promise<RootRequestOutcome<RootIdentity>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { toOutcome, } from "./identities.js";
|
|
2
|
+
function identityOutcome(result) {
|
|
3
|
+
return result.ok
|
|
4
|
+
? { data: result.data.identity, ok: true }
|
|
5
|
+
: toOutcome(result);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Signs the identity out of every device and refuses its sign-in until the
|
|
9
|
+
* suspension is lifted. Root identities are refused with status 409.
|
|
10
|
+
*/
|
|
11
|
+
export async function suspendRootIdentity(api, userId) {
|
|
12
|
+
return identityOutcome(await api.suspendRootIdentityResult(userId));
|
|
13
|
+
}
|
|
14
|
+
export async function liftRootIdentitySuspension(api, userId) {
|
|
15
|
+
return identityOutcome(await api.liftRootIdentitySuspensionResult(userId));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=suspension.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suspension.js","sourceRoot":"","sources":["suspension.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,GACV,MAAM,cAAc,CAAC;AAWtB,SAAS,eAAe,CACtB,MAAqD;IAErD,OAAO,MAAM,CAAC,EAAE;QACd,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE;QAC1C,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AACxB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,GAAsB,EACtB,MAAc;IAEd,OAAO,eAAe,CAAC,MAAM,GAAG,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,GAAsB,EACtB,MAAc;IAEd,OAAO,eAAe,CAAC,MAAM,GAAG,CAAC,gCAAgC,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7E,CAAC","sourcesContent":["import type { RequestResult } from \"@tearleads/api-client\";\nimport type { RootIdentitySuspensionResponse } from \"@tearleads/validators/response\";\nimport {\n type RootIdentity,\n type RootRequestOutcome,\n toOutcome,\n} from \"./identities\";\n\nexport interface RootSuspensionApi {\n liftRootIdentitySuspensionResult(\n userId: string,\n ): Promise<RequestResult<RootIdentitySuspensionResponse>>;\n suspendRootIdentityResult(\n userId: string,\n ): Promise<RequestResult<RootIdentitySuspensionResponse>>;\n}\n\nfunction identityOutcome(\n result: RequestResult<RootIdentitySuspensionResponse>,\n): RootRequestOutcome<RootIdentity> {\n return result.ok\n ? { data: result.data.identity, ok: true }\n : toOutcome(result);\n}\n\n/**\n * Signs the identity out of every device and refuses its sign-in until the\n * suspension is lifted. Root identities are refused with status 409.\n */\nexport async function suspendRootIdentity(\n api: RootSuspensionApi,\n userId: string,\n): Promise<RootRequestOutcome<RootIdentity>> {\n return identityOutcome(await api.suspendRootIdentityResult(userId));\n}\n\nexport async function liftRootIdentitySuspension(\n api: RootSuspensionApi,\n userId: string,\n): Promise<RootRequestOutcome<RootIdentity>> {\n return identityOutcome(await api.liftRootIdentitySuspensionResult(userId));\n}\n"]}
|