@fayz-ai/core 0.28.0 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -6,13 +6,13 @@ import { eventBus, DATA_CHANGED_EVENT, resolveDataProvider } from './chunk-XJGV7
6
6
  export { CustomFieldsError, DATA_CHANGED_EVENT, DataError, FIELDS_TABLE, attachPersistentCache, bulkCreate, bulkRemove, cacheKeyFor, cachePrefixFor, clearCustomFieldsCache, countByTenant, createArchetypeProvider, createEventBus, createFayzApiProvider, createMockProvider, dataCall, dataQuery, emitDataChanged, eventBus, getActiveUnitId, getPersistentCache, invalidateCount, isKnownMissing, isUnitMode, localList, matchesDataChange, mergeCustomFields, registerDataTelemetry, rememberIfMissing, replicaKeyFor, resetActiveUnit, resetMissingObjects, resolveCustomFields, resolveDataProvider, setActiveUnitId, setUnitMode, subscribeActiveUnit, syncReplica, toDataError, useActiveUnitId, useDataChanged, useUnitMode, validateCustomFields, withCache, withOffline } from './chunk-XJGV7TWQ.js';
7
7
  import { getActiveTenantId, getSupabaseClientOptional } from './chunk-HVWFFFKN.js';
8
8
  export { DEFAULT_CACHE_TTL, applyRangeToQuery, applyUnitScope, clearGlobalCache, createCacheStore, createSupabaseProvider, getActiveTenantId, getScopedResource, getSupabaseClientOptional, globalCache, isFilterObject, matchesRange, parseRangeFilter, resolveUnitScope, setActiveTenantId, setGlobalSupabaseClient, setScopedResources, stableKey, subscribeActiveTenant, useActiveTenantId } from './chunk-HVWFFFKN.js';
9
- import { getBlock, checkNodePlacement, getScaffold } from './chunk-LLVL2QFF.js';
10
- export { BLOCK_SETTING_TYPES, PLUGIN_API_VERSION, PluginRuntimeProvider, auditBlocks, blockRegistry, buildEntityDomainEvents, checkAgainstSchema, checkBlockConstraints, checkBlockContext, checkNodePlacement, clearExtensionPoints, clearHandles, clearLoaders, componentRegistry, dataNeedKey, defaultPropsFromSettings, defineBlock, defineExtensionPoint, defineLoader, definePlugin, describeBlock, describeBlocks, describeExtensionPoints, describeLoaders, entityEventKey, extensionAfterHooks, extensionPointRegistry, formatSchemaIssues, getAnalyticsCards, getBlock, getBlockMeta, getComponent, getDashboardWidgets, getHandle, getMetric, getPage, getPlugin, getPluginFactory, getScaffold, getWidgetsForZone, handleNameFor, handleRegistry, hasExtensionPoint, hasHandle, hasLoader, isBlockEnabledOn, isLoaderParamRef, isLoaderPropRef, listBlocks, listExtensionHandlers, listExtensionPoints, listHandles, listLoaders, listMetrics, listPluginFactories, listPlugins, loaderRegistry, metricRegistry, pageRegistry, pluginFactoryRegistry, pluginRegistry, registerBlock, registerComponent, registerExtensionHandler, registerHandle, registerMetric, registerPage, registerPlugin, registerPluginFactory, registerScaffold, repairBlockTree, resolveHandle, resolveLoader, resolvePluginComponent, resolvePluginRuntime, runEscapeValve, runExtensionPoint, scaffoldRegistry, settingsToJsonSchema, summarizeBlockAudit, unregisterExtensionHandler, useConnectorsForPlugin, usePluginRuntime, usePluginRuntimeOptional } from './chunk-LLVL2QFF.js';
9
+ import { getBlock, checkNodePlacement, getScaffold } from './chunk-EQG4UY3X.js';
10
+ export { BLOCK_SETTING_TYPES, PLUGIN_API_VERSION, PluginRuntimeProvider, auditBlocks, blockRegistry, buildEntityDomainEvents, checkAgainstSchema, checkBlockConstraints, checkBlockContext, checkNodePlacement, clearExtensionPoints, clearHandles, clearLoaders, componentRegistry, dataNeedKey, defaultPropsFromSettings, defineBlock, defineExtensionPoint, defineLoader, definePlugin, describeBlock, describeBlocks, describeExtensionPoints, describeLoaders, entityEventKey, extensionAfterHooks, extensionPointRegistry, formatSchemaIssues, getAnalyticsCards, getBlock, getBlockMeta, getComponent, getDashboardWidgets, getHandle, getMetric, getPage, getPlugin, getPluginFactory, getScaffold, getWidgetsForZone, handleNameFor, handleRegistry, hasExtensionPoint, hasHandle, hasLoader, isBlockEnabledOn, isLoaderParamRef, isLoaderPropRef, listBlocks, listExtensionHandlers, listExtensionPoints, listHandles, listLoaders, listMetrics, listPluginFactories, listPlugins, loaderRegistry, metricRegistry, pageRegistry, pluginFactoryRegistry, pluginRegistry, registerBlock, registerComponent, registerExtensionHandler, registerHandle, registerMetric, registerPage, registerPlugin, registerPluginFactory, registerScaffold, repairBlockTree, resolveHandle, resolveLoader, resolvePluginComponent, resolvePluginRuntime, runEscapeValve, runExtensionPoint, scaffoldRegistry, settingsToJsonSchema, summarizeBlockAudit, unregisterExtensionHandler, useConnectorsForPlugin, usePluginRuntime, usePluginRuntimeOptional } from './chunk-EQG4UY3X.js';
11
11
  export { ENTITY_FIELD_TYPES, GENERIC_ENTITY_TABLE, RESERVED_ENTITY_FIELDS, Registry, clearCustomFieldsDeclarations, clearEntityDeclarations, customFieldsRegistry, declaredCustomFields, defineCustomFields, defineEntity, describeEntities, entityAdminForm, entityDeclarationRegistry, entityRecordSchema, hasCustomFieldsDeclaration, hasEntityDeclaration, isCustomId, listEntityDeclarations, resolveEntityDeclaration, validateEntityRecordData } from './chunk-EWKX4VUM.js';
