react-semaphor 0.1.565 → 0.1.566

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 (34) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/briefings/index.js +50 -46
  3. package/dist/chunks/{assistant-chat-DNfb5fbF.js → assistant-chat-DNKAYSQL.js} +5 -5
  4. package/dist/chunks/{bookmark-impact-CHr7b1J2.js → bookmark-impact-BeUbq0jc.js} +1 -1
  5. package/dist/chunks/{card-filter-builder-CcEcfaYz.js → card-filter-builder-SXaRWbKr.js} +46 -46
  6. package/dist/chunks/{dashboard-CtIfxycc.js → dashboard-Cni7nGhg.js} +1 -1
  7. package/dist/chunks/{dashboard-briefing-launcher-D3mc6peE.js → dashboard-briefing-launcher-CXeXRTem.js} +202 -202
  8. package/dist/chunks/{dashboard-controls-BFv0zdws.js → dashboard-controls-CsqKybrf.js} +56 -56
  9. package/dist/chunks/{dashboard-json-CXn_3OYb.js → dashboard-json-WWmw3Piu.js} +1 -1
  10. package/dist/chunks/{dates-DcRxw17S.js → dates-DJRUS-he.js} +4 -4
  11. package/dist/chunks/{edit-dashboard-visual-Y6HatqBd.js → edit-dashboard-visual-BrIEaBhc.js} +213 -197
  12. package/dist/chunks/{filter-reach-copy-DbggA5B7.js → filter-reach-copy-D5LqgrUf.js} +852 -858
  13. package/dist/chunks/{index-DDa_rklN.js → index-Bq9UbCGk.js} +648 -574
  14. package/dist/chunks/{report-preferences-dialog-Db-b04B4.js → report-preferences-dialog-CeHioJwL.js} +7 -7
  15. package/dist/chunks/{resolve-dashboard-input-context-C18J-YZC.js → resolve-dashboard-input-context-CwS-2r-b.js} +3497 -3472
  16. package/dist/chunks/{saved-dashboard-context-DhC_EVus.js → saved-dashboard-context-c-MZZTx2.js} +2 -2
  17. package/dist/chunks/{semaphor-ready-indicator-T6TsiBMT.js → semaphor-ready-indicator-B2NpYRE-.js} +27601 -27648
  18. package/dist/chunks/{shelf-drop-preview-context-CNWL_b0S.js → shelf-drop-preview-context-DM7yypwC.js} +2 -2
  19. package/dist/chunks/{stored-dashboard-IdmtrNkA.js → stored-dashboard-DTWc2pzt.js} +204 -204
  20. package/dist/chunks/{variable-draft-3xseULxR.js → variable-draft-DFizFCJu.js} +2 -2
  21. package/dist/dashboard/index.js +1 -1
  22. package/dist/dashboard-authoring/index.js +1669 -1642
  23. package/dist/index.js +11 -11
  24. package/dist/style.css +1 -1
  25. package/dist/surfboard/index.js +1 -1
  26. package/dist/types/briefings/delivery-outcome.d.ts +37 -0
  27. package/dist/types/briefings/index.d.ts +2 -0
  28. package/dist/types/briefings/run-outcomes.d.ts +6 -0
  29. package/dist/types/components/briefings/briefing-author/run-model.d.ts +9 -0
  30. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +15 -3
  31. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +2 -0
  32. package/dist/types/shared/dashboard-authoring/dashboard-filter-sql-subscription.d.ts +24 -0
  33. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +20 -4
  34. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { a, R as s, D as o } from "../chunks/report-preferences-dialog-Db-b04B4.js";
1
+ import { a, R as s, D as o } from "../chunks/report-preferences-dialog-CeHioJwL.js";
2
2
  import { C as f, E as D } from "../chunks/bookmark-state-ByODVqee.js";
