@jmruthers/pace-core 0.5.183 → 0.5.185
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/CHANGELOG.md +38 -0
- package/README.md +60 -1
- package/core-usage-manifest.json +312 -0
- package/dist/{DataTable-QAB34V6K.js → DataTable-IX2NBUTP.js} +6 -6
- package/dist/{DataTable-Bz8ffqyA.d.ts → DataTable-Z9NLVJh0.d.ts} +1 -1
- package/dist/{index-Bl--n7-T.d.ts → PublicPageProvider-BABf6JCh.d.ts} +21 -10
- package/dist/{UnifiedAuthProvider-7F6T4B6K.js → UnifiedAuthProvider-A4BCQRJY.js} +4 -2
- package/dist/{UnifiedAuthProvider-F86d7dSi.d.ts → UnifiedAuthProvider-BG0AL5eE.d.ts} +2 -1
- package/dist/{api-ROMBCNKU.js → api-BMFCXVQX.js} +2 -2
- package/dist/{chunk-RA3JUFMW.js → chunk-445GEP27.js} +154 -4
- package/dist/{chunk-RA3JUFMW.js.map → chunk-445GEP27.js.map} +1 -1
- package/dist/{chunk-CSOFYHAG.js → chunk-AISXLWGZ.js} +374 -60
- package/dist/chunk-AISXLWGZ.js.map +1 -0
- package/dist/{chunk-FUEYYMX5.js → chunk-FXFJRTKI.js} +24 -3
- package/dist/chunk-FXFJRTKI.js.map +1 -0
- package/dist/{chunk-QETLRQI6.js → chunk-HC67NW5K.js} +380 -360
- package/dist/chunk-HC67NW5K.js.map +1 -0
- package/dist/chunk-HESYZWZW.js +388 -0
- package/dist/chunk-HESYZWZW.js.map +1 -0
- package/dist/{chunk-QUVSNGIP.js → chunk-HGPQUCBC.js} +34 -9
- package/dist/{chunk-QUVSNGIP.js.map → chunk-HGPQUCBC.js.map} +1 -1
- package/dist/{chunk-UHNYIBXL.js → chunk-IXSNYUCT.js} +1 -1
- package/dist/chunk-IXSNYUCT.js.map +1 -0
- package/dist/{chunk-MI7HBHN3.js → chunk-MX3EIJGQ.js} +4 -3
- package/dist/{chunk-MI7HBHN3.js.map → chunk-MX3EIJGQ.js.map} +1 -1
- package/dist/{chunk-PWAHJW4G.js → chunk-OKI34GZD.js} +86 -33
- package/dist/chunk-OKI34GZD.js.map +1 -0
- package/dist/{chunk-W22JP75J.js → chunk-STTZQK2I.js} +3 -3
- package/dist/chunk-THRPYOFK.js +215 -0
- package/dist/chunk-THRPYOFK.js.map +1 -0
- package/dist/{chunk-M7W4CP3M.js → chunk-U6WNSFX5.js} +2 -1
- package/dist/chunk-U6WNSFX5.js.map +1 -0
- package/dist/{chunk-QCDXODCA.js → chunk-XAUHJD3L.js} +2 -2
- package/dist/components.d.ts +182 -6
- package/dist/components.js +157 -11
- package/dist/components.js.map +1 -1
- package/dist/eslint-rules/pace-core-compliance.cjs +406 -0
- package/dist/{file-reference-D06mEEWW.d.ts → file-reference-BjR39ktt.d.ts} +7 -1
- package/dist/hooks.d.ts +7 -14
- package/dist/hooks.js +10 -22
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +79 -16
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +3 -1
- package/dist/rbac/index.d.ts +205 -14
- package/dist/rbac/index.js +28 -6
- package/dist/timezone-_pgH8qrY.d.ts +530 -0
- package/dist/{types-_x1f4QBF.d.ts → types-DUyCRSTj.d.ts} +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/{usePublicRouteParams-JJczomYq.d.ts → usePublicRouteParams-CvnC3d-e.d.ts} +113 -2
- package/dist/utils.d.ts +109 -151
- package/dist/utils.js +128 -138
- package/dist/utils.js.map +1 -1
- package/docs/api/README.md +60 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/Logger.md +178 -0
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +2 -2
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +2 -2
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +5 -5
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/enums/LogLevel.md +54 -0
- package/docs/api/enums/RBACErrorCode.md +1 -1
- package/docs/api/enums/RPCFunction.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/BadgeProps.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CalendarProps.md +18 -2
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/ComplianceResult.md +30 -0
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/DatabaseComplianceResult.md +85 -0
- package/docs/api/interfaces/DatabaseIssue.md +41 -0
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventAppRoleData.md +6 -6
- package/docs/api/interfaces/ExportColumn.md +1 -1
- package/docs/api/interfaces/ExportOptions.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +24 -8
- package/docs/api/interfaces/FileUploadProps.md +24 -13
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/FormFieldProps.md +1 -1
- package/docs/api/interfaces/FormProps.md +1 -1
- package/docs/api/interfaces/GrantEventAppRoleParams.md +9 -9
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoggerConfig.md +62 -0
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +36 -23
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +11 -11
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/ProgressProps.md +1 -1
- package/docs/api/interfaces/ProtectedRouteProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/QuickFix.md +52 -0
- package/docs/api/interfaces/RBACAccessValidateParams.md +1 -1
- package/docs/api/interfaces/RBACAccessValidateResult.md +1 -1
- package/docs/api/interfaces/RBACAuditLogParams.md +1 -1
- package/docs/api/interfaces/RBACAuditLogResult.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +4 -4
- package/docs/api/interfaces/RBACContext.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACPageAccessCheckParams.md +1 -1
- package/docs/api/interfaces/RBACPermissionCheckParams.md +1 -1
- package/docs/api/interfaces/RBACPermissionCheckResult.md +1 -1
- package/docs/api/interfaces/RBACPermissionsGetParams.md +1 -1
- package/docs/api/interfaces/RBACPermissionsGetResult.md +1 -1
- package/docs/api/interfaces/RBACResult.md +1 -1
- package/docs/api/interfaces/RBACRoleGrantParams.md +1 -1
- package/docs/api/interfaces/RBACRoleGrantResult.md +1 -1
- package/docs/api/interfaces/RBACRoleRevokeParams.md +1 -1
- package/docs/api/interfaces/RBACRoleRevokeResult.md +1 -1
- package/docs/api/interfaces/RBACRoleValidateParams.md +1 -1
- package/docs/api/interfaces/RBACRoleValidateResult.md +1 -1
- package/docs/api/interfaces/RBACRolesListParams.md +1 -1
- package/docs/api/interfaces/RBACRolesListResult.md +1 -1
- package/docs/api/interfaces/RBACSessionTrackParams.md +1 -1
- package/docs/api/interfaces/RBACSessionTrackResult.md +1 -1
- package/docs/api/interfaces/ResourcePermissions.md +1 -1
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +7 -7
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RoleManagementResult.md +5 -5
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/RuntimeComplianceResult.md +55 -0
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +1 -1
- package/docs/api/interfaces/SetupIssue.md +41 -0
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/TabsContentProps.md +1 -1
- package/docs/api/interfaces/TabsListProps.md +1 -1
- package/docs/api/interfaces/TabsProps.md +1 -1
- package/docs/api/interfaces/TabsTriggerProps.md +1 -1
- package/docs/api/interfaces/TextareaProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/UseFormDialogOptions.md +62 -0
- package/docs/api/interfaces/UseFormDialogReturn.md +117 -0
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +2 -2
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +2 -2
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +2 -2
- package/docs/api/interfaces/UseResolvedScopeReturn.md +1 -1
- package/docs/api/interfaces/UseResourcePermissionsOptions.md +1 -1
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +738 -42
- package/docs/api-reference/hooks.md +111 -0
- package/docs/api-reference/rpc-functions.md +1 -1
- package/docs/api-reference/utilities.md +184 -0
- package/docs/getting-started/installation-guide.md +75 -16
- package/docs/getting-started/quick-start.md +61 -11
- package/docs/implementation-guides/authentication.md +88 -12
- package/docs/implementation-guides/file-reference-system.md +2 -1
- package/docs/implementation-guides/file-upload-storage.md +21 -0
- package/docs/rbac/README.md +1 -0
- package/docs/rbac/compliance/compliance-guide.md +544 -0
- package/docs/rbac/getting-started.md +158 -33
- package/docs/standards/pace-core-compliance.md +432 -0
- package/eslint-config-pace-core.cjs +93 -0
- package/package.json +15 -3
- package/scripts/analyze-bundle.js +232 -0
- package/scripts/build-css.js +56 -0
- package/scripts/build-docs-incremental.js +1015 -0
- package/scripts/check-pace-core-compliance.cjs +2353 -0
- package/scripts/generate-docs.js +157 -0
- package/scripts/setup-build-cache.js +73 -0
- package/scripts/utils/command-runner.js +131 -0
- package/scripts/utils/env.js +33 -0
- package/scripts/utils/index.js +10 -0
- package/scripts/utils/logger.js +88 -0
- package/scripts/utils/path-helpers.js +37 -0
- package/scripts/validate-formats.js +133 -0
- package/scripts/validate-master.js +155 -0
- package/scripts/validate-pre-publish.js +140 -0
- package/scripts/validate-theme.js +142 -0
- package/src/components/Calendar/Calendar.tsx +8 -1
- package/src/components/Card/Card.tsx +47 -8
- package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.test.tsx +314 -0
- package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.tsx +126 -0
- package/src/components/DatePickerWithTimezone/README.md +135 -0
- package/src/components/DatePickerWithTimezone/index.ts +10 -0
- package/src/components/DateTimeField/DateTimeField.test.tsx +358 -0
- package/src/components/DateTimeField/DateTimeField.tsx +232 -0
- package/src/components/DateTimeField/README.md +148 -0
- package/src/components/DateTimeField/index.ts +10 -0
- package/src/components/FileUpload/FileUpload.tsx +3 -0
- package/src/components/Header/Header.test.tsx +47 -18
- package/src/components/Header/Header.tsx +24 -6
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +29 -20
- package/src/components/PaceAppLayout/README.md +9 -0
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +1 -1
- package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +37 -8
- package/src/components/ProtectedRoute/ProtectedRoute.tsx +12 -4
- package/src/components/index.ts +8 -0
- package/src/eslint-rules/pace-core-compliance.cjs +406 -0
- package/src/eslint-rules/pace-core-compliance.js +640 -0
- package/src/hooks/__tests__/useFormDialog.test.ts +478 -0
- package/src/hooks/index.ts +2 -0
- package/src/hooks/useFileReference.test.ts +1 -0
- package/src/hooks/useFormDialog.ts +147 -0
- package/src/index.ts +27 -0
- package/src/providers/services/OrganisationServiceProvider.tsx +6 -5
- package/src/providers/services/UnifiedAuthProvider.tsx +24 -3
- package/src/rbac/__tests__/scenarios.user-role.test.tsx +3 -0
- package/src/rbac/compliance/database-validator.ts +165 -0
- package/src/rbac/compliance/index.ts +38 -0
- package/src/rbac/compliance/quick-fix-suggestions.ts +209 -0
- package/src/rbac/compliance/runtime-compliance.ts +77 -0
- package/src/rbac/compliance/setup-validator.ts +131 -0
- package/src/rbac/components/PagePermissionGuard.tsx +8 -64
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +35 -21
- package/src/rbac/docs/event-based-apps.md +285 -0
- package/src/rbac/errors.ts +11 -0
- package/src/rbac/hooks/useRoleManagement.ts +292 -12
- package/src/rbac/index.ts +30 -0
- package/src/services/OrganisationService.ts +4 -0
- package/src/types/file-reference.ts +6 -0
- package/src/utils/__tests__/timezone.test.ts +345 -0
- package/src/utils/file-reference/__tests__/file-reference.test.ts +2 -0
- package/src/utils/file-reference/index.ts +1 -0
- package/src/utils/formatting/formatDateTimeTimezone.test.ts +167 -0
- package/src/utils/formatting/formatting.ts +179 -0
- package/src/utils/index.ts +27 -1
- package/src/utils/location/index.ts +16 -0
- package/src/utils/location/location.test.ts +286 -0
- package/src/utils/location/location.ts +175 -0
- package/src/utils/timezone/index.ts +17 -0
- package/src/utils/timezone/timezone.test.ts +349 -0
- package/src/utils/timezone/timezone.ts +281 -0
- package/dist/chunk-CSOFYHAG.js.map +0 -1
- package/dist/chunk-FUEYYMX5.js.map +0 -1
- package/dist/chunk-HKIT6O7W.js +0 -198
- package/dist/chunk-HKIT6O7W.js.map +0 -1
- package/dist/chunk-KUEN3HFB.js +0 -94
- package/dist/chunk-KUEN3HFB.js.map +0 -1
- package/dist/chunk-M7W4CP3M.js.map +0 -1
- package/dist/chunk-PWAHJW4G.js.map +0 -1
- package/dist/chunk-QETLRQI6.js.map +0 -1
- package/dist/chunk-UHNYIBXL.js.map +0 -1
- package/dist/formatting-5wETwiGF.d.ts +0 -162
- /package/dist/{DataTable-QAB34V6K.js.map → DataTable-IX2NBUTP.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-7F6T4B6K.js.map → UnifiedAuthProvider-A4BCQRJY.js.map} +0 -0
- /package/dist/{api-ROMBCNKU.js.map → api-BMFCXVQX.js.map} +0 -0
- /package/dist/{chunk-W22JP75J.js.map → chunk-STTZQK2I.js.map} +0 -0
- /package/dist/{chunk-QCDXODCA.js.map → chunk-XAUHJD3L.js.map} +0 -0
package/dist/utils.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { S as SecureDataAccess,
|
|
1
|
+
export { K as DateTimeFormatOptions, j as LogLevel, L as Logger, k as LoggerConfig, S as SecureDataAccess, N as calculatePasswordStrength, d as cn, i as createLogger, M as dateSchema, e as emailSchema, w as formatCompactNumber, r as formatCurrency, m as formatDate, H as formatDateOnlyForDisplay, q as formatDateTime, G as formatDateTimeForDisplay, J as formatDateTimeForMap, I as formatDateTimeForTable, x as formatFileSize, y as formatInTimeZone, t as formatNumber, v as formatPercent, o as formatTime, A as formatTimeInTimeZone, D as fromZonedTime, g as getAppConfig, h as getCurrentAppId, F as getTimeZoneDifference, z as getTimezoneAbbreviation, B as getUserTimeZone, l as logger, n as nameSchema, b as passwordSchema, p as phoneSchema, E as roundToNearestMinutes, s as setAppConfig, C as toZonedTime, a as urlSchema, u as useSessionTracking } from './timezone-_pgH8qrY.js';
|
|
2
2
|
import { SupabaseClient } from '@supabase/supabase-js';
|
|
3
3
|
import { D as Database } from './database.generated-CBmg2950.js';
|
|
4
4
|
export { g as changePasswordSchema, t as combineSchemas, i as contactFormSchema, l as loginSchema, f as passwordResetSchema, q as pickSchema, r as registrationSchema, c as secureLoginSchema, s as securePasswordSchema, h as userProfileSchema } from './validation-643vUDZW.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
export { u as useComponentPerformance } from './useComponentPerformance-DE9l5RkL.js';
|
|
7
7
|
import * as date_fns from 'date-fns';
|
|
8
|
-
import { D as DataTable } from './DataTable-
|
|
9
|
-
import './types-
|
|
8
|
+
import { D as DataTable } from './DataTable-Z9NLVJh0.js';
|
|
9
|
+
import './types-DUyCRSTj.js';
|
|
10
10
|
import React__default, { ComponentType } from 'react';
|
|
11
11
|
import 'clsx';
|
|
12
12
|
import 'react/jsx-runtime';
|
|
@@ -45,109 +45,6 @@ declare class DebugLogger {
|
|
|
45
45
|
static info(component: string, message: string, ...args: any[]): void;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
/**
|
|
49
|
-
* @file Production-Safe Logger Utility
|
|
50
|
-
* @package @jmruthers/pace-core
|
|
51
|
-
* @module Utils/Logger
|
|
52
|
-
* @since 0.4.76
|
|
53
|
-
*/
|
|
54
|
-
/**
|
|
55
|
-
* Logger levels for different types of messages
|
|
56
|
-
*/
|
|
57
|
-
declare enum LogLevel {
|
|
58
|
-
DEBUG = 0,
|
|
59
|
-
INFO = 1,
|
|
60
|
-
WARN = 2,
|
|
61
|
-
ERROR = 3
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Logger configuration interface
|
|
65
|
-
*/
|
|
66
|
-
interface LoggerConfig {
|
|
67
|
-
/** Minimum log level to output */
|
|
68
|
-
level: LogLevel;
|
|
69
|
-
/** Whether to include timestamps */
|
|
70
|
-
includeTimestamp: boolean;
|
|
71
|
-
/** Whether to include component names */
|
|
72
|
-
includeComponent: boolean;
|
|
73
|
-
/** Custom prefix for all log messages */
|
|
74
|
-
prefix?: string;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Production-safe logger that no-ops in production builds
|
|
78
|
-
* Only outputs logs in development mode to prevent production console spam
|
|
79
|
-
*/
|
|
80
|
-
declare class Logger {
|
|
81
|
-
private static config;
|
|
82
|
-
/**
|
|
83
|
-
* Check if we're in development or test mode
|
|
84
|
-
* Allows logging in both development and test environments
|
|
85
|
-
*/
|
|
86
|
-
private static get isDevelopment();
|
|
87
|
-
/**
|
|
88
|
-
* Configure the logger
|
|
89
|
-
*/
|
|
90
|
-
static configure(config: Partial<LoggerConfig>): void;
|
|
91
|
-
/**
|
|
92
|
-
* Format a log message with optional timestamp and component
|
|
93
|
-
*/
|
|
94
|
-
private static formatMessage;
|
|
95
|
-
/**
|
|
96
|
-
* Check if a log level should be output
|
|
97
|
-
*/
|
|
98
|
-
private static shouldLog;
|
|
99
|
-
/**
|
|
100
|
-
* Log debug information (development only)
|
|
101
|
-
*/
|
|
102
|
-
static debug(component: string, message: string, ...args: any[]): void;
|
|
103
|
-
/**
|
|
104
|
-
* Log info information (development only)
|
|
105
|
-
*/
|
|
106
|
-
static info(component: string, message: string, ...args: any[]): void;
|
|
107
|
-
/**
|
|
108
|
-
* Log warning information (development only)
|
|
109
|
-
*/
|
|
110
|
-
static warn(component: string, message: string, ...args: any[]): void;
|
|
111
|
-
/**
|
|
112
|
-
* Log error information (development only)
|
|
113
|
-
*/
|
|
114
|
-
static error(component: string, message: string, ...args: any[]): void;
|
|
115
|
-
/**
|
|
116
|
-
* Create a scoped logger for a specific component
|
|
117
|
-
*/
|
|
118
|
-
static createScopedLogger(component: string): {
|
|
119
|
-
debug: (message: string, ...args: any[]) => void;
|
|
120
|
-
info: (message: string, ...args: any[]) => void;
|
|
121
|
-
warn: (message: string, ...args: any[]) => void;
|
|
122
|
-
error: (message: string, ...args: any[]) => void;
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Default logger instance for convenience
|
|
127
|
-
*/
|
|
128
|
-
declare const logger: {
|
|
129
|
-
debug: (component: string, message: string, ...args: any[]) => void;
|
|
130
|
-
info: (component: string, message: string, ...args: any[]) => void;
|
|
131
|
-
warn: (component: string, message: string, ...args: any[]) => void;
|
|
132
|
-
error: (component: string, message: string, ...args: any[]) => void;
|
|
133
|
-
createScopedLogger: (component: string) => {
|
|
134
|
-
debug: (message: string, ...args: any[]) => void;
|
|
135
|
-
info: (message: string, ...args: any[]) => void;
|
|
136
|
-
warn: (message: string, ...args: any[]) => void;
|
|
137
|
-
error: (message: string, ...args: any[]) => void;
|
|
138
|
-
};
|
|
139
|
-
configure: (config: Partial<LoggerConfig>) => void;
|
|
140
|
-
};
|
|
141
|
-
/**
|
|
142
|
-
* Convenience function to create a scoped logger
|
|
143
|
-
*/
|
|
144
|
-
declare function createLogger(component: string): {
|
|
145
|
-
debug: (message: string, ...args: any[]) => void;
|
|
146
|
-
info: (message: string, ...args: any[]) => void;
|
|
147
|
-
warn: (message: string, ...args: any[]) => void;
|
|
148
|
-
error: (message: string, ...args: any[]) => void;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
48
|
/**
|
|
152
49
|
* Utility to resolve the current app name from various sources
|
|
153
50
|
* Priority: package.json > environment variables > fallback
|
|
@@ -404,32 +301,6 @@ declare function validateUserInput<T>(schema: z.ZodSchema<T>, data: unknown, san
|
|
|
404
301
|
*/
|
|
405
302
|
declare const usernameSchema: z.ZodPipeline<z.ZodEffects<z.ZodString, string, string>, z.ZodString>;
|
|
406
303
|
|
|
407
|
-
/**
|
|
408
|
-
* @file Common validation schemas
|
|
409
|
-
* @description Reusable validation schemas for common data types
|
|
410
|
-
*/
|
|
411
|
-
|
|
412
|
-
/**
|
|
413
|
-
* Email validation schema
|
|
414
|
-
*/
|
|
415
|
-
declare const emailSchema: z.ZodString;
|
|
416
|
-
/**
|
|
417
|
-
* Name validation schema
|
|
418
|
-
*/
|
|
419
|
-
declare const nameSchema: z.ZodString;
|
|
420
|
-
/**
|
|
421
|
-
* Phone number validation schema
|
|
422
|
-
*/
|
|
423
|
-
declare const phoneSchema: z.ZodString;
|
|
424
|
-
/**
|
|
425
|
-
* URL validation schema
|
|
426
|
-
*/
|
|
427
|
-
declare const urlSchema: z.ZodString;
|
|
428
|
-
/**
|
|
429
|
-
* Date validation schema
|
|
430
|
-
*/
|
|
431
|
-
declare const dateSchema: z.ZodEffects<z.ZodString, string, string>;
|
|
432
|
-
|
|
433
304
|
/**
|
|
434
305
|
* @file CSRF Protection Implementation
|
|
435
306
|
* @description Session-based CSRF token management with security enhancements
|
|
@@ -532,24 +403,6 @@ declare function detectSQLInjection(input: string): {
|
|
|
532
403
|
riskLevel: 'low' | 'medium' | 'high' | 'critical';
|
|
533
404
|
};
|
|
534
405
|
|
|
535
|
-
/**
|
|
536
|
-
* @file Enhanced Password Schema with Security Validations
|
|
537
|
-
* @description Comprehensive password validation with security checks
|
|
538
|
-
*/
|
|
539
|
-
|
|
540
|
-
/**
|
|
541
|
-
* Basic password schema for less strict requirements
|
|
542
|
-
*/
|
|
543
|
-
declare const passwordSchema: z.ZodString;
|
|
544
|
-
/**
|
|
545
|
-
* Password strength calculator
|
|
546
|
-
*/
|
|
547
|
-
declare function calculatePasswordStrength(password: string): {
|
|
548
|
-
score: number;
|
|
549
|
-
feedback: string[];
|
|
550
|
-
level: 'very-weak' | 'weak' | 'fair' | 'good' | 'strong';
|
|
551
|
-
};
|
|
552
|
-
|
|
553
406
|
/**
|
|
554
407
|
* Schema for user settings
|
|
555
408
|
*/
|
|
@@ -931,4 +784,109 @@ declare function getOrganisationContext(supabase: SupabaseClient): Promise<strin
|
|
|
931
784
|
*/
|
|
932
785
|
declare function isOrganisationContextAvailable(supabase: SupabaseClient): Promise<boolean>;
|
|
933
786
|
|
|
934
|
-
|
|
787
|
+
/**
|
|
788
|
+
* @file Location Utilities
|
|
789
|
+
* @package @jmruthers/pace-core
|
|
790
|
+
* @module Utils/Location
|
|
791
|
+
* @since 0.1.0
|
|
792
|
+
*
|
|
793
|
+
* Utility functions for working with geographic coordinates.
|
|
794
|
+
* Provides functions for formatting, validating, comparing, and generating URLs for coordinates.
|
|
795
|
+
*
|
|
796
|
+
* Features:
|
|
797
|
+
* - Format coordinates for display
|
|
798
|
+
* - Validate coordinate objects
|
|
799
|
+
* - Compare coordinates with tolerance
|
|
800
|
+
* - Generate Google Maps URLs
|
|
801
|
+
*
|
|
802
|
+
* @example
|
|
803
|
+
* ```ts
|
|
804
|
+
* import { formatCoordinates, hasValidCoordinates, areCoordinatesEqual, getGoogleMapsUrl } from '@jmruthers/pace-core/utils/location';
|
|
805
|
+
*
|
|
806
|
+
* const coords = { lat: -37.8136, lng: 144.9631 };
|
|
807
|
+
*
|
|
808
|
+
* // Format for display
|
|
809
|
+
* formatCoordinates(coords); // "-37.813600, 144.963100"
|
|
810
|
+
*
|
|
811
|
+
* // Validate
|
|
812
|
+
* hasValidCoordinates(coords); // true
|
|
813
|
+
*
|
|
814
|
+
* // Compare
|
|
815
|
+
* areCoordinatesEqual(coords, { lat: -37.8137, lng: 144.9632 }); // true (within tolerance)
|
|
816
|
+
*
|
|
817
|
+
* // Generate Google Maps URL
|
|
818
|
+
* getGoogleMapsUrl(coords); // "https://www.google.com/maps/search/?api=1&query=-37.8136,144.9631"
|
|
819
|
+
* ```
|
|
820
|
+
*/
|
|
821
|
+
/**
|
|
822
|
+
* Coordinate interface for latitude and longitude
|
|
823
|
+
*/
|
|
824
|
+
interface Coordinates {
|
|
825
|
+
lat: number;
|
|
826
|
+
lng: number;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* Format coordinates as a string with 6 decimal places
|
|
830
|
+
*
|
|
831
|
+
* @param coords - Coordinate object with lat and lng
|
|
832
|
+
* @returns Formatted string "lat, lng" or "N/A" if invalid
|
|
833
|
+
*
|
|
834
|
+
* @example
|
|
835
|
+
* ```ts
|
|
836
|
+
* formatCoordinates({ lat: -37.8136, lng: 144.9631 });
|
|
837
|
+
* // "-37.813600, 144.963100"
|
|
838
|
+
*
|
|
839
|
+
* formatCoordinates(undefined);
|
|
840
|
+
* // "N/A"
|
|
841
|
+
* ```
|
|
842
|
+
*/
|
|
843
|
+
declare function formatCoordinates(coords?: Coordinates): string;
|
|
844
|
+
/**
|
|
845
|
+
* Check if coordinates are valid
|
|
846
|
+
*
|
|
847
|
+
* @param coords - Coordinate object to validate
|
|
848
|
+
* @returns true if coordinates are valid, false otherwise
|
|
849
|
+
*
|
|
850
|
+
* @example
|
|
851
|
+
* ```ts
|
|
852
|
+
* hasValidCoordinates({ lat: -37.8136, lng: 144.9631 }); // true
|
|
853
|
+
* hasValidCoordinates({ lat: 91, lng: 0 }); // false (lat out of range)
|
|
854
|
+
* hasValidCoordinates(undefined); // false
|
|
855
|
+
* ```
|
|
856
|
+
*/
|
|
857
|
+
declare function hasValidCoordinates(coords?: {
|
|
858
|
+
lat?: number;
|
|
859
|
+
lng?: number;
|
|
860
|
+
}): boolean;
|
|
861
|
+
/**
|
|
862
|
+
* Check if two coordinates are equal within a tolerance
|
|
863
|
+
*
|
|
864
|
+
* @param coords1 - First coordinate object
|
|
865
|
+
* @param coords2 - Second coordinate object
|
|
866
|
+
* @param tolerance - Tolerance in degrees (default: 0.0001° ≈ 11 meters)
|
|
867
|
+
* @returns true if coordinates are within tolerance, false otherwise
|
|
868
|
+
*
|
|
869
|
+
* @example
|
|
870
|
+
* ```ts
|
|
871
|
+
* const coords1 = { lat: -37.8136, lng: 144.9631 };
|
|
872
|
+
* const coords2 = { lat: -37.8137, lng: 144.9632 };
|
|
873
|
+
* areCoordinatesEqual(coords1, coords2); // true (within default tolerance)
|
|
874
|
+
* areCoordinatesEqual(coords1, coords2, 0.00001); // false (stricter tolerance)
|
|
875
|
+
* ```
|
|
876
|
+
*/
|
|
877
|
+
declare function areCoordinatesEqual(coords1: Coordinates | null | undefined, coords2: Coordinates | null | undefined, tolerance?: number): boolean;
|
|
878
|
+
/**
|
|
879
|
+
* Generate a Google Maps search URL for coordinates
|
|
880
|
+
*
|
|
881
|
+
* @param coords - Coordinate object with lat and lng
|
|
882
|
+
* @returns Google Maps search URL or empty string if invalid
|
|
883
|
+
*
|
|
884
|
+
* @example
|
|
885
|
+
* ```ts
|
|
886
|
+
* getGoogleMapsUrl({ lat: -37.8136, lng: 144.9631 });
|
|
887
|
+
* // "https://www.google.com/maps/search/?api=1&query=-37.8136,144.9631"
|
|
888
|
+
* ```
|
|
889
|
+
*/
|
|
890
|
+
declare function getGoogleMapsUrl(coords?: Coordinates): string;
|
|
891
|
+
|
|
892
|
+
export { type CSRFTokenData, CachedAppIdResolver, type Coordinates, DebugLogger, LazyDataTable, PERFORMANCE_BUDGETS, PERFORMANCE_THRESHOLDS, type PerformanceMetrics$1 as PerformanceMetrics, PermissionType, type SafeQueryParams, type SanitizationOptions, type SecurityEvent$1 as SecurityEvent, areCoordinatesEqual, auditLog, auditLogger, buildSafeQueryParams, bundleAnalyzer, cachedAppIdResolver, clearOrganisationContext, createLazyComponent, createLazyUtility, createPerformanceBenchmark, csrfManager, deepMerge, detectSQLInjection, escapeLikeQuery, formatCoordinates, generateCSRFToken, generateDeviceFingerprint, getAppId, getAppIds, getAppNameFromBuildTime, getAppNameFromEnvironment, getAppNameFromGlobal, getAppNameFromPackageJson, getCSRFToken, getCurrentAppName, getCurrentAppNameWithFallback, getGoogleMapsUrl, getOrganisationContext, getSecurityHeaders, hasAllPermissions, hasAnyPermission, hasPermission, hasValidCoordinates, isEmpty, isObject, isOrganisationContextAvailable, isStrongPassword, isValidDate, isValidEmail, isValidUrl, isWithinRange, lazyCSVUtils, lazyChartUtils, lazyDateUtils, lazyFormUtils, lazyLodash, limitOffsetSchema, loadCSVUtils, loadChartUtils, loadDateUtils, loadFormUtils, loadLodash, logAuditEvent, logAuthEvent, logPermissionEvent, logSecurityEvent, matchesPattern, measureRenderPerformance, orderBySchema, parsePermission, performanceBudgetMonitor, renderSafeHtml, sanitizeFilters, sanitizeFormData, sanitizeHtml, sanitizeSearchQuery, sanitizeUserInput, searchQuerySchema, securityMonitor, setOrganisationContext, setRBACAppName, sqlIdentifierSchema, trackDynamicImport, transformPermissionMapToBoolean, userPreferencesSchema, userSettingsSchema, usernameSchema, validateCSRFToken, validateDeviceFingerprint, validateHtml, validateImportPattern, validateSecurityHeaders, validateUserInput };
|