@revealui/core 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -30
- package/dist/api/compression.d.ts.map +1 -1
- package/dist/api/payload-optimization.d.ts.map +1 -1
- package/dist/api/rate-limit.d.ts +30 -29
- package/dist/api/rate-limit.d.ts.map +1 -1
- package/dist/api/rate-limit.js +79 -4
- package/dist/api/response-cache.d.ts.map +1 -1
- package/dist/api/response-cache.js +1 -1
- package/dist/api/rest.d.ts.map +1 -1
- package/dist/api/rest.js +5 -4
- package/dist/auth/access.d.ts.map +1 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/cache/query-cache.d.ts +12 -10
- package/dist/cache/query-cache.d.ts.map +1 -1
- package/dist/cache/query-cache.js +38 -42
- package/dist/caching/app-cache.d.ts +5 -0
- package/dist/caching/app-cache.d.ts.map +1 -1
- package/dist/caching/app-cache.js +9 -1
- package/dist/caching/cdn-config.d.ts +2 -2
- package/dist/caching/cdn-config.d.ts.map +1 -1
- package/dist/caching/cdn-config.js +5 -15
- package/dist/caching/edge-cache.d.ts +1 -1
- package/dist/caching/edge-cache.d.ts.map +1 -1
- package/dist/caching/edge-cache.js +44 -11
- package/dist/caching/index.d.ts +6 -0
- package/dist/caching/index.d.ts.map +1 -0
- package/dist/caching/index.js +5 -0
- package/dist/caching/service-worker.d.ts +10 -18
- package/dist/caching/service-worker.d.ts.map +1 -1
- package/dist/caching/service-worker.js +5 -4
- package/dist/client/admin/RichText.d.ts +1 -1
- package/dist/client/admin/RichText.d.ts.map +1 -1
- package/dist/client/admin/components/AdminDashboard.d.ts.map +1 -1
- package/dist/client/admin/components/AdminDashboard.js +178 -205
- package/dist/client/admin/components/CollectionList.d.ts.map +1 -1
- package/dist/client/admin/components/DocumentForm.d.ts.map +1 -1
- package/dist/client/admin/components/DocumentForm.js +130 -6
- package/dist/client/admin/components/GlobalForm.d.ts.map +1 -1
- package/dist/client/admin/context/ServerFunctionContext.d.ts +8 -0
- package/dist/client/admin/context/ServerFunctionContext.d.ts.map +1 -0
- package/dist/client/admin/context/ServerFunctionContext.js +15 -0
- package/dist/client/admin/i18n/en.d.ts.map +1 -1
- package/dist/client/admin/index.d.ts +1 -0
- package/dist/client/admin/index.d.ts.map +1 -1
- package/dist/client/admin/index.js +1 -0
- package/dist/client/admin/layout.d.ts +1 -1
- package/dist/client/admin/layout.d.ts.map +1 -1
- package/dist/client/admin/layout.js +3 -2
- package/dist/client/admin/page.d.ts.map +1 -1
- package/dist/client/admin/utils/apiClient.d.ts.map +1 -1
- package/dist/client/admin/utils/apiClient.js +0 -4
- package/dist/client/admin/utils/auth.d.ts +0 -4
- package/dist/client/admin/utils/auth.d.ts.map +1 -1
- package/dist/client/admin/utils/auth.js +0 -6
- package/dist/client/admin/utils/index.d.ts +0 -1
- package/dist/client/admin/utils/index.d.ts.map +1 -1
- package/dist/client/admin/utils/index.js +0 -1
- package/dist/client/admin/utils/serializeConfig.d.ts.map +1 -1
- package/dist/client/hooks.d.ts.map +1 -1
- package/dist/client/index.d.ts +0 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +0 -2
- package/dist/client/richtext/RichTextEditor.d.ts.map +1 -1
- package/dist/client/richtext/components/ImageNodeComponent.d.ts.map +1 -1
- package/dist/client/richtext/components/ImageNodeComponent.js +0 -1
- package/dist/client/richtext/components/ImageUploadButton.d.ts +2 -0
- package/dist/client/richtext/components/ImageUploadButton.d.ts.map +1 -1
- package/dist/client/richtext/components/ImageUploadButton.js +30 -15
- package/dist/client/richtext/index.d.ts.map +1 -1
- package/dist/client/richtext/nodes/DecoratorBlockNode.d.ts.map +1 -1
- package/dist/client/richtext/nodes/ImageNode.d.ts.map +1 -1
- package/dist/client/richtext/plugins/CollaborationPlugin.d.ts.map +1 -1
- package/dist/client/richtext/plugins/CursorsOverlayPlugin.d.ts.map +1 -1
- package/dist/client/richtext/plugins/FloatingToolbarPlugin.d.ts.map +1 -1
- package/dist/client/richtext/plugins/ImagePlugin.d.ts.map +1 -1
- package/dist/client/richtext/plugins/ToolbarPlugin.d.ts.map +1 -1
- package/dist/client/ui/index.d.ts.map +1 -1
- package/dist/client/ui/index.js +1 -1
- package/dist/collections/CollectionOperations.d.ts +7 -7
- package/dist/collections/CollectionOperations.d.ts.map +1 -1
- package/dist/collections/CollectionOperations.js +15 -1
- package/dist/collections/hooks.d.ts.map +1 -1
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/collections/operations/create.d.ts +2 -4
- package/dist/collections/operations/create.d.ts.map +1 -1
- package/dist/collections/operations/create.js +9 -7
- package/dist/collections/operations/createMany.d.ts +12 -0
- package/dist/collections/operations/createMany.d.ts.map +1 -0
- package/dist/collections/operations/createMany.js +43 -0
- package/dist/collections/operations/delete.d.ts +1 -1
- package/dist/collections/operations/delete.d.ts.map +1 -1
- package/dist/collections/operations/delete.js +31 -2
- package/dist/collections/operations/deleteMany.d.ts +11 -0
- package/dist/collections/operations/deleteMany.d.ts.map +1 -0
- package/dist/collections/operations/deleteMany.js +50 -0
- package/dist/collections/operations/fieldHooks.d.ts +2 -2
- package/dist/collections/operations/fieldHooks.d.ts.map +1 -1
- package/dist/collections/operations/fieldHooks.js +4 -4
- package/dist/collections/operations/find.d.ts +2 -4
- package/dist/collections/operations/find.d.ts.map +1 -1
- package/dist/collections/operations/find.js +115 -8
- package/dist/collections/operations/findById.d.ts +3 -4
- package/dist/collections/operations/findById.d.ts.map +1 -1
- package/dist/collections/operations/findById.js +53 -1
- package/dist/collections/operations/sqlAdapter.d.ts +23 -0
- package/dist/collections/operations/sqlAdapter.d.ts.map +1 -0
- package/dist/collections/operations/sqlAdapter.js +76 -0
- package/dist/collections/operations/update.d.ts +3 -5
- package/dist/collections/operations/update.d.ts.map +1 -1
- package/dist/collections/operations/update.js +103 -11
- package/dist/collections/operations/updateMany.d.ts +11 -0
- package/dist/collections/operations/updateMany.d.ts.map +1 -0
- package/dist/collections/operations/updateMany.js +52 -0
- package/dist/collections/registry.d.ts +12 -0
- package/dist/collections/registry.d.ts.map +1 -0
- package/dist/collections/registry.js +38 -0
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/runtime.d.ts.map +1 -1
- package/dist/config/utils.d.ts +0 -10
- package/dist/config/utils.d.ts.map +1 -1
- package/dist/config/utils.js +18 -17
- package/dist/database/index.d.ts +3 -0
- package/dist/database/index.d.ts.map +1 -1
- package/dist/database/index.js +1 -5
- package/dist/database/safe-parse.d.ts +26 -0
- package/dist/database/safe-parse.d.ts.map +1 -0
- package/dist/database/safe-parse.js +42 -0
- package/dist/database/ssl-config.d.ts.map +1 -1
- package/dist/database/type-adapter.d.ts.map +1 -1
- package/dist/database/universal-postgres.d.ts.map +1 -1
- package/dist/database/universal-postgres.js +18 -13
- package/dist/dataloader.d.ts.map +1 -1
- package/dist/dataloader.js +16 -2
- package/dist/error-handling/circuit-breaker.d.ts +1 -1
- package/dist/error-handling/circuit-breaker.d.ts.map +1 -1
- package/dist/error-handling/circuit-breaker.js +11 -3
- package/dist/error-handling/error-boundary.d.ts.map +1 -1
- package/dist/error-handling/error-reporter.d.ts +6 -5
- package/dist/error-handling/error-reporter.d.ts.map +1 -1
- package/dist/error-handling/error-reporter.js +26 -41
- package/dist/error-handling/fallback-components.d.ts.map +1 -1
- package/dist/error-handling/fallback-components.js +1 -1
- package/dist/error-handling/index.d.ts +3 -5
- package/dist/error-handling/index.d.ts.map +1 -1
- package/dist/error-handling/index.js +2 -5
- package/dist/error-handling/retry.d.ts.map +1 -1
- package/dist/error-handling/retry.js +13 -8
- package/dist/factories/builders.d.ts.map +1 -1
- package/dist/factories/index.d.ts.map +1 -1
- package/dist/features.d.ts +5 -5
- package/dist/features.d.ts.map +1 -1
- package/dist/features.js +6 -5
- package/dist/fieldTraversal.d.ts.map +1 -1
- package/dist/fields/config/types.d.ts.map +1 -1
- package/dist/fields/getDefaultValue.d.ts.map +1 -1
- package/dist/fields/getFieldPaths.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/index.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
- package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
- package/dist/generated/types/cms.d.ts.map +1 -1
- package/dist/generated/types/cms.js +0 -1
- package/dist/generated/types/index.d.ts +0 -3
- package/dist/generated/types/index.d.ts.map +1 -1
- package/dist/generated/types/index.js +0 -7
- package/dist/generated/types/neon.d.ts.map +1 -1
- package/dist/generated/types/neon.js +4 -2
- package/dist/globals/GlobalOperations.d.ts.map +1 -1
- package/dist/globals/GlobalOperations.js +4 -2
- package/dist/globals/index.d.ts.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -6
- package/dist/instance/RevealUIInstance.d.ts.map +1 -1
- package/dist/instance/RevealUIInstance.js +50 -69
- package/dist/instance/index.d.ts.map +1 -1
- package/dist/instance/logger.d.ts.map +1 -1
- package/dist/instance/methods/create.d.ts.map +1 -1
- package/dist/instance/methods/create.js +4 -4
- package/dist/instance/methods/delete.d.ts.map +1 -1
- package/dist/instance/methods/delete.js +5 -5
- package/dist/instance/methods/find.d.ts.map +1 -1
- package/dist/instance/methods/find.js +0 -3
- package/dist/instance/methods/findById.d.ts.map +1 -1
- package/dist/instance/methods/findById.js +0 -3
- package/dist/instance/methods/hooks.d.ts.map +1 -1
- package/dist/instance/methods/hooks.js +3 -1
- package/dist/instance/methods/update.d.ts.map +1 -1
- package/dist/instance/methods/update.js +4 -4
- package/dist/jobs/index.d.ts +16 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/index.js +14 -0
- package/dist/jobs/queue.d.ts +57 -0
- package/dist/jobs/queue.d.ts.map +1 -0
- package/dist/jobs/queue.js +134 -0
- package/dist/license-encryption.d.ts +21 -0
- package/dist/license-encryption.d.ts.map +1 -0
- package/dist/license-encryption.js +74 -0
- package/dist/license.d.ts +33 -7
- package/dist/license.d.ts.map +1 -1
- package/dist/license.js +119 -16
- package/dist/monitoring/alerts.d.ts.map +1 -1
- package/dist/monitoring/cleanup-manager.d.ts.map +1 -1
- package/dist/monitoring/health-monitor.d.ts.map +1 -1
- package/dist/monitoring/index.d.ts.map +1 -1
- package/dist/monitoring/process-registry.d.ts.map +1 -1
- package/dist/monitoring/query-monitor.d.ts.map +1 -1
- package/dist/monitoring/types.d.ts.map +1 -1
- package/dist/monitoring/zombie-detector.d.ts.map +1 -1
- package/dist/monitoring/zombie-detector.js +5 -0
- package/dist/nextjs/index.d.ts.map +1 -1
- package/dist/nextjs/utilities.d.ts.map +1 -1
- package/dist/nextjs/withRevealUI.d.ts.map +1 -1
- package/dist/observability/alerts.d.ts.map +1 -1
- package/dist/observability/alerts.js +1 -2
- package/dist/observability/health-check.d.ts +1 -5
- package/dist/observability/health-check.d.ts.map +1 -1
- package/dist/observability/health-check.js +37 -43
- package/dist/observability/index.d.ts.map +1 -1
- package/dist/observability/logger.d.ts.map +1 -1
- package/dist/observability/logger.js +1 -1
- package/dist/observability/metrics.d.ts.map +1 -1
- package/dist/observability/tracing.d.ts.map +1 -1
- package/dist/observability/tracing.js +0 -1
- package/dist/optimization/asset-optimizer.d.ts +6 -2
- package/dist/optimization/asset-optimizer.d.ts.map +1 -1
- package/dist/optimization/asset-optimizer.js +31 -7
- package/dist/optimization/bundle-analyzer.d.ts +1 -1
- package/dist/optimization/bundle-analyzer.d.ts.map +1 -1
- package/dist/optimization/bundle-analyzer.js +29 -5
- package/dist/optimization/code-splitting.d.ts +0 -23
- package/dist/optimization/code-splitting.d.ts.map +1 -1
- package/dist/optimization/code-splitting.js +0 -29
- package/dist/plugins/form-builder.d.ts.map +1 -1
- package/dist/plugins/index.d.ts.map +1 -1
- package/dist/plugins/nested-docs.d.ts +4 -0
- package/dist/plugins/nested-docs.d.ts.map +1 -1
- package/dist/plugins/nested-docs.js +50 -5
- package/dist/plugins/redirects.d.ts.map +1 -1
- package/dist/queries/index.d.ts.map +1 -1
- package/dist/queries/queryBuilder.d.ts.map +1 -1
- package/dist/queries/queryBuilder.js +15 -5
- package/dist/relationships/analyzer.d.ts.map +1 -1
- package/dist/relationships/analyzer.js +8 -0
- package/dist/relationships/index.d.ts.map +1 -1
- package/dist/relationships/populate-core.d.ts +57 -0
- package/dist/relationships/populate-core.d.ts.map +1 -0
- package/dist/relationships/populate-core.js +116 -0
- package/dist/relationships/populate-helpers.d.ts +5 -51
- package/dist/relationships/populate-helpers.d.ts.map +1 -1
- package/dist/relationships/populate-helpers.js +4 -109
- package/dist/relationships/population.d.ts +1 -9
- package/dist/relationships/population.d.ts.map +1 -1
- package/dist/relationships/population.js +8 -3
- package/dist/revealui.d.ts.map +1 -1
- package/dist/richtext/exports/client/rcc.d.ts.map +1 -1
- package/dist/richtext/exports/client/rcc.js +1 -1
- package/dist/richtext/exports/server/rsc.d.ts +17 -0
- package/dist/richtext/exports/server/rsc.d.ts.map +1 -1
- package/dist/richtext/exports/server/rsc.js +61 -5
- package/dist/richtext/index.d.ts.map +1 -1
- package/dist/richtext/lexical.d.ts.map +1 -1
- package/dist/security/audit.d.ts +1 -1
- package/dist/security/audit.d.ts.map +1 -1
- package/dist/security/audit.js +4 -2
- package/dist/security/auth.d.ts +29 -160
- package/dist/security/auth.d.ts.map +1 -1
- package/dist/security/auth.js +150 -367
- package/dist/security/authorization.d.ts +7 -31
- package/dist/security/authorization.d.ts.map +1 -1
- package/dist/security/authorization.js +72 -14
- package/dist/security/encryption.d.ts +56 -44
- package/dist/security/encryption.d.ts.map +1 -1
- package/dist/security/encryption.js +128 -100
- package/dist/security/gdpr-storage.d.ts +102 -0
- package/dist/security/gdpr-storage.d.ts.map +1 -0
- package/dist/security/gdpr-storage.js +65 -0
- package/dist/security/gdpr.d.ts +57 -37
- package/dist/security/gdpr.d.ts.map +1 -1
- package/dist/security/gdpr.js +155 -94
- package/dist/security/headers.d.ts +4 -2
- package/dist/security/headers.d.ts.map +1 -1
- package/dist/security/headers.js +35 -17
- package/dist/security/index.d.ts +3 -16
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +3 -16
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/renderPage.d.ts.map +1 -1
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +2 -4
- package/dist/storage/vercel-blob.d.ts.map +1 -1
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/types/access.d.ts.map +1 -1
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/cms.d.ts.map +1 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/extensions.d.ts.map +1 -1
- package/dist/types/frontend.d.ts.map +1 -1
- package/dist/types/generated.d.ts +0 -2
- package/dist/types/generated.d.ts.map +1 -1
- package/dist/types/generated.js +0 -1
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/interfaces/app.d.ts.map +1 -1
- package/dist/types/jobs.d.ts.map +1 -1
- package/dist/types/legacy.d.ts.map +1 -1
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/query.d.ts.map +1 -1
- package/dist/types/request.d.ts.map +1 -1
- package/dist/types/richtext.d.ts.map +1 -1
- package/dist/types/runtime.d.ts +59 -1
- package/dist/types/runtime.d.ts.map +1 -1
- package/dist/types/schema.d.ts.map +1 -1
- package/dist/types/user.d.ts.map +1 -1
- package/dist/utils/access-conversion.d.ts.map +1 -1
- package/dist/utils/api-wrapper.d.ts.map +1 -1
- package/dist/utils/api-wrapper.js +1 -1
- package/dist/utils/block-conversion.d.ts.map +1 -1
- package/dist/utils/cache.d.ts.map +1 -1
- package/dist/utils/deep-clone.js +0 -1
- package/dist/utils/error-responses.d.ts.map +1 -1
- package/dist/utils/errors.d.ts +36 -0
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +103 -0
- package/dist/utils/field-conversion.d.ts +1 -1
- package/dist/utils/field-conversion.d.ts.map +1 -1
- package/dist/utils/flattenResult.d.ts.map +1 -1
- package/dist/utils/flattenResult.js +0 -1
- package/dist/utils/getBlockSelect.d.ts.map +1 -1
- package/dist/utils/getSelectMode.d.ts.map +1 -1
- package/dist/utils/isValidID.d.ts.map +1 -1
- package/dist/utils/json-parsing.d.ts.map +1 -1
- package/dist/utils/logger-client.d.ts.map +1 -1
- package/dist/utils/logger-server.d.ts.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/request-context.d.ts.map +1 -1
- package/dist/utils/stripUnselectedFields.d.ts.map +1 -1
- package/dist/utils/type-guards.d.ts.map +1 -1
- package/package.json +39 -16
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { flattenFields, isJsonFieldType } from '../utils/type-guards.js';
|
|
2
|
+
const TYPED_CANDIDATE_SLUGS = new Set(['sites', 'pages', 'posts', 'media', 'users']);
|
|
3
|
+
export function buildCollectionStorageDescriptor(collection) {
|
|
4
|
+
const flattenedFields = flattenFields(collection.fields || []);
|
|
5
|
+
const allowedColumns = new Set([
|
|
6
|
+
'id',
|
|
7
|
+
'createdAt',
|
|
8
|
+
'updatedAt',
|
|
9
|
+
'created_at',
|
|
10
|
+
'updated_at',
|
|
11
|
+
'_json',
|
|
12
|
+
'password',
|
|
13
|
+
]);
|
|
14
|
+
const jsonFieldNames = new Set();
|
|
15
|
+
for (const field of flattenedFields) {
|
|
16
|
+
if (!field.name)
|
|
17
|
+
continue;
|
|
18
|
+
if (isJsonFieldType(field)) {
|
|
19
|
+
jsonFieldNames.add(field.name);
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
allowedColumns.add(field.name);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
slug: collection.slug,
|
|
26
|
+
tableName: collection.slug,
|
|
27
|
+
storageMode: TYPED_CANDIDATE_SLUGS.has(collection.slug) ? 'typed-candidate' : 'dynamic',
|
|
28
|
+
allowedColumns: [...allowedColumns],
|
|
29
|
+
jsonFieldNames: [...jsonFieldNames],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export function buildCollectionStorageRegistry(collections) {
|
|
33
|
+
const registry = {};
|
|
34
|
+
for (const collection of collections || []) {
|
|
35
|
+
registry[collection.slug] = buildCollectionStorageDescriptor(collection);
|
|
36
|
+
}
|
|
37
|
+
return registry;
|
|
38
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAyD1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/config/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/config/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAExE,4CAA4C;AAC5C,KAAK,cAAc,GAAG,YAAY,GAAG,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAK/E;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAAC,OAAO,EAAE;IAAE,MAAM,EAAE,cAAc,CAAA;CAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAoBhG"}
|
package/dist/config/utils.d.ts
CHANGED
|
@@ -1,12 +1,2 @@
|
|
|
1
1
|
export declare function deepMerge<T extends object>(target: Partial<T>, source: T): T;
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated This function is deprecated. Use ConfigContract validation instead.
|
|
4
|
-
* Validation is now handled by the contract system in @revealui/contracts/cms.
|
|
5
|
-
* This function is kept for backward compatibility but should not be used in new code.
|
|
6
|
-
*/
|
|
7
|
-
export declare function validateConfig(config: {
|
|
8
|
-
secret?: string;
|
|
9
|
-
collections?: unknown[];
|
|
10
|
-
globals?: unknown[];
|
|
11
|
-
}): void;
|
|
12
2
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/config/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/config/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAuB5E"}
|
package/dist/config/utils.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import deepmerge from 'deepmerge';
|
|
2
|
-
const overwriteArray = (_target, source) => source;
|
|
3
1
|
export function deepMerge(target, source) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
2
|
+
const result = { ...target };
|
|
3
|
+
for (const key of Object.keys(source)) {
|
|
4
|
+
const s = source[key];
|
|
5
|
+
const t = target[key];
|
|
6
|
+
if (Array.isArray(s)) {
|
|
7
|
+
result[key] = s;
|
|
8
|
+
}
|
|
9
|
+
else if (s !== null &&
|
|
10
|
+
typeof s === 'object' &&
|
|
11
|
+
t !== null &&
|
|
12
|
+
typeof t === 'object' &&
|
|
13
|
+
!Array.isArray(t)) {
|
|
14
|
+
result[key] = deepMerge(t, s);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
result[key] = s;
|
|
18
|
+
}
|
|
19
19
|
}
|
|
20
|
+
return result;
|
|
20
21
|
}
|
package/dist/database/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,YAAY,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC"}
|
package/dist/database/index.js
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Re-export database adapters and types (PostgreSQL/PGlite only)
|
|
3
|
-
|
|
4
|
-
// export type { DatabaseResult } from '../types/index.js'
|
|
5
|
-
// export type { UniversalPostgresAdapterConfig } from './universal-postgres.js'
|
|
6
|
-
// export { universalPostgresAdapter } from './universal-postgres.js'
|
|
2
|
+
export { universalPostgresAdapter } from './universal-postgres.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe row parsing for database results.
|
|
3
|
+
*
|
|
4
|
+
* Database drivers return untyped rows — this module provides a type guard
|
|
5
|
+
* that filters out malformed rows (missing `id`) before they reach the application.
|
|
6
|
+
* All RevealUI tables have `id` as a non-nullable primary key, so filtering these
|
|
7
|
+
* out prevents crashes from unexpected driver behavior or schema migrations.
|
|
8
|
+
*/
|
|
9
|
+
import type { RevealDocument } from '../types/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Validate that a raw database row is a valid RevealDocument.
|
|
12
|
+
*
|
|
13
|
+
* Checks only the structural requirement: the row must be a non-null object
|
|
14
|
+
* with an `id` field of type string or number. All other fields are passed
|
|
15
|
+
* through as-is (trusting the database schema).
|
|
16
|
+
*
|
|
17
|
+
* @param row - Raw value from database driver (unknown type)
|
|
18
|
+
* @returns The row typed as RevealDocument, or null if malformed
|
|
19
|
+
*/
|
|
20
|
+
export declare function safeParseRevealDocument(row: unknown): RevealDocument | null;
|
|
21
|
+
/**
|
|
22
|
+
* Parse an array of raw database rows into RevealDocument[], filtering out
|
|
23
|
+
* any malformed rows and logging warnings for each one skipped.
|
|
24
|
+
*/
|
|
25
|
+
export declare function safeParseRevealDocuments(rows: unknown[]): RevealDocument[];
|
|
26
|
+
//# sourceMappingURL=safe-parse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"safe-parse.d.ts","sourceRoot":"","sources":["../../src/database/safe-parse.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,GAAG,IAAI,CAgB3E;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,cAAc,EAAE,CAI1E"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe row parsing for database results.
|
|
3
|
+
*
|
|
4
|
+
* Database drivers return untyped rows — this module provides a type guard
|
|
5
|
+
* that filters out malformed rows (missing `id`) before they reach the application.
|
|
6
|
+
* All RevealUI tables have `id` as a non-nullable primary key, so filtering these
|
|
7
|
+
* out prevents crashes from unexpected driver behavior or schema migrations.
|
|
8
|
+
*/
|
|
9
|
+
import { defaultLogger } from '../instance/logger.js';
|
|
10
|
+
/**
|
|
11
|
+
* Validate that a raw database row is a valid RevealDocument.
|
|
12
|
+
*
|
|
13
|
+
* Checks only the structural requirement: the row must be a non-null object
|
|
14
|
+
* with an `id` field of type string or number. All other fields are passed
|
|
15
|
+
* through as-is (trusting the database schema).
|
|
16
|
+
*
|
|
17
|
+
* @param row - Raw value from database driver (unknown type)
|
|
18
|
+
* @returns The row typed as RevealDocument, or null if malformed
|
|
19
|
+
*/
|
|
20
|
+
export function safeParseRevealDocument(row) {
|
|
21
|
+
if (row === null || typeof row !== 'object') {
|
|
22
|
+
defaultLogger.warn('Database row is not an object — skipping', { row });
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const r = row;
|
|
26
|
+
if (typeof r.id !== 'string' && typeof r.id !== 'number') {
|
|
27
|
+
defaultLogger.warn('Database row missing required id field — skipping', {
|
|
28
|
+
keys: Object.keys(r),
|
|
29
|
+
});
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return r;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parse an array of raw database rows into RevealDocument[], filtering out
|
|
36
|
+
* any malformed rows and logging warnings for each one skipped.
|
|
37
|
+
*/
|
|
38
|
+
export function safeParseRevealDocuments(rows) {
|
|
39
|
+
return rows
|
|
40
|
+
.map((row) => safeParseRevealDocument(row))
|
|
41
|
+
.filter((doc) => doc !== null);
|
|
42
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssl-config.d.ts","sourceRoot":"","sources":["../../src/database/ssl-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"ssl-config.d.ts","sourceRoot":"","sources":["../../src/database/ssl-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-adapter.d.ts","sourceRoot":"","sources":["../../src/database/type-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,
|
|
1
|
+
{"version":3,"file":"type-adapter.d.ts","sourceRoot":"","sources":["../../src/database/type-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE/D;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAEpE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,GAAG,OAAO,CAEvE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAC/C,QAAQ,EAAE,QAAQ,CAAC,SAAS,CAAC,EAC7B,KAAK,EAAE,MAAM,GACZ,SAAS,CAEX;AAED;;;;GAIG;AACH,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE;QAEN,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,GAAG,EAAE,OAAO,CAAC;YAAC,MAAM,EAAE,OAAO,CAAC;YAAC,MAAM,EAAE,OAAO,CAAA;SAAE,CAAC,CAAC;KAC5E,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,YAAY,IAAI;KACxD,CAAC,IAAI,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAEpE,GAAG,EAAE,MAAM,CAAC,CAAC;KACd,GACG,QAAQ,CAAC,CAAC,CAAC,GACX,KAAK;CACV,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,YAAY,EAAE,CAAC,SAAS,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAC9F,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;IAE1C,GAAG,EAAE,MAAM,CAAC,CAAC;CACd,GACG,QAAQ,CAAC,CAAC,CAAC,GACX,KAAK;IAuBP;;;;;;;;OAQG;;aA1BE,MAAM,CAAC;;aAAP,MAAM,CAAC;;IAqCZ;;OAEG;;aAvCE,MAAM,CAAC;;gBAMJ,MAAM,CAAC;;IAsCf;;OAEG;mBACY,OAAO;aA/CjB,MAAM,CAAC;kBA+CmB;gBAnCvB,MAAM,CAAC;;EAuClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"universal-postgres.d.ts","sourceRoot":"","sources":["../../src/database/universal-postgres.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"universal-postgres.d.ts","sourceRoot":"","sources":["../../src/database/universal-postgres.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAkB,MAAM,mBAAmB,CAAC;AAIzE,MAAM,WAAW,8BAA8B;IAC7C;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;CAC7C;AAmGD;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,GAAE,8BAAmC,GAC1C,eAAe,CAwcjB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,eAAe,UAAQ,GAAG,IAAI,CAa/D;AAGD,eAAe,wBAAwB,CAAC"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { defaultLogger } from '../instance/logger.js';
|
|
15
15
|
import { logger } from '../observability/logger.js';
|
|
16
|
+
import { safeParseRevealDocuments } from './safe-parse.js';
|
|
16
17
|
import { getSSLConfig } from './ssl-config.js';
|
|
17
18
|
/**
|
|
18
19
|
* Worker-isolated PGlite instances for parallel test execution
|
|
@@ -61,6 +62,7 @@ function getWorkerPendingTableCreations() {
|
|
|
61
62
|
if (!workerPendingTableCreations.has(workerID)) {
|
|
62
63
|
workerPendingTableCreations.set(workerID, []);
|
|
63
64
|
}
|
|
65
|
+
// biome-ignore lint/style/noNonNullAssertion: guaranteed by has-check + set above
|
|
64
66
|
return workerPendingTableCreations.get(workerID);
|
|
65
67
|
}
|
|
66
68
|
/**
|
|
@@ -71,6 +73,7 @@ function getWorkerCreatedTables() {
|
|
|
71
73
|
if (!workerCreatedTables.has(workerID)) {
|
|
72
74
|
workerCreatedTables.set(workerID, new Set());
|
|
73
75
|
}
|
|
76
|
+
// biome-ignore lint/style/noNonNullAssertion: guaranteed by has-check + set above
|
|
74
77
|
return workerCreatedTables.get(workerID);
|
|
75
78
|
}
|
|
76
79
|
/**
|
|
@@ -84,7 +87,7 @@ function detectProvider(connectionString) {
|
|
|
84
87
|
if (url.includes('.supabase.co') || url.includes('supabase')) {
|
|
85
88
|
return 'supabase';
|
|
86
89
|
}
|
|
87
|
-
if (url.includes('electric')
|
|
90
|
+
if (url.includes('electric')) {
|
|
88
91
|
return 'electric';
|
|
89
92
|
}
|
|
90
93
|
return 'generic';
|
|
@@ -122,20 +125,20 @@ export function universalPostgresAdapter(config = {}) {
|
|
|
122
125
|
// Use pg library for Neon (more compatible with parameterized queries)
|
|
123
126
|
// Neon serverless has limitations with $1, $2 style parameters
|
|
124
127
|
// Using pg ensures full PostgreSQL compatibility
|
|
128
|
+
// biome-ignore lint/style/noNonNullAssertion: non-electric providers throw above if connectionString is missing
|
|
125
129
|
const neonConnectionString = connectionString;
|
|
130
|
+
const { Pool: NeonPool } = await import('pg');
|
|
131
|
+
const neonPool = new NeonPool({
|
|
132
|
+
connectionString: neonConnectionString,
|
|
133
|
+
ssl: getSSLConfig(neonConnectionString),
|
|
134
|
+
});
|
|
126
135
|
queryFn = async (queryString, values = []) => {
|
|
127
136
|
try {
|
|
128
|
-
|
|
129
|
-
const { Pool } = await import('pg');
|
|
130
|
-
const pool = new Pool({
|
|
131
|
-
connectionString: neonConnectionString,
|
|
132
|
-
ssl: getSSLConfig(neonConnectionString),
|
|
133
|
-
});
|
|
134
|
-
const client = await pool.connect();
|
|
137
|
+
const client = await neonPool.connect();
|
|
135
138
|
try {
|
|
136
139
|
const result = await client.query(queryString, values);
|
|
137
140
|
return {
|
|
138
|
-
rows: result.rows,
|
|
141
|
+
rows: safeParseRevealDocuments(result.rows),
|
|
139
142
|
rowCount: result.rowCount || 0,
|
|
140
143
|
};
|
|
141
144
|
}
|
|
@@ -154,6 +157,7 @@ export function universalPostgresAdapter(config = {}) {
|
|
|
154
157
|
// CRITICAL: For Supabase transaction pooling (port 6543), we use pg library
|
|
155
158
|
// Transaction pooling works fine with pg - no special configuration needed
|
|
156
159
|
// Reference: https://supabase.com/docs/guides/database/connecting-to-postgres
|
|
160
|
+
// biome-ignore lint/style/noNonNullAssertion: non-electric providers throw above if connectionString is missing
|
|
157
161
|
const supabaseConnectionString = connectionString;
|
|
158
162
|
const isTransactionPooling = supabaseConnectionString.includes(':6543');
|
|
159
163
|
if (isTransactionPooling) {
|
|
@@ -169,7 +173,7 @@ export function universalPostgresAdapter(config = {}) {
|
|
|
169
173
|
try {
|
|
170
174
|
const result = await client.query(queryString, values);
|
|
171
175
|
return {
|
|
172
|
-
rows: result.rows,
|
|
176
|
+
rows: safeParseRevealDocuments(result.rows),
|
|
173
177
|
rowCount: result.rowCount || 0,
|
|
174
178
|
};
|
|
175
179
|
}
|
|
@@ -191,7 +195,7 @@ export function universalPostgresAdapter(config = {}) {
|
|
|
191
195
|
try {
|
|
192
196
|
const result = await client.query(queryString, values);
|
|
193
197
|
return {
|
|
194
|
-
rows: result.rows,
|
|
198
|
+
rows: safeParseRevealDocuments(result.rows),
|
|
195
199
|
rowCount: result.rowCount || 0,
|
|
196
200
|
};
|
|
197
201
|
}
|
|
@@ -219,7 +223,7 @@ export function universalPostgresAdapter(config = {}) {
|
|
|
219
223
|
queryFn = async (queryString, values = []) => {
|
|
220
224
|
const result = await db.query(queryString, values);
|
|
221
225
|
return {
|
|
222
|
-
rows: result.rows,
|
|
226
|
+
rows: safeParseRevealDocuments(result.rows),
|
|
223
227
|
rowCount: result.rowCount || 0,
|
|
224
228
|
};
|
|
225
229
|
};
|
|
@@ -227,6 +231,7 @@ export function universalPostgresAdapter(config = {}) {
|
|
|
227
231
|
}
|
|
228
232
|
default: {
|
|
229
233
|
// Generic PostgreSQL using pg (node-postgres)
|
|
234
|
+
// biome-ignore lint/style/noNonNullAssertion: non-electric providers throw above if connectionString is missing
|
|
230
235
|
const genericConnectionString = connectionString;
|
|
231
236
|
const { Pool } = await import('pg');
|
|
232
237
|
const pool = new Pool({
|
|
@@ -239,7 +244,7 @@ export function universalPostgresAdapter(config = {}) {
|
|
|
239
244
|
try {
|
|
240
245
|
const result = await client.query(queryString, values);
|
|
241
246
|
return {
|
|
242
|
-
rows: result.rows,
|
|
247
|
+
rows: safeParseRevealDocuments(result.rows),
|
|
243
248
|
rowCount: result.rowCount || 0,
|
|
244
249
|
};
|
|
245
250
|
}
|
package/dist/dataloader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataloader.d.ts","sourceRoot":"","sources":["../src/dataloader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"dataloader.d.ts","sourceRoot":"","sources":["../src/dataloader.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,UAAU,EACX,MAAM,kBAAkB,CAAC;AA0M1B,UAAU,kBAAmB,SAAQ,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC;IACjE,IAAI,EAAE,CAAC,IAAI,EAAE,iBAAiB,GAAG;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC5F;AAED,eAAO,MAAM,aAAa,GAAI,KAAK,aAAa,KAAG,kBAmBlD,CAAC;AA6CF,KAAK,kBAAkB,GAAG;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,mBAAmB,CAAC;IACpC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAAC;CACvE,CAAC;AACF,eAAO,MAAM,wBAAwB,GAAI,mJAatC,kBAAkB,KAAG,MAcpB,CAAC"}
|
package/dist/dataloader.js
CHANGED
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import DataLoader from 'dataloader';
|
|
2
2
|
import { isValidID } from './utils/isValidID.js';
|
|
3
|
-
const parseCacheKey = (value) =>
|
|
4
|
-
|
|
3
|
+
const parseCacheKey = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
return JSON.parse(value);
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
throw new Error(`DataLoader: malformed cache key (not valid JSON): ${value.slice(0, 120)}`);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const parseBatchKey = (value) => {
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(value);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
throw new Error(`DataLoader: malformed batch key (not valid JSON): ${value.slice(0, 120)}`);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
5
19
|
// RevealUI uses `dataloader` to solve the classic N+1 problem.
|
|
6
20
|
// We keep a list of all documents requested to be populated for any given request
|
|
7
21
|
// and then batch together documents within the same collection,
|
|
@@ -45,7 +45,7 @@ export declare class CircuitBreaker {
|
|
|
45
45
|
private lastSuccessTime?;
|
|
46
46
|
private stateChangedAt;
|
|
47
47
|
private resetTimer?;
|
|
48
|
-
|
|
48
|
+
protected config: Required<CircuitBreakerConfig>;
|
|
49
49
|
constructor(config?: CircuitBreakerConfig);
|
|
50
50
|
/**
|
|
51
51
|
* Execute function with circuit breaker
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"circuit-breaker.d.ts","sourceRoot":"","sources":["../../src/error-handling/circuit-breaker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"circuit-breaker.d.ts","sourceRoot":"","sources":["../../src/error-handling/circuit-breaker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAE3D,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO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E,MAAM,CAAA;KAAE,CAAC;CACnD,GACL,MAAM,OAAO,CAAC,CAAC,CAAC,CAUlB"}
|
|
@@ -11,9 +11,15 @@ const DEFAULT_CONFIG = {
|
|
|
11
11
|
resetTimeout: 30000,
|
|
12
12
|
volumeThreshold: 10,
|
|
13
13
|
errorFilter: () => true,
|
|
14
|
-
onStateChange: () => {
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
onStateChange: () => {
|
|
15
|
+
// No-op default — consumers override via config
|
|
16
|
+
},
|
|
17
|
+
onTrip: () => {
|
|
18
|
+
// No-op default — consumers override via config
|
|
19
|
+
},
|
|
20
|
+
onReset: () => {
|
|
21
|
+
// No-op default — consumers override via config
|
|
22
|
+
},
|
|
17
23
|
};
|
|
18
24
|
/**
|
|
19
25
|
* Circuit Breaker implementation
|
|
@@ -420,6 +426,8 @@ export class AdaptiveCircuitBreaker extends CircuitBreaker {
|
|
|
420
426
|
else if (errorRate > 0.5) {
|
|
421
427
|
this.adaptiveThreshold = Math.max(this.adaptiveThreshold - 1, 2);
|
|
422
428
|
}
|
|
429
|
+
// Sync adaptive threshold to parent config so it actually takes effect
|
|
430
|
+
this.config.failureThreshold = this.adaptiveThreshold;
|
|
423
431
|
}
|
|
424
432
|
/**
|
|
425
433
|
* Get error rate in window
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../src/error-handling/error-boundary.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../../src/error-handling/error-boundary.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGzD,MAAM,WAAW,SAAS;IACxB,cAAc,EAAE,MAAM,C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AAY,CAEpE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAI1E;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAKlF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAItE;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAEnE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAO5D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAStD"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Integrates with error tracking services (Sentry, Bugsnag, etc.)
|
|
5
5
|
*/
|
|
6
|
-
import type { ErrorInfo } from './error-boundary';
|
|
6
|
+
import type { ErrorInfo } from './error-boundary.js';
|
|
7
7
|
export interface ErrorReport {
|
|
8
8
|
error: Error;
|
|
9
9
|
errorInfo?: ErrorInfo;
|
|
@@ -141,11 +141,12 @@ export declare class ConsoleErrorReporter implements ErrorReporter {
|
|
|
141
141
|
addBreadcrumb(breadcrumb: Breadcrumb): void;
|
|
142
142
|
}
|
|
143
143
|
/**
|
|
144
|
-
*
|
|
144
|
+
* Logging-only error reporter (development / no external service)
|
|
145
|
+
*
|
|
146
|
+
* Logs errors via the internal logger. Replace with a real Sentry or
|
|
147
|
+
* Datadog integration when an external error-tracking service is needed.
|
|
145
148
|
*/
|
|
146
|
-
export declare class
|
|
147
|
-
private dsn;
|
|
148
|
-
constructor(dsn: string);
|
|
149
|
+
export declare class LoggingErrorReporter implements ErrorReporter {
|
|
149
150
|
captureError(error: Error, context?: Partial<ErrorReport>): void;
|
|
150
151
|
captureMessage(message: string, level?: ErrorLevel, context?: Partial<ErrorReport>): void;
|
|
151
152
|
setUser(_user: UserContext | null): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-reporter.d.ts","sourceRoot":"","sources":["../../src/error-handling/error-reporter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"error-reporter.d.ts","sourceRoot":"","sources":["../../src/error-handling/error-reporter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,KAAK,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,WAAW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AK,KAAG,OAAO;IAIxC;;OAEG;+BACwB,MAAM,EAAE,KAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,OAAO,CAAC;CAKlE,CAAC"}
|
|
@@ -260,57 +260,36 @@ export class ConsoleErrorReporter {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
/**
|
|
263
|
-
*
|
|
263
|
+
* Logging-only error reporter (development / no external service)
|
|
264
|
+
*
|
|
265
|
+
* Logs errors via the internal logger. Replace with a real Sentry or
|
|
266
|
+
* Datadog integration when an external error-tracking service is needed.
|
|
264
267
|
*/
|
|
265
|
-
export class
|
|
266
|
-
dsn;
|
|
267
|
-
constructor(dsn) {
|
|
268
|
-
this.dsn = dsn;
|
|
269
|
-
}
|
|
268
|
+
export class LoggingErrorReporter {
|
|
270
269
|
captureError(error, context) {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
error: error.message,
|
|
276
|
-
...context,
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
// In production, use actual Sentry SDK:
|
|
280
|
-
// Sentry.captureException(error, {
|
|
281
|
-
// contexts: context?.context,
|
|
282
|
-
// tags: context?.tags,
|
|
283
|
-
// user: context?.user,
|
|
284
|
-
// extra: context?.extra,
|
|
285
|
-
// })
|
|
270
|
+
logger.debug('[ErrorReporter] Error captured', {
|
|
271
|
+
error: error.message,
|
|
272
|
+
...context,
|
|
273
|
+
});
|
|
286
274
|
}
|
|
287
275
|
captureMessage(message, level, context) {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
// Sentry.captureMessage(message, level)
|
|
276
|
+
logger.debug('[ErrorReporter] Message captured', {
|
|
277
|
+
message,
|
|
278
|
+
level,
|
|
279
|
+
...context,
|
|
280
|
+
});
|
|
296
281
|
}
|
|
297
282
|
setUser(_user) {
|
|
298
|
-
//
|
|
283
|
+
// No-op — logging reporter only captures errors and messages
|
|
299
284
|
}
|
|
300
285
|
setContext(_context) {
|
|
301
|
-
//
|
|
286
|
+
// No-op — logging reporter only captures errors and messages
|
|
302
287
|
}
|
|
303
288
|
setTag(_key, _value) {
|
|
304
|
-
//
|
|
289
|
+
// No-op — logging reporter only captures errors and messages
|
|
305
290
|
}
|
|
306
291
|
addBreadcrumb(_breadcrumb) {
|
|
307
|
-
//
|
|
308
|
-
// timestamp: breadcrumb.timestamp,
|
|
309
|
-
// level: breadcrumb.level,
|
|
310
|
-
// category: breadcrumb.category,
|
|
311
|
-
// message: breadcrumb.message,
|
|
312
|
-
// data: breadcrumb.data,
|
|
313
|
-
// })
|
|
292
|
+
// No-op — logging reporter only captures errors and messages
|
|
314
293
|
}
|
|
315
294
|
}
|
|
316
295
|
/**
|
|
@@ -398,14 +377,20 @@ export function initializeErrorReporting(config) {
|
|
|
398
377
|
}
|
|
399
378
|
// Add sample rate filter
|
|
400
379
|
if (config.sampleRate && config.sampleRate < 1) {
|
|
401
|
-
errorReporter.addFilter(() =>
|
|
380
|
+
errorReporter.addFilter(() => {
|
|
381
|
+
const bytes = new Uint32Array(1);
|
|
382
|
+
crypto.getRandomValues(bytes);
|
|
383
|
+
return (bytes[0] ?? 0) / 0xffffffff < (config.sampleRate ?? 1);
|
|
384
|
+
});
|
|
402
385
|
}
|
|
403
386
|
// Add reporters
|
|
404
387
|
if (process.env.NODE_ENV === 'development') {
|
|
405
388
|
errorReporter.addReporter(new ConsoleErrorReporter());
|
|
406
389
|
}
|
|
407
390
|
if (config.dsn) {
|
|
408
|
-
|
|
391
|
+
// DSN is accepted for forward compatibility with external error services.
|
|
392
|
+
// Currently routes to LoggingErrorReporter (structured log output).
|
|
393
|
+
errorReporter.addReporter(new LoggingErrorReporter());
|
|
409
394
|
}
|
|
410
395
|
// Set up global error handlers
|
|
411
396
|
if (typeof window !== 'undefined') {
|