@jmruthers/pace-core 0.6.7 → 0.6.8
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/audit-tool/00-dependencies.cjs +215 -9
- package/audit-tool/audits/02-project-structure.cjs +3 -18
- package/audit-tool/audits/03-architecture.cjs +34 -6
- package/audit-tool/audits/06-security-rbac.cjs +10 -0
- package/audit-tool/audits/07-api-tech-stack.cjs +55 -1
- package/audit-tool/index.cjs +23 -19
- package/audit-tool/utils/report-utils.cjs +141 -2
- package/dist/{DataTable-7PMH7XN7.js → DataTable-6RMSCQJ6.js} +5 -5
- package/dist/{PublicPageProvider-DlsCaR5v.d.ts → PublicPageProvider-CIGSujI2.d.ts} +14 -8
- package/dist/{UnifiedAuthProvider-ZT6TIGM7.js → UnifiedAuthProvider-7SNDOWYD.js} +2 -2
- package/dist/{api-Y4MQWOFW.js → api-7P7DI652.js} +1 -1
- package/dist/{chunk-L4XMVJKY.js → chunk-4DDCYDQ3.js} +8 -7
- package/dist/{chunk-ZKAWKYT4.js → chunk-5W2A3DRC.js} +2 -1
- package/dist/{chunk-VBCS3DUA.js → chunk-EF2UGZWY.js} +3 -3
- package/dist/{chunk-JGWDVX64.js → chunk-EURB7QFZ.js} +123 -53
- package/dist/{chunk-BM4CQ5P3.js → chunk-GS5672WG.js} +6 -6
- package/dist/{chunk-ZFYPMX46.js → chunk-LX6U42O3.js} +1 -1
- package/dist/{chunk-5X4QLXRG.js → chunk-MPBLMWVR.js} +5 -3
- package/dist/{chunk-Q7Q7V5NV.js → chunk-NKHKXPI4.js} +7 -7
- package/dist/{chunk-6F3IILHI.js → chunk-S6ZQKDY6.js} +1 -1
- package/dist/{chunk-FTCRZOG2.js → chunk-T5CVK4R3.js} +5 -5
- package/dist/{chunk-GHYHJTYV.js → chunk-Z2FNRKF3.js} +13 -13
- package/dist/components.d.ts +1 -1
- package/dist/components.js +12 -12
- package/dist/eslint-rules/rules/04-code-quality.cjs +66 -10
- package/dist/eslint-rules/rules/06-security-rbac.cjs +8 -3
- package/dist/eslint-rules/rules/07-api-tech-stack.cjs +190 -68
- package/dist/{functions-DHebl8-F.d.ts → functions-lBy5L2ry.d.ts} +1 -1
- package/dist/hooks.js +7 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -15
- package/dist/providers.js +2 -2
- package/dist/rbac/index.d.ts +1 -1
- package/dist/rbac/index.js +6 -6
- package/dist/theming/runtime.d.ts +48 -1
- package/dist/theming/runtime.js +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/utils.js +1 -1
- package/docs/api/modules.md +63 -14
- package/docs/getting-started/dependencies.md +23 -0
- package/docs/implementation-guides/app-layout.md +1 -1
- package/docs/implementation-guides/data-tables.md +1 -1
- package/docs/standards/1-pace-core-compliance-standards.md +38 -1
- package/eslint-config-pace-core.cjs +30 -11
- package/package.json +45 -15
- package/scripts/eslint-audit.cjs +123 -0
- package/scripts/install-eslint-config.cjs +67 -2
- package/scripts/validate-dependencies.cjs +248 -0
- package/src/__tests__/helpers/__tests__/test-utils.test.tsx +20 -8
- package/src/__tests__/templates/accessibility.test.template.tsx +1 -0
- package/src/components/AddressField/AddressField.tsx +26 -1
- package/src/components/Alert/Alert.test.tsx +86 -22
- package/src/components/Alert/Alert.tsx +19 -11
- package/src/components/Badge/Badge.tsx +1 -1
- package/src/components/Checkbox/Checkbox.test.tsx +2 -1
- package/src/components/ContextSelector/ContextSelector.tsx +39 -41
- package/src/components/DataTable/DataTable.tsx +1 -19
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +6 -10
- package/src/components/DataTable/__tests__/a11y.basic.test.tsx +18 -9
- package/src/components/DataTable/__tests__/pagination.modes.test.tsx +3 -2
- package/src/components/DataTable/components/EmptyState.tsx +1 -1
- package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.test.tsx +1 -1
- package/src/components/DataTable/components/__tests__/EmptyState.test.tsx +3 -3
- package/src/components/DataTable/components/__tests__/LoadingState.test.tsx +33 -29
- package/src/components/DatePickerWithTimezone/DatePickerWithTimezone.test.tsx +1 -2
- package/src/components/FileUpload/FileUpload.test.tsx +22 -31
- package/src/components/FileUpload/FileUpload.tsx +29 -0
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +48 -12
- package/src/components/PaceAppLayout/PaceAppLayout.performance.test.tsx +9 -9
- package/src/components/PaceAppLayout/PaceAppLayout.security.test.tsx +30 -30
- package/src/components/PaceAppLayout/PaceAppLayout.test.tsx +4 -4
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +7 -1
- package/src/hooks/__tests__/useDataTablePerformance.unit.test.ts +8 -5
- package/src/hooks/__tests__/useFileUrl.unit.test.ts +4 -0
- package/src/hooks/__tests__/useFocusTrap.unit.test.tsx +3 -3
- package/src/hooks/__tests__/useInactivityTracker.unit.test.ts +45 -8
- package/src/hooks/__tests__/usePerformanceMonitor.unit.test.ts +22 -2
- package/src/hooks/public/usePublicRouteParams.ts +8 -4
- package/src/hooks/useAddressAutocomplete.test.ts +18 -18
- package/src/hooks/useEventTheme.ts +5 -1
- package/src/hooks/useFileUrl.ts +52 -8
- package/src/hooks/useOrganisationSecurity.test.ts +2 -1
- package/src/providers/__tests__/ProviderLifecycle.test.tsx +1 -1
- package/src/rbac/__tests__/auth-rbac.e2e.test.tsx +15 -6
- package/src/rbac/__tests__/rbac-functions.test.ts +3 -3
- package/src/rbac/api.test.ts +104 -0
- package/src/rbac/engine.ts +1 -1
- package/src/rbac/hooks/useCan.test.ts +2 -2
- package/src/rbac/secureClient.ts +1 -1
- package/src/rbac/types/functions.ts +1 -1
- package/src/theming/__tests__/parseEventColours.test.ts +117 -8
- package/src/theming/parseEventColours.ts +56 -2
- package/src/types/supabase.ts +2 -3
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +9 -9
- package/src/utils/file-reference/__tests__/file-reference.test.ts +4 -0
- package/src/utils/formatting/formatDate.test.ts +3 -2
- package/src/utils/formatting/formatDateTime.test.ts +2 -2
- package/src/utils/google-places/googlePlacesUtils.test.ts +36 -24
- package/src/utils/storage/__tests__/helpers.unit.test.ts +19 -12
- package/src/utils/storage/helpers.test.ts +69 -3
|
@@ -47,13 +47,20 @@ module.exports = {
|
|
|
47
47
|
const functionName = node.id.name;
|
|
48
48
|
if (!functionName) return;
|
|
49
49
|
|
|
50
|
-
// Check for hooks (functions that use React hooks)
|
|
51
50
|
const sourceCode = context.getSourceCode();
|
|
52
51
|
const functionText = sourceCode.getText(node.body);
|
|
52
|
+
|
|
53
|
+
// Check if function returns JSX (is a component)
|
|
54
|
+
const returnsJSX = functionText.includes('return') && (functionText.includes('<') || functionText.includes('createElement'));
|
|
55
|
+
|
|
56
|
+
// Check for hooks (functions that use React hooks but are NOT components)
|
|
53
57
|
const usesReactHooks = /use(State|Effect|Callback|Memo|Ref|Context|Reducer|LayoutEffect|ImperativeHandle|DebugValue)/.test(functionText);
|
|
54
58
|
|
|
55
|
-
//
|
|
56
|
-
|
|
59
|
+
// Only flag as hook if:
|
|
60
|
+
// 1. It uses React hooks AND doesn't return JSX (not a component)
|
|
61
|
+
// 2. OR it starts with 'use' but doesn't return JSX (likely a hook)
|
|
62
|
+
// Components that use hooks are NOT hooks themselves
|
|
63
|
+
if (usesReactHooks && !returnsJSX) {
|
|
57
64
|
if (!functionName.startsWith('use')) {
|
|
58
65
|
context.report({
|
|
59
66
|
node: node.id,
|
|
@@ -69,13 +76,18 @@ module.exports = {
|
|
|
69
76
|
}
|
|
70
77
|
}
|
|
71
78
|
|
|
72
|
-
// Check for providers (components that
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
// Check for providers (components that CREATE a Context.Provider, not just use/wrap one)
|
|
80
|
+
// A provider component must:
|
|
81
|
+
// 1. Use createContext (creates a context)
|
|
82
|
+
// 2. Return <ContextName.Provider> (provides the context)
|
|
83
|
+
// We don't flag components that just wrap other providers (like AppProviders wrapping QueryClientProvider)
|
|
84
|
+
const createsContext = /createContext\s*\(/.test(functionText);
|
|
85
|
+
const returnsContextProvider = /<[A-Z][a-zA-Z0-9]*\.Provider/.test(functionText) ||
|
|
86
|
+
/\.Provider\s*>/.test(functionText);
|
|
77
87
|
|
|
78
|
-
if
|
|
88
|
+
// Only flag if it actually creates a context AND returns a Context.Provider
|
|
89
|
+
// AND doesn't already end with 'Provider'
|
|
90
|
+
if (returnsJSX && createsContext && returnsContextProvider && !functionName.endsWith('Provider')) {
|
|
79
91
|
context.report({
|
|
80
92
|
node: node.id,
|
|
81
93
|
messageId: 'providerNaming',
|
|
@@ -101,9 +113,14 @@ module.exports = {
|
|
|
101
113
|
if (node.init.type === 'ArrowFunctionExpression' || node.init.type === 'FunctionExpression') {
|
|
102
114
|
const sourceCode = context.getSourceCode();
|
|
103
115
|
const functionText = sourceCode.getText(node.init);
|
|
116
|
+
|
|
117
|
+
// Check if it returns JSX (is a component)
|
|
118
|
+
const returnsJSX = functionText.includes('return') && (functionText.includes('<') || functionText.includes('createElement'));
|
|
104
119
|
const usesReactHooks = /use(State|Effect|Callback|Memo|Ref|Context|Reducer|LayoutEffect|ImperativeHandle|DebugValue)/.test(functionText);
|
|
105
120
|
|
|
106
|
-
if (
|
|
121
|
+
// Only flag as hook if it uses React hooks but doesn't return JSX (not a component)
|
|
122
|
+
// Components that use hooks are NOT hooks themselves
|
|
123
|
+
if (usesReactHooks && !returnsJSX && !varName.startsWith('use')) {
|
|
107
124
|
context.report({
|
|
108
125
|
node: node.id,
|
|
109
126
|
messageId: 'hookNaming',
|
|
@@ -159,6 +176,26 @@ module.exports = {
|
|
|
159
176
|
const functionName = node.id.name;
|
|
160
177
|
if (!functionName) return;
|
|
161
178
|
|
|
179
|
+
// Skip event handlers and utility functions (these are not components)
|
|
180
|
+
const isEventHandler = functionName.startsWith('handle') ||
|
|
181
|
+
functionName.startsWith('on') ||
|
|
182
|
+
functionName.startsWith('get') ||
|
|
183
|
+
functionName.startsWith('set') ||
|
|
184
|
+
functionName.startsWith('load') ||
|
|
185
|
+
functionName.startsWith('read') ||
|
|
186
|
+
functionName.startsWith('create') ||
|
|
187
|
+
functionName.startsWith('update') ||
|
|
188
|
+
functionName.startsWith('delete');
|
|
189
|
+
|
|
190
|
+
if (isEventHandler) return;
|
|
191
|
+
|
|
192
|
+
// Only check exported components (not internal functions)
|
|
193
|
+
const isExported = node.parent?.type === 'ExportNamedDeclaration' ||
|
|
194
|
+
node.parent?.type === 'ExportDefaultDeclaration' ||
|
|
195
|
+
(node.parent?.parent?.type === 'ExportNamedDeclaration');
|
|
196
|
+
|
|
197
|
+
if (!isExported) return;
|
|
198
|
+
|
|
162
199
|
// Check if it's a component (returns JSX)
|
|
163
200
|
const sourceCode = context.getSourceCode();
|
|
164
201
|
const functionText = sourceCode.getText(node.body);
|
|
@@ -190,6 +227,25 @@ module.exports = {
|
|
|
190
227
|
const varName = node.id.name;
|
|
191
228
|
if (!varName) return;
|
|
192
229
|
|
|
230
|
+
// Skip event handlers and utility functions (these are not components)
|
|
231
|
+
const isEventHandler = varName.startsWith('handle') ||
|
|
232
|
+
varName.startsWith('on') ||
|
|
233
|
+
varName.startsWith('get') ||
|
|
234
|
+
varName.startsWith('set') ||
|
|
235
|
+
varName.startsWith('load') ||
|
|
236
|
+
varName.startsWith('read') ||
|
|
237
|
+
varName.startsWith('create') ||
|
|
238
|
+
varName.startsWith('update') ||
|
|
239
|
+
varName.startsWith('delete');
|
|
240
|
+
|
|
241
|
+
if (isEventHandler) return;
|
|
242
|
+
|
|
243
|
+
// Only check exported components (not internal functions)
|
|
244
|
+
const isExported = node.parent?.parent?.type === 'ExportNamedDeclaration' ||
|
|
245
|
+
node.parent?.parent?.type === 'ExportDefaultDeclaration';
|
|
246
|
+
|
|
247
|
+
if (!isExported) return;
|
|
248
|
+
|
|
193
249
|
// Check for component variables (arrow functions that return JSX)
|
|
194
250
|
if (node.init.type === 'ArrowFunctionExpression' || node.init.type === 'FunctionExpression') {
|
|
195
251
|
const sourceCode = context.getSourceCode();
|
|
@@ -42,6 +42,11 @@ module.exports = {
|
|
|
42
42
|
return {};
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
// Exclude Edge Functions - they run in Deno and cannot use React hooks
|
|
46
|
+
// Edge Functions must use createClient() directly with service role keys
|
|
47
|
+
const isEdgeFunction = filename.includes('supabase/functions/') ||
|
|
48
|
+
filename.includes('supabase\\functions\\');
|
|
49
|
+
|
|
45
50
|
// Allow createClient in specific config files (supabaseClient.ts/js, etc.)
|
|
46
51
|
const isConfigFile = /(supabase|client)\.(ts|js|tsx|jsx)$/i.test(filename) &&
|
|
47
52
|
(filename.includes('supabase') || filename.includes('client'));
|
|
@@ -63,7 +68,7 @@ module.exports = {
|
|
|
63
68
|
return false;
|
|
64
69
|
});
|
|
65
70
|
|
|
66
|
-
if (hasCreateClient && !isConfigFile) {
|
|
71
|
+
if (hasCreateClient && !isConfigFile && !isEdgeFunction) {
|
|
67
72
|
context.report({
|
|
68
73
|
node: node.source,
|
|
69
74
|
messageId: 'directClientImport',
|
|
@@ -81,7 +86,7 @@ module.exports = {
|
|
|
81
86
|
CallExpression(node) {
|
|
82
87
|
// Check for createClient() calls
|
|
83
88
|
if (node.callee.type === 'Identifier' && node.callee.name === 'createClient') {
|
|
84
|
-
if (!isConfigFile) {
|
|
89
|
+
if (!isConfigFile && !isEdgeFunction) {
|
|
85
90
|
context.report({
|
|
86
91
|
node,
|
|
87
92
|
messageId: 'directClientCreation',
|
|
@@ -98,7 +103,7 @@ module.exports = {
|
|
|
98
103
|
// Check for supabase.createClient() or similar patterns
|
|
99
104
|
if (node.callee.type === 'MemberExpression' &&
|
|
100
105
|
node.callee.property?.name === 'createClient') {
|
|
101
|
-
if (!isConfigFile) {
|
|
106
|
+
if (!isConfigFile && !isEdgeFunction) {
|
|
102
107
|
context.report({
|
|
103
108
|
node,
|
|
104
109
|
messageId: 'directClientCreation',
|
|
@@ -29,7 +29,8 @@ module.exports = {
|
|
|
29
29
|
},
|
|
30
30
|
messages: {
|
|
31
31
|
invalidRpcNaming: "RPC '{{rpcName}}' does not follow naming pattern. Read operations must start with 'data_', write operations must start with 'app_' (e.g., data_events_list, app_event_create)",
|
|
32
|
-
invalidRpcVerb: "RPC '{{rpcName}}' uses invalid verb '{{verb}}'. Use only: list, get, create, update, delete, read"
|
|
32
|
+
invalidRpcVerb: "RPC '{{rpcName}}' uses invalid verb '{{verb}}'. Use only: list, get, create, update, delete, read, check, upsert, ensure, grant, insert, remove, revoke, resolve, bulk_create, bulk_update, bulk_import",
|
|
33
|
+
missingPrefix: "RPC '{{rpcName}}' must start with 'data_' (for read operations) or 'app_' (for write operations). Current name: '{{rpcName}}'. Suggested: '{{suggestedName}}'"
|
|
33
34
|
},
|
|
34
35
|
hasSuggestions: true
|
|
35
36
|
},
|
|
@@ -41,10 +42,66 @@ module.exports = {
|
|
|
41
42
|
return {};
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
const validVerbs = ['list', 'get', 'create', 'update', 'delete', 'read'];
|
|
45
|
-
const readVerbs = ['list', 'get', 'read'];
|
|
46
|
-
const writeVerbs = ['create', 'update', 'delete', 'bulk_create', 'bulk_update'];
|
|
47
|
-
|
|
45
|
+
const validVerbs = ['list', 'get', 'create', 'update', 'delete', 'read', 'check', 'upsert', 'ensure', 'grant', 'insert', 'remove', 'revoke', 'resolve'];
|
|
46
|
+
const readVerbs = ['list', 'get', 'read', 'check', 'resolve'];
|
|
47
|
+
const writeVerbs = ['create', 'update', 'delete', 'upsert', 'bulk_create', 'bulk_update', 'bulk_import', 'ensure', 'grant', 'insert', 'remove', 'revoke'];
|
|
48
|
+
// Common qualifier patterns that can appear after the verb (e.g., _by_code, _by_id, _by_slug)
|
|
49
|
+
const qualifierPatterns = ['by_code', 'by_id', 'by_slug', 'by_name', 'by_email', 'by_uuid'];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Extract the verb from an RPC name, handling qualifiers like _by_code
|
|
53
|
+
* @param {string} rpcName - The RPC name (e.g., 'data_event_get_by_code')
|
|
54
|
+
* @returns {string|null} - The verb (e.g., 'get') or null if not found
|
|
55
|
+
*/
|
|
56
|
+
function extractVerb(rpcName) {
|
|
57
|
+
const parts = rpcName.split('_');
|
|
58
|
+
|
|
59
|
+
// Remove prefix (data_ or app_)
|
|
60
|
+
if (parts[0] === 'data' || parts[0] === 'app') {
|
|
61
|
+
parts.shift();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Look for valid verbs from the end, skipping qualifiers
|
|
65
|
+
for (let i = parts.length - 1; i >= 0; i--) {
|
|
66
|
+
// Check for bulk operations first (bulk_create, bulk_update, bulk_import)
|
|
67
|
+
// These span 2 parts, so check if parts[i-1]_parts[i] forms a bulk verb
|
|
68
|
+
if (i > 0) {
|
|
69
|
+
const bulkCandidate = `${parts[i - 1]}_${parts[i]}`;
|
|
70
|
+
if (writeVerbs.includes(bulkCandidate)) {
|
|
71
|
+
return bulkCandidate;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Check for regular single-part verbs
|
|
76
|
+
const candidate = parts[i];
|
|
77
|
+
if (validVerbs.includes(candidate)) {
|
|
78
|
+
return candidate;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Check if we're in a qualifier pattern
|
|
82
|
+
// Qualifiers like 'by_code' span multiple parts (e.g., 'by' + 'code')
|
|
83
|
+
// Check if the suffix from this position (or including previous part) matches any qualifier
|
|
84
|
+
const suffix = parts.slice(i).join('_');
|
|
85
|
+
const suffixWithPrev = i > 0 ? parts.slice(i - 1).join('_') : suffix;
|
|
86
|
+
|
|
87
|
+
if (qualifierPatterns.some(qp =>
|
|
88
|
+
suffix === qp ||
|
|
89
|
+
suffix.startsWith(qp + '_') ||
|
|
90
|
+
suffixWithPrev === qp ||
|
|
91
|
+
suffixWithPrev.startsWith(qp + '_')
|
|
92
|
+
)) {
|
|
93
|
+
// We're in a qualifier, continue searching backwards
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Updated pattern to allow verbs anywhere in the name (not just at the end)
|
|
102
|
+
// Pattern: (data_|app_) + domain/verb parts + optional qualifiers
|
|
103
|
+
// This allows patterns like: app_insert_event_app_access, app_ensure_page_permissions
|
|
104
|
+
const rpcPattern = /^(data_|app_)[a-z0-9_]+$/;
|
|
48
105
|
|
|
49
106
|
return {
|
|
50
107
|
CallExpression(node) {
|
|
@@ -63,35 +120,131 @@ module.exports = {
|
|
|
63
120
|
return;
|
|
64
121
|
}
|
|
65
122
|
|
|
66
|
-
// Check if
|
|
67
|
-
|
|
68
|
-
|
|
123
|
+
// Check if RPC starts with required prefix
|
|
124
|
+
const hasDataPrefix = rpcName.startsWith('data_');
|
|
125
|
+
const hasAppPrefix = rpcName.startsWith('app_');
|
|
126
|
+
|
|
127
|
+
if (!hasDataPrefix && !hasAppPrefix) {
|
|
128
|
+
// RPC doesn't start with data_ or app_ prefix
|
|
129
|
+
// Try to determine the verb from the RPC name to suggest correct prefix
|
|
69
130
|
const parts = rpcName.split('_');
|
|
70
|
-
|
|
131
|
+
let verb = null;
|
|
132
|
+
let suggestedPrefix = 'data_'; // Default to data_ for read operations
|
|
71
133
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
const
|
|
134
|
+
// Look for verbs in the RPC name (check from the end)
|
|
135
|
+
for (let i = parts.length - 1; i >= 0; i--) {
|
|
136
|
+
const candidate = parts[i];
|
|
137
|
+
const candidateWithBulk = i > 0 ? `${parts[i - 1]}_${candidate}` : null;
|
|
76
138
|
|
|
77
|
-
|
|
78
|
-
if (
|
|
139
|
+
// Check for bulk operations first
|
|
140
|
+
if (candidateWithBulk && writeVerbs.includes(candidateWithBulk)) {
|
|
141
|
+
verb = candidateWithBulk;
|
|
79
142
|
suggestedPrefix = 'app_';
|
|
143
|
+
break;
|
|
80
144
|
}
|
|
81
145
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
146
|
+
// Check for regular verbs
|
|
147
|
+
if (validVerbs.includes(candidate)) {
|
|
148
|
+
verb = candidate;
|
|
149
|
+
if (readVerbs.includes(candidate)) {
|
|
150
|
+
suggestedPrefix = 'data_';
|
|
151
|
+
} else if (writeVerbs.includes(candidate)) {
|
|
152
|
+
suggestedPrefix = 'app_';
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Construct suggested name
|
|
159
|
+
// If we found a verb, suggest adding the prefix
|
|
160
|
+
// Otherwise, suggest data_ prefix (most common for read operations)
|
|
161
|
+
let suggestedName;
|
|
162
|
+
if (verb) {
|
|
163
|
+
// RPC already has a verb, just add the prefix
|
|
164
|
+
suggestedName = `${suggestedPrefix}${rpcName}`;
|
|
93
165
|
} else {
|
|
94
|
-
//
|
|
166
|
+
// Can't determine verb, suggest data_ as default
|
|
167
|
+
// User should review and adjust if it's a write operation
|
|
168
|
+
suggestedName = `data_${rpcName}`;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
context.report({
|
|
172
|
+
node: firstArg,
|
|
173
|
+
messageId: 'missingPrefix',
|
|
174
|
+
data: {
|
|
175
|
+
rpcName,
|
|
176
|
+
suggestedName
|
|
177
|
+
},
|
|
178
|
+
suggest: [{
|
|
179
|
+
desc: `Rename to '${suggestedName}' (or 'app_${rpcName}' if it's a write operation)`,
|
|
180
|
+
fix(fixer) {
|
|
181
|
+
return null; // Complex fix - requires database migration
|
|
182
|
+
}
|
|
183
|
+
}]
|
|
184
|
+
});
|
|
185
|
+
return; // Don't check further if missing prefix
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Basic pattern check - just verify it starts with data_ or app_ and has valid characters
|
|
189
|
+
if (!rpcPattern.test(rpcName)) {
|
|
190
|
+
context.report({
|
|
191
|
+
node: firstArg,
|
|
192
|
+
messageId: 'invalidRpcNaming',
|
|
193
|
+
data: { rpcName },
|
|
194
|
+
suggest: [{
|
|
195
|
+
desc: `RPC name must follow pattern: data_<domain>_<verb> or app_<domain>_<verb>`,
|
|
196
|
+
fix(fixer) {
|
|
197
|
+
return null; // Complex fix
|
|
198
|
+
}
|
|
199
|
+
}]
|
|
200
|
+
});
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Extract verb and validate prefix matches operation type
|
|
205
|
+
const verb = extractVerb(rpcName);
|
|
206
|
+
|
|
207
|
+
if (!verb) {
|
|
208
|
+
// Couldn't extract verb - this is okay for some RPCs that don't follow standard verb patterns
|
|
209
|
+
// But we still require the prefix, which we've already validated
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const isReadOperation = readVerbs.includes(verb);
|
|
214
|
+
const isWriteOperation = writeVerbs.includes(verb) || verb.startsWith('bulk_');
|
|
215
|
+
|
|
216
|
+
// Check if prefix matches verb type
|
|
217
|
+
const hasDataPrefixForVerb = rpcName.startsWith('data_');
|
|
218
|
+
const hasAppPrefixForVerb = rpcName.startsWith('app_');
|
|
219
|
+
|
|
220
|
+
if (hasDataPrefixForVerb && isWriteOperation) {
|
|
221
|
+
context.report({
|
|
222
|
+
node: firstArg,
|
|
223
|
+
messageId: 'invalidRpcNaming',
|
|
224
|
+
data: { rpcName },
|
|
225
|
+
suggest: [{
|
|
226
|
+
desc: `Use 'app_' prefix for write operations (${verb})`,
|
|
227
|
+
fix(fixer) {
|
|
228
|
+
return null; // Complex fix
|
|
229
|
+
}
|
|
230
|
+
}]
|
|
231
|
+
});
|
|
232
|
+
} else if (hasAppPrefixForVerb && isReadOperation) {
|
|
233
|
+
context.report({
|
|
234
|
+
node: firstArg,
|
|
235
|
+
messageId: 'invalidRpcNaming',
|
|
236
|
+
data: { rpcName },
|
|
237
|
+
suggest: [{
|
|
238
|
+
desc: `Use 'data_' prefix for read operations (${verb})`,
|
|
239
|
+
fix(fixer) {
|
|
240
|
+
return null; // Complex fix
|
|
241
|
+
}
|
|
242
|
+
}]
|
|
243
|
+
});
|
|
244
|
+
} else if (!isReadOperation && !isWriteOperation) {
|
|
245
|
+
// Verb not recognized - this might be a valid verb we haven't added yet
|
|
246
|
+
// Only report if it's clearly invalid
|
|
247
|
+
if (!validVerbs.includes(verb)) {
|
|
95
248
|
context.report({
|
|
96
249
|
node: firstArg,
|
|
97
250
|
messageId: 'invalidRpcVerb',
|
|
@@ -104,41 +257,6 @@ module.exports = {
|
|
|
104
257
|
}]
|
|
105
258
|
});
|
|
106
259
|
}
|
|
107
|
-
} else {
|
|
108
|
-
// Check if prefix matches verb type
|
|
109
|
-
const hasDataPrefix = rpcName.startsWith('data_');
|
|
110
|
-
const hasAppPrefix = rpcName.startsWith('app_');
|
|
111
|
-
const parts = rpcName.split('_');
|
|
112
|
-
const verb = parts[parts.length - 1];
|
|
113
|
-
|
|
114
|
-
const isReadOperation = readVerbs.includes(verb);
|
|
115
|
-
const isWriteOperation = writeVerbs.includes(verb) || verb.startsWith('bulk_');
|
|
116
|
-
|
|
117
|
-
if (hasDataPrefix && isWriteOperation) {
|
|
118
|
-
context.report({
|
|
119
|
-
node: firstArg,
|
|
120
|
-
messageId: 'invalidRpcNaming',
|
|
121
|
-
data: { rpcName },
|
|
122
|
-
suggest: [{
|
|
123
|
-
desc: `Use 'app_' prefix for write operations (${verb})`,
|
|
124
|
-
fix(fixer) {
|
|
125
|
-
return null; // Complex fix
|
|
126
|
-
}
|
|
127
|
-
}]
|
|
128
|
-
});
|
|
129
|
-
} else if (hasAppPrefix && isReadOperation) {
|
|
130
|
-
context.report({
|
|
131
|
-
node: firstArg,
|
|
132
|
-
messageId: 'invalidRpcNaming',
|
|
133
|
-
data: { rpcName },
|
|
134
|
-
suggest: [{
|
|
135
|
-
desc: `Use 'data_' prefix for read operations (${verb})`,
|
|
136
|
-
fix(fixer) {
|
|
137
|
-
return null; // Complex fix
|
|
138
|
-
}
|
|
139
|
-
}]
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
260
|
}
|
|
143
261
|
}
|
|
144
262
|
}
|
|
@@ -226,13 +344,17 @@ module.exports = {
|
|
|
226
344
|
}
|
|
227
345
|
|
|
228
346
|
// Only check client code (not server/Node.js files)
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
347
|
+
// Exclude: scripts/, server/, node/, config files, and .config. files
|
|
348
|
+
const isNodeScript = filename.includes('/scripts/') ||
|
|
349
|
+
filename.includes('\\scripts\\') ||
|
|
350
|
+
filename.includes('/server/') ||
|
|
351
|
+
filename.includes('\\server\\') ||
|
|
352
|
+
filename.includes('/node/') ||
|
|
353
|
+
filename.includes('\\node\\') ||
|
|
354
|
+
filename.includes('config') ||
|
|
355
|
+
filename.match(/\.(config|server)\./);
|
|
234
356
|
|
|
235
|
-
if (
|
|
357
|
+
if (isNodeScript) {
|
|
236
358
|
return {};
|
|
237
359
|
}
|
|
238
360
|
|
|
@@ -147,7 +147,7 @@ declare enum RPCFunction {
|
|
|
147
147
|
RBAC_PAGE_ACCESS_CHECK = "rbac_page_access_check",
|
|
148
148
|
RBAC_ROLE_GRANT = "rbac_role_grant",
|
|
149
149
|
RBAC_ROLE_REVOKE = "rbac_role_revoke",
|
|
150
|
-
RBAC_ROLES_LIST = "
|
|
150
|
+
RBAC_ROLES_LIST = "data_rbac_roles_list",
|
|
151
151
|
RBAC_ROLE_VALIDATE = "rbac_role_validate",
|
|
152
152
|
RBAC_SESSION_TRACK = "rbac_session_track",
|
|
153
153
|
RBAC_AUDIT_LOG = "rbac_audit_log"
|
package/dist/hooks.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { clearPublicEventCache, clearPublicLogoCache, extractEventCodeFromPath, generatePublicRoutePath, getPublicEventCacheStats, getPublicLogoCacheStats, useFormDialog, useOrganisationPermissions, usePublicEvent, usePublicEventCode, usePublicEventLogo, usePublicRouteParams, useZodForm } from './chunk-
|
|
2
|
-
import { getPublicUrl, getSignedUrl, uploadFile, deleteFile, archiveFile, listFiles } from './chunk-
|
|
3
|
-
export { cleanupQueryCache, clearFileDisplayCache, clearPublicFileDisplayCache, getFileDisplayCacheStats, getPublicFileDisplayCacheStats, invalidateFileDisplayCache, queryCacheHelpers, useAddressAutocomplete, useDebounce, useEventTheme, useFileDisplay, usePreventTabReload, usePublicFileDisplay, useQueryCache } from './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
export { clearPublicEventCache, clearPublicLogoCache, extractEventCodeFromPath, generatePublicRoutePath, getPublicEventCacheStats, getPublicLogoCacheStats, useFormDialog, useOrganisationPermissions, usePublicEvent, usePublicEventCode, usePublicEventLogo, usePublicRouteParams, useZodForm } from './chunk-4DDCYDQ3.js';
|
|
2
|
+
import { getPublicUrl, getSignedUrl, uploadFile, deleteFile, archiveFile, listFiles } from './chunk-MPBLMWVR.js';
|
|
3
|
+
export { cleanupQueryCache, clearFileDisplayCache, clearPublicFileDisplayCache, getFileDisplayCacheStats, getPublicFileDisplayCacheStats, invalidateFileDisplayCache, queryCacheHelpers, useAddressAutocomplete, useDebounce, useEventTheme, useFileDisplay, usePreventTabReload, usePublicFileDisplay, useQueryCache } from './chunk-MPBLMWVR.js';
|
|
4
|
+
import './chunk-5W2A3DRC.js';
|
|
5
5
|
export { useDataTablePerformance, useFocusTrap, useToast } from './chunk-S7DKJPLT.js';
|
|
6
|
-
export { useAppConfig, useOrganisationSecurity } from './chunk-
|
|
6
|
+
export { useAppConfig, useOrganisationSecurity } from './chunk-EF2UGZWY.js';
|
|
7
7
|
import './chunk-C7NSAPTL.js';
|
|
8
|
-
import './chunk-
|
|
9
|
-
import './chunk-
|
|
8
|
+
import './chunk-T5CVK4R3.js';
|
|
9
|
+
import './chunk-LX6U42O3.js';
|
|
10
10
|
import './chunk-AHU7G2R5.js';
|
|
11
11
|
import './chunk-6QYDGKQY.js';
|
|
12
12
|
import './chunk-4SXLQIZO.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -8,9 +8,9 @@ import { i as OrganisationProviderProps$1, E as Event, h as OrganisationContextT
|
|
|
8
8
|
export { O as Organisation, a as OrganisationMembership, g as OrganisationSecurityError, U as UserProfile } from './event-CW5YB_2p.js';
|
|
9
9
|
import { S as SessionRestorationState } from './auth-BZOJqrdd.js';
|
|
10
10
|
export { A as AccessLevel, E as EventAppRole, G as GlobalRole, I as InvalidScopeError, M as MissingUserContextError, O as Operation, e as OrganisationContextRequiredError, c as OrganisationRole, P as Permission, a as PermissionCheck, d as PermissionDeniedError, b as PermissionMap, R as RBACError, f as RBACNotInitializedError, S as Scope, U as UUID } from './types-BeoeWV5I.js';
|
|
11
|
-
export { A as AccessLevelContext, s as AuditEventType, P as PermissionSource, d as RBACAccessValidateParams, e as RBACAccessValidateResult, q as RBACAuditLogParams, r as RBACAuditLogResult, t as RBACContext, w as RBACErrorCode, v as RBACFunctionResponse, f as RBACPageAccessCheckParams, R as RBACPermissionCheckParams, a as RBACPermissionCheckResult, b as RBACPermissionsGetParams, c as RBACPermissionsGetResult, u as RBACResult, g as RBACRoleGrantParams, h as RBACRoleGrantResult, i as RBACRoleRevokeParams, j as RBACRoleRevokeResult, m as RBACRoleValidateParams, n as RBACRoleValidateResult, k as RBACRolesListParams, l as RBACRolesListResult, o as RBACSessionTrackParams, p as RBACSessionTrackResult, x as RPCFunction, S as SessionType } from './functions-
|
|
11
|
+
export { A as AccessLevelContext, s as AuditEventType, P as PermissionSource, d as RBACAccessValidateParams, e as RBACAccessValidateResult, q as RBACAuditLogParams, r as RBACAuditLogResult, t as RBACContext, w as RBACErrorCode, v as RBACFunctionResponse, f as RBACPageAccessCheckParams, R as RBACPermissionCheckParams, a as RBACPermissionCheckResult, b as RBACPermissionsGetParams, c as RBACPermissionsGetResult, u as RBACResult, g as RBACRoleGrantParams, h as RBACRoleGrantResult, i as RBACRoleRevokeParams, j as RBACRoleRevokeResult, m as RBACRoleValidateParams, n as RBACRoleValidateResult, k as RBACRolesListParams, l as RBACRolesListResult, o as RBACSessionTrackParams, p as RBACSessionTrackResult, x as RPCFunction, S as SessionType } from './functions-lBy5L2ry.js';
|
|
12
12
|
export { ALL_PERMISSIONS, AccessDenied, AccessDeniedProps, AllPermissions, CACHE_PATTERNS, ComplianceResult, DatabaseComplianceResult, DatabaseIssue, EVENT_APP_PERMISSIONS, EventAppRoleData, GLOBAL_PERMISSIONS, GrantEventAppRoleParams, NavigationGuard, NavigationGuardProps, ORGANISATION_PERMISSIONS, PAGE_PERMISSIONS, PagePermissionGuard, PagePermissionGuardProps, QuickFix, RBACAuditManager, RBACCache, RBACConfig, RBACEngine, RBACLogger, RBACPerformanceMetrics, ResourcePermissions, RevokeEventAppRoleParams, RoleManagementResult, RuntimeComplianceResult, SECURE_CLIENT_SYMBOL, SecureSupabaseClient, SetupIssue, UseResolvedScopeOptions, UseResolvedScopeReturn, UseResourcePermissionsOptions, checkRuntimeCompliance, clearInFlightRequests, createAuditManager, createRBACConfig, createRBACEngine, createRBACExpressMiddleware, createRBACMiddleware, createSecureClient, disablePerformanceMonitoring, emitAuditEvent, enablePerformanceMonitoring, fromSupabaseClient, getAccessLevel, getCustomAuthCodeFixes, getDirectSupabaseAuthFixes, getDuplicateConfigFixes, getGlobalAuditManager, getInFlightRequestCount, getPerformanceMetrics, getPerformanceSummary, getPermissionMap, getQuickFixes, getRBACConfig, getRBACLogger, getRoleContext, getSetupIssues, getUnprotectedPageFixes, hasAllPermissions, hasAnyPermission, isDebugMode, isDevelopmentMode, isPerformanceMonitoringEnabled, isPermitted, isPermittedCached, isRBACInitialized, isSecureClient, isValidPermission, rbacCache, recordAuditEvent, recordPermissionCheck, resetPerformanceMetrics, resolveAppContext, setGlobalAuditManager, setupRBAC, useAccessLevel, useCan, useMultiplePermissions, usePermissions, useRBAC, useResolvedScope, useResourcePermissions, useRoleManagement, useSecureSupabase, validateAndWarn, validateDatabaseConfiguration, validateRBACSetup, warnIfInsecureClient, withAccessLevelGuard, withPermissionGuard, withRoleGuard } from './rbac/index.js';
|
|
13
|
-
export { A as AddressField, k as AddressFieldProps, l as AddressFieldRef, o as Alert, q as AlertDescription, p as AlertTitle, r as Avatar, s as AvatarProps, t as Badge, u as BadgeProps, v as BadgeVariant, B as Button, a as ButtonProps, am as Calendar, an as CalendarProps, C as Card, g as CardActions, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, w as Checkbox, aP as ContextSelector, aQ as ContextSelectorProps, M as Dialog, V as DialogBody, a4 as DialogBodyProps, Q as DialogClose, a1 as DialogCloseProps, R as DialogContent, $ as DialogContentProps, Y as DialogDescription, W as DialogFooter, a3 as DialogFooterProps, U as DialogHeader, a2 as DialogHeaderProps, N as DialogPortal, a0 as DialogPortalProps, Z as DialogProps, a5 as DialogSize, X as DialogTitle, O as DialogTrigger, _ as DialogTriggerProps, aS as ErrorBoundary, aU as ErrorBoundaryProps, aT as ErrorBoundaryProvider, aW as ErrorBoundaryProviderProps, aV as ErrorBoundaryState, b1 as FileDisplay, b2 as FileDisplayProps, a$ as FileUpload, b0 as FileUploadProps, aK as Footer, aL as FooterProps, aD as Form, aE as FormField, aG as FormFieldProps, aF as FormProps, aX as GlobalErrorHandler, aJ as Header, I as Input, j as InputProps, L as Label, m as LabelProps, aY as LoadingSpinner, aH as LoginForm, aI as LoginFormProps, aO as NavigationMenu, bk as PaceAppLayout, bj as PaceAppLayoutProps, bm as PaceLoginPage, bl as PaceLoginPageProps, bo as PasswordChangeForm, P as Progress, y as ProgressProps, aM as ProtectedRoute, aN as ProtectedRouteProps, bc as PublicPageFooter, bi as PublicPageFooterProps, bb as PublicPageHeader, bh as PublicPageHeaderProps, ba as PublicPageLayout, bg as PublicPageLayoutProps, bd as PublicPageProvider, a6 as Select, aa as SelectContent, a7 as SelectGroup, ac as SelectItem, ab as SelectLabel, ad as SelectSeparator, a9 as SelectTrigger, a8 as SelectValue, aZ as SessionRestorationLoader, a_ as SessionRestorationLoaderProps, S as Switch, x as SwitchProps, z as Table, E as TableBody, F as TableCaption, G as TableCell, H as TableFooter, J as TableHead, D as TableHeader, K as TableRow, ae as Tabs, ah as TabsContent, al as TabsContentProps, af as TabsList, aj as TabsListProps, ai as TabsProps, ag as TabsTrigger, ak as TabsTriggerProps, T as Textarea, n as TextareaProps, ao as Toast, aq as ToastAction, aw as ToastActionElement, av as ToastClose, au as ToastDescription, ax as ToastProps, ar as ToastProvider, at as ToastTitle, as as ToastViewport, ap as Toaster, ay as Tooltip, aA as TooltipContent, aB as TooltipProvider, aC as TooltipRoot, az as TooltipTrigger, b9 as UseFileReferenceForRecordReturn, b7 as UseFileReferenceOptions, b8 as UseFileReferenceReturn, aR as UserMenu, bn as UserMenuProps, b3 as useFileReference, b5 as useFileReferenceById, b4 as useFileReferenceForRecord, b6 as useFilesByCategory, bf as useIsPublicPage, be as usePublicPageContext } from './PublicPageProvider-
|
|
13
|
+
export { A as AddressField, k as AddressFieldProps, l as AddressFieldRef, o as Alert, q as AlertDescription, p as AlertTitle, r as Avatar, s as AvatarProps, t as Badge, u as BadgeProps, v as BadgeVariant, B as Button, a as ButtonProps, am as Calendar, an as CalendarProps, C as Card, g as CardActions, f as CardContent, e as CardDescription, c as CardFooter, b as CardHeader, h as CardProps, d as CardTitle, w as Checkbox, aP as ContextSelector, aQ as ContextSelectorProps, M as Dialog, V as DialogBody, a4 as DialogBodyProps, Q as DialogClose, a1 as DialogCloseProps, R as DialogContent, $ as DialogContentProps, Y as DialogDescription, W as DialogFooter, a3 as DialogFooterProps, U as DialogHeader, a2 as DialogHeaderProps, N as DialogPortal, a0 as DialogPortalProps, Z as DialogProps, a5 as DialogSize, X as DialogTitle, O as DialogTrigger, _ as DialogTriggerProps, aS as ErrorBoundary, aU as ErrorBoundaryProps, aT as ErrorBoundaryProvider, aW as ErrorBoundaryProviderProps, aV as ErrorBoundaryState, b1 as FileDisplay, b2 as FileDisplayProps, a$ as FileUpload, b0 as FileUploadProps, aK as Footer, aL as FooterProps, aD as Form, aE as FormField, aG as FormFieldProps, aF as FormProps, aX as GlobalErrorHandler, aJ as Header, I as Input, j as InputProps, L as Label, m as LabelProps, aY as LoadingSpinner, aH as LoginForm, aI as LoginFormProps, aO as NavigationMenu, bk as PaceAppLayout, bj as PaceAppLayoutProps, bm as PaceLoginPage, bl as PaceLoginPageProps, bo as PasswordChangeForm, P as Progress, y as ProgressProps, aM as ProtectedRoute, aN as ProtectedRouteProps, bc as PublicPageFooter, bi as PublicPageFooterProps, bb as PublicPageHeader, bh as PublicPageHeaderProps, ba as PublicPageLayout, bg as PublicPageLayoutProps, bd as PublicPageProvider, a6 as Select, aa as SelectContent, a7 as SelectGroup, ac as SelectItem, ab as SelectLabel, ad as SelectSeparator, a9 as SelectTrigger, a8 as SelectValue, aZ as SessionRestorationLoader, a_ as SessionRestorationLoaderProps, S as Switch, x as SwitchProps, z as Table, E as TableBody, F as TableCaption, G as TableCell, H as TableFooter, J as TableHead, D as TableHeader, K as TableRow, ae as Tabs, ah as TabsContent, al as TabsContentProps, af as TabsList, aj as TabsListProps, ai as TabsProps, ag as TabsTrigger, ak as TabsTriggerProps, T as Textarea, n as TextareaProps, ao as Toast, aq as ToastAction, aw as ToastActionElement, av as ToastClose, au as ToastDescription, ax as ToastProps, ar as ToastProvider, at as ToastTitle, as as ToastViewport, ap as Toaster, ay as Tooltip, aA as TooltipContent, aB as TooltipProvider, aC as TooltipRoot, az as TooltipTrigger, b9 as UseFileReferenceForRecordReturn, b7 as UseFileReferenceOptions, b8 as UseFileReferenceReturn, aR as UserMenu, bn as UserMenuProps, b3 as useFileReference, b5 as useFileReferenceById, b4 as useFileReferenceForRecord, b6 as useFilesByCategory, bf as useIsPublicPage, be as usePublicPageContext } from './PublicPageProvider-CIGSujI2.js';
|
|
14
14
|
export { u as useToast } from './useToast-AyaT-x7p.js';
|
|
15
15
|
export { D as DataTable, a as DataTableProps } from './DataTable-DRUIgtUH.js';
|
|
16
16
|
import { d as DataRecord, a as DataTableAction, D as DataTableColumn } from './types-DXstZpNI.js';
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export { ALL_PERMISSIONS, EVENT_APP_PERMISSIONS, GLOBAL_PERMISSIONS, NavigationGuard, ORGANISATION_PERMISSIONS, PAGE_PERMISSIONS, PagePermissionGuard, RBACErrorCode, RPCFunction, checkRuntimeCompliance, createRBACExpressMiddleware, createRBACMiddleware, getCustomAuthCodeFixes, getDirectSupabaseAuthFixes, getDuplicateConfigFixes, getQuickFixes, getSetupIssues, getUnprotectedPageFixes, isRBACInitialized, isValidPermission, validateAndWarn, validateDatabaseConfiguration, validateRBACSetup, withAccessLevelGuard, withPermissionGuard, withRoleGuard } from './chunk-
|
|
2
|
-
export { AddressField, Avatar, Badge, Calendar, ContextSelector, FileDisplay, FileUpload, Footer, Form, FormField, Header, LoginForm, NavigationMenu, PaceAppLayout, PaceLoginPage, PasswordChangeForm, ProtectedRoute, PublicPageFooter, PublicPageHeader, PublicPageLayout, SessionRestorationLoader, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, UserMenu, useFileReference, useFileReferenceById, useFileReferenceForRecord, useFilesByCategory } from './chunk-
|
|
3
|
-
export { AccessDenied } from './chunk-
|
|
4
|
-
import { Dialog, DialogContent, DialogHeader } from './chunk-
|
|
5
|
-
export { Alert, AlertDescription, AlertTitle, Checkbox, ColumnFactory, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, average, count, exportToCSV, exportToCSVWithTableRows, generateCSVContent, max, min, sum } from './chunk-
|
|
6
|
-
import { Button } from './chunk-
|
|
7
|
-
export { Button, SECURE_CLIENT_SYMBOL, SecureSupabaseClient, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, createSecureClient, fromSupabaseClient, isSecureClient, useAccessLevel, useCan, useEvents, useMultiplePermissions, usePermissions, useRBAC, useResolvedScope, useResourcePermissions, useRoleManagement, useSecureSupabase, warnIfInsecureClient } from './chunk-
|
|
8
|
-
export { StorageUtils, clearPublicEventCache, clearPublicLogoCache, extractEventCodeFromPath, generatePublicRoutePath, getPublicEventCacheStats, getPublicLogoCacheStats, useFormDialog, useOrganisationPermissions, usePublicEvent, usePublicEventCode, usePublicEventLogo, usePublicRouteParams, useZodForm } from './chunk-
|
|
9
|
-
export { APP_PATH_MAPPING, DEFAULT_FILE_SIZE_LIMIT, FILE_SIZE_LIMITS, STORAGE_CONFIG, archiveFile, clearPublicFileDisplayCache, deleteFile, downloadFile, extractFileMetadata, generateFilePath, generateFileUrlsBatch, generateUniqueFileName, getBucketName, getFileSizeLimit, getPublicFileDisplayCacheStats, getPublicUrl, getSignedUrl, listFiles, uploadFile, useEventTheme, usePublicFileDisplay, validateFileSize } from './chunk-
|
|
10
|
-
export { applyPalette, clearPalette, parseAndNormalizeEventColours } from './chunk-
|
|
1
|
+
export { ALL_PERMISSIONS, EVENT_APP_PERMISSIONS, GLOBAL_PERMISSIONS, NavigationGuard, ORGANISATION_PERMISSIONS, PAGE_PERMISSIONS, PagePermissionGuard, RBACErrorCode, RPCFunction, checkRuntimeCompliance, createRBACExpressMiddleware, createRBACMiddleware, getCustomAuthCodeFixes, getDirectSupabaseAuthFixes, getDuplicateConfigFixes, getQuickFixes, getSetupIssues, getUnprotectedPageFixes, isRBACInitialized, isValidPermission, validateAndWarn, validateDatabaseConfiguration, validateRBACSetup, withAccessLevelGuard, withPermissionGuard, withRoleGuard } from './chunk-Z2FNRKF3.js';
|
|
2
|
+
export { AddressField, Avatar, Badge, Calendar, ContextSelector, FileDisplay, FileUpload, Footer, Form, FormField, Header, LoginForm, NavigationMenu, PaceAppLayout, PaceLoginPage, PasswordChangeForm, ProtectedRoute, PublicPageFooter, PublicPageHeader, PublicPageLayout, SessionRestorationLoader, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, UserMenu, useFileReference, useFileReferenceById, useFileReferenceForRecord, useFilesByCategory } from './chunk-EURB7QFZ.js';
|
|
3
|
+
export { AccessDenied } from './chunk-S6ZQKDY6.js';
|
|
4
|
+
import { Dialog, DialogContent, DialogHeader } from './chunk-NKHKXPI4.js';
|
|
5
|
+
export { Alert, AlertDescription, AlertTitle, Checkbox, ColumnFactory, DataTable, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogPortal, DialogTitle, DialogTrigger, Input, Label, Progress, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, average, count, exportToCSV, exportToCSVWithTableRows, generateCSVContent, max, min, sum } from './chunk-NKHKXPI4.js';
|
|
6
|
+
import { Button } from './chunk-GS5672WG.js';
|
|
7
|
+
export { Button, SECURE_CLIENT_SYMBOL, SecureSupabaseClient, Tooltip, TooltipContent, TooltipProvider, TooltipRoot, TooltipTrigger, createSecureClient, fromSupabaseClient, isSecureClient, useAccessLevel, useCan, useEvents, useMultiplePermissions, usePermissions, useRBAC, useResolvedScope, useResourcePermissions, useRoleManagement, useSecureSupabase, warnIfInsecureClient } from './chunk-GS5672WG.js';
|
|
8
|
+
export { StorageUtils, clearPublicEventCache, clearPublicLogoCache, extractEventCodeFromPath, generatePublicRoutePath, getPublicEventCacheStats, getPublicLogoCacheStats, useFormDialog, useOrganisationPermissions, usePublicEvent, usePublicEventCode, usePublicEventLogo, usePublicRouteParams, useZodForm } from './chunk-4DDCYDQ3.js';
|
|
9
|
+
export { APP_PATH_MAPPING, DEFAULT_FILE_SIZE_LIMIT, FILE_SIZE_LIMITS, STORAGE_CONFIG, archiveFile, clearPublicFileDisplayCache, deleteFile, downloadFile, extractFileMetadata, generateFilePath, generateFileUrlsBatch, generateUniqueFileName, getBucketName, getFileSizeLimit, getPublicFileDisplayCacheStats, getPublicUrl, getSignedUrl, listFiles, uploadFile, useEventTheme, usePublicFileDisplay, validateFileSize } from './chunk-MPBLMWVR.js';
|
|
10
|
+
export { applyPalette, clearPalette, parseAndNormalizeEventColours } from './chunk-5W2A3DRC.js';
|
|
11
11
|
export { useToast } from './chunk-S7DKJPLT.js';
|
|
12
|
-
import { Card } from './chunk-
|
|
13
|
-
export { Card, CardActions, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ErrorBoundary, ErrorBoundaryProvider, PublicPageProvider, useAppConfig, useIsPublicPage, useOrganisationSecurity, usePublicPageContext } from './chunk-
|
|
12
|
+
import { Card } from './chunk-EF2UGZWY.js';
|
|
13
|
+
export { Card, CardActions, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, ErrorBoundary, ErrorBoundaryProvider, PublicPageProvider, useAppConfig, useIsPublicPage, useOrganisationSecurity, usePublicPageContext } from './chunk-EF2UGZWY.js';
|
|
14
14
|
import './chunk-C7NSAPTL.js';
|
|
15
|
-
import { OrganisationServiceContext, UnifiedAuthContext, OrganisationServiceProvider } from './chunk-
|
|
16
|
-
export { EventServiceProvider, InactivityServiceProvider, OrganisationServiceProvider, UnifiedAuthProvider, useAuthService, useEventService, useInactivityService, useOrganisationService, useOrganisations, useSessionRestoration, useUnifiedAuth } from './chunk-
|
|
17
|
-
export { CACHE_PATTERNS, RBACCache, RBACEngine, clearInFlightRequests, createRBACConfig, createRBACEngine, disablePerformanceMonitoring, enablePerformanceMonitoring, getAccessLevel, getInFlightRequestCount, getPerformanceMetrics, getPerformanceSummary, getPermissionMap, getRBACConfig, getRBACLogger, getRoleContext, hasAllPermissions, hasAnyPermission, isDebugMode, isDevelopmentMode, isPerformanceMonitoringEnabled, isPermitted, isPermittedCached, rbacCache, recordAuditEvent, recordPermissionCheck, resetPerformanceMetrics, resolveAppContext, setupRBAC } from './chunk-
|
|
15
|
+
import { OrganisationServiceContext, UnifiedAuthContext, OrganisationServiceProvider } from './chunk-T5CVK4R3.js';
|
|
16
|
+
export { EventServiceProvider, InactivityServiceProvider, OrganisationServiceProvider, UnifiedAuthProvider, useAuthService, useEventService, useInactivityService, useOrganisationService, useOrganisations, useSessionRestoration, useUnifiedAuth } from './chunk-T5CVK4R3.js';
|
|
17
|
+
export { CACHE_PATTERNS, RBACCache, RBACEngine, clearInFlightRequests, createRBACConfig, createRBACEngine, disablePerformanceMonitoring, enablePerformanceMonitoring, getAccessLevel, getInFlightRequestCount, getPerformanceMetrics, getPerformanceSummary, getPermissionMap, getRBACConfig, getRBACLogger, getRoleContext, hasAllPermissions, hasAnyPermission, isDebugMode, isDevelopmentMode, isPerformanceMonitoringEnabled, isPermitted, isPermittedCached, rbacCache, recordAuditEvent, recordPermissionCheck, resetPerformanceMetrics, resolveAppContext, setupRBAC } from './chunk-LX6U42O3.js';
|
|
18
18
|
export { RBACAuditManager, createAuditManager, emitAuditEvent, getGlobalAuditManager, setGlobalAuditManager } from './chunk-AHU7G2R5.js';
|
|
19
19
|
export { FileCategory } from './chunk-6QYDGKQY.js';
|
|
20
20
|
import './chunk-4SXLQIZO.js';
|
package/dist/providers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './chunk-C7NSAPTL.js';
|
|
2
|
-
export { AuthServiceContext, AuthServiceProvider, EventServiceContext, EventServiceProvider, InactivityServiceContext, InactivityServiceProvider, OrganisationServiceContext, OrganisationServiceProvider, UnifiedAuthContext, UnifiedAuthProvider, useUnifiedAuth } from './chunk-
|
|
3
|
-
import './chunk-
|
|
2
|
+
export { AuthServiceContext, AuthServiceProvider, EventServiceContext, EventServiceProvider, InactivityServiceContext, InactivityServiceProvider, OrganisationServiceContext, OrganisationServiceProvider, UnifiedAuthContext, UnifiedAuthProvider, useUnifiedAuth } from './chunk-T5CVK4R3.js';
|
|
3
|
+
import './chunk-LX6U42O3.js';
|
|
4
4
|
import './chunk-AHU7G2R5.js';
|
|
5
5
|
import './chunk-4SXLQIZO.js';
|
|
6
6
|
import './chunk-HF6O3O37.js';
|
package/dist/rbac/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { U as UUID, g as PermissionCacheKey, h as AuditEventSource, i as RBACAuditEvent, a as PermissionCheck, S as Scope, A as AccessLevel, b as PermissionMap, j as RBACAppContext, k as RBACRoleContext, l as UserRBACContext, P as Permission } from '../types-BeoeWV5I.js';
|
|
2
2
|
export { E as EventAppRole, G as GlobalRole, I as InvalidScopeError, M as MissingUserContextError, O as Operation, e as OrganisationContextRequiredError, c as OrganisationRole, d as PermissionDeniedError, R as RBACError, f as RBACNotInitializedError } from '../types-BeoeWV5I.js';
|
|
3
|
-
export { A as AccessLevelContext, s as AuditEventType, P as PermissionSource, d as RBACAccessValidateParams, e as RBACAccessValidateResult, q as RBACAuditLogParams, r as RBACAuditLogResult, t as RBACContext, w as RBACErrorCode, v as RBACFunctionResponse, f as RBACPageAccessCheckParams, R as RBACPermissionCheckParams, a as RBACPermissionCheckResult, b as RBACPermissionsGetParams, c as RBACPermissionsGetResult, u as RBACResult, g as RBACRoleGrantParams, h as RBACRoleGrantResult, i as RBACRoleRevokeParams, j as RBACRoleRevokeResult, m as RBACRoleValidateParams, n as RBACRoleValidateResult, k as RBACRolesListParams, l as RBACRolesListResult, o as RBACSessionTrackParams, p as RBACSessionTrackResult, x as RPCFunction, S as SessionType } from '../functions-
|
|
3
|
+
export { A as AccessLevelContext, s as AuditEventType, P as PermissionSource, d as RBACAccessValidateParams, e as RBACAccessValidateResult, q as RBACAuditLogParams, r as RBACAuditLogResult, t as RBACContext, w as RBACErrorCode, v as RBACFunctionResponse, f as RBACPageAccessCheckParams, R as RBACPermissionCheckParams, a as RBACPermissionCheckResult, b as RBACPermissionsGetParams, c as RBACPermissionsGetResult, u as RBACResult, g as RBACRoleGrantParams, h as RBACRoleGrantResult, i as RBACRoleRevokeParams, j as RBACRoleRevokeResult, m as RBACRoleValidateParams, n as RBACRoleValidateResult, k as RBACRolesListParams, l as RBACRolesListResult, o as RBACSessionTrackParams, p as RBACSessionTrackResult, x as RPCFunction, S as SessionType } from '../functions-lBy5L2ry.js';
|
|
4
4
|
import { SupabaseClient } from '@supabase/supabase-js';
|
|
5
5
|
import { D as Database } from '../database.generated-CcnC_DRc.js';
|
|
6
6
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
package/dist/rbac/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { ALL_PERMISSIONS, EVENT_APP_PERMISSIONS, GLOBAL_PERMISSIONS, NavigationGuard, ORGANISATION_PERMISSIONS, PAGE_PERMISSIONS, PagePermissionGuard, RBACErrorCode, RPCFunction, checkRuntimeCompliance, createRBACExpressMiddleware, createRBACMiddleware, getCustomAuthCodeFixes, getDirectSupabaseAuthFixes, getDuplicateConfigFixes, getQuickFixes, getSetupIssues, getUnprotectedPageFixes, isRBACInitialized, isValidPermission, validateAndWarn, validateDatabaseConfiguration, validateRBACSetup, withAccessLevelGuard, withPermissionGuard, withRoleGuard } from '../chunk-
|
|
2
|
-
export { AccessDenied } from '../chunk-
|
|
3
|
-
export { SECURE_CLIENT_SYMBOL, SecureSupabaseClient, createSecureClient, fromSupabaseClient, isSecureClient, useAccessLevel, useCan, useMultiplePermissions, usePermissions, useRBAC, useResolvedScope, useResourcePermissions, useRoleManagement, useSecureSupabase, warnIfInsecureClient } from '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
export { ALL_PERMISSIONS, EVENT_APP_PERMISSIONS, GLOBAL_PERMISSIONS, NavigationGuard, ORGANISATION_PERMISSIONS, PAGE_PERMISSIONS, PagePermissionGuard, RBACErrorCode, RPCFunction, checkRuntimeCompliance, createRBACExpressMiddleware, createRBACMiddleware, getCustomAuthCodeFixes, getDirectSupabaseAuthFixes, getDuplicateConfigFixes, getQuickFixes, getSetupIssues, getUnprotectedPageFixes, isRBACInitialized, isValidPermission, validateAndWarn, validateDatabaseConfiguration, validateRBACSetup, withAccessLevelGuard, withPermissionGuard, withRoleGuard } from '../chunk-Z2FNRKF3.js';
|
|
2
|
+
export { AccessDenied } from '../chunk-S6ZQKDY6.js';
|
|
3
|
+
export { SECURE_CLIENT_SYMBOL, SecureSupabaseClient, createSecureClient, fromSupabaseClient, isSecureClient, useAccessLevel, useCan, useMultiplePermissions, usePermissions, useRBAC, useResolvedScope, useResourcePermissions, useRoleManagement, useSecureSupabase, warnIfInsecureClient } from '../chunk-GS5672WG.js';
|
|
4
|
+
import '../chunk-EF2UGZWY.js';
|
|
5
5
|
import '../chunk-C7NSAPTL.js';
|
|
6
|
-
import '../chunk-
|
|
7
|
-
export { CACHE_PATTERNS, RBACCache, RBACEngine, clearInFlightRequests, createRBACConfig, createRBACEngine, disablePerformanceMonitoring, enablePerformanceMonitoring, getAccessLevel, getInFlightRequestCount, getPerformanceMetrics, getPerformanceSummary, getPermissionMap, getRBACConfig, getRBACLogger, getRoleContext, hasAllPermissions, hasAnyPermission, isDebugMode, isDevelopmentMode, isPerformanceMonitoringEnabled, isPermitted, isPermittedCached, rbacCache, recordAuditEvent, recordPermissionCheck, resetPerformanceMetrics, resolveAppContext, setupRBAC } from '../chunk-
|
|
6
|
+
import '../chunk-T5CVK4R3.js';
|
|
7
|
+
export { CACHE_PATTERNS, RBACCache, RBACEngine, clearInFlightRequests, createRBACConfig, createRBACEngine, disablePerformanceMonitoring, enablePerformanceMonitoring, getAccessLevel, getInFlightRequestCount, getPerformanceMetrics, getPerformanceSummary, getPermissionMap, getRBACConfig, getRBACLogger, getRoleContext, hasAllPermissions, hasAnyPermission, isDebugMode, isDevelopmentMode, isPerformanceMonitoringEnabled, isPermitted, isPermittedCached, rbacCache, recordAuditEvent, recordPermissionCheck, resetPerformanceMetrics, resolveAppContext, setupRBAC } from '../chunk-LX6U42O3.js';
|
|
8
8
|
export { RBACAuditManager, createAuditManager, emitAuditEvent, getGlobalAuditManager, setGlobalAuditManager } from '../chunk-AHU7G2R5.js';
|
|
9
9
|
import '../chunk-4SXLQIZO.js';
|
|
10
10
|
import '../chunk-OJ4SKRSV.js';
|