12
12
  export { errorMessage } from './chunk-6TVRNKWW.js';
13
13
  export { clearEntityRegistry, deriveEntityKey, getAllEntities, getEntityByKey, registerEntity } from './chunk-CU64QI4A.js';
14
- import { getCurrentLocale } from './chunk-JI6ECETY.js';
15
- export { I18nProvider, coreTranslations, getCurrentLocale, mergeTranslations, preloadLocale, registerTranslations, resolveLocale, setCurrentLocale, setLocaleStore, tl, useI18nConfig, useTranslation } from './chunk-JI6ECETY.js';
14
+ import { getCurrentLocale } from './chunk-PZTYFXLY.js';
15
+ export { I18nProvider, coreTranslations, getCurrentLocale, mergeTranslations, preloadLocale, registerTranslations, resolveLocale, setCurrentLocale, setLocaleStore, tl, useI18nConfig, useTranslation } from './chunk-PZTYFXLY.js';
16
16
  export { defaultRouterAdapter, hashRouterAdapter, historyRouterAdapter, hostRouterAdapter, staticRouterAdapter, windowRouterAdapter } from './chunk-OXQGRJZT.js';
17
17
  export { FayzRuntimeError, createFayzRuntimeClient } from './chunk-7RTUHSKY.js';
18
18
  export { AGENT_ROLES } from './chunk-2UPIZTL3.js';
@@ -69,6 +69,15 @@ function createDebug(scope) {
69
69
  return logger;
70
70
  }
71
71
 
72
+ // src/lib/local-date.ts
73
+ var two = (n) => String(n).padStart(2, "0");
74
+ function localDateKey(d) {
75
+ return `${d.getFullYear()}-${two(d.getMonth() + 1)}-${two(d.getDate())}`;
76
+ }
77
+ function todayLocal() {
78
+ return localDateKey(/* @__PURE__ */ new Date());
79
+ }
80
+
72
81
  // src/types/plugins.ts
