react-semaphor 0.1.381 → 0.1.382

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.
Files changed (74) hide show
  1. package/DATA_APP_SDK.md +238 -0
  2. package/README.md +7 -0
  3. package/dist/analytics-protocol/index.cjs +1 -1
  4. package/dist/analytics-protocol/index.js +45 -41
  5. package/dist/brand-studio/index.cjs +1 -1
  6. package/dist/brand-studio/index.js +6 -6
  7. package/dist/chunks/analyze-result-contract-CtXfp3nv.js +1 -0
  8. package/dist/chunks/analyze-result-contract-DuhlklhI.js +102 -0
  9. package/dist/chunks/{braces-BT-ZyB-g.js → braces-CGi-YFZp.js} +1 -1
  10. package/dist/chunks/{braces-DOxxfERN.js → braces-CP8BEzl3.js} +1 -1
  11. package/dist/chunks/{calendar-preferences-dialog-Dsgs8WDv.js → calendar-preferences-dialog-CV4xF2Tp.js} +3 -3
  12. package/dist/chunks/{calendar-preferences-dialog-iZs8XqyH.js → calendar-preferences-dialog-rDDobeLo.js} +1 -1
  13. package/dist/chunks/catalog-field-grounding-Bnx-3tE0.js +1 -0
  14. package/dist/chunks/catalog-field-grounding-CJKAqtiC.js +100 -0
  15. package/dist/chunks/{dashboard-briefing-launcher-Coks66cV.js → dashboard-briefing-launcher-BT00MvGB.js} +5 -5
  16. package/dist/chunks/{dashboard-briefing-launcher-B5vPTl8P.js → dashboard-briefing-launcher-Dcbh-mjY.js} +1 -1
  17. package/dist/chunks/{dashboard-controls-BfkcnIdy.js → dashboard-controls-B6y7jkKO.js} +8 -8
  18. package/dist/chunks/{dashboard-controls-Dyqye6fh.js → dashboard-controls-CRqnPibB.js} +1 -1
  19. package/dist/chunks/{dashboard-json-DjXi4cI6.js → dashboard-json-CfIUG8k1.js} +3 -3
  20. package/dist/chunks/{dashboard-json-CV_LnO9x.js → dashboard-json-DEQqRR1x.js} +1 -1
  21. package/dist/chunks/{edit-dashboard-visual-DOW1Ap1N.js → edit-dashboard-visual-DMbf89xa.js} +5 -5
  22. package/dist/chunks/{edit-dashboard-visual-yinO0yU-.js → edit-dashboard-visual-wDOcHak3.js} +1 -1
  23. package/dist/chunks/{index-DlprYjr6.js → index-BAsWLkZ8.js} +169 -168
  24. package/dist/chunks/{index-CkoRCh3g.js → index-CrKxP9uF.js} +5 -5
  25. package/dist/chunks/{layout-grid-DTbOIOsE.js → layout-grid-BsKH3TgY.js} +1 -1
  26. package/dist/chunks/{layout-grid-DccceHv4.js → layout-grid-jJQUqDN9.js} +1 -1
  27. package/dist/chunks/operators-C8TxpM4C.js +48 -0
  28. package/dist/chunks/operators-DrTQsJXv.js +1 -0
  29. package/dist/chunks/{palette-SimHJELn.js → palette-9zLPGlj2.js} +1 -1
  30. package/dist/chunks/{palette-DCzLwqIw.js → palette-xU9Qt6bE.js} +1 -1
  31. package/dist/chunks/{save-D2O96E5A.js → save-8A_q6K4E.js} +1 -1
  32. package/dist/chunks/{save-zNVYH02T.js → save-DzciESDh.js} +1 -1
  33. package/dist/chunks/{source-identity-Dj3dryN9.js → source-identity-CN4xiyKJ.js} +5 -5
  34. package/dist/chunks/{switch-DMPsMpHW.js → switch-DArtNJZh.js} +292 -291
  35. package/dist/chunks/{switch-Jhyl63RF.js → switch-k7kj6NRg.js} +1 -1
  36. package/dist/chunks/{use-create-flow-overlay-state-r5JKyXU8.js → use-create-flow-overlay-state-BdG1DiSx.js} +4 -4
  37. package/dist/chunks/{use-create-flow-overlay-state-NsqFPwdB.js → use-create-flow-overlay-state-ipeaE65_.js} +1 -1
  38. package/dist/chunks/{validators-CtNmgsvG.js → validators-CHPH6ORs.js} +641 -498
  39. package/dist/chunks/validators-lWo8m0Q7.js +1 -0
  40. package/dist/dashboard/index.cjs +1 -1
  41. package/dist/dashboard/index.js +1 -1
  42. package/dist/dashboard-authoring/index.cjs +3 -3
  43. package/dist/dashboard-authoring/index.js +105 -92
  44. package/dist/data-app-builder/index.cjs +1 -1
  45. package/dist/data-app-builder/index.js +3 -3
  46. package/dist/data-app-sdk/index.cjs +1 -1
  47. package/dist/data-app-sdk/index.js +444 -380
  48. package/dist/data-app-sdk-adapters/index.cjs +1 -0
  49. package/dist/data-app-sdk-adapters/index.js +383 -0
  50. package/dist/data-app-sdk-validation/index.cjs +1 -1
  51. package/dist/data-app-sdk-validation/index.js +1073 -6
  52. package/dist/index.cjs +1 -1
  53. package/dist/index.js +7 -7
  54. package/dist/surfboard/index.cjs +1 -1
  55. package/dist/surfboard/index.js +2 -2
  56. package/dist/types/analytics-protocol.d.ts +58 -31
  57. package/dist/types/dashboard-assistant.d.ts +40 -15
  58. package/dist/types/dashboard-authoring.d.ts +36 -16
  59. package/dist/types/dashboard.d.ts +8 -8
  60. package/dist/types/data-app-builder.d.ts +35 -11
  61. package/dist/types/data-app-sdk-adapters.d.ts +733 -0
  62. package/dist/types/data-app-sdk-validation.d.ts +85 -25
  63. package/dist/types/data-app-sdk.d.ts +99 -155
  64. package/dist/types/main.d.ts +35 -11
  65. package/dist/types/shared.d.ts +8 -8
  66. package/dist/types/surfboard.d.ts +8 -8
  67. package/dist/types/types.d.ts +8 -8
  68. package/package.json +9 -2
  69. package/src/data-app-sdk/README.md +240 -0
  70. package/dist/chunks/catalog-field-grounding-8L9I0zdg.js +0 -1
  71. package/dist/chunks/catalog-field-grounding-BK4BX8sZ.js +0 -200
  72. package/dist/chunks/validation-BM3-ShHV.js +0 -1003
  73. package/dist/chunks/validation-BVpqRFar.js +0 -1
  74. package/dist/chunks/validators-jpoYhpHh.js +0 -1
