@brite-future-schools-contracts/contracts 2.0.40 → 2.0.42

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.
@@ -133,6 +133,15 @@ declare const updateProfileContract: _orpc_contract.ContractProcedureBuilderWith
133
133
  phone: z.ZodNullable<z.ZodString>;
134
134
  avatarUrl: z.ZodNullable<z.ZodString>;
135
135
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
136
+ /** Request an email change — requires current password, sends a verification link to the new address */
137
+ declare const requestEmailChangeContract: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
138
+ newEmail: z.ZodEmail;
139
+ password: z.ZodString;
140
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>, Record<never, never>, Record<never, never>>;
141
+ /** Confirm an email change using the token from the verification email */
142
+ declare const confirmEmailChangeContract: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
143
+ token: z.ZodString;
144
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>, Record<never, never>, Record<never, never>>;
136
145
  declare const authContract: {
137
146
  login: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
138
147
  email: z.ZodEmail;
@@ -255,6 +264,13 @@ declare const authContract: {
255
264
  phone: z.ZodNullable<z.ZodString>;
256
265
  avatarUrl: z.ZodNullable<z.ZodString>;
257
266
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
267
+ requestEmailChange: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
268
+ newEmail: z.ZodEmail;
269
+ password: z.ZodString;
270
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>, Record<never, never>, Record<never, never>>;
271
+ confirmEmailChange: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
272
+ token: z.ZodString;
273
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>, Record<never, never>, Record<never, never>>;
258
274
  };
259
275
 
260
276
  declare const createStaffContract: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
@@ -3433,4 +3449,4 @@ declare const blocksContract: {
3433
3449
  }, z.core.$strip>, z.ZodUnknown, Record<never, never>, Record<never, never>>;
3434
3450
  };
3435
3451
 
3436
- export { acknowledgeContract, acknowledgeDiaryEntryContract, approveContract, approveLiftContract, attendanceContract, authContract, bankingContract, blocksContract, bulkUploadStudentsContract, calendarContract, calendarListTermsContract, cancelContract, changePasswordContract, createBankAccountContract, createCategoryContract, createDepartmentContract, createEntryContract, createGradeContract, createNotificationContract, createStaffContract, createStudentContract, createTermContract, createYearContract, deactivateContract, diaryContract, getByClassContract, getByIdContract, getByStudentContract, getEntryContract, getMeContract, getProfileContract, getResponseSummaryContract, getStaffByIdContract, getStudentByIdContract, getTemplateContract, gradesContract, hrContract, linkGuardianContract, listAccountsContract, listAcknowledgementsContract, listActiveBlocksContract, listBanksContract, listCategoriesContract, listClassesContract, listDeliveriesContract, listDepartmentsContract, listEntriesContract, listForGuardianContract, listGradesContract, listResponsesContract, listStaffContract, listStudentsContract, listTemplatesContract, listTermsContract, listYearsContract, loginContract, logoutContract, markAttendanceContract, markReadContract, markUnreadContract, notificationsContract, refreshTokenContract, rejectContract, requestLiftContract, requestPasswordResetContract, resetPasswordContract, resolveBlockAltContract, resolveBlockContract, respondContract, respondToBlockContract, respondToDiaryEntryContract, setCurrentTermContract, setCurrentYearContract, setDefaultContract, studentsContract, submitContract, switchBranchContract, updateBankAccountContract, updateCategoryContract, updateProfileContract, updateStaffStatusContract, verifyPasswordContract };
3452
+ export { acknowledgeContract, acknowledgeDiaryEntryContract, approveContract, approveLiftContract, attendanceContract, authContract, bankingContract, blocksContract, bulkUploadStudentsContract, calendarContract, calendarListTermsContract, cancelContract, changePasswordContract, confirmEmailChangeContract, createBankAccountContract, createCategoryContract, createDepartmentContract, createEntryContract, createGradeContract, createNotificationContract, createStaffContract, createStudentContract, createTermContract, createYearContract, deactivateContract, diaryContract, getByClassContract, getByIdContract, getByStudentContract, getEntryContract, getMeContract, getProfileContract, getResponseSummaryContract, getStaffByIdContract, getStudentByIdContract, getTemplateContract, gradesContract, hrContract, linkGuardianContract, listAccountsContract, listAcknowledgementsContract, listActiveBlocksContract, listBanksContract, listCategoriesContract, listClassesContract, listDeliveriesContract, listDepartmentsContract, listEntriesContract, listForGuardianContract, listGradesContract, listResponsesContract, listStaffContract, listStudentsContract, listTemplatesContract, listTermsContract, listYearsContract, loginContract, logoutContract, markAttendanceContract, markReadContract, markUnreadContract, notificationsContract, refreshTokenContract, rejectContract, requestEmailChangeContract, requestLiftContract, requestPasswordResetContract, resetPasswordContract, resolveBlockAltContract, resolveBlockContract, respondContract, respondToBlockContract, respondToDiaryEntryContract, setCurrentTermContract, setCurrentYearContract, setDefaultContract, studentsContract, submitContract, switchBranchContract, updateBankAccountContract, updateCategoryContract, updateProfileContract, updateStaffStatusContract, verifyPasswordContract };
@@ -133,6 +133,15 @@ declare const updateProfileContract: _orpc_contract.ContractProcedureBuilderWith
133
133
  phone: z.ZodNullable<z.ZodString>;