73
82
  var WidgetZone = {
74
83
  SIDEBAR_BEFORE_NAV: "shell.sidebar.before-nav",
@@ -2561,7 +2570,7 @@ function toTenantPluginBindings(config) {
2561
2570
  }
2562
2571
  function applyNavComposition(entries, nav) {
2563
2572
  const overrides = new Map(nav.map((n) => [n.key, n]));
2564
- return entries.filter((entry) => !overrides.get(entry.key)?.hidden).map((entry) => {
2573
+ const composed = entries.filter((entry) => !overrides.get(entry.key)?.hidden).map((entry) => {
2565
2574
  const override = overrides.get(entry.key);
2566
2575
  if (!override) return entry;
2567
2576
  return {
@@ -2570,7 +2579,9 @@ function applyNavComposition(entries, nav) {
2570
2579
  section: override.section ?? entry.section,
2571
2580
  position: override.position ?? entry.position
2572
2581
  };
2573
- }).sort((a, b) => (a.position ?? 999) - (b.position ?? 999));
2582
+ });
2583
+ if (!nav.some((n) => n.position != null)) return composed;
2584
+ return composed.sort((a, b) => (a.position ?? 999) - (b.position ?? 999));
2574
2585
  }
2575
2586
  var TENANT_OWNED_MANIFEST_KEYS = ["theme", "branding", "locale"];
2576
2587
  function applyAppConfigToManifest(manifest, config) {
@@ -3184,6 +3195,6 @@ function createPendingCommand(key, context) {
3184
3195
  };
3185
3196
  }
3186
3197
 
3187
- export { APP_ERROR_EVENT, BLOCK_PATH_ATTRIBUTE, BLOCK_TYPE_ATTRIBUTE, BR_COUNTRY_CALLING_CODE, BR_MATCH_SUFFIX_LENGTH, BlockChildren, BlockErrorBoundary, BlockRenderer, COUNTRIES, CURRENT_MANIFEST_VERSION, DEFAULT_COUNTRY, DEFAULT_LEAD_PADDING, DEFAULT_TRAIL_PADDING, EMPTY_APP_CONFIG, EVENT_LOG_TABLE, MAX_QUICK_REPLY_BUTTONS, MAX_TEMPLATE_VARIABLES, MESSAGE_TEMPLATES_TABLE, MIN_QUERY_LENGTH, PROVIDER_TEMPLATE_LANGUAGE, TENANT_OWNED_MANIFEST_KEYS, WidgetZone, absoluteUrl, app_manifest_schema_default as appManifestSchema, applyAppConfigToManifest, applyNavComposition, applySeo, blockEditorMode, brNationalNumber, brPhoneSuffixKey, breadcrumbJsonLd, buildCSV, buildSeoTags, callService, callServiceForTenant, clearErrorReporters, clearEventSinks, clearMessageDefaults, clearPostalCache, clearSearchCache, compileProviderTemplate, computeContractHash, createDebug, createEdgePostalProvider, createPendingCommand, createSafeDataProvider, createVendorReporter, createViaCepProvider, defineApp, digitsOf, downloadCSV, emitDomainEvent, exportCSV, fetchAppConfig, foldText, foldWithMap, formatCurrency, formatDate, formatDateTime, formatPostalCode, getActiveLocale, getBlockErrorVisibility, getCountry, getDefaultCurrency, getEventsWithoutMessages, getMessageDefaults, getPostalLookupProvider, highlightRanges, installGlobalErrorHandlers, invalidateAppConfig, isSearchIndexAvailable, isValidPostalCode, loadCritical, loadEventRuns, loadMessageOverrides, lookupPostalCode, maskDigitCount, maskPhone, migrateManifest, navHistoryBack, normalizeAppConfig, normalizeBrPhoneToE164, normalizeMessageActions, normalizePostalCode, normalizeQuery, onDomainEvent, onDomainEvents, organizationJsonLd, placementRuleApplies, positionalVariables, providerTemplateName, recordEventRun, recordNavigation, registerErrorReporter, registerEventSink, registerManifestMigration, registerMessageDefaults, renderApp, renderBlocks, renderMessageTemplate, reportAppError, reportDataError, resetErrorDedupe, resolveBackendEnv, resolveIntegrationSurface, resolveMessage, resolveMessages, routeModule, sampleEventPayload, scoreCandidate, searchEverything, seoOrigin, serializeManifest, serializeManifestWithHash, setBlockEditorMode, setBlockErrorVisibility, setDefaultCurrency, setPostalLookupProvider, setSearchIndexAvailable, shortHash, similarity, startEventLog, surfaceAllowsWrites, toTenantPluginBindings, unmaskPhone, useBlockPath, useDataVersion, useManifest, useNavHistoryStore, useNavReferrer, useOnDataChange, useOnEvent, useSeo, validateManifest };
3198
+ export { APP_ERROR_EVENT, BLOCK_PATH_ATTRIBUTE, BLOCK_TYPE_ATTRIBUTE, BR_COUNTRY_CALLING_CODE, BR_MATCH_SUFFIX_LENGTH, BlockChildren, BlockErrorBoundary, BlockRenderer, COUNTRIES, CURRENT_MANIFEST_VERSION, DEFAULT_COUNTRY, DEFAULT_LEAD_PADDING, DEFAULT_TRAIL_PADDING, EMPTY_APP_CONFIG, EVENT_LOG_TABLE, MAX_QUICK_REPLY_BUTTONS, MAX_TEMPLATE_VARIABLES, MESSAGE_TEMPLATES_TABLE, MIN_QUERY_LENGTH, PROVIDER_TEMPLATE_LANGUAGE, TENANT_OWNED_MANIFEST_KEYS, WidgetZone, absoluteUrl, app_manifest_schema_default as appManifestSchema, applyAppConfigToManifest, applyNavComposition, applySeo, blockEditorMode, brNationalNumber, brPhoneSuffixKey, breadcrumbJsonLd, buildCSV, buildSeoTags, callService, callServiceForTenant, clearErrorReporters, clearEventSinks, clearMessageDefaults, clearPostalCache, clearSearchCache, compileProviderTemplate, computeContractHash, createDebug, createEdgePostalProvider, createPendingCommand, createSafeDataProvider, createVendorReporter, createViaCepProvider, defineApp, digitsOf, downloadCSV, emitDomainEvent, exportCSV, fetchAppConfig, foldText, foldWithMap, formatCurrency, formatDate, formatDateTime, formatPostalCode, getActiveLocale, getBlockErrorVisibility, getCountry, getDefaultCurrency, getEventsWithoutMessages, getMessageDefaults, getPostalLookupProvider, highlightRanges, installGlobalErrorHandlers, invalidateAppConfig, isSearchIndexAvailable, isValidPostalCode, loadCritical, loadEventRuns, loadMessageOverrides, localDateKey, lookupPostalCode, maskDigitCount, maskPhone, migrateManifest, navHistoryBack, normalizeAppConfig, normalizeBrPhoneToE164, normalizeMessageActions, normalizePostalCode, normalizeQuery, onDomainEvent, onDomainEvents, organizationJsonLd, placementRuleApplies, positionalVariables, providerTemplateName, recordEventRun, recordNavigation, registerErrorReporter, registerEventSink, registerManifestMigration, registerMessageDefaults, renderApp, renderBlocks, renderMessageTemplate, reportAppError, reportDataError, resetErrorDedupe, resolveBackendEnv, resolveIntegrationSurface, resolveMessage, resolveMessages, routeModule, sampleEventPayload, scoreCandidate, searchEverything, seoOrigin, serializeManifest, serializeManifestWithHash, setBlockEditorMode, setBlockErrorVisibility, setDefaultCurrency, setPostalLookupProvider, setSearchIndexAvailable, shortHash, similarity, startEventLog, surfaceAllowsWrites, toTenantPluginBindings, todayLocal, unmaskPhone, useBlockPath, useDataVersion, useManifest, useNavHistoryStore, useNavReferrer, useOnDataChange, useOnEvent, useSeo, validateManifest };
3188
3199
  //# sourceMappingURL=index.js.map
3189
3200
  //# sourceMappingURL=index.js.map