@nikthegeek/dreamsforlittles-shared 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access.d.ts +1342 -0
- package/dist/access.js +115 -0
- package/dist/access.js.map +1 -0
- package/dist/admin.d.ts +1689 -0
- package/dist/admin.js +97 -0
- package/dist/admin.js.map +1 -0
- package/dist/allergy-ladders.d.ts +798 -0
- package/dist/allergy-ladders.js +158 -0
- package/dist/allergy-ladders.js.map +1 -0
- package/dist/analysis.d.ts +397 -0
- package/dist/analysis.js +15 -0
- package/dist/analysis.js.map +1 -0
- package/dist/api.d.ts +42 -0
- package/dist/api.js +12 -0
- package/dist/api.js.map +1 -0
- package/dist/auth.d.ts +212 -0
- package/dist/auth.js +19 -0
- package/dist/auth.js.map +1 -0
- package/dist/billing.d.ts +18 -0
- package/dist/billing.js +60 -0
- package/dist/billing.js.map +1 -0
- package/dist/coach.d.ts +511 -0
- package/dist/coach.js +43 -0
- package/dist/coach.js.map +1 -0
- package/dist/enums.d.ts +28 -0
- package/dist/enums.js +89 -0
- package/dist/enums.js.map +1 -0
- package/dist/errors.d.ts +31 -0
- package/dist/errors.js +46 -0
- package/dist/errors.js.map +1 -0
- package/dist/family.d.ts +2428 -0
- package/dist/family.js +192 -0
- package/dist/family.js.map +1 -0
- package/dist/files.d.ts +98 -0
- package/dist/files.js +31 -0
- package/dist/files.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/invites.d.ts +284 -0
- package/dist/invites.js +35 -0
- package/dist/invites.js.map +1 -0
- package/package.json +28 -0
package/dist/coach.d.ts
ADDED
|
@@ -0,0 +1,511 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const createCoachInviteCodeRequestSchema: z.ZodObject<{
|
|
3
|
+
code: z.ZodOptional<z.ZodString>;
|
|
4
|
+
maxUses: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
maxUses: number;
|
|
8
|
+
code?: string | undefined;
|
|
9
|
+
expiresAt?: string | null | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
code?: string | undefined;
|
|
12
|
+
expiresAt?: string | null | undefined;
|
|
13
|
+
maxUses?: number | undefined;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const coachInviteCodesResponseSchema: z.ZodObject<{
|
|
16
|
+
inviteCodes: z.ZodArray<z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
code: z.ZodString;
|
|
19
|
+
organizationId: z.ZodString;
|
|
20
|
+
coachUserId: z.ZodString;
|
|
21
|
+
status: z.ZodEnum<["active", "paused", "expired", "revoked"]>;
|
|
22
|
+
maxUses: z.ZodNumber;
|
|
23
|
+
usedCount: z.ZodNumber;
|
|
24
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
25
|
+
createdBy: z.ZodString;
|
|
26
|
+
createdAt: z.ZodString;
|
|
27
|
+
updatedAt: z.ZodString;
|
|
28
|
+
lastRedeemedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
code: string;
|
|
31
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
32
|
+
id: string;
|
|
33
|
+
organizationId: string;
|
|
34
|
+
coachUserId: string;
|
|
35
|
+
createdAt: string;
|
|
36
|
+
maxUses: number;
|
|
37
|
+
usedCount: number;
|
|
38
|
+
createdBy: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
expiresAt?: string | null | undefined;
|
|
41
|
+
lastRedeemedAt?: string | null | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
code: string;
|
|
44
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
45
|
+
id: string;
|
|
46
|
+
organizationId: string;
|
|
47
|
+
coachUserId: string;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
maxUses: number;
|
|
50
|
+
usedCount: number;
|
|
51
|
+
createdBy: string;
|
|
52
|
+
updatedAt: string;
|
|
53
|
+
expiresAt?: string | null | undefined;
|
|
54
|
+
lastRedeemedAt?: string | null | undefined;
|
|
55
|
+
}>, "many">;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
inviteCodes: {
|
|
58
|
+
code: string;
|
|
59
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
60
|
+
id: string;
|
|
61
|
+
organizationId: string;
|
|
62
|
+
coachUserId: string;
|
|
63
|
+
createdAt: string;
|
|
64
|
+
maxUses: number;
|
|
65
|
+
usedCount: number;
|
|
66
|
+
createdBy: string;
|
|
67
|
+
updatedAt: string;
|
|
68
|
+
expiresAt?: string | null | undefined;
|
|
69
|
+
lastRedeemedAt?: string | null | undefined;
|
|
70
|
+
}[];
|
|
71
|
+
}, {
|
|
72
|
+
inviteCodes: {
|
|
73
|
+
code: string;
|
|
74
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
75
|
+
id: string;
|
|
76
|
+
organizationId: string;
|
|
77
|
+
coachUserId: string;
|
|
78
|
+
createdAt: string;
|
|
79
|
+
maxUses: number;
|
|
80
|
+
usedCount: number;
|
|
81
|
+
createdBy: string;
|
|
82
|
+
updatedAt: string;
|
|
83
|
+
expiresAt?: string | null | undefined;
|
|
84
|
+
lastRedeemedAt?: string | null | undefined;
|
|
85
|
+
}[];
|
|
86
|
+
}>;
|
|
87
|
+
export declare const coachInviteCodeResponseSchema: z.ZodObject<{
|
|
88
|
+
inviteCode: z.ZodObject<{
|
|
89
|
+
id: z.ZodString;
|
|
90
|
+
code: z.ZodString;
|
|
91
|
+
organizationId: z.ZodString;
|
|
92
|
+
coachUserId: z.ZodString;
|
|
93
|
+
status: z.ZodEnum<["active", "paused", "expired", "revoked"]>;
|
|
94
|
+
maxUses: z.ZodNumber;
|
|
95
|
+
usedCount: z.ZodNumber;
|
|
96
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
97
|
+
createdBy: z.ZodString;
|
|
98
|
+
createdAt: z.ZodString;
|
|
99
|
+
updatedAt: z.ZodString;
|
|
100
|
+
lastRedeemedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
code: string;
|
|
103
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
104
|
+
id: string;
|
|
105
|
+
organizationId: string;
|
|
106
|
+
coachUserId: string;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
maxUses: number;
|
|
109
|
+
usedCount: number;
|
|
110
|
+
createdBy: string;
|
|
111
|
+
updatedAt: string;
|
|
112
|
+
expiresAt?: string | null | undefined;
|
|
113
|
+
lastRedeemedAt?: string | null | undefined;
|
|
114
|
+
}, {
|
|
115
|
+
code: string;
|
|
116
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
117
|
+
id: string;
|
|
118
|
+
organizationId: string;
|
|
119
|
+
coachUserId: string;
|
|
120
|
+
createdAt: string;
|
|
121
|
+
maxUses: number;
|
|
122
|
+
usedCount: number;
|
|
123
|
+
createdBy: string;
|
|
124
|
+
updatedAt: string;
|
|
125
|
+
expiresAt?: string | null | undefined;
|
|
126
|
+
lastRedeemedAt?: string | null | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
}, "strip", z.ZodTypeAny, {
|
|
129
|
+
inviteCode: {
|
|
130
|
+
code: string;
|
|
131
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
132
|
+
id: string;
|
|
133
|
+
organizationId: string;
|
|
134
|
+
coachUserId: string;
|
|
135
|
+
createdAt: string;
|
|
136
|
+
maxUses: number;
|
|
137
|
+
usedCount: number;
|
|
138
|
+
createdBy: string;
|
|
139
|
+
updatedAt: string;
|
|
140
|
+
expiresAt?: string | null | undefined;
|
|
141
|
+
lastRedeemedAt?: string | null | undefined;
|
|
142
|
+
};
|
|
143
|
+
}, {
|
|
144
|
+
inviteCode: {
|
|
145
|
+
code: string;
|
|
146
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
147
|
+
id: string;
|
|
148
|
+
organizationId: string;
|
|
149
|
+
coachUserId: string;
|
|
150
|
+
createdAt: string;
|
|
151
|
+
maxUses: number;
|
|
152
|
+
usedCount: number;
|
|
153
|
+
createdBy: string;
|
|
154
|
+
updatedAt: string;
|
|
155
|
+
expiresAt?: string | null | undefined;
|
|
156
|
+
lastRedeemedAt?: string | null | undefined;
|
|
157
|
+
};
|
|
158
|
+
}>;
|
|
159
|
+
export declare const updateCoachInviteCodeRequestSchema: z.ZodObject<{
|
|
160
|
+
status: z.ZodOptional<z.ZodEnum<["active", "paused", "expired", "revoked"]>>;
|
|
161
|
+
maxUses: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
status?: "active" | "revoked" | "expired" | "paused" | undefined;
|
|
165
|
+
expiresAt?: string | null | undefined;
|
|
166
|
+
maxUses?: number | undefined;
|
|
167
|
+
}, {
|
|
168
|
+
status?: "active" | "revoked" | "expired" | "paused" | undefined;
|
|
169
|
+
expiresAt?: string | null | undefined;
|
|
170
|
+
maxUses?: number | undefined;
|
|
171
|
+
}>;
|
|
172
|
+
export declare const coachRevokeFamilyAccessResponseSchema: z.ZodObject<{
|
|
173
|
+
assignment: z.ZodObject<{
|
|
174
|
+
id: z.ZodString;
|
|
175
|
+
status: z.ZodEnum<["active", "revoked", "transferred", "expired"]>;
|
|
176
|
+
organizationId: z.ZodString;
|
|
177
|
+
coachUserId: z.ZodString;
|
|
178
|
+
familyUserId: z.ZodOptional<z.ZodString>;
|
|
179
|
+
canViewLogs: z.ZodBoolean;
|
|
180
|
+
canEditLogs: z.ZodBoolean;
|
|
181
|
+
canViewAnalysis: z.ZodBoolean;
|
|
182
|
+
revokedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
183
|
+
}, "strip", z.ZodTypeAny, {
|
|
184
|
+
status: "active" | "revoked" | "transferred" | "expired";
|
|
185
|
+
id: string;
|
|
186
|
+
canViewAnalysis: boolean;
|
|
187
|
+
organizationId: string;
|
|
188
|
+
coachUserId: string;
|
|
189
|
+
canViewLogs: boolean;
|
|
190
|
+
canEditLogs: boolean;
|
|
191
|
+
familyUserId?: string | undefined;
|
|
192
|
+
revokedAt?: string | null | undefined;
|
|
193
|
+
}, {
|
|
194
|
+
status: "active" | "revoked" | "transferred" | "expired";
|
|
195
|
+
id: string;
|
|
196
|
+
canViewAnalysis: boolean;
|
|
197
|
+
organizationId: string;
|
|
198
|
+
coachUserId: string;
|
|
199
|
+
canViewLogs: boolean;
|
|
200
|
+
canEditLogs: boolean;
|
|
201
|
+
familyUserId?: string | undefined;
|
|
202
|
+
revokedAt?: string | null | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
organization: z.ZodObject<{
|
|
205
|
+
id: z.ZodString;
|
|
206
|
+
name: z.ZodString;
|
|
207
|
+
type: z.ZodEnum<["platformPractice", "independentCoach", "multiCoachPractice", "academy", "partner"]>;
|
|
208
|
+
status: z.ZodEnum<["active", "trialing", "pastDue", "suspended", "archived"]>;
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
210
|
+
type: "platformPractice" | "independentCoach" | "multiCoachPractice" | "academy" | "partner";
|
|
211
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "archived";
|
|
212
|
+
id: string;
|
|
213
|
+
name: string;
|
|
214
|
+
}, {
|
|
215
|
+
type: "platformPractice" | "independentCoach" | "multiCoachPractice" | "academy" | "partner";
|
|
216
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "archived";
|
|
217
|
+
id: string;
|
|
218
|
+
name: string;
|
|
219
|
+
}>;
|
|
220
|
+
premium: z.ZodObject<{
|
|
221
|
+
active: z.ZodBoolean;
|
|
222
|
+
source: z.ZodOptional<z.ZodEnum<["directSubscription", "platformPractice", "coachInvite", "manualComp"]>>;
|
|
223
|
+
entitlementId: z.ZodOptional<z.ZodString>;
|
|
224
|
+
organizationId: z.ZodOptional<z.ZodString>;
|
|
225
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
226
|
+
disabledReason: z.ZodEnum<["none", "expired", "revoked", "billingInactive", "suspendedOrganization", "noEntitlement"]>;
|
|
227
|
+
}, "strip", z.ZodTypeAny, {
|
|
228
|
+
active: boolean;
|
|
229
|
+
disabledReason: "revoked" | "expired" | "none" | "billingInactive" | "suspendedOrganization" | "noEntitlement";
|
|
230
|
+
organizationId?: string | undefined;
|
|
231
|
+
source?: "platformPractice" | "directSubscription" | "coachInvite" | "manualComp" | undefined;
|
|
232
|
+
entitlementId?: string | undefined;
|
|
233
|
+
expiresAt?: string | null | undefined;
|
|
234
|
+
}, {
|
|
235
|
+
active: boolean;
|
|
236
|
+
disabledReason: "revoked" | "expired" | "none" | "billingInactive" | "suspendedOrganization" | "noEntitlement";
|
|
237
|
+
organizationId?: string | undefined;
|
|
238
|
+
source?: "platformPractice" | "directSubscription" | "coachInvite" | "manualComp" | undefined;
|
|
239
|
+
entitlementId?: string | undefined;
|
|
240
|
+
expiresAt?: string | null | undefined;
|
|
241
|
+
}>;
|
|
242
|
+
}, "strip", z.ZodTypeAny, {
|
|
243
|
+
assignment: {
|
|
244
|
+
status: "active" | "revoked" | "transferred" | "expired";
|
|
245
|
+
id: string;
|
|
246
|
+
canViewAnalysis: boolean;
|
|
247
|
+
organizationId: string;
|
|
248
|
+
coachUserId: string;
|
|
249
|
+
canViewLogs: boolean;
|
|
250
|
+
canEditLogs: boolean;
|
|
251
|
+
familyUserId?: string | undefined;
|
|
252
|
+
revokedAt?: string | null | undefined;
|
|
253
|
+
};
|
|
254
|
+
organization: {
|
|
255
|
+
type: "platformPractice" | "independentCoach" | "multiCoachPractice" | "academy" | "partner";
|
|
256
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "archived";
|
|
257
|
+
id: string;
|
|
258
|
+
name: string;
|
|
259
|
+
};
|
|
260
|
+
premium: {
|
|
261
|
+
active: boolean;
|
|
262
|
+
disabledReason: "revoked" | "expired" | "none" | "billingInactive" | "suspendedOrganization" | "noEntitlement";
|
|
263
|
+
organizationId?: string | undefined;
|
|
264
|
+
source?: "platformPractice" | "directSubscription" | "coachInvite" | "manualComp" | undefined;
|
|
265
|
+
entitlementId?: string | undefined;
|
|
266
|
+
expiresAt?: string | null | undefined;
|
|
267
|
+
};
|
|
268
|
+
}, {
|
|
269
|
+
assignment: {
|
|
270
|
+
status: "active" | "revoked" | "transferred" | "expired";
|
|
271
|
+
id: string;
|
|
272
|
+
canViewAnalysis: boolean;
|
|
273
|
+
organizationId: string;
|
|
274
|
+
coachUserId: string;
|
|
275
|
+
canViewLogs: boolean;
|
|
276
|
+
canEditLogs: boolean;
|
|
277
|
+
familyUserId?: string | undefined;
|
|
278
|
+
revokedAt?: string | null | undefined;
|
|
279
|
+
};
|
|
280
|
+
organization: {
|
|
281
|
+
type: "platformPractice" | "independentCoach" | "multiCoachPractice" | "academy" | "partner";
|
|
282
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "archived";
|
|
283
|
+
id: string;
|
|
284
|
+
name: string;
|
|
285
|
+
};
|
|
286
|
+
premium: {
|
|
287
|
+
active: boolean;
|
|
288
|
+
disabledReason: "revoked" | "expired" | "none" | "billingInactive" | "suspendedOrganization" | "noEntitlement";
|
|
289
|
+
organizationId?: string | undefined;
|
|
290
|
+
source?: "platformPractice" | "directSubscription" | "coachInvite" | "manualComp" | undefined;
|
|
291
|
+
entitlementId?: string | undefined;
|
|
292
|
+
expiresAt?: string | null | undefined;
|
|
293
|
+
};
|
|
294
|
+
}>;
|
|
295
|
+
export declare const coachRevokeInviteCodeAccessResponseSchema: z.ZodObject<{
|
|
296
|
+
inviteCode: z.ZodObject<{
|
|
297
|
+
id: z.ZodString;
|
|
298
|
+
code: z.ZodString;
|
|
299
|
+
organizationId: z.ZodString;
|
|
300
|
+
coachUserId: z.ZodString;
|
|
301
|
+
status: z.ZodEnum<["active", "paused", "expired", "revoked"]>;
|
|
302
|
+
maxUses: z.ZodNumber;
|
|
303
|
+
usedCount: z.ZodNumber;
|
|
304
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
305
|
+
createdBy: z.ZodString;
|
|
306
|
+
createdAt: z.ZodString;
|
|
307
|
+
updatedAt: z.ZodString;
|
|
308
|
+
lastRedeemedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
309
|
+
}, "strip", z.ZodTypeAny, {
|
|
310
|
+
code: string;
|
|
311
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
312
|
+
id: string;
|
|
313
|
+
organizationId: string;
|
|
314
|
+
coachUserId: string;
|
|
315
|
+
createdAt: string;
|
|
316
|
+
maxUses: number;
|
|
317
|
+
usedCount: number;
|
|
318
|
+
createdBy: string;
|
|
319
|
+
updatedAt: string;
|
|
320
|
+
expiresAt?: string | null | undefined;
|
|
321
|
+
lastRedeemedAt?: string | null | undefined;
|
|
322
|
+
}, {
|
|
323
|
+
code: string;
|
|
324
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
325
|
+
id: string;
|
|
326
|
+
organizationId: string;
|
|
327
|
+
coachUserId: string;
|
|
328
|
+
createdAt: string;
|
|
329
|
+
maxUses: number;
|
|
330
|
+
usedCount: number;
|
|
331
|
+
createdBy: string;
|
|
332
|
+
updatedAt: string;
|
|
333
|
+
expiresAt?: string | null | undefined;
|
|
334
|
+
lastRedeemedAt?: string | null | undefined;
|
|
335
|
+
}>;
|
|
336
|
+
affectedFamilies: z.ZodArray<z.ZodObject<{
|
|
337
|
+
familyUserId: z.ZodString;
|
|
338
|
+
familyName: z.ZodString;
|
|
339
|
+
}, "strip", z.ZodTypeAny, {
|
|
340
|
+
familyUserId: string;
|
|
341
|
+
familyName: string;
|
|
342
|
+
}, {
|
|
343
|
+
familyUserId: string;
|
|
344
|
+
familyName: string;
|
|
345
|
+
}>, "many">;
|
|
346
|
+
}, "strip", z.ZodTypeAny, {
|
|
347
|
+
inviteCode: {
|
|
348
|
+
code: string;
|
|
349
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
350
|
+
id: string;
|
|
351
|
+
organizationId: string;
|
|
352
|
+
coachUserId: string;
|
|
353
|
+
createdAt: string;
|
|
354
|
+
maxUses: number;
|
|
355
|
+
usedCount: number;
|
|
356
|
+
createdBy: string;
|
|
357
|
+
updatedAt: string;
|
|
358
|
+
expiresAt?: string | null | undefined;
|
|
359
|
+
lastRedeemedAt?: string | null | undefined;
|
|
360
|
+
};
|
|
361
|
+
affectedFamilies: {
|
|
362
|
+
familyUserId: string;
|
|
363
|
+
familyName: string;
|
|
364
|
+
}[];
|
|
365
|
+
}, {
|
|
366
|
+
inviteCode: {
|
|
367
|
+
code: string;
|
|
368
|
+
status: "active" | "revoked" | "expired" | "paused";
|
|
369
|
+
id: string;
|
|
370
|
+
organizationId: string;
|
|
371
|
+
coachUserId: string;
|
|
372
|
+
createdAt: string;
|
|
373
|
+
maxUses: number;
|
|
374
|
+
usedCount: number;
|
|
375
|
+
createdBy: string;
|
|
376
|
+
updatedAt: string;
|
|
377
|
+
expiresAt?: string | null | undefined;
|
|
378
|
+
lastRedeemedAt?: string | null | undefined;
|
|
379
|
+
};
|
|
380
|
+
affectedFamilies: {
|
|
381
|
+
familyUserId: string;
|
|
382
|
+
familyName: string;
|
|
383
|
+
}[];
|
|
384
|
+
}>;
|
|
385
|
+
export declare const coachSubscriptionProviderSchema: z.ZodEnum<["manual", "stripe", "invoice"]>;
|
|
386
|
+
export declare const coachSubscriptionSummarySchema: z.ZodObject<{
|
|
387
|
+
id: z.ZodString;
|
|
388
|
+
organizationId: z.ZodString;
|
|
389
|
+
coachUserId: z.ZodString;
|
|
390
|
+
provider: z.ZodEnum<["manual", "stripe", "invoice"]>;
|
|
391
|
+
status: z.ZodEnum<["active", "trialing", "pastDue", "canceled", "suspended"]>;
|
|
392
|
+
maxFamilies: z.ZodNumber;
|
|
393
|
+
updatedAt: z.ZodString;
|
|
394
|
+
}, "strip", z.ZodTypeAny, {
|
|
395
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "canceled";
|
|
396
|
+
id: string;
|
|
397
|
+
organizationId: string;
|
|
398
|
+
coachUserId: string;
|
|
399
|
+
maxFamilies: number;
|
|
400
|
+
updatedAt: string;
|
|
401
|
+
provider: "manual" | "stripe" | "invoice";
|
|
402
|
+
}, {
|
|
403
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "canceled";
|
|
404
|
+
id: string;
|
|
405
|
+
organizationId: string;
|
|
406
|
+
coachUserId: string;
|
|
407
|
+
maxFamilies: number;
|
|
408
|
+
updatedAt: string;
|
|
409
|
+
provider: "manual" | "stripe" | "invoice";
|
|
410
|
+
}>;
|
|
411
|
+
export declare const coachSubscriptionStatusResponseSchema: z.ZodObject<{
|
|
412
|
+
organization: z.ZodObject<{
|
|
413
|
+
id: z.ZodString;
|
|
414
|
+
name: z.ZodString;
|
|
415
|
+
type: z.ZodEnum<["platformPractice", "independentCoach", "multiCoachPractice", "academy", "partner"]>;
|
|
416
|
+
status: z.ZodEnum<["active", "trialing", "pastDue", "suspended", "archived"]>;
|
|
417
|
+
}, "strip", z.ZodTypeAny, {
|
|
418
|
+
type: "platformPractice" | "independentCoach" | "multiCoachPractice" | "academy" | "partner";
|
|
419
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "archived";
|
|
420
|
+
id: string;
|
|
421
|
+
name: string;
|
|
422
|
+
}, {
|
|
423
|
+
type: "platformPractice" | "independentCoach" | "multiCoachPractice" | "academy" | "partner";
|
|
424
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "archived";
|
|
425
|
+
id: string;
|
|
426
|
+
name: string;
|
|
427
|
+
}>;
|
|
428
|
+
subscription: z.ZodNullable<z.ZodObject<{
|
|
429
|
+
id: z.ZodString;
|
|
430
|
+
organizationId: z.ZodString;
|
|
431
|
+
coachUserId: z.ZodString;
|
|
432
|
+
provider: z.ZodEnum<["manual", "stripe", "invoice"]>;
|
|
433
|
+
status: z.ZodEnum<["active", "trialing", "pastDue", "canceled", "suspended"]>;
|
|
434
|
+
maxFamilies: z.ZodNumber;
|
|
435
|
+
updatedAt: z.ZodString;
|
|
436
|
+
}, "strip", z.ZodTypeAny, {
|
|
437
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "canceled";
|
|
438
|
+
id: string;
|
|
439
|
+
organizationId: string;
|
|
440
|
+
coachUserId: string;
|
|
441
|
+
maxFamilies: number;
|
|
442
|
+
updatedAt: string;
|
|
443
|
+
provider: "manual" | "stripe" | "invoice";
|
|
444
|
+
}, {
|
|
445
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "canceled";
|
|
446
|
+
id: string;
|
|
447
|
+
organizationId: string;
|
|
448
|
+
coachUserId: string;
|
|
449
|
+
maxFamilies: number;
|
|
450
|
+
updatedAt: string;
|
|
451
|
+
provider: "manual" | "stripe" | "invoice";
|
|
452
|
+
}>>;
|
|
453
|
+
activeFamilyCount: z.ZodNumber;
|
|
454
|
+
remainingFamilySeats: z.ZodNullable<z.ZodNumber>;
|
|
455
|
+
}, "strip", z.ZodTypeAny, {
|
|
456
|
+
organization: {
|
|
457
|
+
type: "platformPractice" | "independentCoach" | "multiCoachPractice" | "academy" | "partner";
|
|
458
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "archived";
|
|
459
|
+
id: string;
|
|
460
|
+
name: string;
|
|
461
|
+
};
|
|
462
|
+
subscription: {
|
|
463
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "canceled";
|
|
464
|
+
id: string;
|
|
465
|
+
organizationId: string;
|
|
466
|
+
coachUserId: string;
|
|
467
|
+
maxFamilies: number;
|
|
468
|
+
updatedAt: string;
|
|
469
|
+
provider: "manual" | "stripe" | "invoice";
|
|
470
|
+
} | null;
|
|
471
|
+
activeFamilyCount: number;
|
|
472
|
+
remainingFamilySeats: number | null;
|
|
473
|
+
}, {
|
|
474
|
+
organization: {
|
|
475
|
+
type: "platformPractice" | "independentCoach" | "multiCoachPractice" | "academy" | "partner";
|
|
476
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "archived";
|
|
477
|
+
id: string;
|
|
478
|
+
name: string;
|
|
479
|
+
};
|
|
480
|
+
subscription: {
|
|
481
|
+
status: "active" | "trialing" | "pastDue" | "suspended" | "canceled";
|
|
482
|
+
id: string;
|
|
483
|
+
organizationId: string;
|
|
484
|
+
coachUserId: string;
|
|
485
|
+
maxFamilies: number;
|
|
486
|
+
updatedAt: string;
|
|
487
|
+
provider: "manual" | "stripe" | "invoice";
|
|
488
|
+
} | null;
|
|
489
|
+
activeFamilyCount: number;
|
|
490
|
+
remainingFamilySeats: number | null;
|
|
491
|
+
}>;
|
|
492
|
+
export declare const devActivateCoachSubscriptionRequestSchema: z.ZodObject<{
|
|
493
|
+
planId: z.ZodEnum<["coach-starter", "coach-growth", "coach-clinic"]>;
|
|
494
|
+
cadence: z.ZodDefault<z.ZodEnum<["monthly", "yearly"]>>;
|
|
495
|
+
}, "strip", z.ZodTypeAny, {
|
|
496
|
+
planId: "coach-starter" | "coach-growth" | "coach-clinic";
|
|
497
|
+
cadence: "monthly" | "yearly";
|
|
498
|
+
}, {
|
|
499
|
+
planId: "coach-starter" | "coach-growth" | "coach-clinic";
|
|
500
|
+
cadence?: "monthly" | "yearly" | undefined;
|
|
501
|
+
}>;
|
|
502
|
+
export type CreateCoachInviteCodeRequest = z.infer<typeof createCoachInviteCodeRequestSchema>;
|
|
503
|
+
export type CoachInviteCodesResponse = z.infer<typeof coachInviteCodesResponseSchema>;
|
|
504
|
+
export type CoachInviteCodeResponse = z.infer<typeof coachInviteCodeResponseSchema>;
|
|
505
|
+
export type UpdateCoachInviteCodeRequest = z.infer<typeof updateCoachInviteCodeRequestSchema>;
|
|
506
|
+
export type CoachRevokeFamilyAccessResponse = z.infer<typeof coachRevokeFamilyAccessResponseSchema>;
|
|
507
|
+
export type CoachRevokeInviteCodeAccessResponse = z.infer<typeof coachRevokeInviteCodeAccessResponseSchema>;
|
|
508
|
+
export type CoachSubscriptionProvider = z.infer<typeof coachSubscriptionProviderSchema>;
|
|
509
|
+
export type CoachSubscriptionSummary = z.infer<typeof coachSubscriptionSummarySchema>;
|
|
510
|
+
export type CoachSubscriptionStatusResponse = z.infer<typeof coachSubscriptionStatusResponseSchema>;
|
|
511
|
+
export type DevActivateCoachSubscriptionRequest = z.infer<typeof devActivateCoachSubscriptionRequestSchema>;
|
package/dist/coach.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { adminAssignmentResponseSchema, adminInviteCodeResponseSchema, inviteCodeSummarySchema, updateInviteCodeRequestSchema } from "./admin.js";
|
|
3
|
+
import { organizationSummarySchema } from "./access.js";
|
|
4
|
+
import { coachFamilyInviteCodeAccessSchema } from "./family.js";
|
|
5
|
+
import { idSchema, isoDateStringSchema, nullableIsoDateStringSchema } from "./api.js";
|
|
6
|
+
import { subscriptionStatusSchema } from "./enums.js";
|
|
7
|
+
import { billingCadenceSchema } from "./billing.js";
|
|
8
|
+
export const createCoachInviteCodeRequestSchema = z.object({
|
|
9
|
+
code: z.string().min(1).optional(),
|
|
10
|
+
maxUses: z.number().int().positive().default(25),
|
|
11
|
+
expiresAt: nullableIsoDateStringSchema.optional()
|
|
12
|
+
});
|
|
13
|
+
export const coachInviteCodesResponseSchema = z.object({
|
|
14
|
+
inviteCodes: z.array(inviteCodeSummarySchema)
|
|
15
|
+
});
|
|
16
|
+
export const coachInviteCodeResponseSchema = adminInviteCodeResponseSchema;
|
|
17
|
+
export const updateCoachInviteCodeRequestSchema = updateInviteCodeRequestSchema;
|
|
18
|
+
export const coachRevokeFamilyAccessResponseSchema = adminAssignmentResponseSchema;
|
|
19
|
+
export const coachRevokeInviteCodeAccessResponseSchema = z.object({
|
|
20
|
+
inviteCode: inviteCodeSummarySchema,
|
|
21
|
+
affectedFamilies: coachFamilyInviteCodeAccessSchema.shape.affectedFamilies
|
|
22
|
+
});
|
|
23
|
+
export const coachSubscriptionProviderSchema = z.enum(["manual", "stripe", "invoice"]);
|
|
24
|
+
export const coachSubscriptionSummarySchema = z.object({
|
|
25
|
+
id: idSchema,
|
|
26
|
+
organizationId: idSchema,
|
|
27
|
+
coachUserId: idSchema,
|
|
28
|
+
provider: coachSubscriptionProviderSchema,
|
|
29
|
+
status: subscriptionStatusSchema,
|
|
30
|
+
maxFamilies: z.number().int().nonnegative(),
|
|
31
|
+
updatedAt: isoDateStringSchema
|
|
32
|
+
});
|
|
33
|
+
export const coachSubscriptionStatusResponseSchema = z.object({
|
|
34
|
+
organization: organizationSummarySchema,
|
|
35
|
+
subscription: coachSubscriptionSummarySchema.nullable(),
|
|
36
|
+
activeFamilyCount: z.number().int().nonnegative(),
|
|
37
|
+
remainingFamilySeats: z.number().int().nonnegative().nullable()
|
|
38
|
+
});
|
|
39
|
+
export const devActivateCoachSubscriptionRequestSchema = z.object({
|
|
40
|
+
planId: z.enum(["coach-starter", "coach-growth", "coach-clinic"]),
|
|
41
|
+
cadence: billingCadenceSchema.default("monthly")
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=coach.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coach.js","sourceRoot":"","sources":["../src/coach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,iCAAiC,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IAChD,SAAS,EAAE,2BAA2B,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC;CAC9C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,6BAA6B,GAAG,6BAA6B,CAAC;AAC3E,MAAM,CAAC,MAAM,kCAAkC,GAAG,6BAA6B,CAAC;AAChF,MAAM,CAAC,MAAM,qCAAqC,GAAG,6BAA6B,CAAC;AACnF,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,UAAU,EAAE,uBAAuB;IACnC,gBAAgB,EAAE,iCAAiC,CAAC,KAAK,CAAC,gBAAgB;CAC3E,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAEvF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,EAAE,EAAE,QAAQ;IACZ,cAAc,EAAE,QAAQ;IACxB,WAAW,EAAE,QAAQ;IACrB,QAAQ,EAAE,+BAA+B;IACzC,MAAM,EAAE,wBAAwB;IAChC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC3C,SAAS,EAAE,mBAAmB;CAC/B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5D,YAAY,EAAE,yBAAyB;IACvC,YAAY,EAAE,8BAA8B,CAAC,QAAQ,EAAE;IACvD,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IACjD,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;CAChE,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,MAAM,CAAC;IAChE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;IACjE,OAAO,EAAE,oBAAoB,CAAC,OAAO,CAAC,SAAS,CAAC;CACjD,CAAC,CAAC"}
|
package/dist/enums.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const userRoleSchema: z.ZodEnum<["family", "coach", "superAdmin"]>;
|
|
3
|
+
export declare const organizationTypeSchema: z.ZodEnum<["platformPractice", "independentCoach", "multiCoachPractice", "academy", "partner"]>;
|
|
4
|
+
export declare const organizationStatusSchema: z.ZodEnum<["active", "trialing", "pastDue", "suspended", "archived"]>;
|
|
5
|
+
export declare const organizationMemberRoleSchema: z.ZodEnum<["owner", "coach", "organizationAdmin"]>;
|
|
6
|
+
export declare const organizationMemberStatusSchema: z.ZodEnum<["active", "invited", "suspended", "removed"]>;
|
|
7
|
+
export declare const assignmentStatusSchema: z.ZodEnum<["active", "revoked", "transferred", "expired"]>;
|
|
8
|
+
export declare const assignmentSourceSchema: z.ZodEnum<["inviteCode", "coachAdmin", "superAdmin", "systemImport"]>;
|
|
9
|
+
export declare const inviteStatusSchema: z.ZodEnum<["active", "paused", "expired", "revoked"]>;
|
|
10
|
+
export declare const entitlementStatusSchema: z.ZodEnum<["active", "expired", "revoked", "canceled", "inactiveBilling"]>;
|
|
11
|
+
export declare const entitlementSourceSchema: z.ZodEnum<["directSubscription", "platformPractice", "coachInvite", "manualComp"]>;
|
|
12
|
+
export declare const subscriptionStatusSchema: z.ZodEnum<["active", "trialing", "pastDue", "canceled", "suspended"]>;
|
|
13
|
+
export declare const activityTypeSchema: z.ZodEnum<["breastfeed", "bottles", "sleep", "nappies", "pumping", "medication", "solids"]>;
|
|
14
|
+
export declare const activityTypes: ["breastfeed", "bottles", "sleep", "nappies", "pumping", "medication", "solids"];
|
|
15
|
+
export declare const auditEventTypeSchema: z.ZodEnum<["inviteCode.created", "inviteCode.redeemed", "assignment.created", "assignment.revoked", "assignment.transferred", "entitlement.created", "entitlement.revoked", "entitlement.billingInactive", "coachSubscription.updated", "familyLog.updatedByCoach", "baby.updatedByCoach"]>;
|
|
16
|
+
export type UserRole = z.infer<typeof userRoleSchema>;
|
|
17
|
+
export type OrganizationType = z.infer<typeof organizationTypeSchema>;
|
|
18
|
+
export type OrganizationStatus = z.infer<typeof organizationStatusSchema>;
|
|
19
|
+
export type OrganizationMemberRole = z.infer<typeof organizationMemberRoleSchema>;
|
|
20
|
+
export type OrganizationMemberStatus = z.infer<typeof organizationMemberStatusSchema>;
|
|
21
|
+
export type AssignmentStatus = z.infer<typeof assignmentStatusSchema>;
|
|
22
|
+
export type AssignmentSource = z.infer<typeof assignmentSourceSchema>;
|
|
23
|
+
export type InviteStatus = z.infer<typeof inviteStatusSchema>;
|
|
24
|
+
export type EntitlementStatus = z.infer<typeof entitlementStatusSchema>;
|
|
25
|
+
export type EntitlementSource = z.infer<typeof entitlementSourceSchema>;
|
|
26
|
+
export type SubscriptionStatus = z.infer<typeof subscriptionStatusSchema>;
|
|
27
|
+
export type ActivityType = z.infer<typeof activityTypeSchema>;
|
|
28
|
+
export type AuditEventType = z.infer<typeof auditEventTypeSchema>;
|
package/dist/enums.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const userRoleSchema = z.enum(["family", "coach", "superAdmin"]);
|
|
3
|
+
export const organizationTypeSchema = z.enum([
|
|
4
|
+
"platformPractice",
|
|
5
|
+
"independentCoach",
|
|
6
|
+
"multiCoachPractice",
|
|
7
|
+
"academy",
|
|
8
|
+
"partner"
|
|
9
|
+
]);
|
|
10
|
+
export const organizationStatusSchema = z.enum([
|
|
11
|
+
"active",
|
|
12
|
+
"trialing",
|
|
13
|
+
"pastDue",
|
|
14
|
+
"suspended",
|
|
15
|
+
"archived"
|
|
16
|
+
]);
|
|
17
|
+
export const organizationMemberRoleSchema = z.enum([
|
|
18
|
+
"owner",
|
|
19
|
+
"coach",
|
|
20
|
+
"organizationAdmin"
|
|
21
|
+
]);
|
|
22
|
+
export const organizationMemberStatusSchema = z.enum([
|
|
23
|
+
"active",
|
|
24
|
+
"invited",
|
|
25
|
+
"suspended",
|
|
26
|
+
"removed"
|
|
27
|
+
]);
|
|
28
|
+
export const assignmentStatusSchema = z.enum([
|
|
29
|
+
"active",
|
|
30
|
+
"revoked",
|
|
31
|
+
"transferred",
|
|
32
|
+
"expired"
|
|
33
|
+
]);
|
|
34
|
+
export const assignmentSourceSchema = z.enum([
|
|
35
|
+
"inviteCode",
|
|
36
|
+
"coachAdmin",
|
|
37
|
+
"superAdmin",
|
|
38
|
+
"systemImport"
|
|
39
|
+
]);
|
|
40
|
+
export const inviteStatusSchema = z.enum([
|
|
41
|
+
"active",
|
|
42
|
+
"paused",
|
|
43
|
+
"expired",
|
|
44
|
+
"revoked"
|
|
45
|
+
]);
|
|
46
|
+
export const entitlementStatusSchema = z.enum([
|
|
47
|
+
"active",
|
|
48
|
+
"expired",
|
|
49
|
+
"revoked",
|
|
50
|
+
"canceled",
|
|
51
|
+
"inactiveBilling"
|
|
52
|
+
]);
|
|
53
|
+
export const entitlementSourceSchema = z.enum([
|
|
54
|
+
"directSubscription",
|
|
55
|
+
"platformPractice",
|
|
56
|
+
"coachInvite",
|
|
57
|
+
"manualComp"
|
|
58
|
+
]);
|
|
59
|
+
export const subscriptionStatusSchema = z.enum([
|
|
60
|
+
"active",
|
|
61
|
+
"trialing",
|
|
62
|
+
"pastDue",
|
|
63
|
+
"canceled",
|
|
64
|
+
"suspended"
|
|
65
|
+
]);
|
|
66
|
+
export const activityTypeSchema = z.enum([
|
|
67
|
+
"breastfeed",
|
|
68
|
+
"bottles",
|
|
69
|
+
"sleep",
|
|
70
|
+
"nappies",
|
|
71
|
+
"pumping",
|
|
72
|
+
"medication",
|
|
73
|
+
"solids"
|
|
74
|
+
]);
|
|
75
|
+
export const activityTypes = activityTypeSchema.options;
|
|
76
|
+
export const auditEventTypeSchema = z.enum([
|
|
77
|
+
"inviteCode.created",
|
|
78
|
+
"inviteCode.redeemed",
|
|
79
|
+
"assignment.created",
|
|
80
|
+
"assignment.revoked",
|
|
81
|
+
"assignment.transferred",
|
|
82
|
+
"entitlement.created",
|
|
83
|
+
"entitlement.revoked",
|
|
84
|
+
"entitlement.billingInactive",
|
|
85
|
+
"coachSubscription.updated",
|
|
86
|
+
"familyLog.updatedByCoach",
|
|
87
|
+
"baby.updatedByCoach"
|
|
88
|
+
]);
|
|
89
|
+
//# sourceMappingURL=enums.js.map
|