134
134
  avatarUrl: z.ZodNullable<z.ZodString>;
135
135
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
136
+ /** Request an email change — requires current password, sends a verification link to the new address */
137
+ declare const requestEmailChangeContract: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
138
+ newEmail: z.ZodEmail;
139
+ password: z.ZodString;
140
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>, Record<never, never>, Record<never, never>>;
141
+ /** Confirm an email change using the token from the verification email */
142
+ declare const confirmEmailChangeContract: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
143
+ token: z.ZodString;
144
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>, Record<never, never>, Record<never, never>>;
136
145
  declare const authContract: {
137
146
  login: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
138
147
  email: z.ZodEmail;
@@ -255,6 +264,13 @@ declare const authContract: {
255
264
  phone: z.ZodNullable<z.ZodString>;
256
265
  avatarUrl: z.ZodNullable<z.ZodString>;
257
266
  }, z.core.$strip>, Record<never, never>, Record<never, never>>;
267
+ requestEmailChange: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
268
+ newEmail: z.ZodEmail;
269
+ password: z.ZodString;
270
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>, Record<never, never>, Record<never, never>>;
271
+ confirmEmailChange: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
272
+ token: z.ZodString;
273
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>, Record<never, never>, Record<never, never>>;
258
274
  };
259
275
 
260
276
  declare const createStaffContract: _orpc_contract.ContractProcedureBuilderWithInputOutput<z.ZodObject<{
@@ -3433,4 +3449,4 @@ declare const blocksContract: {
3433
3449
  }, z.core.$strip>, z.ZodUnknown, Record<never, never>, Record<never, never>>;
3434
3450
  };
3435
3451
 