@@ -1,4 +1,3 @@
1
- import { Context } from 'react';
2
1
  import { JSX } from 'react/jsx-runtime';
3
2
  import { ReactNode } from 'react';
4
3
 
@@ -37,7 +36,7 @@ export declare function defineSemaphorDataApp<TDefinition extends SemaphorDataAp
37
36
 
38
37
  export declare function defineSemaphorInput<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: SemaphorInputSpec<TValue>): SemaphorInputSpec<TValue>;
39
38
 
40
- export declare function hasSemaphorInputValue(value: unknown): boolean;
39
+ export declare function isSemaphorInputValueValidForOptions(value: SemaphorInputValue | undefined, options: SemaphorInputOption[] | undefined): boolean;
41
40
 
42
41
  declare type MatrixAxisLevelDescriptor = {
43
42
  instanceId: string;
@@ -358,25 +357,19 @@ declare type MatrixWarning = {
358
357
  severity?: 'info' | 'warning' | 'error';
359
358
  };
360
359
 
361
- export declare function normalizeSemaphorAnalysisPayload(payload: SemaphorAnalysisPayload | undefined | null): SemaphorAnalysisPayload;
362
-
363
- export declare function normalizeSemaphorAnalysisQueryOptions(value: unknown, options?: {
364
- pathPrefix?: string;
365
- validateTimezone?: SemaphorAnalysisTimezoneValidator;
366
- }): SemaphorAnalysisQueryOptionsValidationResult;
367
-
368
- export declare function normalizeSemaphorInputOptions(options?: Array<{
369
- label: string;
370
- value: SemaphorOptionValue;
371
- } | SemaphorOptionValue>): {
372
- label: string;
373
- value: SemaphorOptionValue;
374
- }[];
375
-
376
- export declare function readWindowRuntime(): SemaphorDataAppWindowRuntime | undefined;
377
-
378
360
  export declare const semaphor: {
361
+ source: {
362
+ semantic(spec: SemaphorSemanticSourceBuilderSpec): SemaphorSourceRef;
363
+ sql(spec: Omit<SemaphorSqlSourceBuilderSpec, "kind">): SemaphorSqlSourceBuilderSpec;
364
+ };
365
+ field: {
366
+ measure(name: string, spec?: SemaphorFieldBuilderSpec): SemaphorFieldWithRole<"measure">;
367
+ dimension(name: string, spec?: SemaphorFieldBuilderSpec): SemaphorFieldWithRole<"dimension">;
368
+ date(name: string, spec?: SemaphorFieldBuilderSpec): SemaphorFieldWithRole<"date">;
369
+ id(name: string, spec?: SemaphorFieldBuilderSpec): SemaphorFieldWithRole<"id">;
370
+ };
379
371
  filter<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: Omit<SemaphorFilterInputSpec<TValue>, "kind">): SemaphorFilterInputSpec<TValue>;
372
+ bindInput(input: SemaphorInputReference, binding: SemaphorBindInputSpec): SemaphorInputBindingReference;
380
373
  control<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: SemaphorControlBuilderSpec<TValue>): SemaphorControlInputSpec<TValue>;
381
374
  sqlParam<TValue extends SemaphorSqlParameterValue = SemaphorSqlParameterValue>(spec: SemaphorSqlParamInputSpec<TValue>): SemaphorControlInputSpec<TValue>;
