@beorchid-llc/thrivo-contracts 0.13.0 → 0.14.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/admin.d.ts +323 -10
- package/dist/admin.d.ts.map +1 -1
- package/dist/admin.js +24 -4
- package/dist/admin.js.map +1 -1
- package/dist/leads.d.ts +4 -4
- package/dist/leads.d.ts.map +1 -1
- package/dist/leads.js +2 -2
- package/dist/leads.js.map +1 -1
- package/package.json +1 -1
package/dist/admin.d.ts
CHANGED
|
@@ -72,27 +72,90 @@ export declare const adminOtpVerifyPayloadSchema: z.ZodObject<{
|
|
|
72
72
|
email: string;
|
|
73
73
|
}>;
|
|
74
74
|
export type AdminOtpVerifyPayload = z.infer<typeof adminOtpVerifyPayloadSchema>;
|
|
75
|
+
/**
|
|
76
|
+
* Offset pagination — still the shape for every admin list endpoint that
|
|
77
|
+
* hasn't been converted off OFFSET yet (subscriptions, tips, email-logs,
|
|
78
|
+
* audit-log; none of those routes exist server-side as of R5-4, but the
|
|
79
|
+
* contract is defined ahead of the implementation). Do NOT reuse this for a
|
|
80
|
+
* new list endpoint — SYSTEM_DESIGN §373 mandates keyset for any unbounded
|
|
81
|
+
* list; use `adminKeysetPaginationSchema` instead.
|
|
82
|
+
*/
|
|
83
|
+
export declare const adminPaginationSchema: z.ZodObject<{
|
|
84
|
+
page: z.ZodNumber;
|
|
85
|
+
pageSize: z.ZodNumber;
|
|
86
|
+
total: z.ZodNumber;
|
|
87
|
+
totalPages: z.ZodNumber;
|
|
88
|
+
}, "strip", z.ZodTypeAny, {
|
|
89
|
+
page: number;
|
|
90
|
+
pageSize: number;
|
|
91
|
+
total: number;
|
|
92
|
+
totalPages: number;
|
|
93
|
+
}, {
|
|
94
|
+
page: number;
|
|
95
|
+
pageSize: number;
|
|
96
|
+
total: number;
|
|
97
|
+
totalPages: number;
|
|
98
|
+
}>;
|
|
99
|
+
export type AdminPagination = z.infer<typeof adminPaginationSchema>;
|
|
100
|
+
export declare const adminPaginated: <T extends z.ZodTypeAny>(item: T) => z.ZodObject<{
|
|
101
|
+
items: z.ZodArray<T, "many">;
|
|
102
|
+
pagination: z.ZodObject<{
|
|
103
|
+
page: z.ZodNumber;
|
|
104
|
+
pageSize: z.ZodNumber;
|
|
105
|
+
total: z.ZodNumber;
|
|
106
|
+
totalPages: z.ZodNumber;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
page: number;
|
|
109
|
+
pageSize: number;
|
|
110
|
+
total: number;
|
|
111
|
+
totalPages: number;
|
|
112
|
+
}, {
|
|
113
|
+
page: number;
|
|
114
|
+
pageSize: number;
|
|
115
|
+
total: number;
|
|
116
|
+
totalPages: number;
|
|
117
|
+
}>;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
items: T["_output"][];
|
|
120
|
+
pagination: {
|
|
121
|
+
page: number;
|
|
122
|
+
pageSize: number;
|
|
123
|
+
total: number;
|
|
124
|
+
totalPages: number;
|
|
125
|
+
};
|
|
126
|
+
}, {
|
|
127
|
+
items: T["_input"][];
|
|
128
|
+
pagination: {
|
|
129
|
+
page: number;
|
|
130
|
+
pageSize: number;
|
|
131
|
+
total: number;
|
|
132
|
+
totalPages: number;
|
|
133
|
+
};
|
|
134
|
+
}>;
|
|
75
135
|
/**
|
|
76
136
|
* Keyset pagination (R5-4/I16) — no `page`/`totalPages`, since a numeric page
|
|
77
137
|
* offset is exactly the "scan-and-discard, drifts under concurrent inserts"
|
|
78
|
-
* failure mode this
|
|
138
|
+
* failure mode this replaces (SYSTEM_DESIGN §373). `nextCursor` is opaque;
|
|
79
139
|
* pass it back as `cursor` to fetch the next page, null on the last page.
|
|
140
|
+
* Used by `admin/users` and `admin/leads`, the two endpoints R5-4 actually
|
|
141
|
+
* converted — every other admin list endpoint still uses
|
|
142
|
+
* `adminPaginationSchema` above until it gets the same treatment.
|
|
80
143
|
*/
|
|
81
|
-
export declare const
|
|
144
|
+
export declare const adminKeysetPaginationSchema: z.ZodObject<{
|
|
82
145
|
limit: z.ZodNumber;
|
|
83
146
|
total: z.ZodNumber;
|
|
84
147
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
85
148
|
}, "strip", z.ZodTypeAny, {
|
|
86
149
|
nextCursor: string | null;
|
|
87
|
-
limit: number;
|
|
88
150
|
total: number;
|
|
151
|
+
limit: number;
|
|
89
152
|
}, {
|
|
90
153
|
nextCursor: string | null;
|
|
91
|
-
limit: number;
|
|
92
154
|
total: number;
|
|
155
|
+
limit: number;
|
|
93
156
|
}>;
|
|
94
|
-
export type
|
|
95
|
-
export declare const
|
|
157
|
+
export type AdminKeysetPagination = z.infer<typeof adminKeysetPaginationSchema>;
|
|
158
|
+
export declare const adminKeysetPaginated: <T extends z.ZodTypeAny>(item: T) => z.ZodObject<{
|
|
96
159
|
items: z.ZodArray<T, "many">;
|
|
97
160
|
pagination: z.ZodObject<{
|
|
98
161
|
limit: z.ZodNumber;
|
|
@@ -100,26 +163,26 @@ export declare const adminPaginated: <T extends z.ZodTypeAny>(item: T) => z.ZodO
|
|
|
100
163
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
101
164
|
}, "strip", z.ZodTypeAny, {
|
|
102
165
|
nextCursor: string | null;
|
|
103
|
-
limit: number;
|
|
104
166
|
total: number;
|
|
167
|
+
limit: number;
|
|
105
168
|
}, {
|
|
106
169
|
nextCursor: string | null;
|
|
107
|
-
limit: number;
|
|
108
170
|
total: number;
|
|
171
|
+
limit: number;
|
|
109
172
|
}>;
|
|
110
173
|
}, "strip", z.ZodTypeAny, {
|
|
111
174
|
items: T["_output"][];
|
|
112
175
|
pagination: {
|
|
113
176
|
nextCursor: string | null;
|
|
114
|
-
limit: number;
|
|
115
177
|
total: number;
|
|
178
|
+
limit: number;
|
|
116
179
|
};
|
|
117
180
|
}, {
|
|
118
181
|
items: T["_input"][];
|
|
119
182
|
pagination: {
|
|
120
183
|
nextCursor: string | null;
|
|
121
|
-
limit: number;
|
|
122
184
|
total: number;
|
|
185
|
+
limit: number;
|
|
123
186
|
};
|
|
124
187
|
}>;
|
|
125
188
|
export declare const adminEntitlementSchema: z.ZodEnum<["free", "premium"]>;
|
|
@@ -649,6 +712,256 @@ export declare const adminUserDetailResponseSchema: z.ZodObject<{
|
|
|
649
712
|
};
|
|
650
713
|
}>;
|
|
651
714
|
export type AdminUserDetailResponse = z.infer<typeof adminUserDetailResponseSchema>;
|
|
715
|
+
/** GET /admin/users — keyset-paginated (R5-4/I16); see `adminKeysetPaginated` above. */
|
|
716
|
+
export declare const adminUserListResponseSchema: z.ZodObject<{
|
|
717
|
+
items: z.ZodArray<z.ZodObject<Omit<{
|
|
718
|
+
id: z.ZodString;
|
|
719
|
+
email: z.ZodString;
|
|
720
|
+
image: z.ZodNullable<z.ZodString>;
|
|
721
|
+
goal: z.ZodNullable<z.ZodEnum<["lose", "maintain", "gain"]>>;
|
|
722
|
+
sex: z.ZodNullable<z.ZodEnum<["male", "female", "prefer_not_to_say"]>>;
|
|
723
|
+
age: z.ZodNullable<z.ZodNumber>;
|
|
724
|
+
heightCm: z.ZodNullable<z.ZodString>;
|
|
725
|
+
weightKg: z.ZodNullable<z.ZodString>;
|
|
726
|
+
targetWeightKg: z.ZodNullable<z.ZodString>;
|
|
727
|
+
tdeeKcal: z.ZodNullable<z.ZodNumber>;
|
|
728
|
+
dailyTargetKcal: z.ZodNullable<z.ZodNumber>;
|
|
729
|
+
targetProteinG: z.ZodNullable<z.ZodNumber>;
|
|
730
|
+
targetCarbsG: z.ZodNullable<z.ZodNumber>;
|
|
731
|
+
targetFatG: z.ZodNullable<z.ZodNumber>;
|
|
732
|
+
activityLevel: z.ZodNullable<z.ZodEnum<["sedentary", "light", "moderate", "active", "very_active"]>>;
|
|
733
|
+
manualDailyTargetKcal: z.ZodNullable<z.ZodNumber>;
|
|
734
|
+
notifyTimes: z.ZodNullable<z.ZodArray<z.ZodString, "many">>;
|
|
735
|
+
timezone: z.ZodNullable<z.ZodString>;
|
|
736
|
+
tier: z.ZodEnum<["free", "premium"]>;
|
|
737
|
+
accountStatus: z.ZodEnum<["dormant", "free_trial", "free_plan", "paid"]>;
|
|
738
|
+
trialEndsAt: z.ZodNullable<z.ZodDate>;
|
|
739
|
+
onboardingStep: z.ZodNumber;
|
|
740
|
+
isOnboarded: z.ZodBoolean;
|
|
741
|
+
isOnboardingSkipped: z.ZodBoolean;
|
|
742
|
+
createdAt: z.ZodDate;
|
|
743
|
+
} & {
|
|
744
|
+
name: z.ZodNullable<z.ZodString>;
|
|
745
|
+
onboardingSkipped: z.ZodBoolean;
|
|
746
|
+
subscriptionStatus: z.ZodNullable<z.ZodString>;
|
|
747
|
+
deletedAt: z.ZodNullable<z.ZodDate>;
|
|
748
|
+
updatedAt: z.ZodDate;
|
|
749
|
+
status: z.ZodEnum<["active", "suspended", "deleted"]>;
|
|
750
|
+
lastActiveAt: z.ZodNullable<z.ZodString>;
|
|
751
|
+
totalFoodLogs: z.ZodNumber;
|
|
752
|
+
currentStreakDays: z.ZodNumber;
|
|
753
|
+
subscription: z.ZodNullable<z.ZodObject<{
|
|
754
|
+
status: z.ZodEnum<["active", "trialing", "canceled", "expired", "none"]>;
|
|
755
|
+
priceLabel: z.ZodNullable<z.ZodString>;
|
|
756
|
+
renewsAt: z.ZodNullable<z.ZodString>;
|
|
757
|
+
cancelAtPeriodEnd: z.ZodBoolean;
|
|
758
|
+
}, "strip", z.ZodTypeAny, {
|
|
759
|
+
status: "active" | "trialing" | "canceled" | "expired" | "none";
|
|
760
|
+
priceLabel: string | null;
|
|
761
|
+
renewsAt: string | null;
|
|
762
|
+
cancelAtPeriodEnd: boolean;
|
|
763
|
+
}, {
|
|
764
|
+
status: "active" | "trialing" | "canceled" | "expired" | "none";
|
|
765
|
+
priceLabel: string | null;
|
|
766
|
+
renewsAt: string | null;
|
|
767
|
+
cancelAtPeriodEnd: boolean;
|
|
768
|
+
}>>;
|
|
769
|
+
}, "createdAt"> & {
|
|
770
|
+
createdAt: z.ZodDate;
|
|
771
|
+
}, "strip", z.ZodTypeAny, {
|
|
772
|
+
status: "active" | "suspended" | "deleted";
|
|
773
|
+
name: string | null;
|
|
774
|
+
id: string;
|
|
775
|
+
updatedAt: Date;
|
|
776
|
+
createdAt: Date;
|
|
777
|
+
subscription: {
|
|
778
|
+
status: "active" | "trialing" | "canceled" | "expired" | "none";
|
|
779
|
+
priceLabel: string | null;
|
|
780
|
+
renewsAt: string | null;
|
|
781
|
+
cancelAtPeriodEnd: boolean;
|
|
782
|
+
} | null;
|
|
783
|
+
email: string;
|
|
784
|
+
image: string | null;
|
|
785
|
+
goal: "lose" | "maintain" | "gain" | null;
|
|
786
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
787
|
+
age: number | null;
|
|
788
|
+
heightCm: string | null;
|
|
789
|
+
weightKg: string | null;
|
|
790
|
+
targetWeightKg: string | null;
|
|
791
|
+
tdeeKcal: number | null;
|
|
792
|
+
dailyTargetKcal: number | null;
|
|
793
|
+
targetProteinG: number | null;
|
|
794
|
+
targetCarbsG: number | null;
|
|
795
|
+
targetFatG: number | null;
|
|
796
|
+
activityLevel: "active" | "sedentary" | "light" | "moderate" | "very_active" | null;
|
|
797
|
+
manualDailyTargetKcal: number | null;
|
|
798
|
+
notifyTimes: string[] | null;
|
|
799
|
+
timezone: string | null;
|
|
800
|
+
tier: "free" | "premium";
|
|
801
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
802
|
+
trialEndsAt: Date | null;
|
|
803
|
+
onboardingStep: number;
|
|
804
|
+
isOnboarded: boolean;
|
|
805
|
+
isOnboardingSkipped: boolean;
|
|
806
|
+
onboardingSkipped: boolean;
|
|
807
|
+
subscriptionStatus: string | null;
|
|
808
|
+
deletedAt: Date | null;
|
|
809
|
+
lastActiveAt: string | null;
|
|
810
|
+
totalFoodLogs: number;
|
|
811
|
+
currentStreakDays: number;
|
|
812
|
+
}, {
|
|
813
|
+
status: "active" | "suspended" | "deleted";
|
|
814
|
+
name: string | null;
|
|
815
|
+
id: string;
|
|
816
|
+
updatedAt: Date;
|
|
817
|
+
createdAt: Date;
|
|
818
|
+
subscription: {
|
|
819
|
+
status: "active" | "trialing" | "canceled" | "expired" | "none";
|
|
820
|
+
priceLabel: string | null;
|
|
821
|
+
renewsAt: string | null;
|
|
822
|
+
cancelAtPeriodEnd: boolean;
|
|
823
|
+
} | null;
|
|
824
|
+
email: string;
|
|
825
|
+
image: string | null;
|
|
826
|
+
goal: "lose" | "maintain" | "gain" | null;
|
|
827
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
828
|
+
age: number | null;
|
|
829
|
+
heightCm: string | null;
|
|
830
|
+
weightKg: string | null;
|
|
831
|
+
targetWeightKg: string | null;
|
|
832
|
+
tdeeKcal: number | null;
|
|
833
|
+
dailyTargetKcal: number | null;
|
|
834
|
+
targetProteinG: number | null;
|
|
835
|
+
targetCarbsG: number | null;
|
|
836
|
+
targetFatG: number | null;
|
|
837
|
+
activityLevel: "active" | "sedentary" | "light" | "moderate" | "very_active" | null;
|
|
838
|
+
manualDailyTargetKcal: number | null;
|
|
839
|
+
notifyTimes: string[] | null;
|
|
840
|
+
timezone: string | null;
|
|
841
|
+
tier: "free" | "premium";
|
|
842
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
843
|
+
trialEndsAt: Date | null;
|
|
844
|
+
onboardingStep: number;
|
|
845
|
+
isOnboarded: boolean;
|
|
846
|
+
isOnboardingSkipped: boolean;
|
|
847
|
+
onboardingSkipped: boolean;
|
|
848
|
+
subscriptionStatus: string | null;
|
|
849
|
+
deletedAt: Date | null;
|
|
850
|
+
lastActiveAt: string | null;
|
|
851
|
+
totalFoodLogs: number;
|
|
852
|
+
currentStreakDays: number;
|
|
853
|
+
}>, "many">;
|
|
854
|
+
pagination: z.ZodObject<{
|
|
855
|
+
limit: z.ZodNumber;
|
|
856
|
+
total: z.ZodNumber;
|
|
857
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
858
|
+
}, "strip", z.ZodTypeAny, {
|
|
859
|
+
nextCursor: string | null;
|
|
860
|
+
total: number;
|
|
861
|
+
limit: number;
|
|
862
|
+
}, {
|
|
863
|
+
nextCursor: string | null;
|
|
864
|
+
total: number;
|
|
865
|
+
limit: number;
|
|
866
|
+
}>;
|
|
867
|
+
}, "strip", z.ZodTypeAny, {
|
|
868
|
+
items: {
|
|
869
|
+
status: "active" | "suspended" | "deleted";
|
|
870
|
+
name: string | null;
|
|
871
|
+
id: string;
|
|
872
|
+
updatedAt: Date;
|
|
873
|
+
createdAt: Date;
|
|
874
|
+
subscription: {
|
|
875
|
+
status: "active" | "trialing" | "canceled" | "expired" | "none";
|
|
876
|
+
priceLabel: string | null;
|
|
877
|
+
renewsAt: string | null;
|
|
878
|
+
cancelAtPeriodEnd: boolean;
|
|
879
|
+
} | null;
|
|
880
|
+
email: string;
|
|
881
|
+
image: string | null;
|
|
882
|
+
goal: "lose" | "maintain" | "gain" | null;
|
|
883
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
884
|
+
age: number | null;
|
|
885
|
+
heightCm: string | null;
|
|
886
|
+
weightKg: string | null;
|
|
887
|
+
targetWeightKg: string | null;
|
|
888
|
+
tdeeKcal: number | null;
|
|
889
|
+
dailyTargetKcal: number | null;
|
|
890
|
+
targetProteinG: number | null;
|
|
891
|
+
targetCarbsG: number | null;
|
|
892
|
+
targetFatG: number | null;
|
|
893
|
+
activityLevel: "active" | "sedentary" | "light" | "moderate" | "very_active" | null;
|
|
894
|
+
manualDailyTargetKcal: number | null;
|
|
895
|
+
notifyTimes: string[] | null;
|
|
896
|
+
timezone: string | null;
|
|
897
|
+
tier: "free" | "premium";
|
|
898
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
899
|
+
trialEndsAt: Date | null;
|
|
900
|
+
onboardingStep: number;
|
|
901
|
+
isOnboarded: boolean;
|
|
902
|
+
isOnboardingSkipped: boolean;
|
|
903
|
+
onboardingSkipped: boolean;
|
|
904
|
+
subscriptionStatus: string | null;
|
|
905
|
+
deletedAt: Date | null;
|
|
906
|
+
lastActiveAt: string | null;
|
|
907
|
+
totalFoodLogs: number;
|
|
908
|
+
currentStreakDays: number;
|
|
909
|
+
}[];
|
|
910
|
+
pagination: {
|
|
911
|
+
nextCursor: string | null;
|
|
912
|
+
total: number;
|
|
913
|
+
limit: number;
|
|
914
|
+
};
|
|
915
|
+
}, {
|
|
916
|
+
items: {
|
|
917
|
+
status: "active" | "suspended" | "deleted";
|
|
918
|
+
name: string | null;
|
|
919
|
+
id: string;
|
|
920
|
+
updatedAt: Date;
|
|
921
|
+
createdAt: Date;
|
|
922
|
+
subscription: {
|
|
923
|
+
status: "active" | "trialing" | "canceled" | "expired" | "none";
|
|
924
|
+
priceLabel: string | null;
|
|
925
|
+
renewsAt: string | null;
|
|
926
|
+
cancelAtPeriodEnd: boolean;
|
|
927
|
+
} | null;
|
|
928
|
+
email: string;
|
|
929
|
+
image: string | null;
|
|
930
|
+
goal: "lose" | "maintain" | "gain" | null;
|
|
931
|
+
sex: "male" | "female" | "prefer_not_to_say" | null;
|
|
932
|
+
age: number | null;
|
|
933
|
+
heightCm: string | null;
|
|
934
|
+
weightKg: string | null;
|
|
935
|
+
targetWeightKg: string | null;
|
|
936
|
+
tdeeKcal: number | null;
|
|
937
|
+
dailyTargetKcal: number | null;
|
|
938
|
+
targetProteinG: number | null;
|
|
939
|
+
targetCarbsG: number | null;
|
|
940
|
+
targetFatG: number | null;
|
|
941
|
+
activityLevel: "active" | "sedentary" | "light" | "moderate" | "very_active" | null;
|
|
942
|
+
manualDailyTargetKcal: number | null;
|
|
943
|
+
notifyTimes: string[] | null;
|
|
944
|
+
timezone: string | null;
|
|
945
|
+
tier: "free" | "premium";
|
|
946
|
+
accountStatus: "dormant" | "free_trial" | "free_plan" | "paid";
|
|
947
|
+
trialEndsAt: Date | null;
|
|
948
|
+
onboardingStep: number;
|
|
949
|
+
isOnboarded: boolean;
|
|
950
|
+
isOnboardingSkipped: boolean;
|
|
951
|
+
onboardingSkipped: boolean;
|
|
952
|
+
subscriptionStatus: string | null;
|
|
953
|
+
deletedAt: Date | null;
|
|
954
|
+
lastActiveAt: string | null;
|
|
955
|
+
totalFoodLogs: number;
|
|
956
|
+
currentStreakDays: number;
|
|
957
|
+
}[];
|
|
958
|
+
pagination: {
|
|
959
|
+
nextCursor: string | null;
|
|
960
|
+
total: number;
|
|
961
|
+
limit: number;
|
|
962
|
+
};
|
|
963
|
+
}>;
|
|
964
|
+
export type AdminUserListResponse = z.infer<typeof adminUserListResponseSchema>;
|
|
652
965
|
export declare const adminCancelPayloadSchema: z.ZodObject<{
|
|
653
966
|
reason: z.ZodString;
|
|
654
967
|
}, "strip", z.ZodTypeAny, {
|
package/dist/admin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,eAAe,8CAA4C,CAAC;AACzE,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAKtB,CAAC;AACH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAMhD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAmC,CAAC;AAC3E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC;AAE5B,eAAO,MAAM,4BAA4B;;;;;;EAEvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4B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AAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,iEAAiE;AACjE,eAAO,MAAM,yBAAyB;;;;;;EAAsC,CAAC;AAC7E,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAM5E,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDiB,CAAC"}
|
package/dist/admin.js
CHANGED
|
@@ -23,20 +23,38 @@ export const adminOtpVerifyPayloadSchema = z.object({
|
|
|
23
23
|
code: z.string().min(4),
|
|
24
24
|
});
|
|
25
25
|
// ---------------------------------------------------------------------------
|
|
26
|
-
// Admin pagination
|
|
26
|
+
// Admin pagination helpers
|
|
27
27
|
// ---------------------------------------------------------------------------
|
|
28
|
+
/**
|
|
29
|
+
* Offset pagination — still the shape for every admin list endpoint that
|
|
30
|
+
* hasn't been converted off OFFSET yet (subscriptions, tips, email-logs,
|
|
31
|
+
* audit-log; none of those routes exist server-side as of R5-4, but the
|
|
32
|
+
* contract is defined ahead of the implementation). Do NOT reuse this for a
|
|
33
|
+
* new list endpoint — SYSTEM_DESIGN §373 mandates keyset for any unbounded
|
|
34
|
+
* list; use `adminKeysetPaginationSchema` instead.
|
|
35
|
+
*/
|
|
36
|
+
export const adminPaginationSchema = z.object({
|
|
37
|
+
page: z.number(),
|
|
38
|
+
pageSize: z.number(),
|
|
39
|
+
total: z.number(),
|
|
40
|
+
totalPages: z.number(),
|
|
41
|
+
});
|
|
42
|
+
export const adminPaginated = (item) => z.object({ items: z.array(item), pagination: adminPaginationSchema });
|
|
28
43
|
/**
|
|
29
44
|
* Keyset pagination (R5-4/I16) — no `page`/`totalPages`, since a numeric page
|
|
30
45
|
* offset is exactly the "scan-and-discard, drifts under concurrent inserts"
|
|
31
|
-
* failure mode this
|
|
46
|
+
* failure mode this replaces (SYSTEM_DESIGN §373). `nextCursor` is opaque;
|
|
32
47
|
* pass it back as `cursor` to fetch the next page, null on the last page.
|
|
48
|
+
* Used by `admin/users` and `admin/leads`, the two endpoints R5-4 actually
|
|
49
|
+
* converted — every other admin list endpoint still uses
|
|
50
|
+
* `adminPaginationSchema` above until it gets the same treatment.
|
|
33
51
|
*/
|
|
34
|
-
export const
|
|
52
|
+
export const adminKeysetPaginationSchema = z.object({
|
|
35
53
|
limit: z.number(),
|
|
36
54
|
total: z.number(),
|
|
37
55
|
nextCursor: z.string().nullable(),
|
|
38
56
|
});
|
|
39
|
-
export const
|
|
57
|
+
export const adminKeysetPaginated = (item) => z.object({ items: z.array(item), pagination: adminKeysetPaginationSchema });
|
|
40
58
|
// ---------------------------------------------------------------------------
|
|
41
59
|
// Admin user schemas
|
|
42
60
|
// ---------------------------------------------------------------------------
|
|
@@ -76,6 +94,8 @@ export const adminUserDetailSchema = userProfileSchema
|
|
|
76
94
|
/** List rows use the same full shape as detail. */
|
|
77
95
|
export const adminUserSchema = adminUserDetailSchema;
|
|
78
96
|
export const adminUserDetailResponseSchema = z.object({ user: adminUserDetailSchema });
|
|
97
|
+
/** GET /admin/users — keyset-paginated (R5-4/I16); see `adminKeysetPaginated` above. */
|
|
98
|
+
export const adminUserListResponseSchema = adminKeysetPaginated(adminUserSchema);
|
|
79
99
|
export const adminCancelPayloadSchema = z.object({ reason: z.string().min(1) });
|
|
80
100
|
export const adminRefundPayloadSchema = z.object({
|
|
81
101
|
amountCents: z.number().int().positive().optional(),
|
package/dist/admin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,8EAA8E;AAC9E,iBAAiB;AACjB,8EAA8E;AAE9E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CA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AAK;QACb,IAAI,EAAE,iCAAiC;QACvC,IAAI,EAAE,OAAO;KACd;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,6CAA6C;QACnD,IAAI,EAAE,OAAO;KACd;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,6CAA6C;QACnD,IAAI,EAAE,OAAO;KACd;CACsC,CAAC"}
|
package/dist/leads.d.ts
CHANGED
|
@@ -158,12 +158,12 @@ export declare const adminLeadListResponseSchema: z.ZodObject<{
|
|
|
158
158
|
nextCursor: z.ZodNullable<z.ZodString>;
|
|
159
159
|
}, "strip", z.ZodTypeAny, {
|
|
160
160
|
nextCursor: string | null;
|
|
161
|
-
limit: number;
|
|
162
161
|
total: number;
|
|
162
|
+
limit: number;
|
|
163
163
|
}, {
|
|
164
164
|
nextCursor: string | null;
|
|
165
|
-
limit: number;
|
|
166
165
|
total: number;
|
|
166
|
+
limit: number;
|
|
167
167
|
}>;
|
|
168
168
|
}, "strip", z.ZodTypeAny, {
|
|
169
169
|
items: {
|
|
@@ -187,8 +187,8 @@ export declare const adminLeadListResponseSchema: z.ZodObject<{
|
|
|
187
187
|
}[];
|
|
188
188
|
pagination: {
|
|
189
189
|
nextCursor: string | null;
|
|
190
|
-
limit: number;
|
|
191
190
|
total: number;
|
|
191
|
+
limit: number;
|
|
192
192
|
};
|
|
193
193
|
}, {
|
|
194
194
|
items: {
|
|
@@ -212,8 +212,8 @@ export declare const adminLeadListResponseSchema: z.ZodObject<{
|
|
|
212
212
|
}[];
|
|
213
213
|
pagination: {
|
|
214
214
|
nextCursor: string | null;
|
|
215
|
-
limit: number;
|
|
216
215
|
total: number;
|
|
216
|
+
limit: number;
|
|
217
217
|
};
|
|
218
218
|
}>;
|
|
219
219
|
export type AdminLeadListResponse = z.infer<typeof adminLeadListResponseSchema>;
|
package/dist/leads.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file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nC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;;EAA0C,CAAC;AACjF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,qFAAqF;AACrF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkB1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAwC,CAAC;AACjF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;CAsBkB,CAAC"}
|
package/dist/leads.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { idSchema, isoDateSchema } from "./common";
|
|
3
|
-
import {
|
|
3
|
+
import { adminKeysetPaginated } from "./admin";
|
|
4
4
|
/**
|
|
5
5
|
* Lead capture (pre-signup email captures -- "leads"). Extend this enum as new
|
|
6
6
|
* capture points are added; the DB column itself stays plain text so new
|
|
@@ -44,7 +44,7 @@ export const adminLeadSchema = z.object({
|
|
|
44
44
|
utmMedium: z.string().nullable(),
|
|
45
45
|
utmCampaign: z.string().nullable(),
|
|
46
46
|
});
|
|
47
|
-
export const adminLeadListResponseSchema =
|
|
47
|
+
export const adminLeadListResponseSchema = adminKeysetPaginated(adminLeadSchema);
|
|
48
48
|
export const leadRoutes = {
|
|
49
49
|
capture: {
|
|
50
50
|
method: "POST",
|
package/dist/leads.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leads.js","sourceRoot":"","sources":["../src/leads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"leads.js","sourceRoot":"","sources":["../src/leads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAGvE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,KAAK,EAAE;SACP,GAAG,CAAC,GAAG,CAAC;SACR,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACpC,MAAM,EAAE,gBAAgB;IACxB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACzC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACzC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAA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