codeforlife 2.11.8 → 2.11.10

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.
Files changed (160) hide show
  1. package/dist/api/endpoints/index.d.ts +2 -9
  2. package/dist/api/index.d.ts +2 -5
  3. package/dist/components/form/index.d.ts +2 -14
  4. package/dist/components/index.d.ts +2 -17
  5. package/dist/components/page/index.d.ts +2 -5
  6. package/dist/components/router/index.d.ts +2 -6
  7. package/dist/components/table/index.d.ts +2 -3
  8. package/dist/features/index.d.ts +2 -4
  9. package/dist/hooks/index.d.ts +2 -5
  10. package/dist/index.d.ts +2 -2
  11. package/dist/middlewares/index.d.ts +2 -1
  12. package/dist/server/App.d.ts +4 -15
  13. package/dist/server/entry.cjs.js +1 -1
  14. package/dist/server/entry.cjs.js.map +1 -1
  15. package/dist/server/entry.d.ts +2 -16
  16. package/dist/server/entry.es.js +23 -17
  17. package/dist/server/entry.es.js.map +1 -1
  18. package/dist/server/server.d.ts +4 -55
  19. package/dist/settings/index.d.ts +2 -3
  20. package/dist/slices/index.d.ts +2 -2
  21. package/dist/src/api/endpoints/index.d.ts +9 -0
  22. package/dist/src/api/index.d.ts +5 -0
  23. package/dist/src/components/form/index.d.ts +14 -0
  24. package/dist/src/components/index.d.ts +17 -0
  25. package/dist/src/components/page/index.d.ts +5 -0
  26. package/dist/src/components/router/index.d.ts +6 -0
  27. package/dist/src/components/table/index.d.ts +3 -0
  28. package/dist/src/features/index.d.ts +4 -0
  29. package/dist/src/hooks/index.d.ts +5 -0
  30. package/dist/src/index.d.ts +2 -0
  31. package/dist/src/middlewares/index.d.ts +1 -0
  32. package/dist/src/server/App.d.ts +15 -0
  33. package/dist/src/server/entry.d.ts +16 -0
  34. package/dist/src/server/server.d.ts +55 -0
  35. package/dist/src/settings/index.d.ts +3 -0
  36. package/dist/src/slices/index.d.ts +2 -0
  37. package/dist/src/theme/components/index.d.ts +3 -0
  38. package/dist/src/theme/index.d.ts +7 -0
  39. package/dist/src/utils/api.d.ts +72 -0
  40. package/dist/src/utils/auth.d.ts +28 -0
  41. package/dist/src/utils/form.d.ts +25 -0
  42. package/dist/src/utils/general.d.ts +30 -0
  43. package/dist/src/utils/router.d.ts +19 -0
  44. package/dist/src/utils/schema.d.ts +43 -0
  45. package/dist/src/utils/store.d.ts +10 -0
  46. package/dist/src/utils/test.d.ts +53 -0
  47. package/dist/src/utils/theme.d.ts +11 -0
  48. package/dist/src/utils/window.d.ts +2 -0
  49. package/dist/theme/components/index.d.ts +4 -3
  50. package/dist/theme/index.d.ts +2 -7
  51. package/dist/utils/api.d.ts +2 -72
  52. package/dist/utils/auth.d.ts +2 -28
  53. package/dist/utils/form.d.ts +2 -25
  54. package/dist/utils/general.d.ts +2 -30
  55. package/dist/utils/router.d.ts +2 -19
  56. package/dist/utils/schema.d.ts +2 -43
  57. package/dist/utils/store.d.ts +2 -10
  58. package/dist/utils/test.d.ts +2 -53
  59. package/dist/utils/theme.d.ts +2 -11
  60. package/dist/utils/window.d.ts +2 -2
  61. package/package.json +1 -1
  62. /package/dist/{api → src/api}/createApi.d.ts +0 -0
  63. /package/dist/{api → src/api}/endpoints/authFactor.d.ts +0 -0
  64. /package/dist/{api → src/api}/endpoints/klass.d.ts +0 -0
  65. /package/dist/{api → src/api}/endpoints/school.d.ts +0 -0
  66. /package/dist/{api → src/api}/endpoints/session.d.ts +0 -0
  67. /package/dist/{api → src/api}/endpoints/user.d.ts +0 -0
  68. /package/dist/{api → src/api}/models.d.ts +0 -0
  69. /package/dist/{api → src/api}/schemas.d.ts +0 -0
  70. /package/dist/{api → src/api}/tagTypes.d.ts +0 -0
  71. /package/dist/{api → src/api}/urls.d.ts +0 -0
  72. /package/dist/{components → src/components}/ClickableTooltip.d.ts +0 -0
  73. /package/dist/{components → src/components}/CopyIconButton.d.ts +0 -0
  74. /package/dist/{components → src/components}/CopyIconButton.test.d.ts +0 -0
  75. /package/dist/{components → src/components}/Countdown.d.ts +0 -0
  76. /package/dist/{components → src/components}/DownloadFileButton.d.ts +0 -0
  77. /package/dist/{components → src/components}/ElevatedAppBar.d.ts +0 -0
  78. /package/dist/{components → src/components}/Image.d.ts +0 -0
  79. /package/dist/{components → src/components}/InputFileButton.d.ts +0 -0
  80. /package/dist/{components → src/components}/ItemizedList.d.ts +0 -0
  81. /package/dist/{components → src/components}/OrderedGrid.d.ts +0 -0
  82. /package/dist/{components → src/components}/ScrollIntoViewLink.d.ts +0 -0
  83. /package/dist/{components → src/components}/SyncError.d.ts +0 -0
  84. /package/dist/{components → src/components}/TablePagination.d.ts +0 -0
  85. /package/dist/{components → src/components}/YouTubeVideo.d.ts +0 -0
  86. /package/dist/{components → src/components}/form/ApiAutocompleteField.d.ts +0 -0
  87. /package/dist/{components → src/components}/form/AutocompleteField.d.ts +0 -0
  88. /package/dist/{components → src/components}/form/CheckboxField.d.ts +0 -0
  89. /package/dist/{components → src/components}/form/CountryField.d.ts +0 -0
  90. /package/dist/{components → src/components}/form/DatePickerField.d.ts +0 -0
  91. /package/dist/{components → src/components}/form/EmailField.d.ts +0 -0
  92. /package/dist/{components → src/components}/form/FirstNameField.d.ts +0 -0
  93. /package/dist/{components → src/components}/form/Form.d.ts +0 -0
  94. /package/dist/{components → src/components}/form/OtpField.d.ts +0 -0
  95. /package/dist/{components → src/components}/form/PasswordField.d.ts +0 -0
  96. /package/dist/{components → src/components}/form/RepeatField.d.ts +0 -0
  97. /package/dist/{components → src/components}/form/SubmitButton.d.ts +0 -0
  98. /package/dist/{components → src/components}/form/TextField.d.ts +0 -0
  99. /package/dist/{components → src/components}/form/UkCountyField.d.ts +0 -0
  100. /package/dist/{components → src/components}/page/Banner.d.ts +0 -0
  101. /package/dist/{components → src/components}/page/Notification.d.ts +0 -0
  102. /package/dist/{components → src/components}/page/Page.d.ts +0 -0
  103. /package/dist/{components → src/components}/page/Section.d.ts +0 -0
  104. /package/dist/{components → src/components}/page/TabBar.d.ts +0 -0
  105. /package/dist/{components → src/components}/router/Link.d.ts +0 -0
  106. /package/dist/{components → src/components}/router/LinkButton.d.ts +0 -0
  107. /package/dist/{components → src/components}/router/LinkIconButton.d.ts +0 -0
  108. /package/dist/{components → src/components}/router/LinkListItem.d.ts +0 -0
  109. /package/dist/{components → src/components}/router/LinkTab.d.ts +0 -0
  110. /package/dist/{components → src/components}/router/Navigate.d.ts +0 -0
  111. /package/dist/{components → src/components}/table/CellStack.d.ts +0 -0
  112. /package/dist/{components → src/components}/table/Table.d.ts +0 -0
  113. /package/dist/{features → src/features}/InactiveDialog.d.ts +0 -0
  114. /package/dist/{features → src/features}/ScreenTimeDialog.d.ts +0 -0
  115. /package/dist/{hooks → src/hooks}/api.d.ts +0 -0
  116. /package/dist/{hooks → src/hooks}/auth.d.ts +0 -0
  117. /package/dist/{hooks → src/hooks}/form.d.ts +0 -0
  118. /package/dist/{hooks → src/hooks}/general.d.ts +0 -0
  119. /package/dist/{hooks → src/hooks}/router.d.ts +0 -0
  120. /package/dist/{middlewares → src/middlewares}/session.d.ts +0 -0
  121. /package/dist/{scripts → src/scripts}/index.d.ts +0 -0
  122. /package/dist/{settings → src/settings}/custom.d.ts +0 -0
  123. /package/dist/{settings → src/settings}/vite.d.ts +0 -0
  124. /package/dist/{slices → src/slices}/createSlice.d.ts +0 -0
  125. /package/dist/{slices → src/slices}/session.d.ts +0 -0
  126. /package/dist/{theme → src/theme}/ThemedBox.d.ts +0 -0
  127. /package/dist/{theme → src/theme}/colors.d.ts +0 -0
  128. /package/dist/{theme → src/theme}/components/MuiAccordion.d.ts +0 -0
  129. /package/dist/{theme → src/theme}/components/MuiAutocomplete.d.ts +0 -0
  130. /package/dist/{theme → src/theme}/components/MuiButton.d.ts +0 -0
  131. /package/dist/{theme → src/theme}/components/MuiCardActions.d.ts +0 -0
  132. /package/dist/{theme → src/theme}/components/MuiCheckbox.d.ts +0 -0
  133. /package/dist/{theme → src/theme}/components/MuiContainer.d.ts +0 -0
  134. /package/dist/{theme → src/theme}/components/MuiDialog.d.ts +0 -0
  135. /package/dist/{theme → src/theme}/components/MuiFormControlLabel.d.ts +0 -0
  136. /package/dist/{theme → src/theme}/components/MuiFormHelperText.d.ts +0 -0
  137. /package/dist/{theme → src/theme}/components/MuiGrid.d.ts +0 -0
  138. /package/dist/{theme → src/theme}/components/MuiInputBase.d.ts +0 -0
  139. /package/dist/{theme → src/theme}/components/MuiLink.d.ts +0 -0
  140. /package/dist/{theme → src/theme}/components/MuiList.d.ts +0 -0
  141. /package/dist/{theme → src/theme}/components/MuiListItemText.d.ts +0 -0
  142. /package/dist/{theme → src/theme}/components/MuiMenu.d.ts +0 -0
  143. /package/dist/{theme → src/theme}/components/MuiMenuItem.d.ts +0 -0
  144. /package/dist/{theme → src/theme}/components/MuiSelect.d.ts +0 -0
  145. /package/dist/{theme → src/theme}/components/MuiTab.d.ts +0 -0
  146. /package/dist/{theme → src/theme}/components/MuiTable.d.ts +0 -0
  147. /package/dist/{theme → src/theme}/components/MuiTableBody.d.ts +0 -0
  148. /package/dist/{theme → src/theme}/components/MuiTableHead.d.ts +0 -0
  149. /package/dist/{theme → src/theme}/components/MuiTabs.d.ts +0 -0
  150. /package/dist/{theme → src/theme}/components/MuiTextField.d.ts +0 -0
  151. /package/dist/{theme → src/theme}/components/MuiToolbar.d.ts +0 -0
  152. /package/dist/{theme → src/theme}/components/MuiTypography.d.ts +0 -0
  153. /package/dist/{theme → src/theme}/components/_components.d.ts +0 -0
  154. /package/dist/{theme → src/theme}/palette.d.ts +0 -0
  155. /package/dist/{theme → src/theme}/spacing.d.ts +0 -0
  156. /package/dist/{theme → src/theme}/typography.d.ts +0 -0
  157. /package/dist/{utils → src/utils}/api.test.d.ts +0 -0
  158. /package/dist/{utils → src/utils}/form.test.d.ts +0 -0
  159. /package/dist/{utils → src/utils}/general.test.d.ts +0 -0
  160. /package/dist/{utils → src/utils}/router.test.d.ts +0 -0