3
3
  export {
4
4
  f as CONTROL_CARD_DEFAULT_VALUE,
@@ -0,0 +1,37 @@
1
+ export declare const BRIEFING_DELIVERY_OUTCOME_STATUSES: readonly ["sent", "partly_sent", "failed", "not_set_up"];
2
+ export type BriefingDeliveryOutcomeStatus = (typeof BRIEFING_DELIVERY_OUTCOME_STATUSES)[number];
3
+ export type BriefingDeliveryOutcomeChannel = 'EMAIL' | 'SLACK';
4
+ export type BriefingDeliveryChannelOutcome = {
5
+ channel: BriefingDeliveryOutcomeChannel;
6
+ status: BriefingDeliveryOutcomeStatus;
7
+ /** Recipients the email reached; 1 when Slack posted. */
8
+ sent: number;
9
+ /** Recipients the email did not reach; 1 when the Slack post failed. */
10
+ failed: number;
11
+ /** Slack: the channel's name as the author picked it, without '#'. */
12
+ destination: string | null;
13
+ /** Why it was not (fully) delivered, in the author's words; null when sent. */
14
+ reason: string | null;
15
+ };
16
+ export type BriefingDeliveryOutcome = {
17
+ channels: BriefingDeliveryChannelOutcome[];
18
+ };
19
+ /** One channel's result as the senders report it (email or Slack delivery). */
20
+ export type BriefingChannelDeliveryReport = {
21
+ status: string;
22
+ sentCount?: number;
23
+ failedCount?: number;
24
+ message?: string;
25
+ channelName?: string | null;
26
+ };
27
+ /**
28
+ * The one mapping from a sender's report to an outcome entry. The app calls it
29
+ * when it writes the outcome; the reader calls it only for runs stored before
30
+ * the outcome existed. A channel the run did not ask for (SKIPPED) has none.
31
+ */
32
+ export declare function briefingDeliveryChannelOutcome(channel: BriefingDeliveryOutcomeChannel, report: BriefingChannelDeliveryReport): BriefingDeliveryChannelOutcome | null;
33
+ /**
34
+ * A run's delivery outcome from its stored result, or null when the run never
35
+ * reached delivery.
36
+ */
37
+ export declare function readBriefingDeliveryOutcome(result: unknown): BriefingDeliveryOutcome | null;
@@ -7,6 +7,8 @@ export declare const BRIEFING_KIND: "BRIEFING";
7
7
  export { DEFAULT_BRIEFING_SCHEDULE, briefingScheduleMonths, briefingScheduleDayOccurs, briefingScheduleShortMonths, buildBriefingScheduleExpr, canonicalBriefingMonthDays, describeBriefingSchedule, isValidBriefingTimezone, nextBriefingScheduleDates, parseBriefingScheduleExpr, type BriefingScheduleFrequency, type BriefingScheduleMonthDay, type BriefingScheduleMonthInterval, type BriefingScheduleMonthlyOn, type BriefingScheduleOrdinal, type BriefingScheduleViewModel, } from './schedule.js';
8
8
  export { briefingAttachmentFileTraits, briefingAttachmentFormatLabel, briefingAttachmentNeedsExportJob, briefingAttachmentProduction, type BriefingAttachmentFileTraits, type BriefingAttachmentProduction, getBriefingCardAttachmentCapability, getBriefingCardAttachmentFormats, getDefaultBriefingCardAttachmentFormat, isBriefingTableExportCardType, type BriefingCardAttachmentCapability, } from './attachments.js';
9
9
  export { BRIEFING_ATTACHMENT_OMISSION_CODES, isBriefingAttachmentOmissionCode, readBriefingOmittedAttachments, type BriefingAttachmentOmissionCode, type BriefingOmittedAttachment, } from './attachment-outcomes.js';
10
+ export { BRIEFING_RUN_CANCELLED_ERROR } from './run-outcomes.js';
11
+ export { BRIEFING_DELIVERY_OUTCOME_STATUSES, briefingDeliveryChannelOutcome, readBriefingDeliveryOutcome, type BriefingChannelDeliveryReport, type BriefingDeliveryChannelOutcome, type BriefingDeliveryOutcome, type BriefingDeliveryOutcomeChannel, type BriefingDeliveryOutcomeStatus, } from './delivery-outcome.js';
10
12
  export { canCreateBriefingForUser, type BriefingUiUser } from './capabilities.js';
11
13
  export { getBriefingCreationIntents, type BriefingAuthorIntent, } from './creation.js';
12
14
  export { getBriefingDisplayTypeLabel, getBriefingPresentation, isEmailOnlyBriefingDelivery, type BriefingDisplayTypeLabel, type BriefingEntityPresentation, } from './display.js';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The error a cancelled Briefing run stores. The app writes it when an author
3
+ * cancels a run, and readers (Activity, run history) compare against it
4
+ * exactly instead of searching the error text (background-activity SPEC §2.3).
5
+ */
6
+ export declare const BRIEFING_RUN_CANCELLED_ERROR = "Briefing run cancelled by user";
@@ -46,3 +46,12 @@ export declare function isRecord(value: unknown): value is Record<string, unknow
46
46
  export declare function parseEmailPreviewArtifact(value: unknown): EmailPreviewArtifact | null;
47
47
  export declare function parseSlackPreviewArtifact(value: unknown): SlackPreviewArtifact | null;
48
48
  export declare function parseSavedRunEmailArtifact(run: BriefingRun): EmailPreviewArtifact | null;
49
+ /**
50
+ * The attachments a saved run's package lists (`result.package.attachments`),
51
+ * in order, with whether each was left out. The email preview header and the
52
+ * run status's Details both read this.
53
+ */
54
+ export declare function readRunPackageAttachments(packageResult: unknown): Array<{
55
+ name: string;
56
+ omitted: boolean;
57
+ }>;
@@ -140,8 +140,14 @@ export type DashboardFilterCardReach =
140
140
  | 'bound'
141
141
  /** The card executes the filter's own field (or a proven binding's), so it applies with no mapping. */
142
142
  | 'automatic'
143
- /** A SQL card takes the filter's value as is. */
143
+ /** A SQL card takes the filter's value as is, and its SQL uses filters through a plain collection helper. */
144
144
  | 'sql'
145
+ /**
146
+ * A SQL card whose SQL names a filter another way (`filter('…')`, a helper
147
+ * with arguments): it may apply, as that SQL decides. A reader never counts
148
+ * it as reached or as not reached (MCP-20261027-82HEYK).
149
+ */
150
+ | 'sqlTemplate'
145
151
  /** More than one field of the card could take it: the card blocks until it is mapped. */
146
152
  | 'ambiguous'
147
153
  /** The mapping binds a target the card can't run or no longer has: the card blocks until it is mapped again. */
@@ -154,13 +160,19 @@ export type DashboardFilterCardReach =
154
160
  | 'relationship'
155
161
  /** A server-side resolver confirmed the route the card will apply (RF-D15). */
156
162
  | 'relationshipApplied' | 'notApplicable';
163
+ /**
164
+ * Why a filter in scope doesn't reach a card: a relationship resolver's
165
+ * reason, or `sql_no_filter_reference` for a SQL card whose SQL names no
166
+ * filter, which runs as written whatever the filter holds.
167
+ */
168
+ export type DashboardFilterNotReachedReason = SemaphorSkippedConstraintReason | 'sql_no_filter_reference';
157
169
  /** How a filter reaches a card, with the route or the reason a resolver gave (RF-D15). */
158
170
  export type DashboardFilterCardReachDetail = {
159
171
  reach: DashboardFilterCardReach;
160
172
  /** With 'relationshipApplied'. */
161
173
  route?: SemaphorRelationshipRoute;
162
- /** With 'notApplicable' from a resolver. */
163
- reason?: SemaphorSkippedConstraintReason;
174
+ /** With 'notApplicable': from a resolver, or a SQL card's own SQL. */
175
+ reason?: DashboardFilterNotReachedReason;
164
176
  /** With reason 'relationship_ambiguous'. */
165
177
  candidates?: SemaphorRelationshipRoute[];
166
178
  /** With 'blocked' from a resolver. */
@@ -49,6 +49,8 @@ export type ChangeWarningCode =
49
49
  'filter_not_reaching_cards'
50
50
  /** In-scope cards on another dataset of the filter's domain: decided when each card runs, through the relationships. */
51
51
  | 'filter_reach_through_relationships'
52
+ /** In-scope SQL cards whose SQL names a filter another way than a plain helper: their SQL decides (MCP-20261027-82HEYK). */
53
+ | 'filter_reach_through_sql'
52
54
  /** The compiled card stores the window as fixed dates. */
53
55
  | 'window_saved_as_fixed_dates'
54
56
  /** A type change leaves out fields or preferences. */
@@ -1,3 +1,27 @@
1
+ /**
2
+ * How a SQL card's SQL takes dashboard filters, read from its template
3
+ * markers, never from the SQL itself (MCP-20261027-82HEYK):
4
+ * - `subscribed`: a plain collection helper, `{{ filters | where }}` or
5
+ * `{{ filters | and }}`: the filter applies.
6
+ * - `template`: another template use that names a filter, such as
7
+ * `{{ filter('Region') }}`, `{{ filters.get(…) }}` or a helper with
8
+ * arguments: it may apply, as that SQL decides.
9
+ * - `none`: nothing in a template names a filter, so the data service runs
10
+ * the SQL as written and no filter changes it.
11
+ *
12
+ * One rule for every reader: the outline, the change resolver, the reducer's
13
+ * counts and the editor's filter mapping sheet.
14
+ *
15
+ * A hint over template markers, not a SQL parser (Rohit, 2026-10-27): the data
16
+ * service's template parser is the only exact reader, and the app parses no
17
+ * SQL. Known limits, kept on purpose: a marker inside a SQL comment or string
18
+ * literal still counts, and a SQL dataset the SQL reads may take filters in
19
+ * its own SQL, which isn't seen. The first two can say a rare card is reached
20
+ * when it isn't; the last can say a card isn't reached when its dataset's SQL
21
+ * takes the filter.
22
+ */
23
+ export type SqlFilterUse = 'subscribed' | 'template' | 'none';
24
+ export declare function readSqlFilterUse(sql: string | null | undefined): SqlFilterUse;
1
25
  export type DashboardFilterSubscriptionHint = {
2
26
  helper: '{{ filters | where }}' | '{{ filters | and }}';
3
27
  description: string;
@@ -1,6 +1,5 @@
1
1
  import { TDashboard } from '../../../lib/types/common-types.js';
2
- import { DashboardRelationshipReachResolver } from '../../../lib/query-context/dashboard-filter-mapping-resolution.js';
3
- import { SemaphorSkippedConstraintReason } from '../../analytics-protocol/index.js';
2
+ import { DashboardFilterNotReachedReason, DashboardRelationshipReachResolver } from '../../../lib/query-context/dashboard-filter-mapping-resolution.js';
4
3
  import { FilterInputEntry } from '../filter-model/index.js';
5
4
  import { CalendarContext } from '../../report-runtime-context/index.js';
6
5
  import { FilterValue, TimeWindow } from '../changes/dashboard-change.js';
@@ -37,12 +36,15 @@ export type OutlineFilter = {
37
36
  reaches: string[];
38
37
  /** Targets excluded explicitly. */
39
38
  excluded: string[];
40
- /** In scope, not matched; with a resolver (server side), the reason relationship reach gave. */
39
+ /**
40
+ * In scope, not matched; with a resolver (server side), the reason relationship reach gave.
41
+ * `sql_no_filter_reference`: a SQL card whose SQL names no filter, so it runs as written.
42
+ */
41
43
  notReached: Array<{
42
44
  cardId: string;
43
45
  title: string;
44
46
  datasetName?: string;
45
- reason?: SemaphorSkippedConstraintReason;
47
+ reason?: DashboardFilterNotReachedReason;
46
48
  }>;
47
49
  /** In scope, and blocked when the filter has a value: a binding the card can't run, or two fields it could take. */
48
50
  blocked?: Array<{
@@ -60,6 +62,16 @@ export type OutlineFilter = {
60
62
  title: string;
61
63
  datasetName?: string;
62
64
  }>;
65
+ /**
66
+ * In scope, a SQL card whose SQL names a filter other than through
67
+ * `{{ filters | where }}` or `{{ filters | and }}` (`filter('…')`, a
68
+ * helper with arguments): it may apply, as that SQL decides. Never
69
+ * counted as reached or as not reached.
70
+ */
71
+ sqlPending?: Array<{
72
+ cardId: string;
73
+ title: string;
74
+ }>;
63
75
  } | {
64
76
  filterId: string;
65
77
  label: string;
@@ -81,6 +93,10 @@ export type OutlineFilter = {
81
93
  title: string;
82
94
  datasetName?: string;
83
95
  }>;
96
+ sqlPending?: Array<{
97
+ cardId: string;
98
+ title: string;
99
+ }>;
84
100
  };
85
101
  /** Server-side readers resolve relationship reach the way the card query does (RF-D15). */
86
102
  export type OutlineReachOptions = {
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.565",
8
+ "version": "0.1.566",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",