@bantr-sports/sdk 12.4.6 → 12.7.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/api-type/src/modules/auth/auth.factory.d.ts +4 -0
- package/api-type/src/modules/auth/auth.schema.d.ts +421 -0
- package/api-type/src/modules/auth/auth.service.d.ts +49 -0
- package/api-type/src/modules/auth/index.d.ts +3 -0
- package/api-type/src/modules/calendar/calendar-diagnostics.d.ts +10 -0
- package/api-type/src/modules/calendar/calendar-fetch-client.d.ts +108 -0
- package/api-type/src/modules/calendar/calendar-permissions.factory.d.ts +9 -0
- package/api-type/src/modules/calendar/calendar-permissions.service.d.ts +74 -0
- package/api-type/src/modules/calendar/calendar.schema.d.ts +158 -0
- package/api-type/src/modules/calendar/calendar.service.d.ts +75 -0
- package/api-type/src/modules/compliance/compliance-reminder.service.d.ts +19 -0
- package/api-type/src/modules/csae-report/csae-report.factory.d.ts +17 -0
- package/api-type/src/modules/csae-report/csae-report.schema.d.ts +63 -0
- package/api-type/src/modules/csae-report/csae-report.service.d.ts +28 -0
- package/api-type/src/modules/csae-report/index.d.ts +9 -0
- package/api-type/src/modules/discount_code/discount_code.factory.d.ts +4 -0
- package/api-type/src/modules/discount_code/discount_code.model.d.ts +39 -0
- package/api-type/src/modules/discount_code/discount_code.schema.d.ts +317 -0
- package/api-type/src/modules/discount_code/discount_code.service.d.ts +90 -0
- package/api-type/src/modules/event/event.factory.d.ts +4 -0
- package/api-type/src/modules/event/event.schema.d.ts +42 -0
- package/api-type/src/modules/event/event.service.d.ts +8 -0
- package/api-type/src/modules/free_agent_payments/free_agent_payments.factory.d.ts +4 -0
- package/api-type/src/modules/free_agent_payments/free_agent_payments.schema.d.ts +59 -0
- package/api-type/src/modules/free_agent_payments/free_agent_payments.service.d.ts +46 -0
- package/api-type/src/modules/geolocation/geolocation.factory.d.ts +4 -0
- package/api-type/src/modules/geolocation/geolocation.schema.d.ts +28 -0
- package/api-type/src/modules/geolocation/geolocation.service.d.ts +5 -0
- package/api-type/src/modules/league/league.factory.d.ts +4 -0
- package/api-type/src/modules/league/league.schema.d.ts +66 -0
- package/api-type/src/modules/league/league.service.d.ts +35 -0
- package/api-type/src/modules/league_payments/league_payments.factory.d.ts +4 -0
- package/api-type/src/modules/league_payments/league_payments.schema.d.ts +332 -0
- package/api-type/src/modules/league_payments/league_payments.service.d.ts +47 -0
- package/api-type/src/modules/marketplace/marketplace.factory.d.ts +4 -0
- package/api-type/src/modules/marketplace/marketplace.schema.d.ts +290 -0
- package/api-type/src/modules/marketplace/marketplace.service.d.ts +75 -0
- package/api-type/src/modules/member_notification_settings/member_notification_settings.factory.d.ts +4 -0
- package/api-type/src/modules/member_notification_settings/member_notification_settings.middleware.d.ts +21 -0
- package/api-type/src/modules/member_notification_settings/member_notification_settings.schema.d.ts +99 -0
- package/api-type/src/modules/member_notification_settings/member_notification_settings.service.d.ts +29 -0
- package/api-type/src/modules/oauth/oauth.constant.d.ts +20 -0
- package/api-type/src/modules/oauth/oauth.controller.d.ts +82 -0
- package/api-type/src/modules/oauth/oauth.factory.d.ts +4 -0
- package/api-type/src/modules/oauth/oauth.schema.d.ts +36 -0
- package/api-type/src/modules/oauth/oauth.util.d.ts +12 -0
- package/api-type/src/modules/oauth/providers/apple.service.d.ts +53 -0
- package/api-type/src/modules/oauth/providers/google.service.d.ts +52 -0
- package/api-type/src/modules/oauth/providers/oauth.service.d.ts +74 -0
- package/api-type/src/modules/organization/organization.factory.d.ts +4 -0
- package/api-type/src/modules/organization/organization.schema.d.ts +45 -0
- package/api-type/src/modules/organization/organization.service.d.ts +11 -0
- package/api-type/src/modules/organization_debt/organization_debt.factory.d.ts +4 -0
- package/api-type/src/modules/organization_debt/organization_debt.schema.d.ts +64 -0
- package/api-type/src/modules/organization_debt/organization_debt.service.d.ts +87 -0
- package/api-type/src/modules/pickup_payments/pickup_payments.factory.d.ts +4 -0
- package/api-type/src/modules/pickup_payments/pickup_payments.schema.d.ts +45 -0
- package/api-type/src/modules/pickup_payments/pickup_payments.service.d.ts +32 -0
- package/api-type/src/modules/player_id_validation/player_id_validation.factory.d.ts +4 -0
- package/api-type/src/modules/player_id_validation/player_id_validation.rules.d.ts +15 -0
- package/api-type/src/modules/player_id_validation/player_id_validation.schema.d.ts +184 -0
- package/api-type/src/modules/player_id_validation/player_id_validation.service.d.ts +104 -0
- package/api-type/src/modules/product/product.factory.d.ts +4 -0
- package/api-type/src/modules/product/product.schema.d.ts +117 -0
- package/api-type/src/modules/product/product.service.d.ts +29 -0
- package/api-type/src/modules/refund_request/refund_request.factory.d.ts +4 -0
- package/api-type/src/modules/refund_request/refund_request.schema.d.ts +288 -0
- package/api-type/src/modules/refund_request/refund_request.service.d.ts +10 -0
- package/api-type/src/modules/scout_feed/pinned_scout_profile.model.d.ts +19 -0
- package/api-type/src/modules/scout_feed/scout_feed.factory.d.ts +4 -0
- package/api-type/src/modules/scout_feed/scout_feed.schema.d.ts +2218 -0
- package/api-type/src/modules/scout_feed/scout_feed.service.d.ts +152 -0
- package/api-type/src/modules/scout_feed/scout_feed_filter_hash.d.ts +6 -0
- package/api-type/src/modules/scout_feed/soccer_scorer/soccer.scorer.d.ts +9 -0
- package/api-type/src/modules/scout_feed/soccer_scorer/strategies/age_strategy.d.ts +9 -0
- package/api-type/src/modules/scout_feed/soccer_scorer/strategies/availability_strategy.d.ts +9 -0
- package/api-type/src/modules/scout_feed/soccer_scorer/strategies/distance_strategy.d.ts +11 -0
- package/api-type/src/modules/scout_feed/soccer_scorer/strategies/gender_strategy.d.ts +9 -0
- package/api-type/src/modules/scout_feed/soccer_scorer/strategies/position_strategy.d.ts +9 -0
- package/api-type/src/modules/scout_feed/soccer_scorer/strategies/role_strategy.d.ts +9 -0
- package/api-type/src/modules/scout_profile/scout_profile.factory.d.ts +4 -0
- package/api-type/src/modules/scout_profile/scout_profile.schema.d.ts +875 -0
- package/api-type/src/modules/scout_profile/scout_profile.service.d.ts +41 -0
- package/api-type/src/modules/scout_profile/scout_soccer_profile.model.d.ts +44 -0
- package/api-type/src/modules/super_admin_organizers/index.d.ts +3 -0
- package/api-type/src/modules/super_admin_organizers/super_admin_organizers.factory.d.ts +4 -0
- package/api-type/src/modules/super_admin_organizers/super_admin_organizers.schema.d.ts +253 -0
- package/api-type/src/modules/super_admin_organizers/super_admin_organizers.service.d.ts +10 -0
- package/api-type/src/modules/super_admin_stripe_settings/index.d.ts +3 -0
- package/api-type/src/modules/super_admin_stripe_settings/super_admin_stripe_settings.factory.d.ts +4 -0
- package/api-type/src/modules/super_admin_stripe_settings/super_admin_stripe_settings.schema.d.ts +162 -0
- package/api-type/src/modules/super_admin_stripe_settings/super_admin_stripe_settings.service.d.ts +6 -0
- package/api-type/src/modules/super_admin_transfers/super_admin_transfers.factory.d.ts +4 -0
- package/api-type/src/modules/super_admin_transfers/super_admin_transfers.schema.d.ts +440 -0
- package/api-type/src/modules/super_admin_transfers/super_admin_transfers.service.d.ts +28 -0
- package/api-type/src/modules/team/team.factory.d.ts +4 -0
- package/api-type/src/modules/team/team.schema.d.ts +176 -0
- package/api-type/src/modules/team/team.service.d.ts +62 -0
- package/api-type/src/modules/transaction/transaction.factory.d.ts +4 -0
- package/api-type/src/modules/transaction/transaction.schema.d.ts +100 -0
- package/api-type/src/modules/transaction/transaction.service.d.ts +205 -0
- package/api-type/src/trpcRouter/auth.router.d.ts +23 -1
- package/api-type/src/trpcRouter/event.router.d.ts +20 -0
- package/api-type/src/trpcRouter/marketplace.router.d.ts +2 -50
- package/api-type/src/trpcRouter/member_notification_settings.d.ts +29 -3
- package/api-type/src/trpcRouter/messaging.router.d.ts +11 -11
- package/api-type/src/trpcRouter/player_id_validation.router.d.ts +198 -0
- package/api-type/src/trpcRouter/router.d.ts +1344 -182
- package/api-type/src/trpcRouter/scout_feed.router.d.ts +180 -0
- package/api-type/src/trpcRouter/scout_profile.router.d.ts +128 -0
- package/api-type/src/trpcRouter/super_admin_stripe_settings.router.d.ts +49 -0
- package/api-type/src/trpcRouter/team.d.ts +2 -2
- package/api-type/src/trpcRouter/transaction.router.d.ts +7 -1
- package/api-type/src/types/address.d.ts +22 -0
- package/api-type/src/types/auth.d.ts +106 -0
- package/api-type/src/types/base_league.d.ts +13 -0
- package/api-type/src/types/common.d.ts +26 -0
- package/api-type/src/types/dynamic_season_league_template.d.ts +52 -0
- package/api-type/src/types/email.d.ts +136 -0
- package/api-type/src/types/emoji_media_mapper.d.ts +7 -0
- package/api-type/src/types/event.d.ts +38 -0
- package/api-type/src/types/free_agent.d.ts +44 -0
- package/api-type/src/types/game_stats.d.ts +147 -0
- package/api-type/src/types/geojson.d.ts +4 -0
- package/api-type/src/types/geolocation.d.ts +156 -0
- package/api-type/src/types/index.d.ts +4 -0
- package/api-type/src/types/invite.d.ts +81 -0
- package/api-type/src/types/league.d.ts +429 -0
- package/api-type/src/types/league_media.d.ts +46 -0
- package/api-type/src/types/league_schedule.d.ts +98 -0
- package/api-type/src/types/league_season_roster.d.ts +36 -0
- package/api-type/src/types/league_standing.d.ts +44 -0
- package/api-type/src/types/league_status.d.ts +12 -0
- package/api-type/src/types/league_template.d.ts +16 -0
- package/api-type/src/types/marketplace.d.ts +81 -0
- package/api-type/src/types/member.d.ts +42 -0
- package/api-type/src/types/member_notification_settings.d.ts +90 -0
- package/api-type/src/types/notification.d.ts +5 -0
- package/api-type/src/types/notifications.d.ts +3 -0
- package/api-type/src/types/onboard.d.ts +11 -0
- package/api-type/src/types/organization.d.ts +101 -0
- package/api-type/src/types/organizer.d.ts +7 -0
- package/api-type/src/types/pickup.d.ts +78 -0
- package/api-type/src/types/pickup_group.d.ts +23 -0
- package/api-type/src/types/pickup_group_members.d.ts +4 -0
- package/api-type/src/types/referee.d.ts +27 -0
- package/api-type/src/types/report.d.ts +30 -0
- package/api-type/src/types/season.d.ts +68 -0
- package/api-type/src/types/season_league_template.d.ts +38 -0
- package/api-type/src/types/support.d.ts +7 -0
- package/api-type/src/types/team.d.ts +78 -0
- package/api-type/src/types/waiver.d.ts +18 -0
- package/dist/index.d.ts +2030 -285
- package/dist/index.d.ts.map +1 -1
- package/dist/provider.d.ts +1322 -159
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +18 -3
- package/dist/query.d.ts +639 -57
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +16 -2
- package/package.json +4 -2
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const passwordSchema: z.ZodString;
|
|
3
|
+
export declare const authSetPasswordInputSchema: z.ZodEffects<z.ZodObject<{
|
|
4
|
+
newPassword: z.ZodString;
|
|
5
|
+
confirmPassword: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
newPassword: string;
|
|
8
|
+
confirmPassword: string;
|
|
9
|
+
}, {
|
|
10
|
+
newPassword: string;
|
|
11
|
+
confirmPassword: string;
|
|
12
|
+
}>, {
|
|
13
|
+
newPassword: string;
|
|
14
|
+
confirmPassword: string;
|
|
15
|
+
}, {
|
|
16
|
+
newPassword: string;
|
|
17
|
+
confirmPassword: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type authSetPasswordInputSchema = z.infer<typeof authSetPasswordInputSchema>;
|
|
20
|
+
export declare const authLoginInputSchema: z.ZodObject<{
|
|
21
|
+
email: z.ZodString;
|
|
22
|
+
password: z.ZodString;
|
|
23
|
+
inviteToken: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
email: string;
|
|
26
|
+
password: string;
|
|
27
|
+
inviteToken?: string | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
email: string;
|
|
30
|
+
password: string;
|
|
31
|
+
inviteToken?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
export type authLoginInputSchema = z.infer<typeof authLoginInputSchema>;
|
|
34
|
+
export declare const authRegisterInputSchemaBase: z.ZodObject<{
|
|
35
|
+
firstName: z.ZodString;
|
|
36
|
+
lastName: z.ZodString;
|
|
37
|
+
email: z.ZodString;
|
|
38
|
+
phone: z.ZodString;
|
|
39
|
+
zipCode: z.ZodOptional<z.ZodString>;
|
|
40
|
+
birthday: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
41
|
+
gender: z.ZodEnum<["MALE", "FEMALE", "PREFER_NOT_TO_SAY"]>;
|
|
42
|
+
password: z.ZodString;
|
|
43
|
+
confirmPassword: z.ZodString;
|
|
44
|
+
avatar: z.ZodString;
|
|
45
|
+
address: z.ZodObject<{
|
|
46
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
47
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
48
|
+
type: z.ZodLiteral<"Point">;
|
|
49
|
+
coordinates: z.ZodObject<{
|
|
50
|
+
lat: z.ZodNumber;
|
|
51
|
+
lng: z.ZodNumber;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
lng: number;
|
|
54
|
+
lat: number;
|
|
55
|
+
}, {
|
|
56
|
+
lng: number;
|
|
57
|
+
lat: number;
|
|
58
|
+
}>;
|
|
59
|
+
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
type: "Point";
|
|
61
|
+
coordinates: {
|
|
62
|
+
lng: number;
|
|
63
|
+
lat: number;
|
|
64
|
+
};
|
|
65
|
+
}, {
|
|
66
|
+
type: "Point";
|
|
67
|
+
coordinates: {
|
|
68
|
+
lng: number;
|
|
69
|
+
lat: number;
|
|
70
|
+
};
|
|
71
|
+
}>>;
|
|
72
|
+
country: z.ZodString;
|
|
73
|
+
countryAlias: z.ZodString;
|
|
74
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
75
|
+
stateAlias: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
|
+
neighborhood: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
79
|
+
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
80
|
+
streetNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
81
|
+
complement: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
82
|
+
reference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
83
|
+
formattedAddress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
location: {
|
|
86
|
+
type: "Point";
|
|
87
|
+
coordinates: {
|
|
88
|
+
lng: number;
|
|
89
|
+
lat: number;
|
|
90
|
+
};
|
|
91
|
+
} | null;
|
|
92
|
+
country: string;
|
|
93
|
+
countryAlias: string;
|
|
94
|
+
id?: number | null | undefined;
|
|
95
|
+
city?: string | null | undefined;
|
|
96
|
+
street?: string | null | undefined;
|
|
97
|
+
state?: string | null | undefined;
|
|
98
|
+
stateAlias?: string | null | undefined;
|
|
99
|
+
neighborhood?: string | null | undefined;
|
|
100
|
+
postalCode?: string | null | undefined;
|
|
101
|
+
streetNumber?: string | null | undefined;
|
|
102
|
+
complement?: string | null | undefined;
|
|
103
|
+
reference?: string | null | undefined;
|
|
104
|
+
formattedAddress?: string | null | undefined;
|
|
105
|
+
}, {
|
|
106
|
+
location: {
|
|
107
|
+
type: "Point";
|
|
108
|
+
coordinates: {
|
|
109
|
+
lng: number;
|
|
110
|
+
lat: number;
|
|
111
|
+
};
|
|
112
|
+
} | null;
|
|
113
|
+
country: string;
|
|
114
|
+
countryAlias: string;
|
|
115
|
+
id?: number | null | undefined;
|
|
116
|
+
city?: string | null | undefined;
|
|
117
|
+
street?: string | null | undefined;
|
|
118
|
+
state?: string | null | undefined;
|
|
119
|
+
stateAlias?: string | null | undefined;
|
|
120
|
+
neighborhood?: string | null | undefined;
|
|
121
|
+
postalCode?: string | null | undefined;
|
|
122
|
+
streetNumber?: string | null | undefined;
|
|
123
|
+
complement?: string | null | undefined;
|
|
124
|
+
reference?: string | null | undefined;
|
|
125
|
+
formattedAddress?: string | null | undefined;
|
|
126
|
+
}>;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
firstName: string;
|
|
129
|
+
lastName: string;
|
|
130
|
+
avatar: string;
|
|
131
|
+
birthday: string;
|
|
132
|
+
email: string;
|
|
133
|
+
password: string;
|
|
134
|
+
gender: "MALE" | "FEMALE" | "PREFER_NOT_TO_SAY";
|
|
135
|
+
address: {
|
|
136
|
+
location: {
|
|
137
|
+
type: "Point";
|
|
138
|
+
coordinates: {
|
|
139
|
+
lng: number;
|
|
140
|
+
lat: number;
|
|
141
|
+
};
|
|
142
|
+
} | null;
|
|
143
|
+
country: string;
|
|
144
|
+
countryAlias: string;
|
|
145
|
+
id?: number | null | undefined;
|
|
146
|
+
city?: string | null | undefined;
|
|
147
|
+
street?: string | null | undefined;
|
|
148
|
+
state?: string | null | undefined;
|
|
149
|
+
stateAlias?: string | null | undefined;
|
|
150
|
+
neighborhood?: string | null | undefined;
|
|
151
|
+
postalCode?: string | null | undefined;
|
|
152
|
+
streetNumber?: string | null | undefined;
|
|
153
|
+
complement?: string | null | undefined;
|
|
154
|
+
reference?: string | null | undefined;
|
|
155
|
+
formattedAddress?: string | null | undefined;
|
|
156
|
+
};
|
|
157
|
+
phone: string;
|
|
158
|
+
confirmPassword: string;
|
|
159
|
+
zipCode?: string | undefined;
|
|
160
|
+
}, {
|
|
161
|
+
firstName: string;
|
|
162
|
+
lastName: string;
|
|
163
|
+
avatar: string;
|
|
164
|
+
birthday: string;
|
|
165
|
+
email: string;
|
|
166
|
+
password: string;
|
|
167
|
+
gender: "MALE" | "FEMALE" | "PREFER_NOT_TO_SAY";
|
|
168
|
+
address: {
|
|
169
|
+
location: {
|
|
170
|
+
type: "Point";
|
|
171
|
+
coordinates: {
|
|
172
|
+
lng: number;
|
|
173
|
+
lat: number;
|
|
174
|
+
};
|
|
175
|
+
} | null;
|
|
176
|
+
country: string;
|
|
177
|
+
countryAlias: string;
|
|
178
|
+
id?: number | null | undefined;
|
|
179
|
+
city?: string | null | undefined;
|
|
180
|
+
street?: string | null | undefined;
|
|
181
|
+
state?: string | null | undefined;
|
|
182
|
+
stateAlias?: string | null | undefined;
|
|
183
|
+
neighborhood?: string | null | undefined;
|
|
184
|
+
postalCode?: string | null | undefined;
|
|
185
|
+
streetNumber?: string | null | undefined;
|
|
186
|
+
complement?: string | null | undefined;
|
|
187
|
+
reference?: string | null | undefined;
|
|
188
|
+
formattedAddress?: string | null | undefined;
|
|
189
|
+
};
|
|
190
|
+
phone: string;
|
|
191
|
+
confirmPassword: string;
|
|
192
|
+
zipCode?: string | undefined;
|
|
193
|
+
}>;
|
|
194
|
+
export type authRegisterInputSchemaBase = z.infer<typeof authRegisterInputSchemaBase>;
|
|
195
|
+
export declare const authRegisterInputSchema: z.ZodEffects<z.ZodObject<{
|
|
196
|
+
firstName: z.ZodString;
|
|
197
|
+
lastName: z.ZodString;
|
|
198
|
+
email: z.ZodString;
|
|
199
|
+
phone: z.ZodString;
|
|
200
|
+
zipCode: z.ZodOptional<z.ZodString>;
|
|
201
|
+
birthday: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
202
|
+
gender: z.ZodEnum<["MALE", "FEMALE", "PREFER_NOT_TO_SAY"]>;
|
|
203
|
+
password: z.ZodString;
|
|
204
|
+
confirmPassword: z.ZodString;
|
|
205
|
+
avatar: z.ZodString;
|
|
206
|
+
address: z.ZodObject<{
|
|
207
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
208
|
+
location: z.ZodNullable<z.ZodObject<{
|
|
209
|
+
type: z.ZodLiteral<"Point">;
|
|
210
|
+
coordinates: z.ZodObject<{
|
|
211
|
+
lat: z.ZodNumber;
|
|
212
|
+
lng: z.ZodNumber;
|
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
lng: number;
|
|
215
|
+
lat: number;
|
|
216
|
+
}, {
|
|
217
|
+
lng: number;
|
|
218
|
+
lat: number;
|
|
219
|
+
}>;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
type: "Point";
|
|
222
|
+
coordinates: {
|
|
223
|
+
lng: number;
|
|
224
|
+
lat: number;
|
|
225
|
+
};
|
|
226
|
+
}, {
|
|
227
|
+
type: "Point";
|
|
228
|
+
coordinates: {
|
|
229
|
+
lng: number;
|
|
230
|
+
lat: number;
|
|
231
|
+
};
|
|
232
|
+
}>>;
|
|
233
|
+
country: z.ZodString;
|
|
234
|
+
countryAlias: z.ZodString;
|
|
235
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
236
|
+
stateAlias: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
237
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
238
|
+
neighborhood: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
239
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
240
|
+
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
241
|
+
streetNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
242
|
+
complement: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
243
|
+
reference: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
244
|
+
formattedAddress: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
245
|
+
}, "strip", z.ZodTypeAny, {
|
|
246
|
+
location: {
|
|
247
|
+
type: "Point";
|
|
248
|
+
coordinates: {
|
|
249
|
+
lng: number;
|
|
250
|
+
lat: number;
|
|
251
|
+
};
|
|
252
|
+
} | null;
|
|
253
|
+
country: string;
|
|
254
|
+
countryAlias: string;
|
|
255
|
+
id?: number | null | undefined;
|
|
256
|
+
city?: string | null | undefined;
|
|
257
|
+
street?: string | null | undefined;
|
|
258
|
+
state?: string | null | undefined;
|
|
259
|
+
stateAlias?: string | null | undefined;
|
|
260
|
+
neighborhood?: string | null | undefined;
|
|
261
|
+
postalCode?: string | null | undefined;
|
|
262
|
+
streetNumber?: string | null | undefined;
|
|
263
|
+
complement?: string | null | undefined;
|
|
264
|
+
reference?: string | null | undefined;
|
|
265
|
+
formattedAddress?: string | null | undefined;
|
|
266
|
+
}, {
|
|
267
|
+
location: {
|
|
268
|
+
type: "Point";
|
|
269
|
+
coordinates: {
|
|
270
|
+
lng: number;
|
|
271
|
+
lat: number;
|
|
272
|
+
};
|
|
273
|
+
} | null;
|
|
274
|
+
country: string;
|
|
275
|
+
countryAlias: string;
|
|
276
|
+
id?: number | null | undefined;
|
|
277
|
+
city?: string | null | undefined;
|
|
278
|
+
street?: string | null | undefined;
|
|
279
|
+
state?: string | null | undefined;
|
|
280
|
+
stateAlias?: string | null | undefined;
|
|
281
|
+
neighborhood?: string | null | undefined;
|
|
282
|
+
postalCode?: string | null | undefined;
|
|
283
|
+
streetNumber?: string | null | undefined;
|
|
284
|
+
complement?: string | null | undefined;
|
|
285
|
+
reference?: string | null | undefined;
|
|
286
|
+
formattedAddress?: string | null | undefined;
|
|
287
|
+
}>;
|
|
288
|
+
}, "strip", z.ZodTypeAny, {
|
|
289
|
+
firstName: string;
|
|
290
|
+
lastName: string;
|
|
291
|
+
avatar: string;
|
|
292
|
+
birthday: string;
|
|
293
|
+
email: string;
|
|
294
|
+
password: string;
|
|
295
|
+
gender: "MALE" | "FEMALE" | "PREFER_NOT_TO_SAY";
|
|
296
|
+
address: {
|
|
297
|
+
location: {
|
|
298
|
+
type: "Point";
|
|
299
|
+
coordinates: {
|
|
300
|
+
lng: number;
|
|
301
|
+
lat: number;
|
|
302
|
+
};
|
|
303
|
+
} | null;
|
|
304
|
+
country: string;
|
|
305
|
+
countryAlias: string;
|
|
306
|
+
id?: number | null | undefined;
|
|
307
|
+
city?: string | null | undefined;
|
|
308
|
+
street?: string | null | undefined;
|
|
309
|
+
state?: string | null | undefined;
|
|
310
|
+
stateAlias?: string | null | undefined;
|
|
311
|
+
neighborhood?: string | null | undefined;
|
|
312
|
+
postalCode?: string | null | undefined;
|
|
313
|
+
streetNumber?: string | null | undefined;
|
|
314
|
+
complement?: string | null | undefined;
|
|
315
|
+
reference?: string | null | undefined;
|
|
316
|
+
formattedAddress?: string | null | undefined;
|
|
317
|
+
};
|
|
318
|
+
phone: string;
|
|
319
|
+
confirmPassword: string;
|
|
320
|
+
zipCode?: string | undefined;
|
|
321
|
+
}, {
|
|
322
|
+
firstName: string;
|
|
323
|
+
lastName: string;
|
|
324
|
+
avatar: string;
|
|
325
|
+
birthday: string;
|
|
326
|
+
email: string;
|
|
327
|
+
password: string;
|
|
328
|
+
gender: "MALE" | "FEMALE" | "PREFER_NOT_TO_SAY";
|
|
329
|
+
address: {
|
|
330
|
+
location: {
|
|
331
|
+
type: "Point";
|
|
332
|
+
coordinates: {
|
|
333
|
+
lng: number;
|
|
334
|
+
lat: number;
|
|
335
|
+
};
|
|
336
|
+
} | null;
|
|
337
|
+
country: string;
|
|
338
|
+
countryAlias: string;
|
|
339
|
+
id?: number | null | undefined;
|
|
340
|
+
city?: string | null | undefined;
|
|
341
|
+
street?: string | null | undefined;
|
|
342
|
+
state?: string | null | undefined;
|
|
343
|
+
stateAlias?: string | null | undefined;
|
|
344
|
+
neighborhood?: string | null | undefined;
|
|
345
|
+
postalCode?: string | null | undefined;
|
|
346
|
+
streetNumber?: string | null | undefined;
|
|
347
|
+
complement?: string | null | undefined;
|
|
348
|
+
reference?: string | null | undefined;
|
|
349
|
+
formattedAddress?: string | null | undefined;
|
|
350
|
+
};
|
|
351
|
+
phone: string;
|
|
352
|
+
confirmPassword: string;
|
|
353
|
+
zipCode?: string | undefined;
|
|
354
|
+
}>, {
|
|
355
|
+
firstName: string;
|
|
356
|
+
lastName: string;
|
|
357
|
+
avatar: string;
|
|
358
|
+
birthday: string;
|
|
359
|
+
email: string;
|
|
360
|
+
password: string;
|
|
361
|
+
gender: "MALE" | "FEMALE" | "PREFER_NOT_TO_SAY";
|
|
362
|
+
address: {
|
|
363
|
+
location: {
|
|
364
|
+
type: "Point";
|
|
365
|
+
coordinates: {
|
|
366
|
+
lng: number;
|
|
367
|
+
lat: number;
|
|
368
|
+
};
|
|
369
|
+
} | null;
|
|
370
|
+
country: string;
|
|
371
|
+
countryAlias: string;
|
|
372
|
+
id?: number | null | undefined;
|
|
373
|
+
city?: string | null | undefined;
|
|
374
|
+
street?: string | null | undefined;
|
|
375
|
+
state?: string | null | undefined;
|
|
376
|
+
stateAlias?: string | null | undefined;
|
|
377
|
+
neighborhood?: string | null | undefined;
|
|
378
|
+
postalCode?: string | null | undefined;
|
|
379
|
+
streetNumber?: string | null | undefined;
|
|
380
|
+
complement?: string | null | undefined;
|
|
381
|
+
reference?: string | null | undefined;
|
|
382
|
+
formattedAddress?: string | null | undefined;
|
|
383
|
+
};
|
|
384
|
+
phone: string;
|
|
385
|
+
confirmPassword: string;
|
|
386
|
+
zipCode?: string | undefined;
|
|
387
|
+
}, {
|
|
388
|
+
firstName: string;
|
|
389
|
+
lastName: string;
|
|
390
|
+
avatar: string;
|
|
391
|
+
birthday: string;
|
|
392
|
+
email: string;
|
|
393
|
+
password: string;
|
|
394
|
+
gender: "MALE" | "FEMALE" | "PREFER_NOT_TO_SAY";
|
|
395
|
+
address: {
|
|
396
|
+
location: {
|
|
397
|
+
type: "Point";
|
|
398
|
+
coordinates: {
|
|
399
|
+
lng: number;
|
|
400
|
+
lat: number;
|
|
401
|
+
};
|
|
402
|
+
} | null;
|
|
403
|
+
country: string;
|
|
404
|
+
countryAlias: string;
|
|
405
|
+
id?: number | null | undefined;
|
|
406
|
+
city?: string | null | undefined;
|
|
407
|
+
street?: string | null | undefined;
|
|
408
|
+
state?: string | null | undefined;
|
|
409
|
+
stateAlias?: string | null | undefined;
|
|
410
|
+
neighborhood?: string | null | undefined;
|
|
411
|
+
postalCode?: string | null | undefined;
|
|
412
|
+
streetNumber?: string | null | undefined;
|
|
413
|
+
complement?: string | null | undefined;
|
|
414
|
+
reference?: string | null | undefined;
|
|
415
|
+
formattedAddress?: string | null | undefined;
|
|
416
|
+
};
|
|
417
|
+
phone: string;
|
|
418
|
+
confirmPassword: string;
|
|
419
|
+
zipCode?: string | undefined;
|
|
420
|
+
}>;
|
|
421
|
+
export type authRegisterInputSchema = z.infer<typeof authRegisterInputSchema>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Member } from '../../models/member';
|
|
2
|
+
import { RefreshToken } from '../../models/refresh_token';
|
|
3
|
+
import { authLoginInputSchema, authSetPasswordInputSchema, authRegisterInputSchema } from './auth.schema';
|
|
4
|
+
import Store from '../../utils/store';
|
|
5
|
+
import Email from '../../emails/email';
|
|
6
|
+
export interface AutoLoginResult {
|
|
7
|
+
success: boolean;
|
|
8
|
+
member: {
|
|
9
|
+
id: number;
|
|
10
|
+
email: string;
|
|
11
|
+
firstName: string | null;
|
|
12
|
+
lastName: string | null;
|
|
13
|
+
avatar?: string | null;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface SetPasswordResult {
|
|
17
|
+
success: boolean;
|
|
18
|
+
message: string;
|
|
19
|
+
accessToken: string;
|
|
20
|
+
refreshToken: string;
|
|
21
|
+
}
|
|
22
|
+
export declare class AuthService {
|
|
23
|
+
private readonly MemberModel;
|
|
24
|
+
private readonly RefreshTokenModel;
|
|
25
|
+
private readonly Store;
|
|
26
|
+
private readonly Email;
|
|
27
|
+
private readonly url;
|
|
28
|
+
constructor(MemberModel: typeof Member, RefreshTokenModel: typeof RefreshToken, Store: Store, Email: Email);
|
|
29
|
+
loginMember(input: authLoginInputSchema): Promise<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
accessToken: string;
|
|
32
|
+
refreshToken: string;
|
|
33
|
+
user: import("../../types/auth").MemberAuthResponse;
|
|
34
|
+
}>;
|
|
35
|
+
autoLoginWithJwt(userId: number): Promise<AutoLoginResult>;
|
|
36
|
+
registerMember(input: authRegisterInputSchema): Promise<{
|
|
37
|
+
success: boolean;
|
|
38
|
+
message: string;
|
|
39
|
+
}>;
|
|
40
|
+
setPassword(input: authSetPasswordInputSchema, userId: number): Promise<SetPasswordResult>;
|
|
41
|
+
createVerificationLink(email: string, unhashedVerificationToken: string): Promise<string>;
|
|
42
|
+
generateWelcomeEmail(email: string, unhashedVerificationToken: string): Promise<void>;
|
|
43
|
+
private signAccessToken;
|
|
44
|
+
private signRefreshToken;
|
|
45
|
+
generateResetPasswordToken(userId: number, email: string, inviteToken?: string): string;
|
|
46
|
+
generateResetPasswordUrl(userId: number, email: string, inviteToken?: string): string;
|
|
47
|
+
private checkPassword;
|
|
48
|
+
private hashPassword;
|
|
49
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { AuthService } from './auth.service';
|
|
2
|
+
export { AuthFactory } from './auth.factory';
|
|
3
|
+
export { authSetPasswordInputSchema as setPasswordInputSchema, authLoginInputSchema as loginInputSchema, authRegisterInputSchema as registerInputSchema, type authSetPasswordInputSchema as SetPasswordInput, type authLoginInputSchema as LoginInput, type authRegisterInputSchema as RegisterInput, } from './auth.schema';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OAuth2Client } from 'google-auth-library';
|
|
2
|
+
/**
|
|
3
|
+
* Diagnostic utility to verify calendar access token has correct scopes and belongs to expected account
|
|
4
|
+
* This helps debug persistent 401 errors by showing exactly what's wrong with the token
|
|
5
|
+
*/
|
|
6
|
+
export declare function assertCalendarScopeAndAccount(oAuth2Client: OAuth2Client, expectedEmail?: string): Promise<{
|
|
7
|
+
email: string | null | undefined;
|
|
8
|
+
aud: string | undefined;
|
|
9
|
+
scopes: string[];
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Calendar Fetch Client
|
|
3
|
+
*
|
|
4
|
+
* Direct fetch()-based implementation that bypasses googleapis library.
|
|
5
|
+
* Uses OAuth2Client for automatic token refresh management.
|
|
6
|
+
*
|
|
7
|
+
* Why this approach:
|
|
8
|
+
* - googleapis v166 has a bug where OAuth2Client credentials aren't properly used
|
|
9
|
+
* - Direct fetch() calls work perfectly with Authorization header
|
|
10
|
+
* - OAuth2Client.getAccessToken() handles token refresh automatically
|
|
11
|
+
* - Simpler, more transparent, and more reliable
|
|
12
|
+
*/
|
|
13
|
+
import { OAuth2Client } from 'google-auth-library';
|
|
14
|
+
interface CalendarEvent {
|
|
15
|
+
summary?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
location?: string;
|
|
18
|
+
start?: {
|
|
19
|
+
dateTime?: string;
|
|
20
|
+
date?: string;
|
|
21
|
+
timeZone?: string;
|
|
22
|
+
};
|
|
23
|
+
end?: {
|
|
24
|
+
dateTime?: string;
|
|
25
|
+
date?: string;
|
|
26
|
+
timeZone?: string;
|
|
27
|
+
};
|
|
28
|
+
recurrence?: string[];
|
|
29
|
+
attendees?: Array<{
|
|
30
|
+
email: string;
|
|
31
|
+
displayName?: string;
|
|
32
|
+
responseStatus?: string;
|
|
33
|
+
}>;
|
|
34
|
+
reminders?: {
|
|
35
|
+
useDefault?: boolean;
|
|
36
|
+
overrides?: Array<{
|
|
37
|
+
method: string;
|
|
38
|
+
minutes: number;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
conferenceData?: any;
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}
|
|
44
|
+
interface CalendarListParams {
|
|
45
|
+
maxResults?: number;
|
|
46
|
+
timeMin?: string;
|
|
47
|
+
timeMax?: string;
|
|
48
|
+
singleEvents?: boolean;
|
|
49
|
+
orderBy?: string;
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}
|
|
52
|
+
export declare class GoogleCalendarFetchClient {
|
|
53
|
+
private oauth2Client;
|
|
54
|
+
private readonly baseUrl;
|
|
55
|
+
constructor(oauth2Client: OAuth2Client);
|
|
56
|
+
/**
|
|
57
|
+
* Get a fresh access token (automatically refreshes if expired)
|
|
58
|
+
*/
|
|
59
|
+
private getAccessToken;
|
|
60
|
+
/**
|
|
61
|
+
* Make a request to the Calendar API
|
|
62
|
+
*/
|
|
63
|
+
private request;
|
|
64
|
+
/**
|
|
65
|
+
* Insert a new event
|
|
66
|
+
*/
|
|
67
|
+
insertEvent(calendarId: string, event: CalendarEvent, params?: {
|
|
68
|
+
sendUpdates?: 'all' | 'externalOnly' | 'none';
|
|
69
|
+
}): Promise<CalendarEvent>;
|
|
70
|
+
/**
|
|
71
|
+
* Update an existing event (full replacement)
|
|
72
|
+
*/
|
|
73
|
+
updateEvent(calendarId: string, eventId: string, event: CalendarEvent, params?: {
|
|
74
|
+
sendUpdates?: 'all' | 'externalOnly' | 'none';
|
|
75
|
+
}): Promise<CalendarEvent>;
|
|
76
|
+
/**
|
|
77
|
+
* Patch an existing event (partial update)
|
|
78
|
+
*/
|
|
79
|
+
patchEvent(calendarId: string, eventId: string, event: Partial<CalendarEvent>, params?: {
|
|
80
|
+
sendUpdates?: 'all' | 'externalOnly' | 'none';
|
|
81
|
+
}): Promise<CalendarEvent>;
|
|
82
|
+
/**
|
|
83
|
+
* Delete an event
|
|
84
|
+
*/
|
|
85
|
+
deleteEvent(calendarId: string, eventId: string, params?: {
|
|
86
|
+
sendUpdates?: 'all' | 'externalOnly' | 'none';
|
|
87
|
+
}): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Get a single event
|
|
90
|
+
*/
|
|
91
|
+
getEvent(calendarId: string, eventId: string): Promise<CalendarEvent>;
|
|
92
|
+
/**
|
|
93
|
+
* List events
|
|
94
|
+
*/
|
|
95
|
+
listEvents(calendarId: string, params?: CalendarListParams): Promise<{
|
|
96
|
+
items: CalendarEvent[];
|
|
97
|
+
[key: string]: any;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Get the underlying OAuth2Client (for compatibility with existing code)
|
|
101
|
+
*/
|
|
102
|
+
getOAuth2Client(): OAuth2Client;
|
|
103
|
+
}
|
|
104
|
+
export interface CalendarClientResult {
|
|
105
|
+
calendar: GoogleCalendarFetchClient;
|
|
106
|
+
oauth2Client: OAuth2Client;
|
|
107
|
+
}
|
|
108
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CalendarPermissionsService } from './calendar-permissions.service';
|
|
2
|
+
/**
|
|
3
|
+
* Factory for creating CalendarPermissionsService instances
|
|
4
|
+
* This is separate from OauthFactory which handles the oauth table for user session authentication
|
|
5
|
+
* Calendar functionality uses calendar_permissions table
|
|
6
|
+
*/
|
|
7
|
+
export declare class CalendarPermissionsFactory {
|
|
8
|
+
static createInstance(): CalendarPermissionsService;
|
|
9
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { OAuth2Client, OAuth2ClientOptions } from 'google-auth-library';
|
|
2
|
+
import { CalendarPermissions } from '../../models/calendar_permissions';
|
|
3
|
+
import { CalendarClientResult } from './calendar-fetch-client';
|
|
4
|
+
/**
|
|
5
|
+
* Service for managing Google Calendar permissions using calendar_permissions table
|
|
6
|
+
* This is separate from OauthFactory which handles the oauth table for user session authentication
|
|
7
|
+
*/
|
|
8
|
+
export declare class CalendarPermissionsService {
|
|
9
|
+
private googleClient;
|
|
10
|
+
private googleOptions;
|
|
11
|
+
constructor(googleOauthOptions: OAuth2ClientOptions);
|
|
12
|
+
/**
|
|
13
|
+
* Get the OAuth2Client instance for making Google Calendar API calls
|
|
14
|
+
*/
|
|
15
|
+
getClient(): OAuth2Client;
|
|
16
|
+
/**
|
|
17
|
+
* Generate Google Calendar authorization URL
|
|
18
|
+
*/
|
|
19
|
+
generateCalendarAuthUrl(userId?: number, forceConsent?: boolean): string;
|
|
20
|
+
/**
|
|
21
|
+
* Verify Google Calendar OAuth callback code and return tokens
|
|
22
|
+
*/
|
|
23
|
+
verifyCalendarToken(code: string): Promise<{
|
|
24
|
+
tokens: {
|
|
25
|
+
access_token: string;
|
|
26
|
+
refresh_token?: string | null;
|
|
27
|
+
};
|
|
28
|
+
payload: {
|
|
29
|
+
id: string;
|
|
30
|
+
email: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
picture?: string;
|
|
33
|
+
};
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Check if user has active calendar permissions
|
|
37
|
+
*/
|
|
38
|
+
hasCalendarOAuth(memberId: number): Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Check if user needs to upgrade from legacy broad calendar scope to calendar.events
|
|
41
|
+
* Returns true if user has the old broad scope but not the new narrow scope
|
|
42
|
+
*/
|
|
43
|
+
needsScopeUpgrade(memberId: number): Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* Mark calendar permissions as requiring reauth (sets status to EXPIRED)
|
|
46
|
+
* This is called when token validation fails or diagnostics show the token is invalid
|
|
47
|
+
*/
|
|
48
|
+
markRequiresReauth(memberId: number, reason?: string): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Save calendar OAuth tokens to calendar_permissions table
|
|
51
|
+
*/
|
|
52
|
+
upsertCalendarOAuth(payload: {
|
|
53
|
+
id: string;
|
|
54
|
+
email: string;
|
|
55
|
+
name?: string;
|
|
56
|
+
picture?: string;
|
|
57
|
+
}, memberId: number, accessToken: string, refreshToken?: string | null): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Get calendar permissions for a user from calendar_permissions table
|
|
60
|
+
* Uses calendar_permissions table, NOT oauth table (which is for user session auth)
|
|
61
|
+
*/
|
|
62
|
+
getCalendarPermissions(memberId: number, provider?: string): Promise<CalendarPermissions | null>;
|
|
63
|
+
/**
|
|
64
|
+
* Refresh access token using refresh_token from calendar_permissions table
|
|
65
|
+
*/
|
|
66
|
+
refreshAccessToken(memberId: number, provider?: string): Promise<string>;
|
|
67
|
+
/**
|
|
68
|
+
* Create a Google Calendar API client with credentials from calendar_permissions table
|
|
69
|
+
* If accessToken is missing but refreshToken exists, attempts to refresh first
|
|
70
|
+
*
|
|
71
|
+
* Returns a fetch-based calendar client that bypasses googleapis library bug
|
|
72
|
+
*/
|
|
73
|
+
createCalendarClient(memberId: number, provider?: string): Promise<CalendarClientResult>;
|
|
74
|
+
}
|