@@ -0,0 +1,72 @@
1
+ import { FetchBaseQueryError, TypedUseMutationResult, TypedUseQueryHookResult, TypedUseQueryStateResult } from '@reduxjs/toolkit/query/react';
2
+ import { ReactNode } from 'react';
3
+ import { Optional, Required } from './general';
4
+ import { SchemaMap } from './schema';
5
+ export type Fields = Record<string, unknown>;
6
+ export interface Tag<Type extends string> {
7
+ type: Type;
8
+ id: string;
9
+ }
10
+ export type ModelId = string | number;
11
+ /**
12
+ * A data model.
13
+ * Id: The type of Id.
14
+ * Data: The data fields.
15
+ */
16
+ export type Model<Id extends ModelId, MFields extends Fields = Fields> = {
17
+ id: Id;
18
+ } & Omit<MFields, "id">;
19
+ export type Schemas<M extends Model<any>> = {
20
+ [K in keyof M]-?: SchemaMap<M[K]>;
21
+ };
22
+ export type Result<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never> = Pick<M, "id" | MFields>;
23
+ export type Arg<M extends Model<any>, RequiredFields extends keyof Omit<M, "id">, OptionalFields extends keyof Omit<M, "id" | RequiredFields> = never> = Required<M, RequiredFields> & Optional<M, OptionalFields>;
24
+ export type CreateResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never> = Result<M, MFields>;
25
+ export type CreateArg<M extends Model<any>, RequiredFields extends keyof Omit<M, "id">, OptionalFields extends keyof Omit<M, "id" | RequiredFields> = never> = Arg<M, RequiredFields, OptionalFields>;
26
+ export type BulkCreateResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never, ExtraFields extends Fields = Fields> = Array<Result<M, MFields> & ExtraFields>;
27
+ export type BulkCreateArg<M extends Model<any>, RequiredFields extends keyof Omit<M, "id">, OptionalFields extends keyof Omit<M, "id" | RequiredFields> = never, ExtraFields extends Fields = Fields> = Array<Arg<M, RequiredFields, OptionalFields> & ExtraFields>;
28
+ export type RetrieveResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never> = Result<M, MFields>;
29
+ export type RetrieveArg<M extends Model<any>> = M["id"];
30
+ export interface ListResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never, ExtraFields extends Fields = Fields> {
31
+ count: number;
32
+ offset: number;
33
+ limit: number;
34
+ max_limit: number;
35
+ data: Array<Result<M, MFields> & ExtraFields>;
36
+ }
37
+ export type ListArg<Filters extends Fields = Fields> = {
38
+ limit: number;
39
+ offset: number;
40
+ } & Partial<Omit<Filters, "limit" | "offset">>;
41
+ export type UpdateResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never> = Result<M, MFields>;
42
+ type UpdateWithBody<M extends Model<any>, RequiredFields extends keyof Omit<M, "id">, OptionalFields extends keyof Omit<M, "id" | RequiredFields>> = Pick<M, "id"> & Arg<M, RequiredFields, OptionalFields>;
43
+ export type UpdateArg<M extends Model<any>, RequiredFields extends keyof Omit<M, "id"> = never, OptionalFields extends keyof Omit<M, "id" | RequiredFields> = never> = [RequiredFields] extends [never] ? [OptionalFields] extends [never] ? M["id"] : UpdateWithBody<M, RequiredFields, OptionalFields> : UpdateWithBody<M, RequiredFields, OptionalFields>;
44
+ export type BulkUpdateResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never, ExtraFields extends Fields = Fields> = Array<Result<M, MFields> & ExtraFields>;
45
+ export type BulkUpdateArg<M extends Model<any>, RequiredFields extends keyof Omit<M, "id">, OptionalFields extends keyof Omit<M, "id" | RequiredFields> = never, ExtraFields extends Fields = Fields> = Record<M["id"], Arg<M, RequiredFields, OptionalFields> & ExtraFields>;
46
+ export type DestroyResult = null;
47
+ export type DestroyArg<M extends Model<any>> = M["id"];
48
+ export type BulkDestroyResult = null;
49
+ export type BulkDestroyArg<M extends Model<any>> = Array<M["id"]>;
50
+ export declare function buildUrl(url: string, params: {
51
+ search?: Fields;
52
+ url?: Fields;
53
+ }): string;
54
+ export declare function isModelId(value: unknown): boolean;
55
+ export declare function listTag<Type extends string>(type: Type): Tag<Type>;
56
+ export type TagDataOptions = Partial<{
57
+ includeListTag: boolean;
58
+ argKeysAreIds: boolean;
59
+ id: string;
60
+ }>;
61
+ export declare function tagData<Type extends string, M extends Model<any>>(type: Type, options?: TagDataOptions): (result: Result<M, any> | Array<Result<M, any>> | ListResult<M, any> | null | undefined, error: FetchBaseQueryError | undefined, arg: Arg<M, any> | Array<Arg<M, any>> | Record<M["id"], Arg<M, any>> | ListArg<any> | Array<M["id"]> | string | number | undefined) => Array<Tag<Type>>;
62
+ export declare function modelUrls(list: string, detail: string): {
63
+ list: string;
64
+ detail: string;
65
+ };
66
+ export type HandleQueryStateOptions = Partial<{
67
+ loading: ReactNode;
68
+ error: ReactNode;
69
+ }>;
70
+ export declare function handleResultState<QueryArg, ResultType>(result: TypedUseQueryHookResult<ResultType, QueryArg, any> | TypedUseQueryStateResult<ResultType, QueryArg, any> | TypedUseMutationResult<ResultType, QueryArg, any>, children: (data: NonNullable<ResultType>) => ReactNode, options?: HandleQueryStateOptions): ReactNode;
71
+ export declare function isSafeHttpMethod(method: string): boolean;
72
+ export {};
@@ -0,0 +1,28 @@
1
+ export declare function logout(): void;
2
+ export declare function getCsrfCookie(): string | undefined;
3
+ export declare function makeOAuth2StorageKey(provider: string, key: string): string;
4
+ export declare const OAUTH2_CODE_CHALLENGE_METHODS: readonly ["S256"];
5
+ export type OAuth2CodeChallengeMethods = (typeof OAUTH2_CODE_CHALLENGE_METHODS)[number];
6
+ export declare const OAUTH2_CODE_CHALLENGE_LENGTHS: readonly [43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128];
7
+ export type OAuth2CodeChallengeLengths = (typeof OAUTH2_CODE_CHALLENGE_LENGTHS)[number];
8
+ export type OAuth2RequestCodeUrlSearchParams = {
9
+ client_id: string;
10
+ redirect_uri: string;
11
+ scope: string;
12
+ response_type: string;
13
+ access_type: string;
14
+ prompt?: string;
15
+ state: string;
16
+ code_challenge: string;
17
+ code_challenge_method: string;
18
+ };
19
+ export type OAuth2ReceiveCodeUrlSearchParams = {
20
+ code: string;
21
+ state: string;
22
+ };
23
+ export type OAuth2CodeChallenge = {
24
+ verifier: string;
25
+ challenge: string;
26
+ method: OAuth2CodeChallengeMethods;
27
+ };
28
+ export declare function generateOAuth2CodeChallenge(length: OAuth2CodeChallengeLengths): Promise<OAuth2CodeChallenge>;
@@ -0,0 +1,25 @@
1
+ import { FieldValidator, FormikHelpers } from 'formik';
2
+ import { Schema, ValidateOptions } from 'yup';
3
+ import { TypedMutationTrigger } from '@reduxjs/toolkit/query/react';
4
+ export type FormValues = Record<string, any>;
5
+ export declare function isFormError(error: unknown): boolean;
6
+ export declare function setFormErrors(error: unknown, setErrors: (errors: object) => void): void;
7
+ export type SubmitFormOptions<Values extends FormValues, QueryArg extends FormValues, ResultType> = Partial<{
8
+ exclude: string[];
9
+ include: string[];
10
+ onlyDirtyValues: boolean;
11
+ then: (result: ResultType, values: Values, helpers: FormikHelpers<Values>) => void;
12
+ catch: (error: unknown, values: Values, helpers: FormikHelpers<Values>) => void;
13
+ finally: (values: Values, helpers: FormikHelpers<Values>) => void;
14
+ }> & (Values extends QueryArg ? {
15
+ clean?: (values: Values) => QueryArg;
16
+ } : {
17
+ clean: (values: Values) => QueryArg;
18
+ });
19
+ export type SubmitFormHandler<Values extends FormValues> = (values: Values, helpers: FormikHelpers<Values>) => void | Promise<any>;
20
+ export declare function submitForm<Values extends QueryArg, QueryArg extends FormValues, ResultType>(trigger: TypedMutationTrigger<ResultType, QueryArg, any>, initialValues: Values, options?: SubmitFormOptions<Values, QueryArg, ResultType>): SubmitFormHandler<Values>;
21
+ export declare function submitForm<Values extends FormValues, QueryArg extends FormValues, ResultType>(trigger: TypedMutationTrigger<ResultType, QueryArg, any>, initialValues: Values, options: SubmitFormOptions<Values, QueryArg, ResultType>): SubmitFormHandler<Values>;
22
+ export declare function schemaToFieldValidator(schema: Schema, options?: ValidateOptions): FieldValidator;
23
+ export declare function getDirty<Values extends FormValues>(values: Values, initialValues: Values, names?: string[]): Record<string, boolean>;
24
+ export declare function isDirty<Values extends FormValues>(values: Values, initialValues: Values, name: string): boolean;
25
+ export declare function getCleanNames<Values extends FormValues>(values: Values, initialValues: Values, names?: string[]): string[];
@@ -0,0 +1,30 @@
1
+ export type Required<T, K extends keyof T> = {
2
+ [P in K]-?: T[P];
3
+ };
4
+ export type Optional<T, K extends keyof T> = Partial<Pick<T, K>>;
5
+ export type OptionalPropertyNames<T> = {
6
+ [K in keyof T]-?: {} extends {
7
+ [P in K]: T[K];
8
+ } ? K : never;
9
+ }[keyof T];
10
+ export type IsOptional<T, K extends keyof T> = K extends OptionalPropertyNames<T> ? true : false;
11
+ export declare function openInNewTab(url: string, target?: string): void;
12
+ export declare function wrap(newFn: {
13
+ before?: (...args: any[]) => void;
14
+ after?: (...args: any[]) => void;
15
+ }, fn?: (...args: any[]) => any): (...args: any[]) => any;
16
+ export declare function snakeCaseToCamelCase(obj: Record<string, any>): void;
17
+ export declare function camelCaseToSnakeCase(obj: Record<string, any>): void;
18
+ export declare const MIN_DATE: Date;
19
+ export declare const COUNTRY_ISO_CODES: readonly ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"];
20
+ export type CountryIsoCodes = (typeof COUNTRY_ISO_CODES)[number];
21
+ export declare const COUNTRIES: readonly ["Andorra", "United Arab Emirates (the)", "Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia", "Angola", "Antarctica", "Argentina", "American Samoa", "Austria", "Australia", "Aruba", "Åland Islands", "Azerbaijan", "Bosnia and Herzegovina", "Barbados", "Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain", "Burundi", "Benin", "Saint Barthélemy", "Bermuda", "Brunei Darussalam", "Bolivia (Plurinational State of)", "Bonaire, Sint Eustatius and Saba", "Brazil", "Bahamas (the)", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize", "Canada", "Cocos (Keeling) Islands (the)", "Congo (the Democratic Republic of the)", "Central African Republic (the)", "Congo (the)", "Switzerland", "Côte d'Ivoire", "Cook Islands (the)", "Chile", "Cameroon", "China", "Colombia", "Costa Rica", "Cuba", "Cabo Verde", "Curaçao", "Christmas Island", "Cyprus", "Czechia", "Germany", "Djibouti", "Denmark", "Dominica", "Dominican Republic (the", "Algeria", "Ecuador", "Estonia", "Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji", "Falkland Islands (the) [Malvinas]", "Micronesia (Federated States of)", "Faroe Islands (the)", "France", "Gabon", "United Kingdom of Great Britain and Northern Ireland (the)", "Grenada", "Georgia", "French Guiana", "Guernsey", "Ghana", "Gibraltar", "Greenland", "Gambia (the)", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia and the South Sandwich Islands", "Guatemala", "Guam", "Guinea-Bissau", "Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras", "Croatia", "Haiti", "Hungary", "Indonesia", "Ireland", "Israel", "Isle of Man", "India", "British Indian Ocean Territory (the)", "Iraq", "Iran (Islamic Republic of)", "Iceland", "Italy", "Jersey", "Jamaica", "Jordan", "Japan", "Kenya", "Kyrgyzstan", "Cambodia", "Kiribati", "Comoros (the)", "Saint Kitts and Nevis", "Korea (the Democratic People's Republic of)", "Korea (the Republic of)", "Kuwait", "Cayman Islands (the)", "Kazakhstan", "Lao People's Democratic Republic (the)", "Lebanon", "Saint Lucia", "Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania", "Luxembourg", "Latvia", "Libya", "Morocco", "Monaco", "Moldova (the Republic of)", "Montenegro", "Saint Martin (French part)", "Madagascar", "Marshall Islands (the)", "Republic of North Macedonia", "Mali", "Myanmar", "Mongolia", "Macao", "Northern Mariana Islands (the)", "Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives", "Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia", "Niger (the)", "Norfolk Island", "Nigeria", "Nicaragua", "Netherlands (the)", "Norway", "Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French Polynesia", "Papua New Guinea", "Philippines (the)", "Pakistan", "Poland", "Saint Pierre and Miquelon", "Pitcairn", "Puerto Rico", "Palestine, State of", "Portugal", "Palau", "Paraguay", "Qatar", "Réunion", "Romania", "Serbia", "Russian Federation (the)", "Rwanda", "Saudi Arabia", "Solomon Islands", "Seychelles", "Sudan (the)", "Sweden", "Singapore", "Saint Helena, Ascension and Tristan da Cunha", "Slovenia", "Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal", "Somalia", "Suriname", "South Sudan", "Sao Tome and Principe", "El Salvador", "Sint Maarten (Dutch part)", "Syrian Arab Republic", "Eswatini", "Turks and Caicos Islands (the)", "Chad", "French Southern Territories (the)", "Togo", "Thailand", "Tajikistan", "Tokelau", "Timor-Leste", "Turkmenistan", "Tunisia", "Tonga", "Turkey", "Trinidad and Tobago", "Tuvalu", "Taiwan (Province of China)", "Tanzania, United Republic of", "Ukraine", "Uganda", "United States Minor Outlying Islands (the)", "United States of America (the)", "Uruguay", "Uzbekistan", "Holy See (the)", "Saint Vincent and the Grenadines", "Venezuela (Bolivarian Republic of)", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Viet Nam", "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte", "South Africa", "Zambia", "Zimbabwe"];
22
+ export type Countries = (typeof COUNTRIES)[number];
23
+ export declare const COUNTRY_ISO_CODE_MAPPING: Record<CountryIsoCodes, Countries>;
24
+ export declare const UK_COUNTIES: readonly ["Aberdeen City", "Aberdeenshire", "Angus", "Argyll and Bute", "Bedfordshire", "Belfast", "Belfast Greater", "Berkshire", "Blaenau Gwent", "Bridgend", "Buckinghamshire", "Caerphilly", "Cambridgeshire", "Cardiff", "Carmarthenshire", "Ceredigion", "Channel Islands", "Cheshire", "City of Edinburgh", "Clackmannanshire", "Conwy", "Cornwall", "County Antrim", "County Armagh", "County Down", "County Fermanagh", "County Londonderry", "County Tyrone", "County of Bristol", "Cumbria", "Denbighshire", "Derbyshire", "Devon", "Dorset", "Dumfries and Galloway", "Dunbartonshire", "Dundee City", "Durham", "East Ayrshire", "East Dunbartonshire", "East Lothian", "East Renfrewshire", "East Riding of Yorkshire", "East Sussex", "Essex", "Falkirk", "Fife", "Flintshire", "Glasgow City", "Gloucestershire", "Greater London", "Greater Manchester", "Guernsey Channel Islands", "Gwynedd", "Hampshire", "Hereford and Worcester", "Herefordshire", "Hertfordshire", "Highland", "Inverclyde", "Inverness", "Isle of Anglesey", "Isle of Barra", "Isle of Man", "Isle of Wight", "Jersey Channel Islands", "Kent", "Lancashire", "Leicestershire", "Lincolnshire", "Merseyside", "Merthyr Tydfil", "Midlothian", "Monmouthshire", "Moray", "Neath Port Talbot", "Newport", "Norfolk", "North Ayrshire", "North Lanarkshire", "North Yorkshire", "Northamptonshire", "Northumberland", "Nottinghamshire", "Orkney", "Orkney Islands", "Oxfordshire", "Pembrokeshire", "Perth and Kinross", "Powys", "Renfrewshire", "Rhondda Cynon Taff", "Rutland", "Scottish Borders", "Shetland Islands", "Shropshire", "Somerset", "South Ayrshire", "South Lanarkshire", "South Yorkshire", "Staffordshire", "Stirling", "Suffolk", "Surrey", "Swansea", "Torfaen", "Tyne and Wear", "Vale of Glamorgan", "Warwickshire", "West Dunbart", "West Lothian", "West Midlands", "West Sussex", "West Yorkshire", "Western Isles", "Wiltshire", "Worcestershire", "Wrexham"];
25
+ export type UkCounties = (typeof UK_COUNTIES)[number];
26
+ export declare function getNestedProperty(obj: Record<string, any>, dotPath: string | string[]): any;
27
+ export declare function withKeyPaths(obj: object, delimiter?: string): object;
28
+ export declare function getKeyPaths(obj: object, delimiter?: string): string[];
29
+ export declare function excludeKeyPaths(obj: object, exclude: string[], delimiter?: string): any;
30
+ export declare function generateSecureRandomString(length: number, charSet?: string): string;
@@ -0,0 +1,19 @@
1
+ import { To, LinkProps as _LinkProps } from 'react-router';
2
+ import { PageState } from '../components/page/Page';
3
+ export type LinkProps<Override extends "delta" | "to", State extends Record<string, any> = Record<string, any>> = Omit<_LinkProps, "to" | "state"> & (Override extends "delta" ? {
4
+ to: number;
5
+ } : {
6
+ to: To;
7
+ state?: State & Partial<PageState>;
8
+ });
9
+ export type ReadOnly<T> = {
10
+ readonly [P in keyof T]: T[P];
11
+ };
12
+ export type Parameters = Record<string, string>;
13
+ export interface Path {
14
+ _: string;
15
+ __: string | Parameters;
16
+ [subpath: string]: string | Path | Parameters;
17
+ }
18
+ export declare function path<Subpaths extends Record<string, Path>>(_: string | Parameters, subpaths?: Subpaths): Path & Subpaths;
19
+ export declare function getParam(path: Path, key: string): string;
@@ -0,0 +1,43 @@
1
+ import { AnyObject, BooleanSchema, DateSchema, DefaultFromShape, Flags, InferType, MakePartial, NumberSchema, ObjectSchema, ObjectShape, Schema, StringSchema, TypeFromShape, ValidateOptions, ValidationError } from 'yup';
2
+ export type _<T> = T extends {} ? {
3
+ [k in keyof T]: T[k];
4
+ } : T;
5
+ export type MakeKeysOptional<T> = T extends AnyObject ? _<MakePartial<T>> : T;
6
+ export type ObjectFromShape<Shape extends ObjectShape> = MakeKeysOptional<_<TypeFromShape<Shape, AnyObject>>>;
7
+ export type ObjectSchemaFromShape<Shape extends ObjectShape> = ObjectSchema<_<TypeFromShape<Shape, AnyObject>>, AnyObject, _<DefaultFromShape<Shape>>, "">;
8
+ export type SchemaMap<TType, TContext = AnyObject, TDefault = any, TFlags extends Flags = ""> = NonNullable<TType> extends string ? StringSchema<TType extends undefined ? TType | undefined : TType, TContext, TDefault, TFlags> : NonNullable<TType> extends number ? NumberSchema<TType extends undefined ? TType | undefined : TType, TContext, TDefault, TFlags> : NonNullable<TType> extends boolean ? BooleanSchema<TType extends undefined ? TType | undefined : TType, TContext, TDefault, TFlags> : NonNullable<TType> extends Date ? DateSchema<TType extends undefined ? TType | undefined : TType, TContext, TDefault, TFlags> : NonNullable<TType> extends object ? ObjectSchema<TType extends undefined ? TType | undefined : TType, TContext, TDefault, TFlags> : Schema<TType, TContext, TDefault, TFlags>;
9
+ export declare function numericId(schema?: NumberSchema): NumberSchema<number | undefined, AnyObject, undefined, "">;
10
+ export type MatchesCharSetOptions = Partial<{
11
+ schema: StringSchema;
12
+ flags: string;
13
+ }>;
14
+ export declare function matchesCharSet(charSet: string, message: string, options?: MatchesCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
15
+ export type BuildCharSetOptions = MatchesCharSetOptions & Partial<{
16
+ spaces: boolean;
17
+ specialChars: string;
18
+ }>;
19
+ export declare function buildCharSet(charSet: string, description: string, options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
20
+ export declare function buildUnicodeCharSet(charSet: string, description: string, options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
21
+ export declare function asciiAlphaString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
22
+ export declare function lowercaseAsciiAlphaString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
23
+ export declare function uppercaseAsciiAlphaString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
24
+ export declare function asciiNumericString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
25
+ export declare function asciiAlphanumericString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
26
+ export declare function lowercaseAsciiAlphanumericString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
27
+ export declare function uppercaseAsciiAlphanumericString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
28
+ export declare function unicodeAlphaString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
29
+ export declare function lowercaseUnicodeAlphaString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
30
+ export declare function uppercaseUnicodeAlphaString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
31
+ export declare function unicodeNumericString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
32
+ export declare function unicodeAlphanumericString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
33
+ export declare function lowercaseUnicodeAlphanumericString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
34
+ export declare function uppercaseUnicodeAlphanumericString(options?: BuildCharSetOptions): StringSchema<string | undefined, AnyObject, undefined, "">;
35
+ export type TryValidateSyncOnErrorRT<S extends Schema> = InferType<S> | void;
36
+ export type TryValidateSyncRT<S extends Schema, OnErrorRT extends TryValidateSyncOnErrorRT<S>> = OnErrorRT extends InferType<S> ? InferType<S> : InferType<S> | undefined;
37
+ export type TryValidateSyncOptions<S extends Schema, OnErrorRT extends TryValidateSyncOnErrorRT<S>> = ValidateOptions & {
38
+ onError?: (error: ValidationError) => OnErrorRT;
39
+ };
40
+ export declare function tryValidateSync<S extends Schema>(value: any, schema: S, options?: ValidateOptions): InferType<S> | undefined;
41
+ export declare function tryValidateSync<S extends Schema, OnErrorRT extends TryValidateSyncOnErrorRT<S>>(value: any, schema: S, options?: ValidateOptions & {
42
+ onError: (error: ValidationError) => OnErrorRT;
43
+ }): TryValidateSyncRT<S, OnErrorRT>;
@@ -0,0 +1,10 @@
1
+ import { Middleware, Reducer, EnhancedStore, Tuple } from '@reduxjs/toolkit';
2
+ import { UnknownAction, StoreEnhancer } from 'redux';
3
+ import { ThunkDispatch } from 'redux-thunk';
4
+ export declare function makeStore<R extends Reducer>({ reducer, middlewares, preloadedState, }: {
5
+ reducer: R;
6
+ middlewares?: Middleware[];
7
+ preloadedState?: Partial<ReturnType<R>>;
8
+ }): EnhancedStore<any, UnknownAction, Tuple<[ StoreEnhancer<{
9
+ dispatch: ThunkDispatch<any, undefined, UnknownAction>;
10
+ }>, StoreEnhancer]>>;
@@ -0,0 +1,53 @@
1
+ import { Middleware, Reducer, Store } from '@reduxjs/toolkit';
2
+ import { ReactElement } from 'react';
3
+ import { Queries, queries } from '@testing-library/dom';
4
+ import { RenderOptions, RenderResult } from '@testing-library/react';
5
+ import { Container as RendererableContainer, hydrateRoot } from 'react-dom/client';
6
+ import { UserEvent } from '@testing-library/user-event';
7
+ import { makeStore } from './store';
8
+ type HydrateableContainer = Parameters<typeof hydrateRoot>[0];
9
+ type RenderWithUserResult<Q extends Queries = typeof queries, Container extends RendererableContainer | HydrateableContainer = HTMLElement, BaseElement extends RendererableContainer | HydrateableContainer = Container> = RenderResult<Q, Container, BaseElement> & {
10
+ user: UserEvent;
11
+ };
12
+ export declare function renderWithUser<Q extends Queries = typeof queries, Container extends RendererableContainer | HydrateableContainer = HTMLElement, BaseElement extends RendererableContainer | HydrateableContainer = Container>(ui: ReactElement, renderOptions?: RenderOptions<Q, Container, BaseElement>): RenderWithUserResult<Q, Container, BaseElement>;
13
+ /**
14
+ * Renders the given React element with Redux Provider and custom store.
15
+ * This function is useful for testing components that are connected to the
16
+ * Redux store.
17
+ *
18
+ * @param ui - The React component or element to render.
19
+ * @param reducer - The root reducer to use for the store.
20
+ * @param extendedRenderOptions - Optional configuration options for rendering.
21
+ * This includes `preloadedState` for initial Redux state and `store` for a
22
+ * specific Redux store instance. Any additional properties are passed to React
23
+ * Testing Library's render function.
24
+ * @returns An object containing the Redux store used in the render, User event
25
+ * API for simulating user interactions in tests, and all of React Testing
26
+ * Library's query functions for testing the component.
27
+ */
28
+ export declare function renderWithStore<R extends Reducer, Q extends Queries = typeof queries, Container extends RendererableContainer | HydrateableContainer = HTMLElement, BaseElement extends RendererableContainer | HydrateableContainer = Container>(ui: ReactElement, reducer: R, extendedRenderOptions?: RenderOptions<Q, Container, BaseElement> & {
29
+ /**
30
+ * The middlewares used to create the Redux store.
31
+ */
32
+ middlewares?: Middleware[];
33
+ /**
34
+ * Defines a specific portion or the entire initial state for the Redux store.
35
+ * This is particularly useful for initializing the state in a
36
+ * controlled manner during testing, allowing components to be rendered
37
+ * with predetermined state conditions.
38
+ */
39
+ preloadedState?: Partial<ReturnType<R>>;
40
+ /**
41
+ * Allows the use of a specific Redux store instance instead of a
42
+ * default or global store. This flexibility is beneficial when
43
+ * testing components with unique store requirements or when isolating
44
+ * tests from a global store state. The custom store should be configured
45
+ * to match the structure and middleware of the store used by the application.
46
+ *
47
+ * @default makeStore({reducer,middlewares,preloadedState})
48
+ */
49
+ store?: Store;
50
+ }): RenderWithUserResult<Q, Container, BaseElement> & {
51
+ store: ReturnType<typeof makeStore<R>>;
52
+ };
53
+ export {};
@@ -0,0 +1,11 @@
1
+ import { DividerProps, ThemeOptions } from '@mui/material';
2
+ import { CommonProps } from '@mui/material/OverridableComponent';
3
+ import { ReactElement } from 'react';
4
+ export declare function insertDividerBetweenElements({ elements, dividerProps, }: {
5
+ elements: ReactElement[];
6
+ dividerProps?: DividerProps;
7
+ }): ReactElement[];
8
+ export declare function getStyleOverrides(ownerState: CommonProps, componentKey: keyof NonNullable<ThemeOptions["components"]>, muiClassName?: string, components?: ThemeOptions["components"]): object;
9
+ export declare function getClassNames(props: CommonProps): string[];
10
+ export declare function includesClassNames(propsOrClassNames: CommonProps | string[], includes: string[]): boolean;
11
+ export declare function matchClassNames(propsOrClassNames: CommonProps | string[], pattern: string | RegExp): RegExpMatchArray[];
@@ -0,0 +1,2 @@
1
+ export declare function configureFreshworksWidget(display: "open" | "hide"): void;
2
+ export declare function toggleOneTrustInfoDisplay(): void;
@@ -1,3 +1,4 @@
1
- import { ThemeOptions } from '@mui/material';
2
- declare const components: ThemeOptions["components"];
3
- export default components;
1
+ export {}
2
+ import Codeforlife from '../../src/theme/components/index'
3
+ export default Codeforlife
4
+ export {}
@@ -1,7 +1,2 @@
1
- import { ThemeOptions, Theme } from '@mui/material';
2
- export * as colors from './colors';
3
- export * from './palette';
4
- export * from './ThemedBox';
5
- export { default as ThemedBox } from './ThemedBox';
6
- export declare const themeOptions: ThemeOptions;
7
- export declare const theme: Theme;
1
+ export * from '../src/theme/index'
2
+ export {}
@@ -1,72 +1,2 @@
1
- import { FetchBaseQueryError, TypedUseMutationResult, TypedUseQueryHookResult, TypedUseQueryStateResult } from '@reduxjs/toolkit/query/react';
2
- import { ReactNode } from 'react';
3
- import { Optional, Required } from './general';
4
- import { SchemaMap } from './schema';
5
- export type Fields = Record<string, unknown>;
6
- export interface Tag<Type extends string> {
7
- type: Type;
8
- id: string;
9
- }
10
- export type ModelId = string | number;
11
- /**
12
- * A data model.
13
- * Id: The type of Id.
14
- * Data: The data fields.
15
- */
16
- export type Model<Id extends ModelId, MFields extends Fields = Fields> = {
17
- id: Id;
18
- } & Omit<MFields, "id">;
19
- export type Schemas<M extends Model<any>> = {
20
- [K in keyof M]-?: SchemaMap<M[K]>;
21
- };
22
- export type Result<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never> = Pick<M, "id" | MFields>;
23
- export type Arg<M extends Model<any>, RequiredFields extends keyof Omit<M, "id">, OptionalFields extends keyof Omit<M, "id" | RequiredFields> = never> = Required<M, RequiredFields> & Optional<M, OptionalFields>;
24
- export type CreateResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never> = Result<M, MFields>;
25
- export type CreateArg<M extends Model<any>, RequiredFields extends keyof Omit<M, "id">, OptionalFields extends keyof Omit<M, "id" | RequiredFields> = never> = Arg<M, RequiredFields, OptionalFields>;
26
- export type BulkCreateResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never, ExtraFields extends Fields = Fields> = Array<Result<M, MFields> & ExtraFields>;
27
- export type BulkCreateArg<M extends Model<any>, RequiredFields extends keyof Omit<M, "id">, OptionalFields extends keyof Omit<M, "id" | RequiredFields> = never, ExtraFields extends Fields = Fields> = Array<Arg<M, RequiredFields, OptionalFields> & ExtraFields>;
28
- export type RetrieveResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never> = Result<M, MFields>;
29
- export type RetrieveArg<M extends Model<any>> = M["id"];
30
- export interface ListResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never, ExtraFields extends Fields = Fields> {
31
- count: number;
32
- offset: number;
33
- limit: number;
34
- max_limit: number;
35
- data: Array<Result<M, MFields> & ExtraFields>;
36
- }
37
- export type ListArg<Filters extends Fields = Fields> = {
38
- limit: number;
39
- offset: number;
40
- } & Partial<Omit<Filters, "limit" | "offset">>;
41
- export type UpdateResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never> = Result<M, MFields>;
42
- type UpdateWithBody<M extends Model<any>, RequiredFields extends keyof Omit<M, "id">, OptionalFields extends keyof Omit<M, "id" | RequiredFields>> = Pick<M, "id"> & Arg<M, RequiredFields, OptionalFields>;
43
- export type UpdateArg<M extends Model<any>, RequiredFields extends keyof Omit<M, "id"> = never, OptionalFields extends keyof Omit<M, "id" | RequiredFields> = never> = [RequiredFields] extends [never] ? [OptionalFields] extends [never] ? M["id"] : UpdateWithBody<M, RequiredFields, OptionalFields> : UpdateWithBody<M, RequiredFields, OptionalFields>;
44
- export type BulkUpdateResult<M extends Model<any>, MFields extends keyof Omit<M, "id"> = never, ExtraFields extends Fields = Fields> = Array<Result<M, MFields> & ExtraFields>;
45
- export type BulkUpdateArg<M extends Model<any>, RequiredFields extends keyof Omit<M, "id">, OptionalFields extends keyof Omit<M, "id" | RequiredFields> = never, ExtraFields extends Fields = Fields> = Record<M["id"], Arg<M, RequiredFields, OptionalFields> & ExtraFields>;
46
- export type DestroyResult = null;
47
- export type DestroyArg<M extends Model<any>> = M["id"];
48
- export type BulkDestroyResult = null;
49
- export type BulkDestroyArg<M extends Model<any>> = Array<M["id"]>;
50
- export declare function buildUrl(url: string, params: {
51
- search?: Fields;
52
- url?: Fields;
53
- }): string;
54
- export declare function isModelId(value: unknown): boolean;
55
- export declare function listTag<Type extends string>(type: Type): Tag<Type>;
56
- export type TagDataOptions = Partial<{
57
- includeListTag: boolean;
58
- argKeysAreIds: boolean;
59
- id: string;
60
- }>;
61
- export declare function tagData<Type extends string, M extends Model<any>>(type: Type, options?: TagDataOptions): (result: Result<M, any> | Array<Result<M, any>> | ListResult<M, any> | null | undefined, error: FetchBaseQueryError | undefined, arg: Arg<M, any> | Array<Arg<M, any>> | Record<M["id"], Arg<M, any>> | ListArg<any> | Array<M["id"]> | string | number | undefined) => Array<Tag<Type>>;
62
- export declare function modelUrls(list: string, detail: string): {
63
- list: string;
64
- detail: string;
65
- };
66
- export type HandleQueryStateOptions = Partial<{
67
- loading: ReactNode;
68
- error: ReactNode;
69
- }>;
70
- export declare function handleResultState<QueryArg, ResultType>(result: TypedUseQueryHookResult<ResultType, QueryArg, any> | TypedUseQueryStateResult<ResultType, QueryArg, any> | TypedUseMutationResult<ResultType, QueryArg, any>, children: (data: NonNullable<ResultType>) => ReactNode, options?: HandleQueryStateOptions): ReactNode;
71
- export declare function isSafeHttpMethod(method: string): boolean;
72
- export {};
1
+ export * from '../src/utils/api'
2
+ export {}
@@ -1,28 +1,2 @@
1
- export declare function logout(): void;
2
- export declare function getCsrfCookie(): string | undefined;
3
- export declare function makeOAuth2StorageKey(provider: string, key: string): string;
4
- export declare const OAUTH2_CODE_CHALLENGE_METHODS: readonly ["S256"];
5
- export type OAuth2CodeChallengeMethods = (typeof OAUTH2_CODE_CHALLENGE_METHODS)[number];
6
- export declare const OAUTH2_CODE_CHALLENGE_LENGTHS: readonly [43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128];
7
- export type OAuth2CodeChallengeLengths = (typeof OAUTH2_CODE_CHALLENGE_LENGTHS)[number];
8
- export type OAuth2RequestCodeUrlSearchParams = {
9
- client_id: string;
10
- redirect_uri: string;
11
- scope: string;
12
- response_type: string;
13
- access_type: string;
14
- prompt?: string;
15
- state: string;
16
- code_challenge: string;
17
- code_challenge_method: string;
18
- };
19
- export type OAuth2ReceiveCodeUrlSearchParams = {
20
- code: string;
21
- state: string;
22
- };
23
- export type OAuth2CodeChallenge = {
24
- verifier: string;
25
- challenge: string;
26
- method: OAuth2CodeChallengeMethods;
27
- };
28
- export declare function generateOAuth2CodeChallenge(length: OAuth2CodeChallengeLengths): Promise<OAuth2CodeChallenge>;
1
+ export * from '../src/utils/auth'
2
+ export {}
@@ -1,25 +1,2 @@
1
- import { FieldValidator, FormikHelpers } from 'formik';
2
- import { Schema, ValidateOptions } from 'yup';
3
- import { TypedMutationTrigger } from '@reduxjs/toolkit/query/react';
4
- export type FormValues = Record<string, any>;
5
- export declare function isFormError(error: unknown): boolean;
6
- export declare function setFormErrors(error: unknown, setErrors: (errors: object) => void): void;
7
- export type SubmitFormOptions<Values extends FormValues, QueryArg extends FormValues, ResultType> = Partial<{
8
- exclude: string[];
9
- include: string[];
10
- onlyDirtyValues: boolean;
11
- then: (result: ResultType, values: Values, helpers: FormikHelpers<Values>) => void;
12
- catch: (error: unknown, values: Values, helpers: FormikHelpers<Values>) => void;
13
- finally: (values: Values, helpers: FormikHelpers<Values>) => void;
14
- }> & (Values extends QueryArg ? {
15
- clean?: (values: Values) => QueryArg;
16
- } : {
17
- clean: (values: Values) => QueryArg;
18
- });
19
- export type SubmitFormHandler<Values extends FormValues> = (values: Values, helpers: FormikHelpers<Values>) => void | Promise<any>;
20
- export declare function submitForm<Values extends QueryArg, QueryArg extends FormValues, ResultType>(trigger: TypedMutationTrigger<ResultType, QueryArg, any>, initialValues: Values, options?: SubmitFormOptions<Values, QueryArg, ResultType>): SubmitFormHandler<Values>;
21
- export declare function submitForm<Values extends FormValues, QueryArg extends FormValues, ResultType>(trigger: TypedMutationTrigger<ResultType, QueryArg, any>, initialValues: Values, options: SubmitFormOptions<Values, QueryArg, ResultType>): SubmitFormHandler<Values>;
22
- export declare function schemaToFieldValidator(schema: Schema, options?: ValidateOptions): FieldValidator;
23
- export declare function getDirty<Values extends FormValues>(values: Values, initialValues: Values, names?: string[]): Record<string, boolean>;
24
- export declare function isDirty<Values extends FormValues>(values: Values, initialValues: Values, name: string): boolean;
25
- export declare function getCleanNames<Values extends FormValues>(values: Values, initialValues: Values, names?: string[]): string[];
1
+ export * from '../src/utils/form'
2
+ export {}
@@ -1,30 +1,2 @@
1
- export type Required<T, K extends keyof T> = {
2
- [P in K]-?: T[P];
3
- };
4
- export type Optional<T, K extends keyof T> = Partial<Pick<T, K>>;
5
- export type OptionalPropertyNames<T> = {
6
- [K in keyof T]-?: {} extends {
7
- [P in K]: T[K];
8
- } ? K : never;
9
- }[keyof T];
10
- export type IsOptional<T, K extends keyof T> = K extends OptionalPropertyNames<T> ? true : false;
11
- export declare function openInNewTab(url: string, target?: string): void;
12
- export declare function wrap(newFn: {
13
- before?: (...args: any[]) => void;
14
- after?: (...args: any[]) => void;
15
- }, fn?: (...args: any[]) => any): (...args: any[]) => any;
16
- export declare function snakeCaseToCamelCase(obj: Record<string, any>): void;
17
- export declare function camelCaseToSnakeCase(obj: Record<string, any>): void;
18
- export declare const MIN_DATE: Date;
19
- export declare const COUNTRY_ISO_CODES: readonly ["AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "YE", "YT", "ZA", "ZM", "ZW"];
20
- export type CountryIsoCodes = (typeof COUNTRY_ISO_CODES)[number];
21
- export declare const COUNTRIES: readonly ["Andorra", "United Arab Emirates (the)", "Afghanistan", "Antigua and Barbuda", "Anguilla", "Albania", "Armenia", "Angola", "Antarctica", "Argentina", "American Samoa", "Austria", "Australia", "Aruba", "Åland Islands", "Azerbaijan", "Bosnia and Herzegovina", "Barbados", "Bangladesh", "Belgium", "Burkina Faso", "Bulgaria", "Bahrain", "Burundi", "Benin", "Saint Barthélemy", "Bermuda", "Brunei Darussalam", "Bolivia (Plurinational State of)", "Bonaire, Sint Eustatius and Saba", "Brazil", "Bahamas (the)", "Bhutan", "Bouvet Island", "Botswana", "Belarus", "Belize", "Canada", "Cocos (Keeling) Islands (the)", "Congo (the Democratic Republic of the)", "Central African Republic (the)", "Congo (the)", "Switzerland", "Côte d'Ivoire", "Cook Islands (the)", "Chile", "Cameroon", "China", "Colombia", "Costa Rica", "Cuba", "Cabo Verde", "Curaçao", "Christmas Island", "Cyprus", "Czechia", "Germany", "Djibouti", "Denmark", "Dominica", "Dominican Republic (the", "Algeria", "Ecuador", "Estonia", "Egypt", "Western Sahara", "Eritrea", "Spain", "Ethiopia", "Finland", "Fiji", "Falkland Islands (the) [Malvinas]", "Micronesia (Federated States of)", "Faroe Islands (the)", "France", "Gabon", "United Kingdom of Great Britain and Northern Ireland (the)", "Grenada", "Georgia", "French Guiana", "Guernsey", "Ghana", "Gibraltar", "Greenland", "Gambia (the)", "Guinea", "Guadeloupe", "Equatorial Guinea", "Greece", "South Georgia and the South Sandwich Islands", "Guatemala", "Guam", "Guinea-Bissau", "Guyana", "Hong Kong", "Heard Island and McDonald Islands", "Honduras", "Croatia", "Haiti", "Hungary", "Indonesia", "Ireland", "Israel", "Isle of Man", "India", "British Indian Ocean Territory (the)", "Iraq", "Iran (Islamic Republic of)", "Iceland", "Italy", "Jersey", "Jamaica", "Jordan", "Japan", "Kenya", "Kyrgyzstan", "Cambodia", "Kiribati", "Comoros (the)", "Saint Kitts and Nevis", "Korea (the Democratic People's Republic of)", "Korea (the Republic of)", "Kuwait", "Cayman Islands (the)", "Kazakhstan", "Lao People's Democratic Republic (the)", "Lebanon", "Saint Lucia", "Liechtenstein", "Sri Lanka", "Liberia", "Lesotho", "Lithuania", "Luxembourg", "Latvia", "Libya", "Morocco", "Monaco", "Moldova (the Republic of)", "Montenegro", "Saint Martin (French part)", "Madagascar", "Marshall Islands (the)", "Republic of North Macedonia", "Mali", "Myanmar", "Mongolia", "Macao", "Northern Mariana Islands (the)", "Martinique", "Mauritania", "Montserrat", "Malta", "Mauritius", "Maldives", "Malawi", "Mexico", "Malaysia", "Mozambique", "Namibia", "New Caledonia", "Niger (the)", "Norfolk Island", "Nigeria", "Nicaragua", "Netherlands (the)", "Norway", "Nepal", "Nauru", "Niue", "New Zealand", "Oman", "Panama", "Peru", "French Polynesia", "Papua New Guinea", "Philippines (the)", "Pakistan", "Poland", "Saint Pierre and Miquelon", "Pitcairn", "Puerto Rico", "Palestine, State of", "Portugal", "Palau", "Paraguay", "Qatar", "Réunion", "Romania", "Serbia", "Russian Federation (the)", "Rwanda", "Saudi Arabia", "Solomon Islands", "Seychelles", "Sudan (the)", "Sweden", "Singapore", "Saint Helena, Ascension and Tristan da Cunha", "Slovenia", "Svalbard and Jan Mayen", "Slovakia", "Sierra Leone", "San Marino", "Senegal", "Somalia", "Suriname", "South Sudan", "Sao Tome and Principe", "El Salvador", "Sint Maarten (Dutch part)", "Syrian Arab Republic", "Eswatini", "Turks and Caicos Islands (the)", "Chad", "French Southern Territories (the)", "Togo", "Thailand", "Tajikistan", "Tokelau", "Timor-Leste", "Turkmenistan", "Tunisia", "Tonga", "Turkey", "Trinidad and Tobago", "Tuvalu", "Taiwan (Province of China)", "Tanzania, United Republic of", "Ukraine", "Uganda", "United States Minor Outlying Islands (the)", "United States of America (the)", "Uruguay", "Uzbekistan", "Holy See (the)", "Saint Vincent and the Grenadines", "Venezuela (Bolivarian Republic of)", "Virgin Islands (British)", "Virgin Islands (U.S.)", "Viet Nam", "Vanuatu", "Wallis and Futuna", "Samoa", "Yemen", "Mayotte", "South Africa", "Zambia", "Zimbabwe"];
22
- export type Countries = (typeof COUNTRIES)[number];
23
- export declare const COUNTRY_ISO_CODE_MAPPING: Record<CountryIsoCodes, Countries>;
24
- export declare const UK_COUNTIES: readonly ["Aberdeen City", "Aberdeenshire", "Angus", "Argyll and Bute", "Bedfordshire", "Belfast", "Belfast Greater", "Berkshire", "Blaenau Gwent", "Bridgend", "Buckinghamshire", "Caerphilly", "Cambridgeshire", "Cardiff", "Carmarthenshire", "Ceredigion", "Channel Islands", "Cheshire", "City of Edinburgh", "Clackmannanshire", "Conwy", "Cornwall", "County Antrim", "County Armagh", "County Down", "County Fermanagh", "County Londonderry", "County Tyrone", "County of Bristol", "Cumbria", "Denbighshire", "Derbyshire", "Devon", "Dorset", "Dumfries and Galloway", "Dunbartonshire", "Dundee City", "Durham", "East Ayrshire", "East Dunbartonshire", "East Lothian", "East Renfrewshire", "East Riding of Yorkshire", "East Sussex", "Essex", "Falkirk", "Fife", "Flintshire", "Glasgow City", "Gloucestershire", "Greater London", "Greater Manchester", "Guernsey Channel Islands", "Gwynedd", "Hampshire", "Hereford and Worcester", "Herefordshire", "Hertfordshire", "Highland", "Inverclyde", "Inverness", "Isle of Anglesey", "Isle of Barra", "Isle of Man", "Isle of Wight", "Jersey Channel Islands", "Kent", "Lancashire", "Leicestershire", "Lincolnshire", "Merseyside", "Merthyr Tydfil", "Midlothian", "Monmouthshire", "Moray", "Neath Port Talbot", "Newport", "Norfolk", "North Ayrshire", "North Lanarkshire", "North Yorkshire", "Northamptonshire", "Northumberland", "Nottinghamshire", "Orkney", "Orkney Islands", "Oxfordshire", "Pembrokeshire", "Perth and Kinross", "Powys", "Renfrewshire", "Rhondda Cynon Taff", "Rutland", "Scottish Borders", "Shetland Islands", "Shropshire", "Somerset", "South Ayrshire", "South Lanarkshire", "South Yorkshire", "Staffordshire", "Stirling", "Suffolk", "Surrey", "Swansea", "Torfaen", "Tyne and Wear", "Vale of Glamorgan", "Warwickshire", "West Dunbart", "West Lothian", "West Midlands", "West Sussex", "West Yorkshire", "Western Isles", "Wiltshire", "Worcestershire", "Wrexham"];
25
- export type UkCounties = (typeof UK_COUNTIES)[number];
26
- export declare function getNestedProperty(obj: Record<string, any>, dotPath: string | string[]): any;
27
- export declare function withKeyPaths(obj: object, delimiter?: string): object;
28
- export declare function getKeyPaths(obj: object, delimiter?: string): string[];
29
- export declare function excludeKeyPaths(obj: object, exclude: string[], delimiter?: string): any;
30
- export declare function generateSecureRandomString(length: number, charSet?: string): string;
1
+ export * from '../src/utils/general'
2
+ export {}
@@ -1,19 +1,2 @@
1
- import { To, LinkProps as _LinkProps } from 'react-router';
2
- import { PageState } from '../components/page/Page';
3
- export type LinkProps<Override extends "delta" | "to", State extends Record<string, any> = Record<string, any>> = Omit<_LinkProps, "to" | "state"> & (Override extends "delta" ? {
4
- to: number;
5
- } : {
6
- to: To;
7
- state?: State & Partial<PageState>;
8
- });
9
- export type ReadOnly<T> = {
10
- readonly [P in keyof T]: T[P];
11
- };
12
- export type Parameters = Record<string, string>;
13
- export interface Path {
14
- _: string;
15
- __: string | Parameters;
16
- [subpath: string]: string | Path | Parameters;
17
- }
18
- export declare function path<Subpaths extends Record<string, Path>>(_: string | Parameters, subpaths?: Subpaths): Path & Subpaths;
19
- export declare function getParam(path: Path, key: string): string;
1
+ export * from '../src/utils/router'
2
+ export {}