3436
- export { acknowledgeContract, acknowledgeDiaryEntryContract, approveContract, approveLiftContract, attendanceContract, authContract, bankingContract, blocksContract, bulkUploadStudentsContract, calendarContract, calendarListTermsContract, cancelContract, changePasswordContract, createBankAccountContract, createCategoryContract, createDepartmentContract, createEntryContract, createGradeContract, createNotificationContract, createStaffContract, createStudentContract, createTermContract, createYearContract, deactivateContract, diaryContract, getByClassContract, getByIdContract, getByStudentContract, getEntryContract, getMeContract, getProfileContract, getResponseSummaryContract, getStaffByIdContract, getStudentByIdContract, getTemplateContract, gradesContract, hrContract, linkGuardianContract, listAccountsContract, listAcknowledgementsContract, listActiveBlocksContract, listBanksContract, listCategoriesContract, listClassesContract, listDeliveriesContract, listDepartmentsContract, listEntriesContract, listForGuardianContract, listGradesContract, listResponsesContract, listStaffContract, listStudentsContract, listTemplatesContract, listTermsContract, listYearsContract, loginContract, logoutContract, markAttendanceContract, markReadContract, markUnreadContract, notificationsContract, refreshTokenContract, rejectContract, requestLiftContract, requestPasswordResetContract, resetPasswordContract, resolveBlockAltContract, resolveBlockContract, respondContract, respondToBlockContract, respondToDiaryEntryContract, setCurrentTermContract, setCurrentYearContract, setDefaultContract, studentsContract, submitContract, switchBranchContract, updateBankAccountContract, updateCategoryContract, updateProfileContract, updateStaffStatusContract, verifyPasswordContract };
3452
+ export { acknowledgeContract, acknowledgeDiaryEntryContract, approveContract, approveLiftContract, attendanceContract, authContract, bankingContract, blocksContract, bulkUploadStudentsContract, calendarContract, calendarListTermsContract, cancelContract, changePasswordContract, confirmEmailChangeContract, createBankAccountContract, createCategoryContract, createDepartmentContract, createEntryContract, createGradeContract, createNotificationContract, createStaffContract, createStudentContract, createTermContract, createYearContract, deactivateContract, diaryContract, getByClassContract, getByIdContract, getByStudentContract, getEntryContract, getMeContract, getProfileContract, getResponseSummaryContract, getStaffByIdContract, getStudentByIdContract, getTemplateContract, gradesContract, hrContract, linkGuardianContract, listAccountsContract, listAcknowledgementsContract, listActiveBlocksContract, listBanksContract, listCategoriesContract, listClassesContract, listDeliveriesContract, listDepartmentsContract, listEntriesContract, listForGuardianContract, listGradesContract, listResponsesContract, listStaffContract, listStudentsContract, listTemplatesContract, listTermsContract, listYearsContract, loginContract, logoutContract, markAttendanceContract, markReadContract, markUnreadContract, notificationsContract, refreshTokenContract, rejectContract, requestEmailChangeContract, requestLiftContract, requestPasswordResetContract, resetPasswordContract, resolveBlockAltContract, resolveBlockContract, respondContract, respondToBlockContract, respondToDiaryEntryContract, setCurrentTermContract, setCurrentYearContract, setDefaultContract, studentsContract, submitContract, switchBranchContract, updateBankAccountContract, updateCategoryContract, updateProfileContract, updateStaffStatusContract, verifyPasswordContract };
@@ -12,6 +12,7 @@ import {
12
12
  calendarListTermsContract,
13
13
  cancelContract,
14
14
  changePasswordContract,
15
+ confirmEmailChangeContract,
15
16
  createBankAccountContract,
16
17
  createCategoryContract,
17
18
  createDepartmentContract,
@@ -62,6 +63,7 @@ import {
62
63
  notificationsContract,
63
64
  refreshTokenContract,
64
65
  rejectContract,
66
+ requestEmailChangeContract,
65
67
  requestLiftContract,
66
68
  requestPasswordResetContract,
67
69
  resetPasswordContract,
@@ -81,8 +83,8 @@ import {
81
83
  updateProfileContract,
82
84
  updateStaffStatusContract,
83
85
  verifyPasswordContract
84
- } from "../chunk-KTEC74C2.js";
85
- import "../chunk-VNZGHQ6T.js";
86
+ } from "../chunk-C4UISE2G.js";
87
+ import "../chunk-FFST2NEY.js";
86
88
  export {
87
89
  acknowledgeContract,
88
90
  acknowledgeDiaryEntryContract,
@@ -97,6 +99,7 @@ export {
97
99
  calendarListTermsContract,
98
100
  cancelContract,
99
101
  changePasswordContract,
102
+ confirmEmailChangeContract,
100
103
  createBankAccountContract,
101
104
  createCategoryContract,
102
105
  createDepartmentContract,
@@ -147,6 +150,7 @@ export {
147
150
  notificationsContract,
148
151
  refreshTokenContract,
149
152
  rejectContract,
153
+ requestEmailChangeContract,
150
154
  requestLiftContract,
151
155
  requestPasswordResetContract,
152
156
  resetPasswordContract,
package/dist/index.cjs CHANGED
@@ -46,6 +46,7 @@ __export(src_exports, {
46
46
  ChangePasswordInputSchema: () => ChangePasswordInputSchema,
47
47
  ClassAttendanceRowSchema: () => ClassAttendanceRowSchema,
48
48
  ClassSummarySchema: () => ClassSummarySchema,
49
+ ConfirmEmailChangeInputSchema: () => ConfirmEmailChangeInputSchema,
49
50
  CreateBankAccountInputSchema: () => CreateBankAccountInputSchema,
50
51
  CreateDepartmentInputSchema: () => CreateDepartmentInputSchema,
51
52
  CreateDiaryCategoryInputSchema: () => CreateDiaryCategoryInputSchema,
@@ -107,6 +108,7 @@ __export(src_exports, {
107
108
  RefreshTokenInputSchema: () => RefreshTokenInputSchema,
108
109
  RefreshTokenOutputSchema: () => RefreshTokenOutputSchema,
109
110
  RejectNotificationInputSchema: () => RejectNotificationInputSchema,
111
+ RequestEmailChangeInputSchema: () => RequestEmailChangeInputSchema,
110
112
  RequestPasswordResetInputSchema: () => RequestPasswordResetInputSchema,
111
113
  ResetPasswordInputSchema: () => ResetPasswordInputSchema,
112
114
  RespondToBlockInputSchema: () => RespondToBlockInputSchema,
@@ -185,6 +187,7 @@ __export(src_exports, {
185
187
  canViewTransport: () => canViewTransport,
186
188
  cancelContract: () => cancelContract,
187
189
  changePasswordContract: () => changePasswordContract,
190
+ confirmEmailChangeContract: () => confirmEmailChangeContract,
188
191
  createBankAccountContract: () => createBankAccountContract,
189
192
  createCategoryContract: () => createCategoryContract,
190
193
  createDepartmentContract: () => createDepartmentContract,
@@ -266,6 +269,7 @@ __export(src_exports, {
266
269
  paginatedOutputSchema: () => paginatedOutputSchema,
267
270
  refreshTokenContract: () => refreshTokenContract,
268
271
  rejectContract: () => rejectContract,
272
+ requestEmailChangeContract: () => requestEmailChangeContract,
269
273
  requestLiftContract: () => requestLiftContract,
270
274
  requestPasswordResetContract: () => requestPasswordResetContract,
271
275
  resetPasswordContract: () => resetPasswordContract,
@@ -413,6 +417,13 @@ var UpdateProfileInputSchema = z2.object({
413
417
  lastName: z2.string().min(1),
414
418
  phone: z2.string().regex(/^\+[1-9]\d{1,14}$/, { error: "Phone must be in E.164 format, e.g. +254712345678" })
415
419
  });
420
+ var RequestEmailChangeInputSchema = z2.object({
421
+ newEmail: z2.email().meta({ description: "The email address to change to" }),
422
+ password: z2.string().min(1).meta({ description: "Current password \u2014 required to authorize the change" })
423
+ });
424
+ var ConfirmEmailChangeInputSchema = z2.object({
425
+ token: z2.string().min(1).meta({ description: "One-time token from the confirmation email link" })
426
+ });
416
427
 
417
428
  // src/schemas/hr.ts
418
429
  var z3 = __toESM(require("zod"), 1);
@@ -1167,6 +1178,8 @@ var switchBranchContract = import_contract.oc.route({ method: "POST", path: "/au
1167
1178
  var verifyPasswordContract = import_contract.oc.route({ method: "POST", path: "/auth/verify-password" }).input(VerifyPasswordInputSchema).output(VerifyPasswordOutputSchema);
1168
1179
  var getProfileContract = import_contract.oc.route({ method: "GET", path: "/auth/profile" }).output(ProfileOutputSchema);
1169
1180
  var updateProfileContract = import_contract.oc.route({ method: "PATCH", path: "/auth/profile" }).input(UpdateProfileInputSchema).output(ProfileOutputSchema);
1181
+ var requestEmailChangeContract = import_contract.oc.route({ method: "POST", path: "/auth/request-email-change" }).input(RequestEmailChangeInputSchema).output(EmptyOutputSchema);
1182
+ var confirmEmailChangeContract = import_contract.oc.route({ method: "POST", path: "/auth/confirm-email-change" }).input(ConfirmEmailChangeInputSchema).output(EmptyOutputSchema);
1170
1183
  var authContract = {
1171
1184
  login: loginContract,
1172
1185
  refreshToken: refreshTokenContract,
@@ -1178,7 +1191,9 @@ var authContract = {
1178
1191
  switchBranch: switchBranchContract,
1179
1192
  verifyPassword: verifyPasswordContract,
1180
1193
  profile: getProfileContract,
1181
- updateProfile: updateProfileContract
1194
+ updateProfile: updateProfileContract,
1195
+ requestEmailChange: requestEmailChangeContract,
1196
+ confirmEmailChange: confirmEmailChangeContract
1182
1197
  };
1183
1198
 
1184
1199
  // src/contracts/hr.ts
@@ -1647,6 +1662,7 @@ function isScopedToOwnVehicle(user) {
1647
1662
  ChangePasswordInputSchema,
1648
1663
  ClassAttendanceRowSchema,
1649
1664
  ClassSummarySchema,
1665
+ ConfirmEmailChangeInputSchema,
1650
1666
  CreateBankAccountInputSchema,
1651
1667
  CreateDepartmentInputSchema,
1652
1668
  CreateDiaryCategoryInputSchema,
@@ -1708,6 +1724,7 @@ function isScopedToOwnVehicle(user) {
1708
1724
  RefreshTokenInputSchema,
1709
1725
  RefreshTokenOutputSchema,
1710
1726
  RejectNotificationInputSchema,
1727
+ RequestEmailChangeInputSchema,
1711
1728
  RequestPasswordResetInputSchema,
1712
1729
  ResetPasswordInputSchema,
1713
1730
  RespondToBlockInputSchema,
@@ -1786,6 +1803,7 @@ function isScopedToOwnVehicle(user) {
1786
1803
  canViewTransport,
1787
1804
  cancelContract,
1788
1805
  changePasswordContract,
1806
+ confirmEmailChangeContract,
1789
1807
  createBankAccountContract,
1790
1808
  createCategoryContract,
1791
1809
  createDepartmentContract,
@@ -1867,6 +1885,7 @@ function isScopedToOwnVehicle(user) {
1867
1885
  paginatedOutputSchema,
1868
1886
  refreshTokenContract,
1869
1887
  rejectContract,
1888
+ requestEmailChangeContract,
1870
1889
  requestLiftContract,
1871
1890
  requestPasswordResetContract,
1872
1891
  resetPasswordContract,