@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,11 @@
|
|
|
1
|
+
export declare function linear(hex: string): [number, number, number];
|
|
2
|
+
export declare function oklab([r, g, b]: readonly number[]): [number, number, number];
|
|
3
|
+
/** The first reader two series are too alike for, how far apart they are to them and what they need; undefined when
|
|
4
|
+
every reader tells them apart. The one measure: the check says it, and a suggested chart is proved by it. */
|
|
5
|
+
export declare function chartPairFailure(a: string, b: string): {
|
|
6
|
+
vision: string;
|
|
7
|
+
distance: number;
|
|
8
|
+
needs: number;
|
|
9
|
+
} | undefined;
|
|
10
|
+
/** Whether two series stay apart for every reader the chart check holds a palette to. */
|
|
11
|
+
export declare function chartsApart(a: string, b: string): boolean;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chart series apart for color-blind readers: the one measure `mistri check` holds an App's chart to
|
|
3
|
+
* (themeCheck.ts) and the built-in looks order their series by under each palette (lookPalettes.ts).
|
|
4
|
+
*/
|
|
5
|
+
/** Machado, Oliveira and Fernandes (2009) at full severity, in linear sRGB: the
|
|
6
|
+
two red-green deficiencies, about one man in twelve between them. Tritanopia
|
|
7
|
+
is rare enough (about 1 in 10,000) that it is not held against a palette. */
|
|
8
|
+
const DEFICIENCIES = {
|
|
9
|
+
protanopia: [
|
|
10
|
+
[0.152286, 1.052583, -0.204868],
|
|
11
|
+
[0.114503, 0.786281, 0.099216],
|
|
12
|
+
[-0.003882, -0.048116, 1.051998],
|
|
13
|
+
],
|
|
14
|
+
deuteranopia: [
|
|
15
|
+
[0.367322, 0.860646, -0.227968],
|
|
16
|
+
[0.280085, 0.672501, 0.047413],
|
|
17
|
+
[-0.01182, 0.04294, 0.968881],
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
/** Adjacent series, in OKLab ΔE ×100: at least 8 under each deficiency, and 10 to normal vision. */
|
|
21
|
+
const CHART_SEPARATION = { deficient: 8, normal: 10 };
|
|
22
|
+
export function linear(hex) {
|
|
23
|
+
return [1, 3, 5].map((start) => {
|
|
24
|
+
const value = parseInt(hex.slice(start, start + 2), 16) / 255;
|
|
25
|
+
return value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export function oklab([r, g, b]) {
|
|
29
|
+
const l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b), m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b), s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);
|
|
30
|
+
return [
|
|
31
|
+
0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
|
|
32
|
+
1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
|
|
33
|
+
0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
function simulate(color, matrix) {
|
|
37
|
+
return matrix.map((row) => Math.min(1, Math.max(0, row[0] * color[0] + row[1] * color[1] + row[2] * color[2])));
|
|
38
|
+
}
|
|
39
|
+
/** OKLab distance ×100 between two hex colors, as seen with the deficiency named or with normal vision. */
|
|
40
|
+
function chartDistance(a, b, deficiency) {
|
|
41
|
+
const see = (hex) => oklab(deficiency ? simulate(linear(hex), DEFICIENCIES[deficiency]) : linear(hex));
|
|
42
|
+
const x = see(a), y = see(b);
|
|
43
|
+
return 100 * Math.hypot(x[0] - y[0], x[1] - y[1], x[2] - y[2]);
|
|
44
|
+
}
|
|
45
|
+
/** The first reader two series are too alike for, how far apart they are to them and what they need; undefined when
|
|
46
|
+
every reader tells them apart. The one measure: the check says it, and a suggested chart is proved by it. */
|
|
47
|
+
export function chartPairFailure(a, b) {
|
|
48
|
+
const tests = [
|
|
49
|
+
['normal vision', chartDistance(a, b), CHART_SEPARATION.normal],
|
|
50
|
+
...Object.keys(DEFICIENCIES).map((kind) => [kind, chartDistance(a, b, kind), CHART_SEPARATION.deficient]),
|
|
51
|
+
];
|
|
52
|
+
const failed = tests.find(([, distance, needs]) => distance < needs);
|
|
53
|
+
return failed && { vision: failed[0], distance: failed[1], needs: failed[2] };
|
|
54
|
+
}
|
|
55
|
+
/** Whether two series stay apart for every reader the chart check holds a palette to. */
|
|
56
|
+
export function chartsApart(a, b) {
|
|
57
|
+
return !chartPairFailure(a, b);
|
|
58
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A query's trailing clauses, found by keyword: the client's chips take them
|
|
3
|
+
* off one at a time (client/clauses.js), and a list's question is built and
|
|
4
|
+
* read by them on both sides (listQuestion.ts).
|
|
5
|
+
*
|
|
6
|
+
* The split is by keyword, which the grammar makes safe: a query is a table,
|
|
7
|
+
* then conditions, then any of `show`, `sort`/`order by` and `limit` in that
|
|
8
|
+
* order. Only the trailing keywords are looked for, so a *value* containing
|
|
9
|
+
* the word "limit" cannot be mistaken for the clause — the boundary is found
|
|
10
|
+
* from the right, and only outside quotes.
|
|
11
|
+
*/
|
|
12
|
+
export { maskQuoted } from './maskQuoted.js';
|
|
13
|
+
/** A query's parts: its table, its conditions and each trailing clause it has, keyword and all. */
|
|
14
|
+
interface QueryParts {
|
|
15
|
+
table: string;
|
|
16
|
+
filter: string;
|
|
17
|
+
show?: string;
|
|
18
|
+
sort?: string;
|
|
19
|
+
limit?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Break a query into its table, filter and trailing clauses. */
|
|
22
|
+
export declare function splitQuery(text: unknown): QueryParts;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A query's trailing clauses, found by keyword: the client's chips take them
|
|
3
|
+
* off one at a time (client/clauses.js), and a list's question is built and
|
|
4
|
+
* read by them on both sides (listQuestion.ts).
|
|
5
|
+
*
|
|
6
|
+
* The split is by keyword, which the grammar makes safe: a query is a table,
|
|
7
|
+
* then conditions, then any of `show`, `sort`/`order by` and `limit` in that
|
|
8
|
+
* order. Only the trailing keywords are looked for, so a *value* containing
|
|
9
|
+
* the word "limit" cannot be mistaken for the clause — the boundary is found
|
|
10
|
+
* from the right, and only outside quotes.
|
|
11
|
+
*/
|
|
12
|
+
/** Trailing clause keywords, longest first so `order by` wins over `order`. */
|
|
13
|
+
const TAIL = [
|
|
14
|
+
{ key: 'limit', pattern: /\blimit\b/i },
|
|
15
|
+
{ key: 'sort', pattern: /\b(?:sort|order\s+by)\b/i },
|
|
16
|
+
{ key: 'show', pattern: /\bshow\b/i },
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Positions of characters that are inside a quoted value.
|
|
20
|
+
*
|
|
21
|
+
* `status = "sort code"` contains the word `sort` and does not contain a sort
|
|
22
|
+
* clause. Scanning for quotes first is what keeps the two apart.
|
|
23
|
+
*/
|
|
24
|
+
function quotedSpans(text) {
|
|
25
|
+
const spans = [];
|
|
26
|
+
let quote = null;
|
|
27
|
+
let start = 0;
|
|
28
|
+
for (let i = 0; i < text.length; i += 1) {
|
|
29
|
+
const c = text[i];
|
|
30
|
+
if (quote) {
|
|
31
|
+
if (c === '\\') {
|
|
32
|
+
i += 1;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (c === quote) {
|
|
36
|
+
spans.push([start, i]);
|
|
37
|
+
quote = null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else if (c === '"' || c === "'") {
|
|
41
|
+
quote = c;
|
|
42
|
+
start = i;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (quote)
|
|
46
|
+
spans.push([start, text.length]);
|
|
47
|
+
return spans;
|
|
48
|
+
}
|
|
49
|
+
const inside = (spans, at) => spans.some(([a, b]) => at > a && at < b);
|
|
50
|
+
/* The quote mask every scanner here reads through; the client imports it from this module. */
|
|
51
|
+
export { maskQuoted } from './maskQuoted.js';
|
|
52
|
+
/** Break a query into its table, filter and trailing clauses. */
|
|
53
|
+
export function splitQuery(text) {
|
|
54
|
+
const query = String(text ?? '').trim();
|
|
55
|
+
const spans = quotedSpans(query);
|
|
56
|
+
const firstSpace = query.search(/\s/);
|
|
57
|
+
const table = firstSpace < 0 ? query : query.slice(0, firstSpace);
|
|
58
|
+
let rest = firstSpace < 0 ? '' : query.slice(firstSpace + 1);
|
|
59
|
+
const offset = firstSpace + 1;
|
|
60
|
+
const parts = { table, filter: '' };
|
|
61
|
+
/* Boundaries are found first, then sorted by *position* — not peeled off in
|
|
62
|
+
grammar order.
|
|
63
|
+
|
|
64
|
+
Peeling assumed the clauses arrive in the order the grammar lists them. The
|
|
65
|
+
parser does not require that, and `customer limit 5 sort name` is a query
|
|
66
|
+
someone will type. Peeling `limit` first took everything from `limit` to
|
|
67
|
+
the end, so the sort clause was swallowed into it: the chip read "5 sort
|
|
68
|
+
name" and removing the limit removed the sort with it.
|
|
69
|
+
|
|
70
|
+
The last occurrence of each keyword wins, because a clause word can appear
|
|
71
|
+
earlier as an unquoted value; quoted ones are excluded outright. */
|
|
72
|
+
const marks = [];
|
|
73
|
+
for (const { key, pattern } of TAIL) {
|
|
74
|
+
let at = -1;
|
|
75
|
+
let from = 0;
|
|
76
|
+
for (;;) {
|
|
77
|
+
const found = rest.slice(from).search(pattern);
|
|
78
|
+
if (found < 0)
|
|
79
|
+
break;
|
|
80
|
+
const absolute = from + found;
|
|
81
|
+
if (!inside(spans, offset + absolute))
|
|
82
|
+
at = absolute;
|
|
83
|
+
from = absolute + 1;
|
|
84
|
+
}
|
|
85
|
+
if (at >= 0)
|
|
86
|
+
marks.push({ key, at });
|
|
87
|
+
}
|
|
88
|
+
marks.sort((a, b) => a.at - b.at);
|
|
89
|
+
marks.forEach(({ key, at }, i) => {
|
|
90
|
+
const until = marks[i + 1]?.at ?? rest.length;
|
|
91
|
+
parts[key] = rest.slice(at, until).trim();
|
|
92
|
+
});
|
|
93
|
+
if (marks.length)
|
|
94
|
+
rest = rest.slice(0, marks[0].at);
|
|
95
|
+
parts.filter = rest.trim();
|
|
96
|
+
return parts;
|
|
97
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type AppNoun } from './model.js';
|
|
2
|
+
import { type DatabaseSchema } from './schema.js';
|
|
3
|
+
/** The captions the App's resources give, by table id: `resources.<t>.labels`, column or label path → word; and what a record is called. */
|
|
4
|
+
type Captions = Readonly<Record<string, {
|
|
5
|
+
labels?: Record<string, string>;
|
|
6
|
+
noun?: AppNoun;
|
|
7
|
+
}>>;
|
|
8
|
+
/**
|
|
9
|
+
* The one rule for what a column is called, on a screen and in anything the
|
|
10
|
+
* server words for a person (a record's history, an import's headers): the
|
|
11
|
+
* resource's own caption, else the one the schema implies. The server and the
|
|
12
|
+
* client both read it here, so the history says "Customer" where the screen does.
|
|
13
|
+
* `check` warns (`restated`) on a caption this returns without being told.
|
|
14
|
+
*/
|
|
15
|
+
export declare function columnCaption(resources: Captions, schema: DatabaseSchema | null, tableId: string, path: string, contextPath?: string): string;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* What a column is called: the one naming rule the server (record history, imports, anything that names a column) and the client share. */
|
|
2
|
+
import { humanName } from './model.js';
|
|
3
|
+
import { headingOf, pluralOf, recordNoun } from './appNoun.js';
|
|
4
|
+
import { hasFilterOf } from './listFilters.js';
|
|
5
|
+
import { columnKind, findTable, labelColumn } from './schema.js';
|
|
6
|
+
const midSentence = (word) => (/^[A-Z][a-z]/.test(word) ? word.charAt(0).toLowerCase() + word.slice(1) : word);
|
|
7
|
+
/**
|
|
8
|
+
* A list's filter over the rows that point at its record (listFilters.ts),
|
|
9
|
+
* said by those rows: "Opportunity stage"; on a link table, the record its
|
|
10
|
+
* reference names ("Tag"); by one of their segments, "Has open opportunities".
|
|
11
|
+
*/
|
|
12
|
+
function hasCaption(resources, schema, tableId, has) {
|
|
13
|
+
const child = schema ? (findTable(schema, has.child) ?? schema.tables.find((table) => table.name === has.child)) : undefined;
|
|
14
|
+
const id = child?.id ?? has.child;
|
|
15
|
+
const noun = Object.hasOwn(resources, id) ? resources[id].noun : undefined;
|
|
16
|
+
const one = recordNoun(noun, child?.name ?? has.child);
|
|
17
|
+
if (child?.segments && Object.hasOwn(child.segments, has.asks)) {
|
|
18
|
+
return `Has ${midSentence(humanName(has.asks))} ${noun?.many ?? pluralOf(one)}`;
|
|
19
|
+
}
|
|
20
|
+
const caption = columnCaption(resources, schema, id, has.asks);
|
|
21
|
+
const reference = has.asks.includes('.') ? undefined : child?.columns.find((column) => column.name === has.asks)?.references;
|
|
22
|
+
if (reference && reference.table !== tableId)
|
|
23
|
+
return caption;
|
|
24
|
+
return `${headingOf(one)} ${midSentence(caption)}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The one rule for what a column is called, on a screen and in anything the
|
|
28
|
+
* server words for a person (a record's history, an import's headers): the
|
|
29
|
+
* resource's own caption, else the one the schema implies. The server and the
|
|
30
|
+
* client both read it here, so the history says "Customer" where the screen does.
|
|
31
|
+
* `check` warns (`restated`) on a caption this returns without being told.
|
|
32
|
+
*/
|
|
33
|
+
export function columnCaption(resources, schema, tableId, path, contextPath = '') {
|
|
34
|
+
const explicit = (table, column) => {
|
|
35
|
+
const labels = Object.hasOwn(resources, table) ? resources[table].labels : undefined;
|
|
36
|
+
if (!labels || !Object.hasOwn(labels, column))
|
|
37
|
+
return undefined;
|
|
38
|
+
return labels[column];
|
|
39
|
+
};
|
|
40
|
+
const named = explicit(tableId, path);
|
|
41
|
+
if (named)
|
|
42
|
+
return named;
|
|
43
|
+
const has = hasFilterOf(path);
|
|
44
|
+
if (has)
|
|
45
|
+
return hasCaption(resources, schema, tableId, has);
|
|
46
|
+
const tableAt = (parts) => {
|
|
47
|
+
let at = tableId;
|
|
48
|
+
for (const part of parts) {
|
|
49
|
+
const fk = schema?.foreignKeys.find((fk) => fk.from.table === at && fk.from.columns.length === 1 && fk.from.columns[0] === part);
|
|
50
|
+
if (!fk)
|
|
51
|
+
return undefined;
|
|
52
|
+
at = fk.to.table;
|
|
53
|
+
}
|
|
54
|
+
return at;
|
|
55
|
+
};
|
|
56
|
+
// A section already titled for a related record need not repeat that relationship on every field.
|
|
57
|
+
if (contextPath && path.startsWith(`${contextPath}.`)) {
|
|
58
|
+
const context = tableAt(contextPath.split('.'));
|
|
59
|
+
if (context)
|
|
60
|
+
return columnCaption(resources, schema, context, path.slice(contextPath.length + 1), '');
|
|
61
|
+
}
|
|
62
|
+
const parts = path.split('.');
|
|
63
|
+
const leaf = parts[parts.length - 1];
|
|
64
|
+
const owner = tableAt(parts.slice(0, -1));
|
|
65
|
+
const table = schema && owner ? findTable(schema, owner) : undefined;
|
|
66
|
+
if (parts.length > 1 && table && leaf === labelColumn(table)) {
|
|
67
|
+
return explicit(tableId, parts[0]) || humanName(parts[0].replace(/_(id|sku|code|key)$/, ''));
|
|
68
|
+
}
|
|
69
|
+
const inherited = owner && explicit(owner, leaf);
|
|
70
|
+
if (inherited)
|
|
71
|
+
return inherited;
|
|
72
|
+
const reference = table?.columns.find((col) => col.name === leaf)?.references;
|
|
73
|
+
if (reference && schema && owner) {
|
|
74
|
+
const target = findTable(schema, reference.table);
|
|
75
|
+
const naming = target && labelColumn(target);
|
|
76
|
+
const single = schema.foreignKeys.some((fk) => fk.from.table === owner && fk.from.columns.length === 1 && fk.from.columns[0] === leaf && fk.to.table === reference.table);
|
|
77
|
+
const projected = naming && single && explicit(owner, `${leaf}.${naming}`);
|
|
78
|
+
if (projected)
|
|
79
|
+
return projected;
|
|
80
|
+
}
|
|
81
|
+
if (reference)
|
|
82
|
+
return humanName(leaf.replace(/_id$/, ''));
|
|
83
|
+
// A moment is said by what happened: `ready_at` is "Ready", `due_on` "Due". The suffix is how SQL
|
|
84
|
+
// spells the type, not a word a person reads; a number or a flag named so keeps it.
|
|
85
|
+
const column = table?.columns.find((col) => col.name === leaf);
|
|
86
|
+
const kind = column && !column.flag ? columnKind(column.type ?? '') : undefined;
|
|
87
|
+
if ((kind === 'date' || kind === 'text') && /._(at|on)$/.test(leaf))
|
|
88
|
+
return humanName(leaf.replace(/_(at|on)$/, ''));
|
|
89
|
+
return humanName(leaf);
|
|
90
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The one spelling of a refusal's field path. It sits below the command
|
|
3
|
+
* runtime because the canonical JSON walk (adapters/commands/canonicalJson.ts),
|
|
4
|
+
* which the stores share, names a refused member by it too.
|
|
5
|
+
*/
|
|
6
|
+
/** A refusal's field path: `name`, `group.name` or `rows[1].name`, as deep as groups nest. */
|
|
7
|
+
export const COMMAND_FIELD_PATH = /^[A-Za-z_][A-Za-z0-9_]{0,127}(?:\[\d{1,3}\])?(?:\.[A-Za-z_][A-Za-z0-9_]{0,127}(?:\[\d{1,3}\])?){0,2}$/;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a command request and a date field carry, below the commands that use them: the most keys one request may
|
|
3
|
+
* name, one record's key as text, a served input's fields depth first, and an ISO calendar date. The kit's selection, composed reads and date picker read
|
|
4
|
+
* them as the App framework's commands do (command.ts re-exports them), so the cap and the key's spelling are one rule
|
|
5
|
+
* on both sides without the kit reaching into the command rules.
|
|
6
|
+
*/
|
|
7
|
+
import type { AppCommandField } from '../../schema/model.js';
|
|
8
|
+
/**
|
|
9
|
+
* A selection larger than one loaded page is a filter, not a selection. The
|
|
10
|
+
* most records a queue selects, and the most keys one multi-target command
|
|
11
|
+
* request may name: one constant, so the client cap and the server cap agree.
|
|
12
|
+
*/
|
|
13
|
+
export declare const BULK_LIMIT = 200;
|
|
14
|
+
/**
|
|
15
|
+
* One record's identity: its columns sorted, each value as text. `{ id: 1 }`
|
|
16
|
+
* and `{ id: "1" }` name the same row, so a target list may not carry both,
|
|
17
|
+
* and the client and the server match a refusal's key to a record by it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function commandKeyText(key: unknown): string;
|
|
20
|
+
/** An ISO calendar date, `YYYY-MM-DD`, that exists. */
|
|
21
|
+
export declare function isIsoDate(value: unknown): value is string;
|
|
22
|
+
/** Every field of a declaration, depth first, with the group path it sits under. */
|
|
23
|
+
export declare function commandFieldsDeep(fields: readonly AppCommandField[], within?: string): Generator<{
|
|
24
|
+
field: AppCommandField;
|
|
25
|
+
path: string;
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a command request and a date field carry, below the commands that use them: the most keys one request may
|
|
3
|
+
* name, one record's key as text, a served input's fields depth first, and an ISO calendar date. The kit's selection, composed reads and date picker read
|
|
4
|
+
* them as the App framework's commands do (command.ts re-exports them), so the cap and the key's spelling are one rule
|
|
5
|
+
* on both sides without the kit reaching into the command rules.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* A selection larger than one loaded page is a filter, not a selection. The
|
|
9
|
+
* most records a queue selects, and the most keys one multi-target command
|
|
10
|
+
* request may name: one constant, so the client cap and the server cap agree.
|
|
11
|
+
*/
|
|
12
|
+
export const BULK_LIMIT = 200;
|
|
13
|
+
/**
|
|
14
|
+
* One record's identity: its columns sorted, each value as text. `{ id: 1 }`
|
|
15
|
+
* and `{ id: "1" }` name the same row, so a target list may not carry both,
|
|
16
|
+
* and the client and the server match a refusal's key to a record by it.
|
|
17
|
+
*/
|
|
18
|
+
export function commandKeyText(key) {
|
|
19
|
+
if (!key || typeof key !== 'object' || Array.isArray(key))
|
|
20
|
+
return '';
|
|
21
|
+
const record = key;
|
|
22
|
+
return JSON.stringify(Object.keys(record)
|
|
23
|
+
.sort()
|
|
24
|
+
.map((column) => [column, String(record[column])]));
|
|
25
|
+
}
|
|
26
|
+
/** An ISO calendar date, `YYYY-MM-DD`, that exists. */
|
|
27
|
+
export function isIsoDate(value) {
|
|
28
|
+
if (typeof value !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(value))
|
|
29
|
+
return false;
|
|
30
|
+
const date = new Date(`${value}T00:00:00Z`);
|
|
31
|
+
return !Number.isNaN(date.getTime()) && date.toISOString().slice(0, 10) === value;
|
|
32
|
+
}
|
|
33
|
+
/** Every field of a declaration, depth first, with the group path it sits under. */
|
|
34
|
+
export function* commandFieldsDeep(fields, within = '') {
|
|
35
|
+
for (const item of fields) {
|
|
36
|
+
const path = within ? `${within}.${item.name}` : item.name;
|
|
37
|
+
yield { field: item, path };
|
|
38
|
+
if (item.type === 'group')
|
|
39
|
+
yield* commandFieldsDeep(item.fields, path);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Computed columns: a resource's virtual columns, each a typed expression over
|
|
3
|
+
* its own columns — `computed: { is_overdue: computed.boolean('due_on < today
|
|
4
|
+
* and not completed'), days_open: computed.number('today - opened_on') }`.
|
|
5
|
+
*
|
|
6
|
+
* A computed column is served like a rollup (rollups.ts): never a column of
|
|
7
|
+
* the table, so no insert, no update, no form and no single-table read ever
|
|
8
|
+
* names it; it lives beside the columns (`TableMeta.computed`), where the path
|
|
9
|
+
* resolver finds it by name, and the view compiler writes its expression into
|
|
10
|
+
* the statement wherever a path names it — a list's `show`, a sort, a tab's or
|
|
11
|
+
* an action's condition, a record page's fields, a dashboard's measure, an
|
|
12
|
+
* export. So it sorts, filters, tones and exports like a column, on every
|
|
13
|
+
* engine, with nothing for the browser to work out.
|
|
14
|
+
*
|
|
15
|
+
* Its words are the query language's: columns (and paths through a reference,
|
|
16
|
+
* as a record label's template reads them, `account_id.close_date`), numbers,
|
|
17
|
+
* quoted text, `true`/`false`, `today` and `now`, `me` (the signed-in
|
|
18
|
+
* account's email, as a fixed action's `set` writes it), comparisons,
|
|
19
|
+
* `and`/`or`/`not`, `in (…)`, `is empty`, arithmetic, and dates: a date minus a date is
|
|
20
|
+
* days, a date plus a number is that many days later, and a unit says others
|
|
21
|
+
* (`ends_on + term months`, `now - 30 minutes`). Five functions: `coalesce(a, b, …)`
|
|
22
|
+
* the first that has a value, `round(x)` and `round(x, 2)`, `abs(x)`, and
|
|
23
|
+
* `min(a, b, …)` and `max(a, b, …)` of numbers or dates, which have no value
|
|
24
|
+
* where one of theirs has none, as arithmetic has (`max(owed - paid, 0)`).
|
|
25
|
+
* That covers a due flag, an age, a renewal day, a balance.
|
|
26
|
+
* Anything heavier is a database view or a generated column, which the
|
|
27
|
+
* catalog reads as a column already.
|
|
28
|
+
*
|
|
29
|
+
* The constants are folded when the catalog is served (withComputed), each
|
|
30
|
+
* request's: `today` is the App's day in its time zone, `now` the instant,
|
|
31
|
+
* `me` this reader. A reader is served a computed column only where every
|
|
32
|
+
* column it reads is served to them, so a value never says what its inputs
|
|
33
|
+
* would not (appComputed.ts).
|
|
34
|
+
*/
|
|
35
|
+
import type { SqlStyle } from './filter.js';
|
|
36
|
+
import type { ColumnMeta, DatabaseSchema } from './schema.js';
|
|
37
|
+
export declare const COMPUTED_TYPES: readonly ['boolean', 'number', 'date'];
|
|
38
|
+
export type ComputedType = (typeof COMPUTED_TYPES)[number];
|
|
39
|
+
/** A span a date moves by: `3 days`, `term months`. */
|
|
40
|
+
export type ComputedUnit = ComputedSpan['unit'];
|
|
41
|
+
export type ComputedNode = {
|
|
42
|
+
k: 'path';
|
|
43
|
+
path: string;
|
|
44
|
+
} | {
|
|
45
|
+
k: 'number';
|
|
46
|
+
value: number;
|
|
47
|
+
} | {
|
|
48
|
+
k: 'text';
|
|
49
|
+
value: string;
|
|
50
|
+
} | {
|
|
51
|
+
k: 'bool';
|
|
52
|
+
value: boolean;
|
|
53
|
+
} | {
|
|
54
|
+
k: 'today';
|
|
55
|
+
} | {
|
|
56
|
+
k: 'now';
|
|
57
|
+
} | {
|
|
58
|
+
k: 'me';
|
|
59
|
+
} | {
|
|
60
|
+
k: 'date';
|
|
61
|
+
value: string;
|
|
62
|
+
} | {
|
|
63
|
+
k: 'instant';
|
|
64
|
+
value: string;
|
|
65
|
+
} | {
|
|
66
|
+
k: 'nobody';
|
|
67
|
+
} | {
|
|
68
|
+
k: 'not';
|
|
69
|
+
of: ComputedNode;
|
|
70
|
+
} | {
|
|
71
|
+
k: 'neg';
|
|
72
|
+
of: ComputedNode;
|
|
73
|
+
} | {
|
|
74
|
+
k: 'empty';
|
|
75
|
+
of: ComputedNode;
|
|
76
|
+
negate: boolean;
|
|
77
|
+
} | ComputedSpan | {
|
|
78
|
+
k: 'call';
|
|
79
|
+
fn: ComputedFunction;
|
|
80
|
+
args: ComputedNode[];
|
|
81
|
+
} | {
|
|
82
|
+
k: 'op';
|
|
83
|
+
op: ComputedOp;
|
|
84
|
+
left: ComputedNode;
|
|
85
|
+
right: ComputedNode;
|
|
86
|
+
};
|
|
87
|
+
/** The functions an expression may call (computedParse.ts COMPUTED_FUNCTIONS): each written alike on every engine and worked out alike in JavaScript. */
|
|
88
|
+
export type ComputedFunction = 'coalesce' | 'round' | 'min' | 'max' | 'abs';
|
|
89
|
+
interface ComputedSpan {
|
|
90
|
+
k: 'span';
|
|
91
|
+
of: ComputedNode;
|
|
92
|
+
unit: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
93
|
+
}
|
|
94
|
+
export type ComputedOp = '+' | '-' | '*' | '/' | '=' | '!=' | '<' | '<=' | '>' | '>=' | 'and' | 'or';
|
|
95
|
+
/** A computed column as a catalog serves it and a view carries it: no request ever supplies one. */
|
|
96
|
+
export interface ComputedColumn {
|
|
97
|
+
type: ComputedType;
|
|
98
|
+
expr: ComputedNode;
|
|
99
|
+
/** The paths it reads, from its own table: what a reader must be served for it to be. */
|
|
100
|
+
reads: string[];
|
|
101
|
+
}
|
|
102
|
+
/** A computed column a view names, keyed by its path in `ViewDef.expressions`, with the prefix of the record it is on. */
|
|
103
|
+
export interface ComputedPath extends ComputedColumn {
|
|
104
|
+
on: string;
|
|
105
|
+
}
|
|
106
|
+
/** What a computed column is to anything that reads columns: typed, never written, never a key. */
|
|
107
|
+
export declare function computedColumnMeta(name: string, computed: Pick<ComputedColumn, 'type'>): ColumnMeta;
|
|
108
|
+
/**
|
|
109
|
+
* The catalog with each table's computed columns among its columns, typed and never written (`computed` by table id):
|
|
110
|
+
* what a rule judged of a stored row reads one through (a validation, a form's value from a referenced record), where
|
|
111
|
+
* the figure is worked out once the row is read rather than by the statement that reads it.
|
|
112
|
+
*/
|
|
113
|
+
export declare function withComputedColumns(schema: DatabaseSchema, computed: ReadonlyMap<string, Readonly<Record<string, Pick<ComputedColumn, 'type'>>>>): DatabaseSchema;
|
|
114
|
+
export declare class ComputedError extends Error {
|
|
115
|
+
readonly at: number;
|
|
116
|
+
constructor(message: string, at: number);
|
|
117
|
+
}
|
|
118
|
+
/** Every path an expression reads, once each, in order. */
|
|
119
|
+
export declare function computedReads(node: ComputedNode): string[];
|
|
120
|
+
export type ValueKind = 'number' | 'date' | 'text' | 'boolean' | 'span' | 'null';
|
|
121
|
+
/**
|
|
122
|
+
* What an expression is, or why it is none: each column's kind from the
|
|
123
|
+
* catalog (`kindOf`), a date minus a date a number of days, a date plus a
|
|
124
|
+
* number or a span a date. Said in the author's words, with the character
|
|
125
|
+
* the mistake stands at where a word locates it.
|
|
126
|
+
*/
|
|
127
|
+
export declare function computedKind(node: ComputedNode, kindOf: (path: string) => ValueKind | undefined): ValueKind;
|
|
128
|
+
/** A statement that writes `now` was compiled where no request says the instant: a missing wrapper, not a bad definition,
|
|
129
|
+
* so a caller that turns compile errors into "not shown" lets this one through rather than keep the answer it would give. */
|
|
130
|
+
export declare class StatementInstantMissing extends Error {
|
|
131
|
+
}
|
|
132
|
+
/** Who says the instant a statement is written at (an ISO string), or undefined where nobody does. */
|
|
133
|
+
export declare function readStatementInstantFrom(read: () => string | undefined): void;
|
|
134
|
+
/** The expression with its constants as this request's values: the App's day, the instant, the reader. `keepNow`
|
|
135
|
+
* leaves the instant as written, for the statement to write as its request's (statementInstant, above). */
|
|
136
|
+
export declare function foldConstants(node: ComputedNode, values: {
|
|
137
|
+
today: string;
|
|
138
|
+
now: string;
|
|
139
|
+
me: string | null;
|
|
140
|
+
}, keepNow?: boolean): ComputedNode;
|
|
141
|
+
/**
|
|
142
|
+
* The expression as SQL on one engine. `column` writes a path the way the
|
|
143
|
+
* view writes every other (qualified against its joins); `kindOf` is the
|
|
144
|
+
* same reading of the catalog that typed it, which says where a yes-or-no
|
|
145
|
+
* column is an integer (SQLite, a PostgreSQL 0/1 flag).
|
|
146
|
+
*/
|
|
147
|
+
export declare function compileComputed(computed: Pick<ComputedColumn, 'type' | 'expr'>, style: SqlStyle, column: (path: string) => string, kindOf: (path: string) => {
|
|
148
|
+
kind: ValueKind;
|
|
149
|
+
native?: boolean;
|
|
150
|
+
} | undefined): string;
|
|
151
|
+
/** What an expression comes to: a figure, a yes-or-no, text, a calendar day or an instant; null for no value. */
|
|
152
|
+
export type ComputedValue = number | boolean | string | null | {
|
|
153
|
+
day: string;
|
|
154
|
+
} | {
|
|
155
|
+
instant: Date;
|
|
156
|
+
};
|
|
157
|
+
/** Whether an expression says the instant (`now`), so it comes to a moment rather than a day. */
|
|
158
|
+
export declare function readsNow(node: ComputedNode): boolean;
|
|
159
|
+
/** Whether an expression says the reader (`me`), so it comes to a different value for each. */
|
|
160
|
+
export declare function readsMe(node: ComputedNode): boolean;
|
|
161
|
+
export {};
|