@mistriwork/engine 0.0.0-stage → 1.0.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +17 -2
- package/dist/adapters/adapter.d.ts +693 -0
- package/dist/adapters/adapter.js +444 -0
- package/dist/adapters/cache/cacheStore.d.ts +75 -0
- package/dist/adapters/cache/cacheStore.js +160 -0
- package/dist/adapters/cache/resp.d.ts +52 -0
- package/dist/adapters/cache/resp.js +237 -0
- package/dist/adapters/commands/canonicalJson.d.ts +19 -0
- package/dist/adapters/commands/canonicalJson.js +154 -0
- package/dist/adapters/connect.d.ts +29 -0
- package/dist/adapters/connect.js +40 -0
- package/dist/adapters/connectionBudget.d.ts +101 -0
- package/dist/adapters/connectionBudget.js +128 -0
- package/dist/adapters/dbLatency.d.ts +35 -0
- package/dist/adapters/dbLatency.js +79 -0
- package/dist/adapters/epochCache.d.ts +50 -0
- package/dist/adapters/epochCache.js +85 -0
- package/dist/adapters/http/egress.d.ts +48 -0
- package/dist/adapters/http/egress.js +175 -0
- package/dist/adapters/http/httpAdapter.d.ts +71 -0
- package/dist/adapters/http/httpAdapter.js +512 -0
- package/dist/adapters/http/httpDescription.d.ts +32 -0
- package/dist/adapters/http/httpDescription.js +246 -0
- package/dist/adapters/http/openapi.d.ts +98 -0
- package/dist/adapters/http/openapi.js +487 -0
- package/dist/adapters/layoutRefusal.d.ts +24 -0
- package/dist/adapters/layoutRefusal.js +35 -0
- package/dist/adapters/net/networkPolicy.d.ts +44 -0
- package/dist/adapters/net/networkPolicy.js +123 -0
- package/dist/adapters/net/untrustedDatabase.d.ts +18 -0
- package/dist/adapters/net/untrustedDatabase.js +120 -0
- package/dist/adapters/poolAdmission.d.ts +43 -0
- package/dist/adapters/poolAdmission.js +184 -0
- package/dist/adapters/poolMetrics.d.ts +121 -0
- package/dist/adapters/poolMetrics.js +185 -0
- package/dist/adapters/postgres.d.ts +436 -0
- package/dist/adapters/postgres.js +1890 -0
- package/dist/adapters/postgresCatalog.d.ts +96 -0
- package/dist/adapters/postgresCatalog.js +387 -0
- package/dist/adapters/postgresCatalogDigest.d.ts +30 -0
- package/dist/adapters/postgresCatalogDigest.js +87 -0
- package/dist/adapters/postgresCatalogRows.d.ts +62 -0
- package/dist/adapters/postgresCatalogRows.js +37 -0
- package/dist/adapters/postgresDates.d.ts +1 -0
- package/dist/adapters/postgresDates.js +39 -0
- package/dist/adapters/postgresMaintenance.d.ts +33 -0
- package/dist/adapters/postgresMaintenance.js +179 -0
- package/dist/adapters/postgresPool.d.ts +255 -0
- package/dist/adapters/postgresPool.js +838 -0
- package/dist/adapters/postgresPooler.d.ts +28 -0
- package/dist/adapters/postgresPooler.js +267 -0
- package/dist/adapters/postgresReadCatalog.d.ts +31 -0
- package/dist/adapters/postgresReadCatalog.js +226 -0
- package/dist/adapters/postgresReadSnapshot.d.ts +46 -0
- package/dist/adapters/postgresReadSnapshot.js +133 -0
- package/dist/adapters/postgresSchemaEpoch.d.ts +24 -0
- package/dist/adapters/postgresSchemaEpoch.js +149 -0
- package/dist/adapters/postgresTransactionHandle.d.ts +173 -0
- package/dist/adapters/postgresTransactionHandle.js +524 -0
- package/dist/adapters/postgresValues.d.ts +30 -0
- package/dist/adapters/postgresValues.js +75 -0
- package/dist/adapters/replicas.d.ts +70 -0
- package/dist/adapters/replicas.js +208 -0
- package/dist/adapters/reservedSql.d.ts +38 -0
- package/dist/adapters/reservedSql.js +264 -0
- package/dist/adapters/rolePrivileges.d.ts +17 -0
- package/dist/adapters/rolePrivileges.js +22 -0
- package/dist/adapters/scoped/keyRows.d.ts +65 -0
- package/dist/adapters/scoped/keyRows.js +173 -0
- package/dist/adapters/scoped/postgresScopeCatalog.d.ts +16 -0
- package/dist/adapters/scoped/postgresScopeCatalog.js +117 -0
- package/dist/adapters/scoped/scopedCommandOperations.d.ts +5 -0
- package/dist/adapters/scoped/scopedCommandOperations.js +48 -0
- package/dist/adapters/scoped/scopedReads.d.ts +20 -0
- package/dist/adapters/scoped/scopedReads.js +174 -0
- package/dist/adapters/scoped/scopedTransaction.d.ts +89 -0
- package/dist/adapters/scoped/scopedTransaction.js +303 -0
- package/dist/adapters/scoped/sqliteScopeCatalog.d.ts +16 -0
- package/dist/adapters/scoped/sqliteScopeCatalog.js +241 -0
- package/dist/adapters/scoped/updateGuard.d.ts +3 -0
- package/dist/adapters/scoped/updateGuard.js +40 -0
- package/dist/adapters/serverSettings.d.ts +45 -0
- package/dist/adapters/serverSettings.js +46 -0
- package/dist/adapters/sqlite.d.ts +262 -0
- package/dist/adapters/sqlite.js +1434 -0
- package/dist/adapters/sqliteCostlyReads.d.ts +33 -0
- package/dist/adapters/sqliteCostlyReads.js +49 -0
- package/dist/adapters/sqliteDecimals.d.ts +22 -0
- package/dist/adapters/sqliteDecimals.js +57 -0
- package/dist/adapters/sqliteHandles.d.ts +43 -0
- package/dist/adapters/sqliteHandles.js +143 -0
- package/dist/adapters/sqliteStatementProcess.d.ts +29 -0
- package/dist/adapters/sqliteStatementProcess.js +131 -0
- package/dist/adapters/statementControl.d.ts +34 -0
- package/dist/adapters/statementControl.js +90 -0
- package/dist/adapters/storeHost.d.ts +130 -0
- package/dist/adapters/storeHost.js +13 -0
- package/dist/adapters/telemetry/drivers.d.ts +21 -0
- package/dist/adapters/telemetry/drivers.js +321 -0
- package/dist/adapters/telemetry/metrics.d.ts +63 -0
- package/dist/adapters/telemetry/metrics.js +122 -0
- package/dist/adapters/telemetry/otlp.d.ts +12 -0
- package/dist/adapters/telemetry/otlp.js +320 -0
- package/dist/adapters/telemetry/otlpEncode.d.ts +48 -0
- package/dist/adapters/telemetry/otlpEncode.js +366 -0
- package/dist/adapters/telemetry/otlpEnv.d.ts +1 -0
- package/dist/adapters/telemetry/otlpEnv.js +12 -0
- package/dist/adapters/telemetry/serverTiming.d.ts +83 -0
- package/dist/adapters/telemetry/serverTiming.js +503 -0
- package/dist/adapters/telemetry/start.d.ts +10 -0
- package/dist/adapters/telemetry/start.js +25 -0
- package/dist/adapters/telemetry/statement.d.ts +16 -0
- package/dist/adapters/telemetry/statement.js +134 -0
- package/dist/adapters/telemetry/trace.d.ts +127 -0
- package/dist/adapters/telemetry/trace.js +295 -0
- package/dist/adapters/writeAhead.d.ts +27 -0
- package/dist/adapters/writeAhead.js +46 -0
- package/dist/adapters/writeAttribution.d.ts +18 -0
- package/dist/adapters/writeAttribution.js +23 -0
- package/dist/adapters/writeCapture.d.ts +73 -0
- package/dist/adapters/writeCapture.js +20 -0
- package/dist/adapters/writeLanes.d.ts +94 -0
- package/dist/adapters/writeLanes.js +232 -0
- package/dist/engine.d.ts +15 -0
- package/dist/engine.js +13 -0
- package/dist/server/auth/credentials.d.ts +61 -0
- package/dist/server/auth/credentials.js +260 -0
- package/dist/server/cacheService.d.ts +50 -0
- package/dist/server/cacheService.js +110 -0
- package/dist/server/cli/args.d.ts +176 -0
- package/dist/server/cli/args.js +342 -0
- package/dist/server/cli/bin.d.ts +5 -0
- package/dist/server/cli/bin.js +66 -0
- package/dist/server/cli/browser.d.ts +15 -0
- package/dist/server/cli/browser.js +37 -0
- package/dist/server/cli/config.d.ts +50 -0
- package/dist/server/cli/config.js +206 -0
- package/dist/server/cli/startup.d.ts +36 -0
- package/dist/server/cli/startup.js +128 -0
- package/dist/server/cli/startupOptions.d.ts +63 -0
- package/dist/server/cli/startupOptions.js +143 -0
- package/dist/server/cli/subcommand.d.ts +28 -0
- package/dist/server/cli/subcommand.js +32 -0
- package/dist/server/cli/usage.d.ts +13 -0
- package/dist/server/cli/usage.js +31 -0
- package/dist/server/clientHttp.d.ts +184 -0
- package/dist/server/clientHttp.js +700 -0
- package/dist/server/clientSurface.d.ts +128 -0
- package/dist/server/clientSurface.js +182 -0
- package/dist/server/columnGrants.d.ts +103 -0
- package/dist/server/columnGrants.js +730 -0
- package/dist/server/compileCache.d.ts +1 -0
- package/dist/server/compileCache.js +30 -0
- package/dist/server/config/locations.d.ts +1 -0
- package/dist/server/config/locations.js +15 -0
- package/dist/server/configPaths.d.ts +7 -0
- package/dist/server/configPaths.js +34 -0
- package/dist/server/configSections.d.ts +64 -0
- package/dist/server/configSections.js +72 -0
- package/dist/server/connectionRedaction.d.ts +30 -0
- package/dist/server/connectionRedaction.js +77 -0
- package/dist/server/connections.d.ts +353 -0
- package/dist/server/connections.js +978 -0
- package/dist/server/constraints.d.ts +82 -0
- package/dist/server/constraints.js +169 -0
- package/dist/server/demo.d.ts +9 -0
- package/dist/server/demo.js +554 -0
- package/dist/server/devclient.d.ts +108 -0
- package/dist/server/devclient.js +361 -0
- package/dist/server/evidence.d.ts +55 -0
- package/dist/server/evidence.js +323 -0
- package/dist/server/hiddenColumns.d.ts +32 -0
- package/dist/server/hiddenColumns.js +238 -0
- package/dist/server/http/baselineHeaders.d.ts +24 -0
- package/dist/server/http/baselineHeaders.js +12 -0
- package/dist/server/http/captured.d.ts +35 -0
- package/dist/server/http/captured.js +73 -0
- package/dist/server/http/clock.d.ts +1 -0
- package/dist/server/http/clock.js +14 -0
- package/dist/server/http/connectionSource.d.ts +4 -0
- package/dist/server/http/connectionSource.js +48 -0
- package/dist/server/http/context.d.ts +189 -0
- package/dist/server/http/context.js +11 -0
- package/dist/server/http/crawlerText.d.ts +15 -0
- package/dist/server/http/crawlerText.js +32 -0
- package/dist/server/http/dataRoutes.d.ts +88 -0
- package/dist/server/http/dataRoutes.js +137 -0
- package/dist/server/http/door.d.ts +57 -0
- package/dist/server/http/door.js +39 -0
- package/dist/server/http/exportRoute.d.ts +15 -0
- package/dist/server/http/exportRoute.js +320 -0
- package/dist/server/http/firstPaint.d.ts +108 -0
- package/dist/server/http/firstPaint.js +262 -0
- package/dist/server/http/httpOperationRoutes.d.ts +11 -0
- package/dist/server/http/httpOperationRoutes.js +50 -0
- package/dist/server/http/pageReads.d.ts +20 -0
- package/dist/server/http/pageReads.js +205 -0
- package/dist/server/http/pageRoutes.d.ts +39 -0
- package/dist/server/http/pageRoutes.js +291 -0
- package/dist/server/http/probes.d.ts +22 -0
- package/dist/server/http/probes.js +27 -0
- package/dist/server/http/rateLimit.d.ts +131 -0
- package/dist/server/http/rateLimit.js +351 -0
- package/dist/server/http/readRoutes.d.ts +9 -0
- package/dist/server/http/readRoutes.js +131 -0
- package/dist/server/http/readRouting.d.ts +20 -0
- package/dist/server/http/readRouting.js +80 -0
- package/dist/server/http/recordCompose.d.ts +67 -0
- package/dist/server/http/recordCompose.js +167 -0
- package/dist/server/http/recordWrites.d.ts +89 -0
- package/dist/server/http/recordWrites.js +298 -0
- package/dist/server/http/refusalReport.d.ts +38 -0
- package/dist/server/http/refusalReport.js +63 -0
- package/dist/server/http/reply.d.ts +130 -0
- package/dist/server/http/reply.js +394 -0
- package/dist/server/http/requestOrigin.d.ts +11 -0
- package/dist/server/http/requestOrigin.js +8 -0
- package/dist/server/http/router.d.ts +45 -0
- package/dist/server/http/router.js +22 -0
- package/dist/server/http/serverCore.d.ts +68 -0
- package/dist/server/http/serverCore.js +177 -0
- package/dist/server/http/traceRequest.d.ts +30 -0
- package/dist/server/http/traceRequest.js +224 -0
- package/dist/server/http/trust.d.ts +261 -0
- package/dist/server/http/trust.js +472 -0
- package/dist/server/http/writeRefusal.d.ts +33 -0
- package/dist/server/http/writeRefusal.js +24 -0
- package/dist/server/httpConnection.d.ts +49 -0
- package/dist/server/httpConnection.js +170 -0
- package/dist/server/impact.d.ts +55 -0
- package/dist/server/impact.js +47 -0
- package/dist/server/journal.d.ts +134 -0
- package/dist/server/journal.js +398 -0
- package/dist/server/keysetReadHttp.d.ts +52 -0
- package/dist/server/keysetReadHttp.js +85 -0
- package/dist/server/layouts.d.ts +49 -0
- package/dist/server/layouts.js +192 -0
- package/dist/server/migrate/cli.d.ts +55 -0
- package/dist/server/migrate/cli.js +517 -0
- package/dist/server/migrate/database.d.ts +37 -0
- package/dist/server/migrate/database.js +247 -0
- package/dist/server/migrate/desired.d.ts +76 -0
- package/dist/server/migrate/desired.js +292 -0
- package/dist/server/migrate/files.d.ts +34 -0
- package/dist/server/migrate/files.js +141 -0
- package/dist/server/migrate/flyway.d.ts +7 -0
- package/dist/server/migrate/flyway.js +69 -0
- package/dist/server/migrate/history.d.ts +70 -0
- package/dist/server/migrate/history.js +211 -0
- package/dist/server/migrate/runner.d.ts +100 -0
- package/dist/server/migrate/runner.js +409 -0
- package/dist/server/migrate/snapshot.d.ts +30 -0
- package/dist/server/migrate/snapshot.js +239 -0
- package/dist/server/migrate/target.d.ts +33 -0
- package/dist/server/migrate/target.js +82 -0
- package/dist/server/openapiDraft.d.ts +25 -0
- package/dist/server/openapiDraft.js +171 -0
- package/dist/server/operations/diagnostics.d.ts +101 -0
- package/dist/server/operations/diagnostics.js +284 -0
- package/dist/server/operations/requestMetrics.d.ts +33 -0
- package/dist/server/operations/requestMetrics.js +94 -0
- package/dist/server/packageVersion.d.ts +1 -0
- package/dist/server/packageVersion.js +11 -0
- package/dist/server/poolConfig.d.ts +34 -0
- package/dist/server/poolConfig.js +114 -0
- package/dist/server/product.d.ts +20 -0
- package/dist/server/product.js +12 -0
- package/dist/server/recordHistoryOperations.d.ts +39 -0
- package/dist/server/recordHistoryOperations.js +43 -0
- package/dist/server/recordWriteOperations.d.ts +111 -0
- package/dist/server/recordWriteOperations.js +329 -0
- package/dist/server/resourceReadHttp.d.ts +81 -0
- package/dist/server/resourceReadHttp.js +606 -0
- package/dist/server/resourceReadOperations.d.ts +147 -0
- package/dist/server/resourceReadOperations.js +452 -0
- package/dist/server/scaffoldMachine.d.ts +54 -0
- package/dist/server/scaffoldMachine.js +184 -0
- package/dist/server/seed/cli.d.ts +20 -0
- package/dist/server/seed/cli.js +164 -0
- package/dist/server/seed/lexicon.d.ts +26 -0
- package/dist/server/seed/lexicon.js +585 -0
- package/dist/server/seed/seed.d.ts +70 -0
- package/dist/server/seed/seed.js +779 -0
- package/dist/server/seed/words.d.ts +21 -0
- package/dist/server/seed/words.js +164 -0
- package/dist/server/serverRequests.d.ts +6 -0
- package/dist/server/serverRequests.js +33 -0
- package/dist/server/serverTimeouts.d.ts +33 -0
- package/dist/server/serverTimeouts.js +32 -0
- package/dist/server/shapeonly.d.ts +32 -0
- package/dist/server/shapeonly.js +110 -0
- package/dist/server/startupWarnings.d.ts +32 -0
- package/dist/server/startupWarnings.js +92 -0
- package/dist/shared/addressParams.d.ts +28 -0
- package/dist/shared/addressParams.js +47 -0
- package/dist/shared/appCards.d.ts +123 -0
- package/dist/shared/appCards.js +385 -0
- package/dist/shared/appComponents.d.ts +177 -0
- package/dist/shared/appComponents.js +422 -0
- package/dist/shared/appDocuments.d.ts +43 -0
- package/dist/shared/appDocuments.js +131 -0
- package/dist/shared/appEmbeds.d.ts +21 -0
- package/dist/shared/appEmbeds.js +24 -0
- package/dist/shared/appIcons.d.ts +28 -0
- package/dist/shared/appIcons.js +223 -0
- package/dist/shared/appLinks.d.ts +17 -0
- package/dist/shared/appLinks.js +124 -0
- package/dist/shared/appListColumns.d.ts +3 -0
- package/dist/shared/appListColumns.js +66 -0
- package/dist/shared/appLocale.d.ts +36 -0
- package/dist/shared/appLocale.js +86 -0
- package/dist/shared/appMessages.d.ts +44 -0
- package/dist/shared/appMessages.js +78 -0
- package/dist/shared/appNoun.d.ts +21 -0
- package/dist/shared/appNoun.js +32 -0
- package/dist/shared/autoBucket.d.ts +98 -0
- package/dist/shared/autoBucket.js +305 -0
- package/dist/shared/autoValues.d.ts +25 -0
- package/dist/shared/autoValues.js +25 -0
- package/dist/shared/breakdown.d.ts +228 -0
- package/dist/shared/breakdown.js +557 -0
- package/dist/shared/breakdowntext.d.ts +41 -0
- package/dist/shared/breakdowntext.js +400 -0
- package/dist/shared/builtInThemes.d.ts +2 -0
- package/dist/shared/builtInThemes.js +771 -0
- package/dist/shared/chartSeparation.d.ts +11 -0
- package/dist/shared/chartSeparation.js +58 -0
- package/dist/shared/clauses.d.ts +22 -0
- package/dist/shared/clauses.js +97 -0
- package/dist/shared/columnCaption.d.ts +16 -0
- package/dist/shared/columnCaption.js +90 -0
- package/dist/shared/commandFieldPath.d.ts +2 -0
- package/dist/shared/commandFieldPath.js +7 -0
- package/dist/shared/commandWire.d.ts +26 -0
- package/dist/shared/commandWire.js +41 -0
- package/dist/shared/computed.d.ts +161 -0
- package/dist/shared/computed.js +378 -0
- package/dist/shared/computedParse.d.ts +13 -0
- package/dist/shared/computedParse.js +278 -0
- package/dist/shared/computedValue.d.ts +47 -0
- package/dist/shared/computedValue.js +191 -0
- package/dist/shared/connection.d.ts +30 -0
- package/dist/shared/connection.js +1 -0
- package/dist/shared/csv.d.ts +20 -0
- package/dist/shared/csv.js +63 -0
- package/dist/shared/dashLayout.d.ts +30 -0
- package/dist/shared/dashLayout.js +132 -0
- package/dist/shared/dashboardAsks.d.ts +93 -0
- package/dist/shared/dashboardAsks.js +129 -0
- package/dist/shared/dashboardTrend.d.ts +20 -0
- package/dist/shared/dashboardTrend.js +50 -0
- package/dist/shared/declaredReferences.d.ts +50 -0
- package/dist/shared/declaredReferences.js +202 -0
- package/dist/shared/definedFields.d.ts +63 -0
- package/dist/shared/definedFields.js +103 -0
- package/dist/shared/definedValues.d.ts +63 -0
- package/dist/shared/definedValues.js +184 -0
- package/dist/shared/displayDefaults.d.ts +135 -0
- package/dist/shared/displayDefaults.js +529 -0
- package/dist/shared/dueDate.d.ts +6 -0
- package/dist/shared/dueDate.js +6 -0
- package/dist/shared/duration.d.ts +4 -0
- package/dist/shared/duration.js +23 -0
- package/dist/shared/fileBounds.d.ts +9 -0
- package/dist/shared/fileBounds.js +9 -0
- package/dist/shared/filter.d.ts +217 -0
- package/dist/shared/filter.js +305 -0
- package/dist/shared/firstPaint.d.ts +24 -0
- package/dist/shared/firstPaint.js +33 -0
- package/dist/shared/form.d.ts +21 -0
- package/dist/shared/form.js +25 -0
- package/dist/shared/formValues.d.ts +104 -0
- package/dist/shared/formValues.js +352 -0
- package/dist/shared/funnel.d.ts +45 -0
- package/dist/shared/funnel.js +108 -0
- package/dist/shared/httpOperations.d.ts +48 -0
- package/dist/shared/httpOperations.js +9 -0
- package/dist/shared/iconGlyphs.d.ts +4 -0
- package/dist/shared/iconGlyphs.js +151 -0
- package/dist/shared/iconWeights.d.ts +3 -0
- package/dist/shared/iconWeights.js +162 -0
- package/dist/shared/imageWidths.d.ts +32 -0
- package/dist/shared/imageWidths.js +38 -0
- package/dist/shared/keysetPage.d.ts +64 -0
- package/dist/shared/keysetPage.js +161 -0
- package/dist/shared/like.d.ts +20 -0
- package/dist/shared/like.js +29 -0
- package/dist/shared/listEmpty.d.ts +12 -0
- package/dist/shared/listEmpty.js +36 -0
- package/dist/shared/listFilters.d.ts +28 -0
- package/dist/shared/listFilters.js +84 -0
- package/dist/shared/listPresentations.d.ts +199 -0
- package/dist/shared/listPresentations.js +7 -0
- package/dist/shared/listQuestion.d.ts +52 -0
- package/dist/shared/listQuestion.js +137 -0
- package/dist/shared/lookPalettes.d.ts +62 -0
- package/dist/shared/lookPalettes.js +306 -0
- package/dist/shared/maskQuoted.d.ts +24 -0
- package/dist/shared/maskQuoted.js +48 -0
- package/dist/shared/mentionLabel.d.ts +19 -0
- package/dist/shared/mentionLabel.js +38 -0
- package/dist/shared/mentionLookup.d.ts +17 -0
- package/dist/shared/mentionLookup.js +64 -0
- package/dist/shared/menuCounts.d.ts +16 -0
- package/dist/shared/menuCounts.js +74 -0
- package/dist/shared/model.d.ts +79 -0
- package/dist/shared/model.js +153 -0
- package/dist/shared/money.d.ts +44 -0
- package/dist/shared/money.js +81 -0
- package/dist/shared/moneyEntry.d.ts +7 -0
- package/dist/shared/moneyEntry.js +27 -0
- package/dist/shared/mount.d.ts +118 -0
- package/dist/shared/mount.js +248 -0
- package/dist/shared/niceTicks.d.ts +26 -0
- package/dist/shared/niceTicks.js +50 -0
- package/dist/shared/order.d.ts +59 -0
- package/dist/shared/order.js +133 -0
- package/dist/shared/page.d.ts +135 -0
- package/dist/shared/page.js +1187 -0
- package/dist/shared/pageAnatomy.d.ts +99 -0
- package/dist/shared/pageAnatomy.js +370 -0
- package/dist/shared/pageConfig.d.ts +25 -0
- package/dist/shared/pageConfig.js +1308 -0
- package/dist/shared/pageEmptyActions.d.ts +12 -0
- package/dist/shared/pageEmptyActions.js +20 -0
- package/dist/shared/pageLayouts.d.ts +72 -0
- package/dist/shared/pageLayouts.js +205 -0
- package/dist/shared/pageModel.d.ts +785 -0
- package/dist/shared/pageModel.js +121 -0
- package/dist/shared/pagePaths.d.ts +180 -0
- package/dist/shared/pagePaths.js +869 -0
- package/dist/shared/pagePlans.d.ts +52 -0
- package/dist/shared/pagePlans.js +108 -0
- package/dist/shared/pageRoutes.d.ts +9 -0
- package/dist/shared/pageRoutes.js +9 -0
- package/dist/shared/query.d.ts +166 -0
- package/dist/shared/query.js +1302 -0
- package/dist/shared/queryDates.d.ts +12 -0
- package/dist/shared/queryDates.js +101 -0
- package/dist/shared/queryOperands.d.ts +99 -0
- package/dist/shared/queryOperands.js +131 -0
- package/dist/shared/reads.d.ts +103 -0
- package/dist/shared/reads.js +154 -0
- package/dist/shared/recordLabel.d.ts +51 -0
- package/dist/shared/recordLabel.js +123 -0
- package/dist/shared/recordReadKeys.d.ts +30 -0
- package/dist/shared/recordReadKeys.js +51 -0
- package/dist/shared/recordReads.d.ts +268 -0
- package/dist/shared/recordReads.js +368 -0
- package/dist/shared/recordview.d.ts +198 -0
- package/dist/shared/recordview.js +356 -0
- package/dist/shared/referenceModel.d.ts +58 -0
- package/dist/shared/referenceModel.js +194 -0
- package/dist/shared/refusal.d.ts +64 -0
- package/dist/shared/refusal.js +144 -0
- package/dist/shared/relatedCreate.d.ts +30 -0
- package/dist/shared/relatedCreate.js +162 -0
- package/dist/shared/resourceHttp.d.ts +464 -0
- package/dist/shared/resourceHttp.js +1 -0
- package/dist/shared/richText.d.ts +85 -0
- package/dist/shared/richText.js +305 -0
- package/dist/shared/rollups.d.ts +143 -0
- package/dist/shared/rollups.js +64 -0
- package/dist/shared/rowScope.d.ts +72 -0
- package/dist/shared/rowScope.js +376 -0
- package/dist/shared/runtimeTables.d.ts +44 -0
- package/dist/shared/runtimeTables.js +79 -0
- package/dist/shared/schema.d.ts +523 -0
- package/dist/shared/schema.js +627 -0
- package/dist/shared/schematext.d.ts +38 -0
- package/dist/shared/schematext.js +101 -0
- package/dist/shared/scopeCatalog.d.ts +29 -0
- package/dist/shared/scopeCatalog.js +468 -0
- package/dist/shared/servedApp.d.ts +681 -0
- package/dist/shared/servedApp.js +45 -0
- package/dist/shared/sessionLease.d.ts +34 -0
- package/dist/shared/sessionLease.js +3 -0
- package/dist/shared/shape.d.ts +55 -0
- package/dist/shared/shape.js +168 -0
- package/dist/shared/slug.d.ts +1 -0
- package/dist/shared/slug.js +12 -0
- package/dist/shared/sortText.d.ts +14 -0
- package/dist/shared/sortText.js +26 -0
- package/dist/shared/sqlRelation.d.ts +4 -0
- package/dist/shared/sqlRelation.js +8 -0
- package/dist/shared/sqlsaved.d.ts +44 -0
- package/dist/shared/sqlsaved.js +63 -0
- package/dist/shared/stitchedPaths.d.ts +27 -0
- package/dist/shared/stitchedPaths.js +38 -0
- package/dist/shared/structuredFilter.d.ts +22 -0
- package/dist/shared/structuredFilter.js +1 -0
- package/dist/shared/subtitlePath.d.ts +20 -0
- package/dist/shared/subtitlePath.js +24 -0
- package/dist/shared/suggest.d.ts +18 -0
- package/dist/shared/suggest.js +59 -0
- package/dist/shared/tableSizing.d.ts +4 -0
- package/dist/shared/tableSizing.js +9 -0
- package/dist/shared/tagLists.d.ts +57 -0
- package/dist/shared/tagLists.js +34 -0
- package/dist/shared/textRules.d.ts +54 -0
- package/dist/shared/textRules.js +133 -0
- package/dist/shared/theme.d.ts +94 -0
- package/dist/shared/theme.js +800 -0
- package/dist/shared/themeColor.d.ts +34 -0
- package/dist/shared/themeColor.js +109 -0
- package/dist/shared/themeFaces.d.ts +30 -0
- package/dist/shared/themeFaces.js +42 -0
- package/dist/shared/themeInk.d.ts +20 -0
- package/dist/shared/themeInk.js +52 -0
- package/dist/shared/themeLooks.d.ts +9 -0
- package/dist/shared/themeLooks.js +572 -0
- package/dist/shared/themeParts.d.ts +26 -0
- package/dist/shared/themeParts.js +71 -0
- package/dist/shared/themePartsCheck.d.ts +21 -0
- package/dist/shared/themePartsCheck.js +91 -0
- package/dist/shared/themePresets.d.ts +85 -0
- package/dist/shared/themePresets.js +139 -0
- package/dist/shared/themeRecipeWords.d.ts +156 -0
- package/dist/shared/themeRecipeWords.js +156 -0
- package/dist/shared/themeRecipes.d.ts +213 -0
- package/dist/shared/themeRecipes.js +234 -0
- package/dist/shared/themeResolve.d.ts +55 -0
- package/dist/shared/themeResolve.js +52 -0
- package/dist/shared/themeTokens.d.ts +107 -0
- package/dist/shared/themeTokens.js +116 -0
- package/dist/shared/themeType.d.ts +38 -0
- package/dist/shared/themeType.js +205 -0
- package/dist/shared/unitWord.d.ts +4 -0
- package/dist/shared/unitWord.js +37 -0
- package/dist/shared/view.d.ts +195 -0
- package/dist/shared/view.js +987 -0
- package/dist/shared/viewLabels.d.ts +47 -0
- package/dist/shared/viewLabels.js +459 -0
- package/dist/shared/viewPaths.d.ts +248 -0
- package/dist/shared/viewPaths.js +294 -0
- package/dist/shared/viewtext.d.ts +57 -0
- package/dist/shared/viewtext.js +282 -0
- package/dist/shared/vocabulary.d.ts +71 -0
- package/dist/shared/vocabulary.js +249 -0
- package/dist/shared/weekStart.d.ts +7 -0
- package/dist/shared/weekStart.js +36 -0
- package/mark.svg +1 -0
- package/package.json +261 -4
- package/schema/model.d.ts +298 -0
- package/schema/theme.d.ts +587 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Near-miss suggestions for error messages: "did you mean", and a list short
|
|
3
|
+
* enough to read. One copy, because the query language, view paths and the
|
|
4
|
+
* MCP argument check each grew their own edit distance.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Levenshtein distance, capped: names more than three characters apart in
|
|
8
|
+
* length score 99 without the table being built. Only ever used to suggest
|
|
9
|
+
* a near miss, where anything that far off is no suggestion at all.
|
|
10
|
+
*/
|
|
11
|
+
export function distance(a, b) {
|
|
12
|
+
if (Math.abs(a.length - b.length) > 3)
|
|
13
|
+
return 99;
|
|
14
|
+
const prev = Array.from({ length: b.length + 1 }, (_, i) => i);
|
|
15
|
+
for (let i = 1; i <= a.length; i++) {
|
|
16
|
+
let last = prev[0];
|
|
17
|
+
prev[0] = i;
|
|
18
|
+
for (let j = 1; j <= b.length; j++) {
|
|
19
|
+
const tmp = prev[j];
|
|
20
|
+
prev[j] = Math.min(prev[j] + 1, prev[j - 1] + 1, last + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
21
|
+
last = tmp;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return prev[b.length];
|
|
25
|
+
}
|
|
26
|
+
/** The candidate closest to `name` ignoring case, if one is within three edits. */
|
|
27
|
+
export function nearest(name, candidates) {
|
|
28
|
+
const near = candidates.map((c) => ({ c, d: apart(name.toLowerCase(), c.toLowerCase()) })).sort((a, b) => a.d - b.d)[0];
|
|
29
|
+
return near && near.d <= 3 ? near.c : undefined;
|
|
30
|
+
}
|
|
31
|
+
/* Two letters swapped is the commonest slip and two edits by the distance:
|
|
32
|
+
it ranks ahead of any one-letter change, so `lable` finds `label`, not
|
|
33
|
+
`table`. It never brings a name inside the three edits that was not. */
|
|
34
|
+
function apart(a, b) {
|
|
35
|
+
const d = distance(a, b);
|
|
36
|
+
return d === 2 && [...a].sort().join('') === [...b].sort().join('') ? 0.5 : d;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The refusal of a key its place does not take, after the place:
|
|
40
|
+
* `has no "lable". Did you mean "label"? It takes: …`, the caller ending the
|
|
41
|
+
* sentence. A key some other place takes (`homes`) is told where it belongs
|
|
42
|
+
* instead: it is spelled right and put in the wrong place. A key here one
|
|
43
|
+
* slip away still wins, since a typo is the likelier mistake.
|
|
44
|
+
*/
|
|
45
|
+
export function unknownKey(key, takes, homes = []) {
|
|
46
|
+
const found = nearest(key, takes);
|
|
47
|
+
const d = found === undefined ? Infinity : apart(key.toLowerCase(), found.toLowerCase());
|
|
48
|
+
/* Three edits is near for a long key and another word for a short one:
|
|
49
|
+
`sql` is not `all`, nor `when` `other`, nor `name` `base`. A slip, or less than half the shorter. */
|
|
50
|
+
const near = found !== undefined && (d <= 1 || d < Math.min(key.length, found.length) / 2) ? found : undefined;
|
|
51
|
+
const slip = near !== undefined && d <= 1;
|
|
52
|
+
const where = homes.length > 1 ? `${homes.slice(0, -1).join(', ')} or ${homes[homes.length - 1]}` : homes[0];
|
|
53
|
+
const hint = where && !slip ? ` "${key}" belongs ${where}.` : near ? ` Did you mean "${near}"?` : '';
|
|
54
|
+
return `has no "${key}".${hint} It takes: ${takes.join(', ')}`;
|
|
55
|
+
}
|
|
56
|
+
/** A short list for an error message; long lists help nobody. */
|
|
57
|
+
export function shortList(items) {
|
|
58
|
+
return items.length > 6 ? `${items.slice(0, 6).join(', ')}, …` : items.join(', ');
|
|
59
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type TableSizing = 'fit' | 'scroll';
|
|
2
|
+
export declare const TABLE_SIZINGS: readonly TableSizing[];
|
|
3
|
+
/** Omission preserves the renderer's fit default without rewriting authored config. */
|
|
4
|
+
export declare function parseTableSizing(value: unknown, at: string): TableSizing | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const TABLE_SIZINGS = ['fit', 'scroll'];
|
|
2
|
+
/** Omission preserves the renderer's fit default without rewriting authored config. */
|
|
3
|
+
export function parseTableSizing(value, at) {
|
|
4
|
+
if (value === undefined)
|
|
5
|
+
return undefined;
|
|
6
|
+
if (value !== 'fit' && value !== 'scroll')
|
|
7
|
+
throw new Error(`${at} has an invalid "sizing". Use "fit" or "scroll".`);
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A record's tags read like a column: `tags` in a list's `show` draws its
|
|
3
|
+
* chips, `filters: ['tags']` offers each tag as a choice, and the query
|
|
4
|
+
* language asks `tags has bug` or `tags has (bug, docs)` — any of them.
|
|
5
|
+
*
|
|
6
|
+
* Like a rollup (rollups.ts), the tags are never a column of the table. The
|
|
7
|
+
* App's catalog carries them beside the columns (`TableMeta.tags`, from the
|
|
8
|
+
* resource's `tags: { through, to, tone }`, appResourceRules.appTagRules), so
|
|
9
|
+
* an insert form, a plain read or an export of the table never names them,
|
|
10
|
+
* and only the view compiler writes them: the list as one JSON array per row
|
|
11
|
+
* through a correlated subquery, `has` as an EXISTS over the link rows. Both
|
|
12
|
+
* read the link and tag tables through the statement's own relations
|
|
13
|
+
* (rowScope.ts), so a row policy or a tenant scope on either narrows the tags
|
|
14
|
+
* exactly as it narrows a related list of them, and a reader whose catalog
|
|
15
|
+
* cannot see the link table or the tags is served none (the rule is resolved
|
|
16
|
+
* against the reader's catalog).
|
|
17
|
+
*/
|
|
18
|
+
import type { ColumnMeta } from './schema.js';
|
|
19
|
+
/** The name a record's tags are read by, in a path, a `show` and a filter. */
|
|
20
|
+
export declare const TAGS_COLUMN = "tags";
|
|
21
|
+
/** The type a record's tags carry where a column's would be: no column has it. */
|
|
22
|
+
export declare const TAGS_TYPE = "tags";
|
|
23
|
+
/** A record's tags as the catalog serves them and a view carries them: no request ever supplies one. */
|
|
24
|
+
export interface TagSet {
|
|
25
|
+
/** The link table's id. */
|
|
26
|
+
through: string;
|
|
27
|
+
/** The link column holding the record's key, and the record's column it points at. */
|
|
28
|
+
from: string;
|
|
29
|
+
key: string;
|
|
30
|
+
/** The tag table's id. */
|
|
31
|
+
to: string;
|
|
32
|
+
/** The link column holding the tag's key, and the tag's column it points at. */
|
|
33
|
+
via: string;
|
|
34
|
+
tagKey: string;
|
|
35
|
+
/** The tag's naming column: what a chip says and `has` compares. */
|
|
36
|
+
label: string;
|
|
37
|
+
/** The tag's tone column (good | warn | bad | info | neutral), where it has one. */
|
|
38
|
+
tone?: string;
|
|
39
|
+
}
|
|
40
|
+
/** A view's tags, keyed by path ('tags', or 'project_id.tags'): the set and the prefix of the record it hangs off. */
|
|
41
|
+
export interface TagPath extends TagSet {
|
|
42
|
+
on: string;
|
|
43
|
+
}
|
|
44
|
+
/** The tags read as a column: never written, never null (a record without tags has none). */
|
|
45
|
+
export declare function tagsColumnMeta(name?: string): ColumnMeta;
|
|
46
|
+
/** One tag as a cell draws it. */
|
|
47
|
+
interface TagChip {
|
|
48
|
+
label: string;
|
|
49
|
+
tone?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A row's tags as the database answered them: a JSON array of [label, tone]
|
|
53
|
+
* pairs, parsed already (PostgreSQL's json) or as text (SQLite).
|
|
54
|
+
* Sorted by label, so every engine's answer reads the same; anything else is no tags.
|
|
55
|
+
*/
|
|
56
|
+
export declare function tagChips(value: unknown): TagChip[];
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/** The name a record's tags are read by, in a path, a `show` and a filter. */
|
|
2
|
+
export const TAGS_COLUMN = 'tags';
|
|
3
|
+
/** The type a record's tags carry where a column's would be: no column has it. */
|
|
4
|
+
export const TAGS_TYPE = 'tags';
|
|
5
|
+
/** The tags read as a column: never written, never null (a record without tags has none). */
|
|
6
|
+
export function tagsColumnMeta(name = TAGS_COLUMN) {
|
|
7
|
+
return { name, type: TAGS_TYPE, nullable: false, primaryKey: false, writable: false };
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A row's tags as the database answered them: a JSON array of [label, tone]
|
|
11
|
+
* pairs, parsed already (PostgreSQL's json) or as text (SQLite).
|
|
12
|
+
* Sorted by label, so every engine's answer reads the same; anything else is no tags.
|
|
13
|
+
*/
|
|
14
|
+
export function tagChips(value) {
|
|
15
|
+
let list = value;
|
|
16
|
+
if (typeof list === 'string') {
|
|
17
|
+
try {
|
|
18
|
+
list = JSON.parse(list);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (!Array.isArray(list))
|
|
25
|
+
return [];
|
|
26
|
+
const chips = [];
|
|
27
|
+
for (const item of list) {
|
|
28
|
+
const [label, tone] = Array.isArray(item) ? item : [item];
|
|
29
|
+
if (label === null || label === undefined || label === '')
|
|
30
|
+
continue;
|
|
31
|
+
chips.push({ label: String(label), ...(typeof tone === 'string' && tone ? { tone } : {}) });
|
|
32
|
+
}
|
|
33
|
+
return chips.sort((a, b) => a.label.localeCompare(b.label));
|
|
34
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text rules on a column: how long a value may be and what form it takes,
|
|
3
|
+
* in the words a command's text input already uses (packages/mistri/schema/command.d.ts):
|
|
4
|
+
*
|
|
5
|
+
* text: { code: { pattern: '^[A-Z]{3}$', message: 'Three capital letters' }, name: { min: 2, max: 80 } }
|
|
6
|
+
*
|
|
7
|
+
* Two places say them. The App, on the resource (`text`), and the database
|
|
8
|
+
* itself: a `varchar(80)` holds at most 80 characters, and on PostgreSQL a
|
|
9
|
+
* `CHECK (char_length(name) >= 2)` or `CHECK (code ~ '^[A-Z]{3}$')` in that
|
|
10
|
+
* simple form says the rest (adapters read them into `ColumnMeta.text`). A
|
|
11
|
+
* schema-first App gets the database's words free; what the App says wins,
|
|
12
|
+
* key by key.
|
|
13
|
+
*
|
|
14
|
+
* The browser judges a value as it is typed and says the rule under the
|
|
15
|
+
* field; the server judges the stored row on every write (appValidation.ts),
|
|
16
|
+
* whichever door the write came through. Pure: both sides read this one
|
|
17
|
+
* judgement, so they cannot disagree about what "at least 2" counts.
|
|
18
|
+
*/
|
|
19
|
+
import { type ColumnMeta } from './schema.js';
|
|
20
|
+
/** A column's rule: fewest and most characters, a regular expression the whole value matches, and what to say. */
|
|
21
|
+
export interface TextRule {
|
|
22
|
+
/** Fewest characters, after trimming. */
|
|
23
|
+
min?: number;
|
|
24
|
+
/** Most characters. */
|
|
25
|
+
max?: number;
|
|
26
|
+
/** A regular expression the whole value must match, as its source text. */
|
|
27
|
+
pattern?: string;
|
|
28
|
+
/** What the form says when the rule is not met; a generic sentence otherwise. */
|
|
29
|
+
message?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Which part of a rule a value breaks. */
|
|
32
|
+
type TextRuleBreak = 'min' | 'max' | 'pattern';
|
|
33
|
+
/**
|
|
34
|
+
* `resources.<name>.text`, read: an object of the resource's own columns, each
|
|
35
|
+
* { min?, max?, pattern?, message? } with something to check. Throws the
|
|
36
|
+
* sentence the author reads.
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseTextRules(raw: unknown, at: string): Record<string, TextRule>;
|
|
39
|
+
/** Why a resource's text rules cannot run on this table, or undefined. Each must name a text column. */
|
|
40
|
+
export declare function textRulesProblem(rules: Readonly<Record<string, TextRule>>, columns: readonly ColumnMeta[], table: string): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The rule a column is held to: the database's (`ColumnMeta.text`) with the
|
|
43
|
+
* App's on top, key by key. Undefined where neither says anything.
|
|
44
|
+
*/
|
|
45
|
+
export declare function columnTextRule(column: Pick<ColumnMeta, 'text'>, authored?: TextRule): TextRule | undefined;
|
|
46
|
+
/** What a value breaks of its rule, or undefined. An empty value breaks nothing: whether one is needed is NOT NULL's to say. */
|
|
47
|
+
export declare function textRuleBreak(rule: TextRule, value: unknown): TextRuleBreak | undefined;
|
|
48
|
+
/** A column's catalog rule as the database states it, for `ColumnMeta.text`; undefined where it states none. */
|
|
49
|
+
export declare function catalogTextRule(parts: {
|
|
50
|
+
max?: number | null;
|
|
51
|
+
min?: number;
|
|
52
|
+
pattern?: string;
|
|
53
|
+
}): ColumnMeta['text'];
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text rules on a column: how long a value may be and what form it takes,
|
|
3
|
+
* in the words a command's text input already uses (packages/mistri/schema/command.d.ts):
|
|
4
|
+
*
|
|
5
|
+
* text: { code: { pattern: '^[A-Z]{3}$', message: 'Three capital letters' }, name: { min: 2, max: 80 } }
|
|
6
|
+
*
|
|
7
|
+
* Two places say them. The App, on the resource (`text`), and the database
|
|
8
|
+
* itself: a `varchar(80)` holds at most 80 characters, and on PostgreSQL a
|
|
9
|
+
* `CHECK (char_length(name) >= 2)` or `CHECK (code ~ '^[A-Z]{3}$')` in that
|
|
10
|
+
* simple form says the rest (adapters read them into `ColumnMeta.text`). A
|
|
11
|
+
* schema-first App gets the database's words free; what the App says wins,
|
|
12
|
+
* key by key.
|
|
13
|
+
*
|
|
14
|
+
* The browser judges a value as it is typed and says the rule under the
|
|
15
|
+
* field; the server judges the stored row on every write (appValidation.ts),
|
|
16
|
+
* whichever door the write came through. Pure: both sides read this one
|
|
17
|
+
* judgement, so they cannot disagree about what "at least 2" counts.
|
|
18
|
+
*/
|
|
19
|
+
import { columnKind } from './schema.js';
|
|
20
|
+
const TEXT_RULE_KEYS = ['min', 'max', 'pattern', 'message'];
|
|
21
|
+
/** The most characters a rule may name, as a command's text input. */
|
|
22
|
+
const TEXT_RULE_MOST = 16384;
|
|
23
|
+
const MESSAGE_MOST = 200;
|
|
24
|
+
const PATTERN_MOST = 500;
|
|
25
|
+
const IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
26
|
+
/** A pattern's source as a whole-value test, or undefined where JavaScript cannot read it. */
|
|
27
|
+
function wholePattern(source) {
|
|
28
|
+
try {
|
|
29
|
+
return new RegExp(`^(?:${source})$`, 'u');
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* `resources.<name>.text`, read: an object of the resource's own columns, each
|
|
37
|
+
* { min?, max?, pattern?, message? } with something to check. Throws the
|
|
38
|
+
* sentence the author reads.
|
|
39
|
+
*/
|
|
40
|
+
export function parseTextRules(raw, at) {
|
|
41
|
+
const shape = `${at} has a "text" that is not an object of the resource's own column → { min?, max?, pattern?, message? }, like text: { code: { pattern: '^[A-Z]{3}$' } }.`;
|
|
42
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw) || !Object.keys(raw).length)
|
|
43
|
+
throw new Error(shape);
|
|
44
|
+
const rules = {};
|
|
45
|
+
for (const [column, value] of Object.entries(raw)) {
|
|
46
|
+
const here = `${at}, text "${column}"`;
|
|
47
|
+
if (!IDENTIFIER.test(column))
|
|
48
|
+
throw new Error(`${here}: a text rule is keyed by the resource's own column, never a path.`);
|
|
49
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
50
|
+
throw new Error(shape);
|
|
51
|
+
const given = value;
|
|
52
|
+
const unknown = Object.keys(given).find((key) => !TEXT_RULE_KEYS.includes(key));
|
|
53
|
+
if (unknown)
|
|
54
|
+
throw new Error(`${here} has "${unknown}"; a text rule takes min, max, pattern and message.`);
|
|
55
|
+
const rule = {};
|
|
56
|
+
for (const key of ['min', 'max']) {
|
|
57
|
+
if (given[key] === undefined)
|
|
58
|
+
continue;
|
|
59
|
+
const n = given[key];
|
|
60
|
+
if (typeof n !== 'number' || !Number.isInteger(n) || n < 1 || n > TEXT_RULE_MOST) {
|
|
61
|
+
throw new Error(`${here}: "${key}" must be a whole number of characters from 1 to ${TEXT_RULE_MOST}.`);
|
|
62
|
+
}
|
|
63
|
+
rule[key] = n;
|
|
64
|
+
}
|
|
65
|
+
if (rule.min !== undefined && rule.max !== undefined && rule.min > rule.max)
|
|
66
|
+
throw new Error(`${here}: "min" is more than "max".`);
|
|
67
|
+
if (given.pattern !== undefined) {
|
|
68
|
+
const source = given.pattern;
|
|
69
|
+
if (typeof source !== 'string' || !source || source.length > PATTERN_MOST) {
|
|
70
|
+
throw new Error(`${here}: "pattern" must be a regular expression's source text, at most ${PATTERN_MOST} characters.`);
|
|
71
|
+
}
|
|
72
|
+
if (!wholePattern(source))
|
|
73
|
+
throw new Error(`${here}: "pattern" is not a regular expression JavaScript can read: ${source}`);
|
|
74
|
+
rule.pattern = source;
|
|
75
|
+
}
|
|
76
|
+
if (given.message !== undefined) {
|
|
77
|
+
if (typeof given.message !== 'string' || !given.message.trim() || given.message.length > MESSAGE_MOST) {
|
|
78
|
+
throw new Error(`${here}: "message" must be a sentence of 1 to ${MESSAGE_MOST} characters.`);
|
|
79
|
+
}
|
|
80
|
+
rule.message = given.message.trim();
|
|
81
|
+
}
|
|
82
|
+
if (rule.min === undefined && rule.max === undefined && rule.pattern === undefined) {
|
|
83
|
+
throw new Error(`${here} checks nothing; give it a "min", a "max" or a "pattern".`);
|
|
84
|
+
}
|
|
85
|
+
rules[column] = rule;
|
|
86
|
+
}
|
|
87
|
+
return rules;
|
|
88
|
+
}
|
|
89
|
+
/** Why a resource's text rules cannot run on this table, or undefined. Each must name a text column. */
|
|
90
|
+
export function textRulesProblem(rules, columns, table) {
|
|
91
|
+
for (const name of Object.keys(rules)) {
|
|
92
|
+
const column = columns.find((candidate) => candidate.name === name);
|
|
93
|
+
if (!column)
|
|
94
|
+
return `text "${name}": "${table}" has no column "${name}".`;
|
|
95
|
+
if (columnKind(column.type) !== 'text' || column.allowed?.length) {
|
|
96
|
+
return `text "${name}" is ${column.allowed?.length ? 'a vocabulary' : column.type || 'untyped'}; a text rule checks a text column.`;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The rule a column is held to: the database's (`ColumnMeta.text`) with the
|
|
103
|
+
* App's on top, key by key. Undefined where neither says anything.
|
|
104
|
+
*/
|
|
105
|
+
export function columnTextRule(column, authored) {
|
|
106
|
+
const rule = { ...(column.text ?? {}), ...(authored ?? {}) };
|
|
107
|
+
return rule.min === undefined && rule.max === undefined && rule.pattern === undefined ? undefined : rule;
|
|
108
|
+
}
|
|
109
|
+
/** Characters as a person counts them, and as `char_length` does: code points, not UTF-16 units. */
|
|
110
|
+
const length = (text) => [...text].length;
|
|
111
|
+
/** What a value breaks of its rule, or undefined. An empty value breaks nothing: whether one is needed is NOT NULL's to say. */
|
|
112
|
+
export function textRuleBreak(rule, value) {
|
|
113
|
+
if (typeof value !== 'string' || value === '')
|
|
114
|
+
return undefined;
|
|
115
|
+
if (rule.min !== undefined && length(value.trim()) < rule.min)
|
|
116
|
+
return 'min';
|
|
117
|
+
if (rule.max !== undefined && length(value) > rule.max)
|
|
118
|
+
return 'max';
|
|
119
|
+
if (rule.pattern !== undefined && !wholePattern(rule.pattern)?.test(value))
|
|
120
|
+
return 'pattern';
|
|
121
|
+
return undefined;
|
|
122
|
+
}
|
|
123
|
+
/** A column's catalog rule as the database states it, for `ColumnMeta.text`; undefined where it states none. */
|
|
124
|
+
export function catalogTextRule(parts) {
|
|
125
|
+
const rule = {};
|
|
126
|
+
if (typeof parts.max === 'number' && Number.isInteger(parts.max) && parts.max > 0)
|
|
127
|
+
rule.max = parts.max;
|
|
128
|
+
if (parts.min !== undefined && parts.min > 0)
|
|
129
|
+
rule.min = parts.min;
|
|
130
|
+
if (parts.pattern !== undefined)
|
|
131
|
+
rule.pattern = parts.pattern;
|
|
132
|
+
return Object.keys(rule).length ? rule : undefined;
|
|
133
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import type { ThemeDefinition, ThemePalette, ThemeRecipes } from '../../schema/theme.js';
|
|
2
|
+
import { type AppAccent } from './themePresets.js';
|
|
3
|
+
import { HEAT_TOP, heatTop } from './themeColor.js';
|
|
4
|
+
export { FONT_TOKENS, PALETTE_TOKENS, RADIUS_TOKENS, shapeTokens, THEME_BASES } from './themeTokens.js';
|
|
5
|
+
export type { ThemeBase, ThemeDefinition, ThemePalette, ThemePaletteVariant } from '../../schema/theme.js';
|
|
6
|
+
export declare function parseThemes(raw: unknown, where: string, key?: string): ThemeDefinition[] | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* What a theme's shape says that `check` warns of (theme-radius): a panel squarer than the controls it holds, its
|
|
9
|
+
* corner cutting under theirs. A round control is a pill, not a corner, so it is never measured against a panel.
|
|
10
|
+
*/
|
|
11
|
+
export declare function themeShapeWarnings(themes: readonly ThemeDefinition[]): string[];
|
|
12
|
+
/**
|
|
13
|
+
* What a theme's shadow says that `check` warns of (theme-shadow, the contract's C2): a shadow lighter than the ground
|
|
14
|
+
* it falls on, which draws a glow round a card or a menu rather than lifting it off the page — the edge the lift was
|
|
15
|
+
* for is lost. The theme still wears.
|
|
16
|
+
*/
|
|
17
|
+
export declare function themeShadowWarnings(themes: readonly ThemeDefinition[]): string[];
|
|
18
|
+
/**
|
|
19
|
+
* What a banded table's parts say that `check` warns of (theme-band, the contract's C13): a `status` or `tag` part
|
|
20
|
+
* given an opaque ground. Part rules live in the `theme` cascade layer, above the `look` layer's band, so the chip
|
|
21
|
+
* keeps its own ground on every other row and shows as a pale column. The author's color is not touched: a
|
|
22
|
+
* translucent ground lets the band through, and so does the default.
|
|
23
|
+
*/
|
|
24
|
+
export declare function themeBandWarnings(themes: readonly ThemeDefinition[]): string[];
|
|
25
|
+
/**
|
|
26
|
+
* What a theme's type says that `check` warns of (theme-type, the contract's C8): a role heavier than 700 whose face
|
|
27
|
+
* leads with a family the theme does not ship at that weight. design.md keeps titles at 700 or under for this: a
|
|
28
|
+
* heavier weight a family has no file for is drawn by the browser as a smeared 700, or resolves a book face to its
|
|
29
|
+
* Black cut, a masthead where a title was meant.
|
|
30
|
+
*/
|
|
31
|
+
export declare function themeTypeWarnings(themes: readonly ThemeDefinition[]): string[];
|
|
32
|
+
export declare function contrastRatio(a: string, b: string): number;
|
|
33
|
+
/**
|
|
34
|
+
* The least luminance ratio a field's fill may be from the ground and the surface it sits on, when the field draws
|
|
35
|
+
* no edge. 1.08:1 is Lintel's Hearth (a warm #eeede7 well on a #f7f6f2 page, 1.085, and on white, 1.173): the faintest
|
|
36
|
+
* field we ship that still reads as a well, and the faintest a calibrated laptop screen shows in daylight. Below it
|
|
37
|
+
* (white on #fcfbf8, 1.03) the field is gone. WCAG 1.4.11 asks 3:1 of a control's boundary unless it is identified
|
|
38
|
+
* some other way; the label stands over the field and the focus ring draws a 2px edge, which is that other way.
|
|
39
|
+
*/
|
|
40
|
+
export declare const EDGELESS_FIELD_DELTA = 1.08;
|
|
41
|
+
export { HEAT_TOP, heatTop };
|
|
42
|
+
/**
|
|
43
|
+
* The colours a platform component mixes from a theme's series and its ink rather than wears as a token: no pair of
|
|
44
|
+
* tokens is what it draws, so each is measured as drawn, and named by the series it comes from. A board card's
|
|
45
|
+
* category chip (TriageBoard.css: 45% of its series in the ink, except under the `strip` board, which says it in words, on a 13% tint of it over the card), a person's
|
|
46
|
+
* initials on their avatar (features.css: 45% in the ink, on a 15% tint over a 7% ink wash), and under the `icon`
|
|
47
|
+
* stat recipe, a stat card's mark (lumenLook.css: 80% in the ink on a 12% tint, a graphic at 3:1). `check` holds a
|
|
48
|
+
* theme to each, and `grade` names the series behind a reading of one.
|
|
49
|
+
*/
|
|
50
|
+
export declare function componentInks(palette: ThemePalette, recipes?: Partial<ThemeRecipes>): Array<{
|
|
51
|
+
role: keyof ThemePalette;
|
|
52
|
+
what: string;
|
|
53
|
+
fg: string;
|
|
54
|
+
bg: string;
|
|
55
|
+
needs: number;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* The pairs a role is read in (CONTRAST_PAIRS), measured with `value` drawn in its place: what an author wrote for a
|
|
59
|
+
* colour the page wears as another (a link written as the accent is drawn in the accent's ink), so the colour as
|
|
60
|
+
* written is held to the rule its role is.
|
|
61
|
+
*/
|
|
62
|
+
export declare function rolePairs(palette: ThemePalette, role: keyof ThemePalette, value: string): Array<{
|
|
63
|
+
background: keyof ThemePalette;
|
|
64
|
+
needs: number;
|
|
65
|
+
what?: string;
|
|
66
|
+
ratio: number;
|
|
67
|
+
}>;
|
|
68
|
+
/** One failed check: which theme, palette and mode, the role it is about, and the sentence for it. */
|
|
69
|
+
export interface ThemeFinding {
|
|
70
|
+
themeId: string;
|
|
71
|
+
paletteId: string;
|
|
72
|
+
mode: 'light' | 'dark';
|
|
73
|
+
/** The role (`accent`, `navMuted`, `chart3`); rolePath gives the spec's name for it (`nav.muted`, `chart[2]`). */
|
|
74
|
+
token: keyof ThemePalette;
|
|
75
|
+
/** What the check measures, in a few words: "accent on surface", "chart2 beside chart3 for deuteranopia". */
|
|
76
|
+
check: string;
|
|
77
|
+
ratio: number;
|
|
78
|
+
needs: number;
|
|
79
|
+
message: string;
|
|
80
|
+
}
|
|
81
|
+
export declare function themeWarnings(themes: readonly ThemeDefinition[], own?: {
|
|
82
|
+
accent?: AppAccent;
|
|
83
|
+
}): string[];
|
|
84
|
+
/** Every failed check of the themes; with `all`, every check measured, passed or not (a fix reads what it reaches). */
|
|
85
|
+
export declare function themeFindings(themes: readonly ThemeDefinition[], own?: {
|
|
86
|
+
accent?: AppAccent;
|
|
87
|
+
}, all?: boolean): ThemeFinding[];
|
|
88
|
+
/** Readers can select any offered look, so App-wide overrides are checked on
|
|
89
|
+
built-ins too. Without overrides retain the registered-theme warning scope. */
|
|
90
|
+
export declare function appThemeWarnings(themes: readonly ThemeDefinition[], own?: {
|
|
91
|
+
accent?: AppAccent;
|
|
92
|
+
radius?: string;
|
|
93
|
+
font?: string;
|
|
94
|
+
}): string[];
|