react-semaphor 0.1.603 → 0.1.605
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/activity/index.js +1 -73
- package/dist/analytics-protocol/index.js +1 -1491
- package/dist/appearance/index.js +1 -12
- package/dist/appearance-runtime/index.js +1 -5
- package/dist/assistant-context/index.js +1 -11
- package/dist/assistant-protocol/index.js +1 -152
- package/dist/brand-studio/index.js +3 -1598
- package/dist/briefings/index.js +1 -70
- package/dist/chunks/add-to-dashboard-CEmZUf9o.js +12 -0
- package/dist/chunks/analytics-base-schemas-DMFrDqn_.js +1 -0
- package/dist/chunks/appearance-provider-CfoAVQuG.js +608 -0
- package/dist/chunks/appearance-runtime-provider-Bx8H-moR.js +1 -0
- package/dist/chunks/applied-constraints-CinevlKD.js +1 -0
- package/dist/chunks/assistant-chat-DgUaCE9k.js +51 -0
- package/dist/chunks/attachment-filter-line-C_zHMhGh.js +1 -0
- package/dist/chunks/attribution-BEFSsbNn.js +1 -0
- package/dist/chunks/availability-3AIOf6Z-.js +1 -0
- package/dist/chunks/bookmark-impact-BAtemeyK.js +1 -0
- package/dist/chunks/bookmark-state-DScd31KT.js +1 -0
- package/dist/chunks/brand-C9APUFaP.js +1 -0
- package/dist/chunks/card-filter-builder-ClWrXB7P.js +11 -0
- package/dist/chunks/column-bands-DwxbZ6UI.js +1 -0
- package/dist/chunks/comparison-window-caption-tguyN24S.js +1 -0
- package/dist/chunks/context-CntvtZwC.js +2 -0
- package/dist/chunks/conversation-JMK2kyTK.js +1 -0
- package/dist/chunks/dashboard-ChIcbVTx.js +1 -0
- package/dist/chunks/dashboard-briefing-launcher-CwMlhkxV.js +42 -0
- package/dist/chunks/dashboard-controls-UCSAFCGA.js +42 -0
- package/dist/chunks/dashboard-json-B120hYDa.js +1 -0
- package/dist/chunks/dashboard-temporal-snapshot-BFJKbp_6.js +1 -0
- package/dist/chunks/edit-dashboard-visual-DvHp03h_.js +73 -0
- package/dist/chunks/export-file-format-B-wQNHIn.js +4 -0
- package/dist/chunks/filter-line-WwUV5JzN.js +1 -0
- package/dist/chunks/filter-reach-preview-C5M5_hf_.js +1 -0
- package/dist/chunks/filter-value-text-DqTHe_vu.js +1 -0
- package/dist/chunks/index-DViPGDFj.js +1 -0
- package/dist/chunks/index-bkP6SnYu.js +1 -0
- package/dist/chunks/kpi-trend-rule-B87LNzcz.js +1 -0
- package/dist/chunks/layout-grid-CFzqJ7GC.js +6 -0
- package/dist/chunks/matrix-analytical-definition-5T-2euHZ.js +1 -0
- package/dist/chunks/matrix-member-presentation-vVAv-aqg.js +1 -0
- package/dist/chunks/matrix-operation-contract-CWvcEsQ0.js +1 -0
- package/dist/chunks/normalize-dashboard-for-dirty-check-ILKfqgL3.js +1 -0
- package/dist/chunks/numeric-range-options-C8tr-Bls.js +1 -0
- package/dist/chunks/palette-NvEIuXHN.js +6 -0
- package/dist/chunks/pivot-result-contract-expectations-BNWhS8mv.js +1 -0
- package/dist/chunks/pivot-result-identity-B0eWVMXg.js +1 -0
- package/dist/chunks/raw-temporal-value-BHQ-ldpW.js +1 -0
- package/dist/chunks/rendered-file-BbvwaU6z.js +1 -0
- package/dist/chunks/report-preferences-dialog-Bseb2Rlg.js +1 -0
- package/dist/chunks/report-runtime-context-Cd1b5pku.js +1 -0
- package/dist/chunks/resolve-dashboard-input-context-BDY7KwRe.js +8 -0
- package/dist/chunks/resolver-CjsW8Rz0.js +1 -0
- package/dist/chunks/saved-dashboard-context-C3lWc4Dx.js +1 -0
- package/dist/chunks/schema-O1Y3WTGF.js +4 -0
- package/dist/chunks/selection-filter-compiler-kYsRugss.js +1 -0
- package/dist/chunks/semaphor-ready-indicator-BQarSo6S.js +612 -0
- package/dist/chunks/set-6mOnfQeH.js +1 -0
- package/dist/chunks/slider-BPnHdMGq.js +4 -0
- package/dist/chunks/stored-dashboard-DfrxDLhR.js +1 -0
- package/dist/chunks/table-export-sheet-xaczzWZF.js +2 -0
- package/dist/chunks/token-types-1vzMWjI-.js +1 -0
- package/dist/chunks/validators-Dg2kyF4_.js +1 -0
- package/dist/chunks/variable-draft-B4_xqr4Y.js +1 -0
- package/dist/chunks/visual-choice-DgEFfkE-.js +1 -0
- package/dist/dashboard/index.js +1 -7
- package/dist/dashboard-authoring/index.js +1 -4614
- package/dist/format-utils/index.js +1 -425
- package/dist/index.js +1 -554
- package/dist/layouts/index.js +1 -7
- package/dist/live-channel/index.js +1 -124
- package/dist/pdf-export-policy/index.js +1 -92
- package/dist/pdf-table-layout/index.js +1 -993
- package/dist/report-runtime-context/index.js +1 -9
- package/dist/shared/index.js +1 -6
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -9
- package/dist/types/brand-studio/brand-studio-draft.d.ts +45 -13
- package/dist/types/brand-studio/brand-studio-editor.d.ts +13 -2
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +17 -6
- package/dist/types/components/visual/data-table/types/data-table.d.ts +52 -42
- package/dist/types/index.js +1 -88
- package/dist/types/lib/appearance/aliases.d.ts +3 -0
- package/dist/types/lib/appearance/index.d.ts +1 -0
- package/dist/types/lib/appearance/table-density.d.ts +18 -0
- package/dist/types/lib/appearance/types.d.ts +39 -1
- package/dist/types/lib/dashboard-viewer/column-header-actions.d.ts +100 -0
- package/dist/types/lib/dashboard-viewer/table-view-edit.d.ts +0 -27
- package/dist/types/lib/dashboard-viewer/table-view.d.ts +26 -2
- package/dist/types/lib/dashboard-viewer/use-table-view.d.ts +2 -0
- package/dist/types/lib/filter-values/build-card-filter-definition.d.ts +32 -0
- package/dist/types/lib/hooks/use-add-new-frame.d.ts +7 -0
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +4 -0
- package/dist/types/lib/interactions/get-click-context-from-chartjs.d.ts +8 -0
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +9 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +14 -2
- package/dist/types/lib/stores/explorer-actions.d.ts +7 -10
- package/dist/types/lib/types/common-types.d.ts +1 -2
- package/dist/types/lib/types/semantic-types.d.ts +6 -10
- package/dist/types/lib/utils/card-config-utils.d.ts +13 -0
- package/dist/types/lib/utils/field-placement.d.ts +17 -0
- package/dist/types/lib/utils/field-state-calculator.d.ts +7 -19
- package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +21 -1
- package/dist/types/shared/analytics-protocol/field-provenance.d.ts +7 -4
- package/dist/types/shared/dashboard-authoring/calculations/definition.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-base.d.ts +125 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-field-folders.d.ts +55 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-joins.d.ts +114 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/card-prune.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-catalog.d.ts +60 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/filter-field-folders.d.ts +180 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/index.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/card-data-source/join-reach.d.ts +42 -0
- package/dist/types/shared/dashboard-authoring/card-field-places.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +2 -8
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/column-display-values.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-display.d.ts +52 -0
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/card-settings/table-viewer-switches.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +132 -3
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +10 -1
- package/dist/types/shared/dashboard-authoring/field-aggregations.d.ts +9 -2
- package/dist/types/shared/dashboard-authoring/field-folders/field-folders.d.ts +116 -0
- package/dist/types/shared/dashboard-authoring/field-folders/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-decision.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +7 -1
- package/dist/types/shared/dashboard-authoring/operations/card-operations.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +7 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +6 -2
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/see-records/result.d.ts +7 -22
- package/dist/types/shared/dashboard-authoring/sheet-kinds.d.ts +36 -0
- package/dist/types/shared/dashboard-authoring/table-sheet-shape.d.ts +140 -0
- package/dist/types/shared/dashboard-viewer/table-column-move.d.ts +15 -0
- package/dist/types/shared/dashboard-viewer/table-settings.d.ts +8 -2
- package/dist/types/shared/format-utils/types/format-types.d.ts +1 -1
- package/dist/usage-events/index.js +1 -285
- package/dist/value-format-preferences/index.js +1 -635
- package/package.json +5 -2
- package/dist/chunks/add-to-dashboard-CFF-wFU-.js +0 -291
- package/dist/chunks/analytics-base-schemas-DsUh5Q3C.js +0 -680
- package/dist/chunks/appearance-context-BwBp25ZG.js +0 -162
- package/dist/chunks/appearance-runtime-provider-BRHYELkC.js +0 -80
- package/dist/chunks/applied-constraints-DU-wndZ7.js +0 -47
- package/dist/chunks/assistant-chat-B6hNQI1t.js +0 -6115
- package/dist/chunks/attribution-BvoKvhcj.js +0 -32
- package/dist/chunks/availability-Bp5Gfu1I.js +0 -44
- package/dist/chunks/bookmark-impact-Ba2PLcGp.js +0 -76
- package/dist/chunks/bookmark-state-n7AaNzR_.js +0 -1667
- package/dist/chunks/brand-BoUV0iHF.js +0 -54
- package/dist/chunks/card-filter-builder-Y22HizVx.js +0 -4069
- package/dist/chunks/column-bands-RdM-kjDe.js +0 -47
- package/dist/chunks/comparison-window-caption-Ck2TIbnR.js +0 -741
- package/dist/chunks/context-UCQ7sere.js +0 -369
- package/dist/chunks/conversation-sQiWYUOb.js +0 -16
- package/dist/chunks/dashboard-BghI99oY.js +0 -14
- package/dist/chunks/dashboard-briefing-launcher-DtBAnGiH.js +0 -4875
- package/dist/chunks/dashboard-controls-CtFXlyjV.js +0 -2290
- package/dist/chunks/dashboard-json-DfGBUtCd.js +0 -66
- package/dist/chunks/dates-BnrXF4bb.js +0 -185
- package/dist/chunks/edit-9df1zOWe.js +0 -226
- package/dist/chunks/edit-dashboard-visual-oxt3x1wb.js +0 -18397
- package/dist/chunks/export-file-format-C-tJsxsf.js +0 -111
- package/dist/chunks/filter-line-Cy5YYqRL.js +0 -703
- package/dist/chunks/filter-reach-copy-CE_ZX147.js +0 -5111
- package/dist/chunks/filter-value-text-fWvSDwkl.js +0 -153
- package/dist/chunks/index-BVKzKl5d.js +0 -90
- package/dist/chunks/index-CV_Kzou0.js +0 -595
- package/dist/chunks/index-D5rxbtS4.js +0 -2795
- package/dist/chunks/layout-grid-9LndRoLa.js +0 -16
- package/dist/chunks/matrix-analytical-definition-CCp48UCw.js +0 -1233
- package/dist/chunks/matrix-member-presentation-zNehruXR.js +0 -391
- package/dist/chunks/matrix-operation-contract-DPBj69D8.js +0 -1413
- package/dist/chunks/metric-comparison-B0FR-Q8I.js +0 -600
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +0 -119
- package/dist/chunks/paintbrush-58FQYY-y.js +0 -27
- package/dist/chunks/palette-Be62Tkoa.js +0 -23
- package/dist/chunks/pickers-DkqmtnTL.js +0 -2403
- package/dist/chunks/pivot-result-contract-expectations-BYqAmG9n.js +0 -5092
- package/dist/chunks/pivot-result-identity-CAP4--iq.js +0 -77
- package/dist/chunks/raw-temporal-value-Dg_MTFF7.js +0 -3778
- package/dist/chunks/rendered-file-D8xEuVVx.js +0 -108
- package/dist/chunks/report-preferences-dialog-uJp9GBTM.js +0 -1651
- package/dist/chunks/report-runtime-context-c77_KF9v.js +0 -388
- package/dist/chunks/resolve-dashboard-input-context-Rtl1ffmE.js +0 -25324
- package/dist/chunks/resolver-DG_tfEpt.js +0 -156
- package/dist/chunks/save-C5A0JnEV.js +0 -21
- package/dist/chunks/saved-dashboard-context-tcyTU8jm.js +0 -618
- package/dist/chunks/schema-C9NPiIru.js +0 -2568
- package/dist/chunks/selection-filter-compiler-DNijjI5y.js +0 -150
- package/dist/chunks/semaphor-ready-indicator-FBvunj6S.js +0 -145603
- package/dist/chunks/shelf-drop-preview-context-QKStrcK9.js +0 -2466
- package/dist/chunks/stored-dashboard-CHozcAY9.js +0 -4075
- package/dist/chunks/style-sheet-parts-CDCG-8Ej.js +0 -8681
- package/dist/chunks/table-export-sheet-ZFIvs6Sj.js +0 -949
- package/dist/chunks/token-types-XbM6QByy.js +0 -8
- package/dist/chunks/upload-H15d7uHK.js +0 -15
- package/dist/chunks/validators-Baf3VIf5.js +0 -3686
- package/dist/chunks/variable-draft-C2y8Jp6Z.js +0 -242
- package/dist/chunks/visual-choice-DDfHfHvY.js +0 -172
|
@@ -1,124 +1 @@
|
|
|
1
|
-
const m = {
|
|
2
|
-
heartbeatMs: 25e3,
|
|
3
|
-
/** A screen's record expires this long after its last heartbeat: it is gone. */
|
|
4
|
-
heartbeatExpiryMs: 75e3,
|
|
5
|
-
hiddenTabGraceMs: 12e4,
|
|
6
|
-
/** Then the last value repeatedly. */
|
|
7
|
-
reconnectBackoffMs: [0, 1e3, 2e3, 5e3],
|
|
8
|
-
/** One per call. */
|
|
9
|
-
copyAnswerWaitMs: 3e3,
|
|
10
|
-
outcomeWaitMs: 8e3,
|
|
11
|
-
/** applyWithinMs = the outcome wait less this. */
|
|
12
|
-
applyMarginMs: 1e3,
|
|
13
|
-
/** A copy answer or an outcome is kept this long past its call's wait. */
|
|
14
|
-
replyRetentionMs: 3e4,
|
|
15
|
-
/** Distinct screens; a sixth gets 429. */
|
|
16
|
-
connectionsPerToken: 5
|
|
17
|
-
}, a = 200, u = 500, c = 50, p = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, l = /* @__PURE__ */ new Set(["dashboard_changed", "not_editable", "refused", "expired"]);
|
|
18
|
-
function d(r) {
|
|
19
|
-
return typeof r == "string" && p.test(r);
|
|
20
|
-
}
|
|
21
|
-
function b(r, n) {
|
|
22
|
-
const e = I(n);
|
|
23
|
-
if (!e) return t("the event data is not a JSON object");
|
|
24
|
-
if (e.type !== r) return t("the event name and type differ");
|
|
25
|
-
switch (e.type) {
|
|
26
|
-
case "connected":
|
|
27
|
-
return s(e.connectionId) ? { ok: !0, value: { type: "connected", connectionId: e.connectionId } } : t("connected needs a connectionId");
|
|
28
|
-
case "copy_request":
|
|
29
|
-
return s(e.requestId) ? s(e.dashboardId) ? {
|
|
30
|
-
ok: !0,
|
|
31
|
-
value: { type: "copy_request", requestId: e.requestId, dashboardId: e.dashboardId }
|
|
32
|
-
} : t("copy_request needs a dashboardId") : t("copy_request needs a requestId");
|
|
33
|
-
case "delivery":
|
|
34
|
-
return s(e.deliveryId) ? s(e.revisionId) ? s(e.proposalId) ? f(e.operations) ? h(e.context) ? v(e.summary) ? typeof e.applyWithinMs != "number" || !Number.isFinite(e.applyWithinMs) || e.applyWithinMs <= 0 ? t("delivery needs a positive applyWithinMs") : {
|
|
35
|
-
ok: !0,
|
|
36
|
-
value: {
|
|
37
|
-
type: "delivery",
|
|
38
|
-
deliveryId: e.deliveryId,
|
|
39
|
-
revisionId: e.revisionId,
|
|
40
|
-
proposalId: e.proposalId,
|
|
41
|
-
operations: e.operations,
|
|
42
|
-
context: e.context,
|
|
43
|
-
summary: e.summary,
|
|
44
|
-
applyWithinMs: e.applyWithinMs
|
|
45
|
-
}
|
|
46
|
-
} : t("delivery needs a summary") : t("delivery needs a context") : t("delivery needs operations") : t("delivery needs a proposalId") : t("delivery needs a revisionId") : t("delivery needs a deliveryId");
|
|
47
|
-
default:
|
|
48
|
-
return t("unknown event type");
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function M(r, n) {
|
|
52
|
-
const e = o(r);
|
|
53
|
-
if (!e) return t("the answer is not an object");
|
|
54
|
-
if (e.kind !== "uploaded") return t('kind must be "uploaded"');
|
|
55
|
-
if (e.screenId !== n.screenId || !d(e.screenId))
|
|
56
|
-
return t("screenId must match the query string");
|
|
57
|
-
if (e.requestId !== n.requestId || !s(e.requestId))
|
|
58
|
-
return t("requestId must match the query string");
|
|
59
|
-
if (!s(e.revisionId)) return t("the answer needs a revisionId");
|
|
60
|
-
const i = o(e.dashboard);
|
|
61
|
-
return !i || !s(i.id) ? t("the answer needs a dashboard with an id") : {
|
|
62
|
-
ok: !0,
|
|
63
|
-
value: {
|
|
64
|
-
kind: "uploaded",
|
|
65
|
-
screenId: e.screenId,
|
|
66
|
-
requestId: e.requestId,
|
|
67
|
-
revisionId: e.revisionId,
|
|
68
|
-
dashboard: i
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
function _(r) {
|
|
73
|
-
const n = o(r);
|
|
74
|
-
if (!n) return t("the report is not an object");
|
|
75
|
-
if (!d(n.screenId)) return t("the report needs a screenId (UUID v4)");
|
|
76
|
-
if (!s(n.deliveryId)) return t("the report needs a deliveryId");
|
|
77
|
-
const e = y(n.outcome);
|
|
78
|
-
return e ? { ok: !0, value: { screenId: n.screenId, deliveryId: n.deliveryId, outcome: e } } : t("the report needs an outcome");
|
|
79
|
-
}
|
|
80
|
-
function y(r) {
|
|
81
|
-
const n = o(r);
|
|
82
|
-
return n ? n.status === "applied" ? { status: "applied" } : n.status === "not_applied" && typeof n.reason == "string" && l.has(n.reason) && typeof n.message == "string" && n.message.length <= u ? {
|
|
83
|
-
status: "not_applied",
|
|
84
|
-
reason: n.reason,
|
|
85
|
-
message: n.message
|
|
86
|
-
} : null : null;
|
|
87
|
-
}
|
|
88
|
-
function t(r) {
|
|
89
|
-
return { ok: !1, problem: r };
|
|
90
|
-
}
|
|
91
|
-
function I(r) {
|
|
92
|
-
try {
|
|
93
|
-
return o(JSON.parse(r));
|
|
94
|
-
} catch {
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function o(r) {
|
|
99
|
-
return r !== null && typeof r == "object" && !Array.isArray(r) ? r : null;
|
|
100
|
-
}
|
|
101
|
-
function s(r) {
|
|
102
|
-
return typeof r == "string" && r.length > 0 && r.length <= a;
|
|
103
|
-
}
|
|
104
|
-
function f(r) {
|
|
105
|
-
return Array.isArray(r) && r.length > 0 && r.every((n) => {
|
|
106
|
-
const e = o(n);
|
|
107
|
-
return e !== null && typeof e.op == "string";
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
function h(r) {
|
|
111
|
-
const n = o(r);
|
|
112
|
-
return n !== null && (n.calendar === null || o(n.calendar) !== null);
|
|
113
|
-
}
|
|
114
|
-
function v(r) {
|
|
115
|
-
return Array.isArray(r) && r.length <= c && r.every((n) => typeof n == "string");
|
|
116
|
-
}
|
|
117
|
-
export {
|
|
118
|
-
m as LIVE_CHANNEL_TIMINGS,
|
|
119
|
-
d as isScreenId,
|
|
120
|
-
_ as parseDeliveryOutcomeReport,
|
|
121
|
-
b as parseLiveChannelEvent,
|
|
122
|
-
M as parseScreenCopyAnswer,
|
|
123
|
-
y as parseScreenOutcome
|
|
124
|
-
};
|
|
1
|
+
const m={heartbeatMs:25e3,heartbeatExpiryMs:75e3,hiddenTabGraceMs:12e4,reconnectBackoffMs:[0,1e3,2e3,5e3],copyAnswerWaitMs:3e3,outcomeWaitMs:8e3,applyMarginMs:1e3,replyRetentionMs:3e4,connectionsPerToken:5},a=200,u=500,c=50,p=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i,l=/* @__PURE__ */new Set(["dashboard_changed","not_editable","refused","expired"]);function d(r){return typeof r=="string"&&p.test(r);}function b(r,n){const e=I(n);if(!e)return t("the event data is not a JSON object");if(e.type!==r)return t("the event name and type differ");switch(e.type){case"connected":return s(e.connectionId)?{ok:!0,value:{type:"connected",connectionId:e.connectionId}}:t("connected needs a connectionId");case"copy_request":return s(e.requestId)?s(e.dashboardId)?{ok:!0,value:{type:"copy_request",requestId:e.requestId,dashboardId:e.dashboardId}}:t("copy_request needs a dashboardId"):t("copy_request needs a requestId");case"delivery":return s(e.deliveryId)?s(e.revisionId)?s(e.proposalId)?f(e.operations)?h(e.context)?v(e.summary)?typeof e.applyWithinMs!="number"||!Number.isFinite(e.applyWithinMs)||e.applyWithinMs<=0?t("delivery needs a positive applyWithinMs"):{ok:!0,value:{type:"delivery",deliveryId:e.deliveryId,revisionId:e.revisionId,proposalId:e.proposalId,operations:e.operations,context:e.context,summary:e.summary,applyWithinMs:e.applyWithinMs}}:t("delivery needs a summary"):t("delivery needs a context"):t("delivery needs operations"):t("delivery needs a proposalId"):t("delivery needs a revisionId"):t("delivery needs a deliveryId");default:return t("unknown event type");}}function M(r,n){const e=o(r);if(!e)return t("the answer is not an object");if(e.kind!=="uploaded")return t('kind must be "uploaded"');if(e.screenId!==n.screenId||!d(e.screenId))return t("screenId must match the query string");if(e.requestId!==n.requestId||!s(e.requestId))return t("requestId must match the query string");if(!s(e.revisionId))return t("the answer needs a revisionId");const i=o(e.dashboard);return!i||!s(i.id)?t("the answer needs a dashboard with an id"):{ok:!0,value:{kind:"uploaded",screenId:e.screenId,requestId:e.requestId,revisionId:e.revisionId,dashboard:i}};}function _(r){const n=o(r);if(!n)return t("the report is not an object");if(!d(n.screenId))return t("the report needs a screenId (UUID v4)");if(!s(n.deliveryId))return t("the report needs a deliveryId");const e=y(n.outcome);return e?{ok:!0,value:{screenId:n.screenId,deliveryId:n.deliveryId,outcome:e}}:t("the report needs an outcome");}function y(r){const n=o(r);return n?n.status==="applied"?{status:"applied"}:n.status==="not_applied"&&typeof n.reason=="string"&&l.has(n.reason)&&typeof n.message=="string"&&n.message.length<=u?{status:"not_applied",reason:n.reason,message:n.message}:null:null;}function t(r){return{ok:!1,problem:r};}function I(r){try{return o(JSON.parse(r));}catch{return null;}}function o(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)?r:null;}function s(r){return typeof r=="string"&&r.length>0&&r.length<=a;}function f(r){return Array.isArray(r)&&r.length>0&&r.every(n=>{const e=o(n);return e!==null&&typeof e.op=="string";});}function h(r){const n=o(r);return n!==null&&(n.calendar===null||o(n.calendar)!==null);}function v(r){return Array.isArray(r)&&r.length<=c&&r.every(n=>typeof n=="string");}export{m as LIVE_CHANNEL_TIMINGS,d as isScreenId,_ as parseDeliveryOutcomeReport,b as parseLiveChannelEvent,M as parseScreenCopyAnswer,y as parseScreenOutcome};
|
|
@@ -1,92 +1 @@
|
|
|
1
|
-
const s = Object.freeze({
|
|
2
|
-
/**
|
|
3
|
-
* Pages in one paginated PDF, a table or a Document, whatever its paper
|
|
4
|
-
* size or orientation (PC-D3, PC-D11). Measured on the worker (plan
|
|
5
|
-
* Phase 0).
|
|
6
|
-
*/
|
|
7
|
-
maxPages: 300,
|
|
8
|
-
/**
|
|
9
|
-
* Rows in one table of a PDF, whatever prints it: a Table or Detail Table
|
|
10
|
-
* card, a scheduled table, a Matrix and a Document's Table section (PC-D2,
|
|
11
|
-
* PC-D9). Phase 0 measured 5,000 fitting every path on a 6 GB worker
|
|
12
|
-
* (PC-D15); more needs printing from data (PC-D16).
|
|
13
|
-
*/
|
|
14
|
-
maxTableRows: 5e3,
|
|
15
|
-
/**
|
|
16
|
-
* Bytes in one PDF file as a recipient gets it, encrypted or not, merged
|
|
17
|
-
* or not (PC-D5): 50 MiB, the delivery guard's size.
|
|
18
|
-
*/
|
|
19
|
-
maxFileBytes: 52428800
|
|
20
|
-
}), E = Object.freeze({
|
|
21
|
-
maxRequestBytes: 2621440
|
|
22
|
-
// 2.5 MiB
|
|
23
|
-
}), f = "PDF_SAFETY_LIMIT_EXCEEDED", c = Object.freeze([
|
|
24
|
-
"PDF_ROW_LIMIT_EXCEEDED",
|
|
25
|
-
"PDF_PAGE_LIMIT_EXCEEDED",
|
|
26
|
-
"PDF_SIZE_LIMIT_EXCEEDED",
|
|
27
|
-
// A dashboard or visual printed as one page taller than the height guard.
|
|
28
|
-
"PDF_CAPTURE_TOO_TALL"
|
|
29
|
-
]);
|
|
30
|
-
function P(e) {
|
|
31
|
-
return c.includes(e);
|
|
32
|
-
}
|
|
33
|
-
const D = "PDF_NUMBER_COLUMN_TOO_WIDE", a = [
|
|
34
|
-
"rowCount",
|
|
35
|
-
"rowLimit",
|
|
36
|
-
"pageCount",
|
|
37
|
-
"pageLimit",
|
|
38
|
-
"bytes",
|
|
39
|
-
"byteLimit",
|
|
40
|
-
"heightPx",
|
|
41
|
-
"heightLimitPx"
|
|
42
|
-
];
|
|
43
|
-
function u(e) {
|
|
44
|
-
let t = e;
|
|
45
|
-
if (typeof e == "string")
|
|
46
|
-
try {
|
|
47
|
-
t = JSON.parse(e);
|
|
48
|
-
} catch {
|
|
49
|
-
return {};
|
|
50
|
-
}
|
|
51
|
-
if (!t || typeof t != "object" || Array.isArray(t)) return {};
|
|
52
|
-
const _ = t, i = {};
|
|
53
|
-
for (const r of a) {
|
|
54
|
-
const n = _[r];
|
|
55
|
-
typeof n == "number" && Number.isSafeInteger(n) && n >= 0 && (i[r] = n);
|
|
56
|
-
}
|
|
57
|
-
return i;
|
|
58
|
-
}
|
|
59
|
-
const o = Object.freeze([
|
|
60
|
-
"table",
|
|
61
|
-
"detailTable"
|
|
62
|
-
]);
|
|
63
|
-
function T(e) {
|
|
64
|
-
return typeof e == "string" && o.includes(e);
|
|
65
|
-
}
|
|
66
|
-
function C(e) {
|
|
67
|
-
return new TextEncoder().encode(e).byteLength;
|
|
68
|
-
}
|
|
69
|
-
function F(e) {
|
|
70
|
-
return Number.isInteger(e) && e > 0 && e <= s.maxTableRows;
|
|
71
|
-
}
|
|
72
|
-
function I(e) {
|
|
73
|
-
return Number.isInteger(e) && e >= 0 && e <= E.maxRequestBytes;
|
|
74
|
-
}
|
|
75
|
-
function b(e) {
|
|
76
|
-
return Number.isInteger(e) && e > 0 && e <= s.maxPages;
|
|
77
|
-
}
|
|
78
|
-
export {
|
|
79
|
-
E as FAST_PDF_POLICY,
|
|
80
|
-
s as PDF_CAPACITY,
|
|
81
|
-
c as PDF_CAPACITY_REFUSAL_CODES,
|
|
82
|
-
D as PDF_NUMBER_COLUMN_TOO_WIDE,
|
|
83
|
-
f as PDF_SAFETY_LIMIT_EXCEEDED,
|
|
84
|
-
o as PDF_TABLE_CARD_TYPES,
|
|
85
|
-
C as getUtf8ByteLength,
|
|
86
|
-
I as isFastPdfRequestSizeEligible,
|
|
87
|
-
F as isFastPdfRowCountEligible,
|
|
88
|
-
P as isPdfCapacityRefusalCode,
|
|
89
|
-
b as isPdfPageCountWithinCapacity,
|
|
90
|
-
T as isPdfTableCardType,
|
|
91
|
-
u as readPdfCapacityFacts
|
|
92
|
-
};
|
|
1
|
+
const s=Object.freeze({maxPages:300,maxTableRows:5e3,maxFileBytes:52428800}),E=Object.freeze({maxRequestBytes:2621440}),f="PDF_SAFETY_LIMIT_EXCEEDED",c=Object.freeze(["PDF_ROW_LIMIT_EXCEEDED","PDF_PAGE_LIMIT_EXCEEDED","PDF_SIZE_LIMIT_EXCEEDED","PDF_CAPTURE_TOO_TALL"]);function P(e){return c.includes(e);}const D="PDF_NUMBER_COLUMN_TOO_WIDE",a=["rowCount","rowLimit","pageCount","pageLimit","bytes","byteLimit","heightPx","heightLimitPx"];function u(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e);}catch{return{};}if(!t||typeof t!="object"||Array.isArray(t))return{};const _=t,i={};for(const r of a){const n=_[r];typeof n=="number"&&Number.isSafeInteger(n)&&n>=0&&(i[r]=n);}return i;}const o=Object.freeze(["table","detailTable"]);function T(e){return typeof e=="string"&&o.includes(e);}function C(e){return new TextEncoder().encode(e).byteLength;}function F(e){return Number.isInteger(e)&&e>0&&e<=s.maxTableRows;}function I(e){return Number.isInteger(e)&&e>=0&&e<=E.maxRequestBytes;}function b(e){return Number.isInteger(e)&&e>0&&e<=s.maxPages;}export{E as FAST_PDF_POLICY,s as PDF_CAPACITY,c as PDF_CAPACITY_REFUSAL_CODES,D as PDF_NUMBER_COLUMN_TOO_WIDE,f as PDF_SAFETY_LIMIT_EXCEEDED,o as PDF_TABLE_CARD_TYPES,C as getUtf8ByteLength,I as isFastPdfRequestSizeEligible,F as isFastPdfRowCountEligible,P as isPdfCapacityRefusalCode,b as isPdfPageCountWithinCapacity,T as isPdfTableCardType,u as readPdfCapacityFacts};
|