382
375
  derivedField(spec: Omit<SemaphorDerivedFieldDefinition, "kind"> & {
@@ -444,20 +437,6 @@ export declare type SemaphorAnalysisQueryOptions = {
444
437
  calendarContext?: CalendarContext;
445
438
  };
446
439
 
447
- export declare type SemaphorAnalysisQueryOptionsValidationIssue = {
448
- code: 'invalid_analysis_option';
449
- message: string;
450
- path: string;
451
- };
452
-
453
- export declare type SemaphorAnalysisQueryOptionsValidationResult = {
454
- ok: true;
455
- analysisOptions?: SemaphorAnalysisQueryOptions;
456
- } | {
457
- ok: false;
458
- issues: SemaphorAnalysisQueryOptionsValidationIssue[];
459
- };
460
-
461
440
  export declare type SemaphorAnalysisQueryResult = SemaphorQueryState & SemaphorAnalysisPayload & {
462
441
  id?: string;
463
442
  intent?: SemaphorMetricIntent;
@@ -475,8 +454,6 @@ export declare type SemaphorAnalysisResultSet = {
475
454
  rowCount?: number;
476
455
  };
477
456
 
478
- export declare type SemaphorAnalysisTimezoneValidator = (tz: string) => string | null;
479
-
480
457
  declare type SemaphorAnalyticsDiagnosticAnsweredItem = {
481
458
  slotId?: string;
482
459
  queryId?: string;
@@ -543,7 +520,7 @@ declare type SemaphorAnalyticsExecutionResult = {
543
520
 
544
521
  declare type SemaphorAnalyticsExecutionStatus = 'answered' | 'partial' | 'failed';
545
522
 
546
- declare type SemaphorAnalyticsFieldRole = 'metric' | 'dateField' | 'dimension' | 'input' | 'source' | 'sql';
523
+ declare type SemaphorAnalyticsFieldRole = 'measure' | 'date' | 'dimension' | 'input' | 'source' | 'sql';
547
524
 
548
525
  export declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
549
526
 
@@ -573,7 +550,7 @@ declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';
573
550
 
574
551
  declare type SemaphorAnalyticsPopulation = {
575
552
  scope: 'filtered_query';
576
- metrics: Record<string, number | string | null>;
553
+ measures: Record<string, number | string | null>;
577
554
  };
578
555
 
579
556
  declare type SemaphorAnalyticsRepairHint = {
@@ -581,7 +558,7 @@ declare type SemaphorAnalyticsRepairHint = {
581
558
  message?: string;
582
559
  invalidField?: string;
583
560
  fieldRole?: SemaphorAnalyticsFieldRole;
584
- validMetricCandidates?: string[];
561
+ validMeasureCandidates?: string[];
585
562
  validDateCandidates?: string[];
586
563
  validDimensionCandidates?: string[];
587
564
  recommendedNextStep: string;
@@ -599,7 +576,7 @@ declare type SemaphorAnalyticsResultBase = {
599
576
  pagination?: SemaphorPaginationMetadata;
600
577
  };
601
578
 
602
- declare type SemaphorAnalyticsValidationCode = 'missing_source' | 'invalid_source_kind' | 'missing_semantic_domain' | 'missing_dataset_name' | 'missing_connection_id' | 'missing_table_name' | 'missing_sql' | 'missing_metric' | 'missing_record_fields' | 'missing_input_options_field' | 'invalid_metric' | 'invalid_metric_list' | 'invalid_date_field' | 'invalid_dimension' | 'invalid_metric_dimensions' | 'conflicting_sql' | 'sql_policy_violation' | 'unsupported_intent_for_adapter' | 'invalid_analytics_kind' | 'invalid_analytics_intent';
579
+ declare type SemaphorAnalyticsValidationCode = 'missing_source' | 'invalid_source_kind' | 'missing_semantic_domain' | 'missing_dataset_name' | 'missing_connection_id' | 'missing_table_name' | 'missing_sql' | 'missing_measure' | 'missing_record_fields' | 'missing_input_options_input_id' | 'missing_input_options_label_field' | 'missing_input_options_value_field' | 'invalid_input_options_dependencies' | 'invalid_input_options_population' | 'invalid_measure' | 'invalid_measure_list' | 'invalid_date_field' | 'invalid_dimension' | 'invalid_measure_dimensions' | 'conflicting_sql' | 'sql_policy_violation' | 'unsupported_intent_for_adapter' | 'invalid_analytics_kind' | 'invalid_analytics_intent';
603
580
 
604
581
  declare type SemaphorAnalyticsValidationIssue = SemaphorProtocolIssue & {
605
582
  code: SemaphorAnalyticsValidationCode | string;
@@ -627,6 +604,10 @@ export declare type SemaphorAppDerivedFieldsSpec = {
627
604
  derivedFields?: SemaphorDerivedFieldDefinition[];
628
605
  };
629
606
 
607
+ export declare type SemaphorBindInputSpec = Omit<SemaphorInputBinding, 'inputId'> & {
608
+ inputId?: string;
609
+ };
610
+
630
611
  declare type SemaphorCompiledQuery = {
631
612
  kind: 'config';
632
613
  queryId: string;
@@ -663,9 +644,7 @@ export declare type SemaphorControlInputSpec<TValue extends SemaphorInputValue =
663
644
  role: SemaphorControlRole;
664
645
  };
665
646
 
666
- export declare type SemaphorControlRole = 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
667
-
668
- export declare const SemaphorDataAppContext: Context<SemaphorDataAppRuntime>;
647
+ export declare type SemaphorControlRole = 'grain' | 'measure' | 'dimension' | 'aggregation' | 'sqlParam';
669
648
 
670
649
  export declare type SemaphorDataAppDefinition = {
671
650
  id?: string;
@@ -676,12 +655,6 @@ export declare type SemaphorDataAppDefinition = {
676
655
  views: SemaphorDataAppViewDefinition[];
677
656
  };
678
657
 
679
- export declare type SemaphorDataAppFieldCatalog = {
680
- source: SemaphorSourceRef;
681
- sourceAliases?: SemaphorSourceRef[];
682
- fields: SemaphorFieldRef[];
683
- };
684
-
685
658
  export declare function SemaphorDataAppProvider({ token, apiBaseUrl, executor, children, }: SemaphorDataAppProviderProps): JSX.Element;
686
659
 
687
660
  export declare type SemaphorDataAppProviderProps = SemaphorQueryExecutorContext & {
@@ -689,43 +662,6 @@ export declare type SemaphorDataAppProviderProps = SemaphorQueryExecutorContext
689
662
  children: ReactNode;
690
663
  };
691
664
 
692
- export declare type SemaphorDataAppQuerySpecEnvelope = {
693
- queryHook: 'useSemaphorQuery';
694
- spec: SemaphorQueryDefinition;
695
- };
696
-
697
- export declare type SemaphorDataAppQueryValidation = {
698
- queryHook: SemaphorDataAppQuerySpecEnvelope['queryHook'];
699
- queryId?: string;
700
- intent?: SemaphorAnalyticsIntent;
701
- diagnostics: SemaphorDataAppValidationDiagnostic[];
702
- executionResult: SemaphorAnalyticsExecutionResult;
703
- };
704
-
705
- export declare type SemaphorDataAppRuntime = SemaphorQueryExecutorContext & {
706
- executor?: SemaphorQueryExecutor;
707
- };
708
-
709
- export declare type SemaphorDataAppValidationDiagnostic = {
710
- severity: 'error' | 'warning';
711
- code: 'invalid_query_spec' | 'invalid_analytics_intent' | 'invalid_source_ref' | 'missing_field' | 'unsupported_input_filter_composition' | string;
712
- message: string;
713
- path?: string;
714
- queryHook?: SemaphorDataAppQuerySpecEnvelope['queryHook'];
715
- queryId?: string;
716
- intentId?: string;
717
- source?: SemaphorSourceRef;
718
- field?: SemaphorFieldRef;
719
- };
720
-
721
- export declare type SemaphorDataAppValidationResult = {
722
- ok: boolean;
723
- diagnostics: SemaphorDataAppValidationDiagnostic[];
724
- queries: SemaphorDataAppQueryValidation[];
725
- intents: SemaphorAnalyticsIntent[];
726
- executionResults: SemaphorAnalyticsExecutionResult[];
727
- };
728
-
729
665
  export declare type SemaphorDataAppViewDefinition<TQuery extends SemaphorQueryDefinition = SemaphorQueryDefinition> = {
730
666
  id: string;
731
667
  title?: string;
@@ -734,14 +670,6 @@ export declare type SemaphorDataAppViewDefinition<TQuery extends SemaphorQueryDe
734
670
  inputs?: SemaphorInputReference[];
735
671
  };
736
672
 
737
- declare type SemaphorDataAppWindowRuntime = {
738
- apiBaseUrl?: string;
739
- dataApiBaseUrl?: string;
740
- authToken?: null | {
741
- accessToken?: string;
742
- };
743
- };
744
-
745
673
  declare type SemaphorDerivedFieldAggregationBehavior = 'additive' | 'non_additive' | 'ratio_of_sums' | 'weighted' | 'pre_aggregated' | 'snapshot';
746
674
 
747
675
  declare type SemaphorDerivedFieldAggregationStrategy = 'default' | 'symmetric_aggregate' | 'aggregate_then_join' | 'weighted';
@@ -770,15 +698,9 @@ declare type SemaphorDerivedFieldInput = {
770
698
  kind: 'field';
771
699
  field: SemaphorFieldRef;
772
700
  aggregate?: SemaphorAggregateFunction;
773
- } | {
774
- kind: 'metric';
775
- metric: SemaphorFieldRef;
776
- } | {
777
- kind: 'dimension';
778
- dimension: SemaphorFieldRef;
779
701
  };
780
702
 
781
- declare type SemaphorDerivedFieldResultRole = 'measure' | 'group' | 'date' | 'id' | 'filter';
703
+ declare type SemaphorDerivedFieldResultRole = 'measure' | 'dimension' | 'date' | 'id' | 'unknown';
782
704
 
783
705
  declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
784
706
 
@@ -797,6 +719,8 @@ declare type SemaphorExplorerSourceRef = Extract<SemaphorSourceRef, {
797
719
  kind: 'physical';
798
720
  }>;
799
721
 
722
+ export declare type SemaphorFieldBuilderSpec = Omit<SemaphorFieldRef, 'name' | 'role'>;
723
+
800
724
  export declare type SemaphorFieldRef = {
801
725
  name: string;
802
726
  label?: string;
@@ -806,10 +730,15 @@ export declare type SemaphorFieldRef = {
806
730
  aggregate?: SemaphorAggregateFunction;
807
731
  };
808
732
 
733
+ declare type SemaphorFieldWithRole<TRole extends NonNullable<SemaphorFieldRef['role']>> = SemaphorFieldRef & {
734
+ role: TRole;
735
+ };
736
+
809
737
  export declare type SemaphorFilterInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorInputBase<TValue> & {
810
738
  kind: 'filter';
811
739
  field: SemaphorQueryField;
812
- operator?: SemaphorInputOperatorInput;
740
+ operator?: SemaphorInputOperator;
741
+ relationshipHint?: SemaphorInputBinding['relationshipHint'];
813
742
  multi?: boolean;
814
743
  };
815
744
 
@@ -824,12 +753,17 @@ declare type SemaphorInputBase<TValue extends SemaphorInputValue> = {
824
753
  options?: Array<SemaphorInputOption | SemaphorOptionValue>;
825
754
  };
826
755
 
827
- declare type SemaphorInputBinding = {
756
+ export declare type SemaphorInputBinding = {
828
757
  inputId: string;
829
758
  kind?: 'filter' | 'control';
830
- controlRole?: 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
759
+ controlRole?: 'grain' | 'measure' | 'dimension' | 'aggregation' | 'sqlParam';
831
760
  operator?: SemaphorInputOperator;
832
761
  field?: SemaphorFieldRef;
762
+ relationshipHint?: SemaphorRelationshipHint;
763
+ };
764
+
765
+ export declare type SemaphorInputBindingReference<TValue extends SemaphorInputValue = SemaphorInputValue> = {
766
+ toAnalyticsInput(): SemaphorActiveInput<TValue>;
833
767
  };
834
768
 
835
769
  export declare type SemaphorInputHandle<TValue extends SemaphorInputValue = SemaphorInputValue> = {
@@ -838,6 +772,7 @@ export declare type SemaphorInputHandle<TValue extends SemaphorInputValue = Sema
838
772
  label?: string;
839
773
  field?: SemaphorFieldRef;
840
774
  operator?: SemaphorInputOperator;
775
+ relationshipHint?: SemaphorInputBinding['relationshipHint'];
841
776
  controlRole?: SemaphorControlRole;
842
777
  value: TValue | undefined;
843
778
  options: SemaphorInputOption[];
@@ -849,14 +784,11 @@ export declare type SemaphorInputHandle<TValue extends SemaphorInputValue = Sema
849
784
 
850
785
  export declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'not_contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
851
786
 
852
- declare type SemaphorInputOperatorAlias = 'eq' | 'equals' | 'not_equals' | 'neq' | 'not equal' | 'not equals' | 'not in' | 'like' | 'not_contains' | 'not contains' | 'not_like' | 'not like' | 'not_between' | 'not between';
853
-
854
- export declare type SemaphorInputOperatorInput = SemaphorInputOperator | SemaphorInputOperatorAlias;
855
-
856
787
  export declare type SemaphorInputOption = {
857
788
  label: string;
858
789
  value: SemaphorOptionValue;
859
790
  count?: number;
791
+ disambiguation?: string[];
860
792
  };
861
793
 
862
794
  declare type SemaphorInputOptionsIntent = {
@@ -864,10 +796,17 @@ declare type SemaphorInputOptionsIntent = {
864
796
  version?: SemaphorProtocolVersion;
865
797
  id?: string;
866
798
  label?: string;
799
+ inputId: string;
867
800
  source: SemaphorSourceRef;
868
- field: SemaphorFieldRef;
801
+ labelField: SemaphorFieldRef;
802
+ valueField: SemaphorFieldRef;
803
+ searchField?: SemaphorFieldRef;
804
+ disambiguationFields?: SemaphorFieldRef[];
805
+ population?: SemaphorOptionPopulation;
806
+ dependencies?: SemaphorOptionDependencies;
869
807
  search?: string;
870
808
  limit?: number;
809
+ inputs?: SemaphorInputBinding[];
871
810
  derivedFields?: SemaphorDerivedFieldDefinition[];
872
811
  };
873
812
 
@@ -890,7 +829,14 @@ export declare type SemaphorInputOptionsQueryResult = SemaphorQueryState & Semap
890
829
  export declare type SemaphorInputOptionsQuerySpec = SemaphorQuerySourceSpec & SemaphorAppDerivedFieldsSpec & {
891
830
  id?: string;
892
831
  label?: string;
893
- field: SemaphorQueryField;
832
+ inputId: string;
833
+ labelField: SemaphorQueryField;
834
+ valueField: SemaphorQueryField;
835
+ searchField?: SemaphorQueryField;
836
+ disambiguationFields?: SemaphorQueryField[];
837
+ population?: SemaphorOptionPopulation;
838
+ dependencies?: SemaphorOptionDependencies;
839
+ inputs?: SemaphorInputReference[];
894
840
  search?: string;
895
841
  limit?: number;
896
842
  };
@@ -901,10 +847,11 @@ declare type SemaphorInputOptionsResult = SemaphorAnalyticsResultBase & {
901
847
  label: string;
902
848
  value: unknown;
903
849
  count?: number;
850
+ disambiguation?: string[];
904
851
  }>;
905
852
  };
906
853
 
907
- export declare type SemaphorInputReference = SemaphorInputSpec | SemaphorInputBinding | SemaphorActiveInput | SemaphorInputHandle;
854
+ export declare type SemaphorInputReference = SemaphorInputSpec | SemaphorInputBinding | SemaphorActiveInput | SemaphorInputHandle | SemaphorInputBindingReference;
908
855
 
909
856
  export declare type SemaphorInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue> = SemaphorFilterInputSpec<TValue> | SemaphorControlInputSpec<TValue>;
910
857
 
@@ -970,6 +917,7 @@ export declare type SemaphorMatrixIntent = {
970
917
  values: SemaphorMatrixValueField[];
971
918
  filters?: SemaphorAnalyticsFilter[];
972
919
  inputs?: SemaphorInputBinding[];
920
+ relationshipHint?: SemaphorRelationshipHint;
973
921
  totals?: SemaphorMatrixTotalOptions;
974
922
  sort?: SemaphorMatrixSortRule[];
975
923
  expansion?: SemaphorMatrixExpansionOptions;
@@ -1134,8 +1082,8 @@ declare type SemaphorMetricIntent = {
1134
1082
  version?: SemaphorProtocolVersion;
1135
1083
  id?: string;
1136
1084
  source: SemaphorSourceRef;
1137
- metrics: SemaphorFieldRef[];
1138
- primaryMetric?: SemaphorFieldRef;
1085
+ measures: SemaphorFieldRef[];
1086
+ primaryMeasure?: SemaphorFieldRef;
1139
1087
  label?: string;
1140
1088
  dateField?: SemaphorFieldRef;
1141
1089
  timeGrain?: SemaphorTimeGrain;
@@ -1152,13 +1100,14 @@ declare type SemaphorMetricIntent = {
1152
1100
  direction: 'asc' | 'desc';
1153
1101
  };
1154
1102
  inputs?: SemaphorInputBinding[];
1103
+ relationshipHint?: SemaphorRelationshipHint;
1155
1104
  limit?: number;
1156
1105
  derivedFields?: SemaphorDerivedFieldDefinition[];
1157
1106
  };
1158
1107
 
1159
1108
  export declare type SemaphorMetricPayload = {
1160
1109
  value: number | string | null;
1161
- metrics?: Record<string, number | string | null>;
1110
+ measures?: Record<string, number | string | null>;
1162
1111
  comparisonValue?: number | string | null;
1163
1112
  delta?: number | null;
1164
1113
  deltaPercent?: number | null;
@@ -1178,14 +1127,15 @@ export declare type SemaphorMetricQueryResult = SemaphorQueryState & SemaphorMet
1178
1127
  export declare type SemaphorMetricQuerySpec = SemaphorQuerySourceSpec & SemaphorAppDerivedFieldsSpec & {
1179
1128
  id?: string;
1180
1129
  label?: string;
1181
- metrics: SemaphorNonEmptyArray<SemaphorQueryField>;
1182
- primaryMetric?: SemaphorQueryField;
1130
+ measures: SemaphorNonEmptyArray<SemaphorQueryField>;
1131
+ primaryMeasure?: SemaphorQueryField;
1183
1132
  dateField?: SemaphorQueryField;
1184
1133
  timeGrain?: SemaphorTimeGrain;
1185
1134
  dimensions?: SemaphorQueryField[];
1186
1135
  comparison?: SemaphorMetricComparison;
1187
1136
  orderBy?: SemaphorQueryOrderBy;
1188
1137
  inputs?: SemaphorInputReference[];
1138
+ relationshipHint?: SemaphorRelationshipHint;
1189
1139
  limit?: number;
1190
1140
  };
1191
1141
 
@@ -1202,6 +1152,21 @@ declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
1202
1152
 
1203
1153
  export declare type SemaphorNonEmptyArray<T> = [T, ...T[]];
1204
1154
 
1155
+ export declare type SemaphorOptionDependencies = {
1156
+ mode?: 'auto' | 'independent' | 'explicit';
1157
+ includeInputIds?: string[];
1158
+ excludeInputIds?: string[];
1159
+ };
1160
+
1161
+ export declare type SemaphorOptionPopulation = {
1162
+ kind: 'option_source';
1163
+ baseSource?: never;
1164
+ } | {
1165
+ kind: 'related_population';
1166
+ baseSource: SemaphorSourceRef;
1167
+ relationshipHint?: SemaphorRelationshipHint;
1168
+ };
1169
+
1205
1170
  export declare type SemaphorOptionValue = string | number | boolean;
1206
1171
 
1207
1172
  export declare type SemaphorPaginationMetadata = {
@@ -1283,6 +1248,7 @@ declare type SemaphorRecordsBaseQuerySpec = SemaphorQuerySourceSpec & SemaphorAp
1283
1248
  filters?: SemaphorAnalyticsFilter[];
1284
1249
  orderBy?: SemaphorRecordsOrderBy;
1285
1250
  inputs?: SemaphorInputReference[];
1251
+ relationshipHint?: SemaphorRelationshipHint;
1286
1252
  limit?: number;
1287
1253
  pagination?: SemaphorPaginationRequest;
1288
1254
  };
@@ -1309,6 +1275,7 @@ declare type SemaphorRecordsIntent = {
1309
1275
  direction: 'asc' | 'desc';
1310
1276
  };
1311
1277
  inputs?: SemaphorInputBinding[];
1278
+ relationshipHint?: SemaphorRelationshipHint;
1312
1279
  derivedFields?: SemaphorDerivedFieldDefinition[];
1313
1280
  };
1314
1281
 
@@ -1364,6 +1331,10 @@ declare type SemaphorRelationshipDiagnostics = {
1364
1331
 
1365
1332
  declare type SemaphorRelationshipDiagnosticStatus = 'not_required' | 'resolved' | 'missing' | 'ambiguous' | 'fanout_risk' | 'unknown';
1366
1333
 
1334
+ declare type SemaphorRelationshipHint = {
1335
+ relationshipIds?: string[];
1336
+ };
1337
+
1367
1338
  declare type SemaphorRelativeTimeWindow = {
1368
1339
  kind?: 'relative';
1369
1340
  unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
@@ -1397,6 +1368,14 @@ export declare type SemaphorRowsQueryResult<TRecord extends Record<string, unkno
1397
1368
 
1398
1369
  export declare type SemaphorScalar = string | number | boolean | null;
1399
1370
 
1371
+ export declare type SemaphorSemanticSourceBuilderSpec = {
1372
+ domainId: string;
1373
+ datasetName: string;
1374
+ datasetId?: string;
1375
+ connectionId?: string;
1376
+ label?: string;
1377
+ };
1378
+
1400
1379
  declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
1401
1380
  kind: 'semantic';
1402
1381
  }>;
@@ -1491,6 +1470,10 @@ declare type SemaphorSqlResult = SemaphorAnalyticsResultBase & {
1491
1470
  };
1492
1471
  };
1493
1472
 
1473
+ export declare type SemaphorSqlSourceBuilderSpec = Extract<SemaphorSourceRef, {
1474
+ kind: 'sql';
1475
+ }>;
1476
+
1494
1477
  export declare type SemaphorSqlSourceSpec = {
1495
1478
  source: Extract<SemaphorSourceRef, {
1496
1479
  kind: 'sql';
@@ -1539,39 +1522,7 @@ declare type SemaphorValueFormat = {
1539
1522
  suffix?: string;
1540
1523
  };
1541
1524
 
1542
- export declare function toSemaphorActiveInputSnapshots(inputs: SemaphorInputReference[] | undefined): SemaphorActiveInput[];
1543
-
1544
- export declare function toSemaphorAnalysisIntent(spec: SemaphorAnalysisQuerySpec): SemaphorMetricIntent;
1545
-
1546
- export declare function toSemaphorAnalysisQueryOptions(spec: SemaphorAnalysisQuerySpec): SemaphorAnalysisQueryOptions;
1547
-
1548
- export declare function toSemaphorInputBinding(input: SemaphorInputReference): SemaphorInputBinding;
1549
-
1550
- export declare function toSemaphorInputBindings(inputs: SemaphorInputReference[] | undefined): SemaphorInputBinding[] | undefined;
1551
-
1552
- export declare function toSemaphorInputOptionsIntent(spec: SemaphorInputOptionsQuerySpec): Extract<SemaphorAnalyticsIntent, {
1553
- kind: 'inputOptions';
1554
- }>;
1555
-
1556
- export declare function toSemaphorInputSnapshots(inputs: SemaphorInputReference[] | undefined): SemaphorActiveInput[];
1557
-
1558
- export declare function toSemaphorInputSpec<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: SemaphorInputSpec<TValue>): SemaphorInputBinding & {
1559
- kind: SemaphorInputSpec['kind'];
1560
- label?: string;
1561
- field?: SemaphorFieldRef;
1562
- operator?: SemaphorInputOperator;
1563
- controlRole?: SemaphorControlRole;
1564
- };
1565
-
1566
- export declare function toSemaphorMatrixIntent(spec: SemaphorMatrixQuerySpec): SemaphorMatrixIntent;
1567
-
1568
- export declare function toSemaphorMetricIntent(spec: SemaphorMetricQuerySpec): SemaphorMetricIntent;
1569
-
1570
- export declare function toSemaphorRecordsIntent(spec: SemaphorRecordsQuerySpec): SemaphorRecordsIntent;
1571
-
1572
- export declare function toSemaphorSqlIntent(spec: SemaphorSqlQuerySpec): SemaphorSqlIntent;
1573
-
1574
- export declare function useSemaphorDataAppRuntime(): SemaphorDataAppRuntime;
1525
+ export declare function useClearInvalidSemaphorInputValue(input: SemaphorInputHandle, optionsResult: Pick<SemaphorInputOptionsQueryResult, 'options' | 'status'> | undefined): void;
1575
1526
 
1576
1527
  export declare function useSemaphorInput<TValue extends SemaphorInputValue = SemaphorInputValue>(spec: SemaphorInputSpec<TValue>): SemaphorInputHandle;
1577
1528
 
@@ -1589,13 +1540,6 @@ export declare function useSemaphorQuery<TRecord extends Record<string, unknown>
1589
1540
 
1590
1541
  export declare function useSemaphorQuery(spec: SemaphorMatrixQueryDefinition, options?: SemaphorQueryRuntimeOptions): SemaphorMatrixQueryResult;
1591
1542
 
1592
- export declare function validateSemaphorDataAppQuerySpecs(input: {
1593
- queries: SemaphorDataAppQuerySpecEnvelope[];
1594
- fieldCatalogs?: SemaphorDataAppFieldCatalog[];
1595
- requireFieldCatalog?: boolean;
1596
- validateTimezone?: SemaphorAnalysisTimezoneValidator;
1597
- }): SemaphorDataAppValidationResult;
1598
-
1599
1543
  /**
1600
1544
  * Week start day type.
1601
1545
  * 0 = Sunday (US, Canada, Japan)
@@ -4875,15 +4875,9 @@ declare type SemaphorDerivedFieldInput = {
4875
4875
  kind: 'field';
4876
4876
  field: SemaphorFieldRef;
4877
4877
  aggregate?: SemaphorAggregateFunction;
4878
- } | {
4879
- kind: 'metric';
4880
- metric: SemaphorFieldRef;
4881
- } | {
4882
- kind: 'dimension';
4883
- dimension: SemaphorFieldRef;
4884
4878
  };
4885
4879
 
4886
- declare type SemaphorDerivedFieldResultRole = 'measure' | 'group' | 'date' | 'id' | 'filter';
4880
+ declare type SemaphorDerivedFieldResultRole = 'measure' | 'dimension' | 'date' | 'id' | 'unknown';
4887
4881
 
4888
4882
  declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
4889
4883
 
@@ -4907,9 +4901,10 @@ declare type SemaphorFieldRef = {
4907
4901
  declare type SemaphorInputBinding = {
4908
4902
  inputId: string;
4909
4903
  kind?: 'filter' | 'control';
4910
- controlRole?: 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
4904
+ controlRole?: 'grain' | 'measure' | 'dimension' | 'aggregation' | 'sqlParam';
4911
4905
  operator?: SemaphorInputOperator;
4912
4906
  field?: SemaphorFieldRef;
4907
+ relationshipHint?: SemaphorRelationshipHint;
4913
4908
  };
4914
4909
 
4915
4910
  declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'not_contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
@@ -4919,10 +4914,17 @@ declare type SemaphorInputOptionsIntent = {
4919
4914
  version?: SemaphorProtocolVersion;
4920
4915
  id?: string;
4921
4916
  label?: string;
4917
+ inputId: string;
4922
4918
  source: SemaphorSourceRef;
4923
- field: SemaphorFieldRef;
4919
+ labelField: SemaphorFieldRef;
4920
+ valueField: SemaphorFieldRef;
4921
+ searchField?: SemaphorFieldRef;
4922
+ disambiguationFields?: SemaphorFieldRef[];
4923
+ population?: SemaphorOptionPopulation;
4924
+ dependencies?: SemaphorOptionDependencies;
4924
4925
  search?: string;
4925
4926
  limit?: number;
4927
+ inputs?: SemaphorInputBinding[];
4926
4928
  derivedFields?: SemaphorDerivedFieldDefinition[];
4927
4929
  };
4928
4930
 
@@ -4984,6 +4986,7 @@ declare type SemaphorMatrixIntent = {
4984
4986
  values: SemaphorMatrixValueField[];
4985
4987
  filters?: SemaphorAnalyticsFilter[];
4986
4988
  inputs?: SemaphorInputBinding[];
4989
+ relationshipHint?: SemaphorRelationshipHint;
4987
4990
  totals?: SemaphorMatrixTotalOptions;
4988
4991
  sort?: SemaphorMatrixSortRule[];
4989
4992
  expansion?: SemaphorMatrixExpansionOptions;
@@ -5106,8 +5109,8 @@ declare type SemaphorMetricIntent = {
5106
5109
  version?: SemaphorProtocolVersion;
5107
5110
  id?: string;
5108
5111
  source: SemaphorSourceRef;
5109
- metrics: SemaphorFieldRef[];
5110
- primaryMetric?: SemaphorFieldRef;
5112
+ measures: SemaphorFieldRef[];
5113
+ primaryMeasure?: SemaphorFieldRef;
5111
5114
  label?: string;
5112
5115
  dateField?: SemaphorFieldRef;
5113
5116
  timeGrain?: SemaphorTimeGrain;
@@ -5124,10 +5127,26 @@ declare type SemaphorMetricIntent = {
5124
5127
  direction: 'asc' | 'desc';
5125
5128
  };
5126
5129
  inputs?: SemaphorInputBinding[];
5130
+ relationshipHint?: SemaphorRelationshipHint;
5127
5131
  limit?: number;
5128
5132
  derivedFields?: SemaphorDerivedFieldDefinition[];
5129
5133
  };
5130
5134
 
5135
+ declare type SemaphorOptionDependencies = {
5136
+ mode?: 'auto' | 'independent' | 'explicit';
5137
+ includeInputIds?: string[];
5138
+ excludeInputIds?: string[];
5139
+ };
5140
+
5141
+ declare type SemaphorOptionPopulation = {
5142
+ kind: 'option_source';
5143
+ baseSource?: never;
5144
+ } | {
5145
+ kind: 'related_population';
5146
+ baseSource: SemaphorSourceRef;
5147
+ relationshipHint?: SemaphorRelationshipHint;
5148
+ };
5149
+
5131
5150
  declare type SemaphorPaginationMetadata = {
5132
5151
  page: number;
5133
5152
  pageSize: number;
@@ -5170,9 +5189,14 @@ declare type SemaphorRecordsIntent = {
5170
5189
  direction: 'asc' | 'desc';
5171
5190
  };
5172
5191
  inputs?: SemaphorInputBinding[];
5192
+ relationshipHint?: SemaphorRelationshipHint;
5173
5193
  derivedFields?: SemaphorDerivedFieldDefinition[];
5174
5194
  };
5175
5195
 
5196
+ declare type SemaphorRelationshipHint = {
5197
+ relationshipIds?: string[];
5198
+ };
5199
+
5176
5200
  declare type SemaphorRelativeTimeWindow = {
5177
5201
  kind?: 'relative';
5178
5202
  unit: 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
@@ -1655,15 +1655,9 @@ declare type SemaphorDerivedFieldInput = {
1655
1655
  kind: 'field';
1656
1656
  field: SemaphorFieldRef;
1657
1657
  aggregate?: SemaphorAggregateFunction;
1658
- } | {
1659
- kind: 'metric';
1660
- metric: SemaphorFieldRef;
1661
- } | {
1662
- kind: 'dimension';
1663
- dimension: SemaphorFieldRef;
1664
1658
  };
1665
1659
 
1666
- declare type SemaphorDerivedFieldResultRole = 'measure' | 'group' | 'date' | 'id' | 'filter';
1660
+ declare type SemaphorDerivedFieldResultRole = 'measure' | 'dimension' | 'date' | 'id' | 'unknown';
1667
1661
 
1668
1662
  declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
1669
1663
 
@@ -1687,9 +1681,10 @@ declare type SemaphorFieldRef = {
1687
1681
  declare type SemaphorInputBinding = {
1688
1682
  inputId: string;
1689
1683
  kind?: 'filter' | 'control';
1690
- controlRole?: 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
1684
+ controlRole?: 'grain' | 'measure' | 'dimension' | 'aggregation' | 'sqlParam';
1691
1685
  operator?: SemaphorInputOperator;
1692
1686
  field?: SemaphorFieldRef;
1687
+ relationshipHint?: SemaphorRelationshipHint;
1693
1688
  };
1694
1689
 
1695
1690
  declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'not_contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
@@ -1752,6 +1747,7 @@ declare type SemaphorMatrixIntent = {
1752
1747
  values: SemaphorMatrixValueField[];
1753
1748
  filters?: SemaphorAnalyticsFilter[];
1754
1749
  inputs?: SemaphorInputBinding[];
1750
+ relationshipHint?: SemaphorRelationshipHint;
1755
1751
  totals?: SemaphorMatrixTotalOptions;
1756
1752
  sort?: SemaphorMatrixSortRule[];
1757
1753
  expansion?: SemaphorMatrixExpansionOptions;
@@ -1840,6 +1836,10 @@ declare type SemaphorMatrixValueField = {
1840
1836
 
1841
1837
  declare type SemaphorProtocolVersion = 1;
1842
1838
 
1839
+ declare type SemaphorRelationshipHint = {
1840
+ relationshipIds?: string[];
1841
+ };
1842
+
1843
1843
  declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
1844
1844
  kind: 'semantic';
1845
1845
  }>;