@persei/perseed-api 5.0.17 → 5.0.19
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/ecosystem-container-widget.cjs +34 -0
- package/dist/ecosystem-container-widget.cjs.map +1 -0
- package/dist/ecosystem-container-widget.d.ts +1 -0
- package/dist/ecosystem-container-widget.mjs +34 -0
- package/dist/ecosystem-container-widget.mjs.map +1 -0
- package/dist/global-dates.cjs +6 -0
- package/dist/global-dates.cjs.map +1 -0
- package/dist/global-dates.d.ts +1 -0
- package/dist/global-dates.mjs +6 -0
- package/dist/global-dates.mjs.map +1 -0
- package/dist/global-locale.cjs +28 -0
- package/dist/global-locale.cjs.map +1 -0
- package/dist/global-locale.d.ts +1 -0
- package/dist/global-locale.mjs +28 -0
- package/dist/global-locale.mjs.map +1 -0
- package/dist/lib-CDM5aEJG.cjs +27 -0
- package/dist/lib-CDM5aEJG.cjs.map +1 -0
- package/dist/lib-XRCJ_UAQ.js +28 -0
- package/dist/lib-XRCJ_UAQ.js.map +1 -0
- package/dist/src/app.d.ts.map +1 -1
- package/dist/src/config/config.d.ts +1 -0
- package/dist/src/config/config.d.ts.map +1 -1
- package/dist/src/controllers/AuthController.d.ts +37 -1
- package/dist/src/controllers/AuthController.d.ts.map +1 -1
- package/dist/src/controllers/thryve-credentials-crypto.d.ts +25 -0
- package/dist/src/controllers/thryve-credentials-crypto.d.ts.map +1 -0
- package/dist/src/controllers/thryve-credentials-crypto.test.d.ts +2 -0
- package/dist/src/controllers/thryve-credentials-crypto.test.d.ts.map +1 -0
- package/dist/src/schemas/container_widget/create_widget_payload.schema.json +7 -20
- package/dist/src/schemas/container_widget/update_widget_payload.schema.json +7 -20
- package/dist/src/schemas/container_widget/widgetTypes/PatientListProps.d.ts +2 -6
- package/dist/src/schemas/container_widget/widgetTypes/PatientListProps.d.ts.map +1 -1
- package/dist/src/v2/modules/ecosystem/container-widget/container-widget.helper.d.ts +53 -0
- package/dist/src/v2/modules/ecosystem/container-widget/container-widget.helper.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/container-widget/container-widget.helper.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/container-widget/container-widget.helper.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/container-widget/container-widget.schema.d.ts +22 -0
- package/dist/src/v2/modules/ecosystem/container-widget/container-widget.schema.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/container-widget/container-widget.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/container-widget/index.d.ts +3 -0
- package/dist/src/v2/modules/ecosystem/container-widget/index.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/container-widget/lib.d.ts +3 -0
- package/dist/src/v2/modules/ecosystem/container-widget/lib.d.ts.map +1 -0
- package/dist/src/v2/modules/global/dates/dates.helper.d.ts +17 -0
- package/dist/src/v2/modules/global/dates/dates.helper.d.ts.map +1 -0
- package/dist/src/v2/modules/global/dates/dates.helper.test.d.ts +2 -0
- package/dist/src/v2/modules/global/dates/dates.helper.test.d.ts.map +1 -0
- package/dist/src/v2/modules/global/dates/dates.schema.d.ts +7 -0
- package/dist/src/v2/modules/global/dates/dates.schema.d.ts.map +1 -0
- package/dist/src/v2/modules/global/dates/index.d.ts +2 -0
- package/dist/src/v2/modules/global/dates/index.d.ts.map +1 -1
- package/dist/src/v2/modules/global/dates/lib.d.ts +3 -0
- package/dist/src/v2/modules/global/dates/lib.d.ts.map +1 -0
- package/dist/src/v2/modules/global/e2e-operation/e2e-operation.controller.d.ts.map +1 -0
- package/dist/src/v2/modules/global/e2e-operation/e2e-operation.controller.test.d.ts.map +1 -0
- package/dist/src/v2/modules/global/e2e-operation/e2e-operation.middleware.d.ts.map +1 -0
- package/dist/src/v2/modules/global/e2e-operation/e2e-operation.schema.d.ts.map +1 -0
- package/dist/src/v2/modules/global/e2e-operation/e2e-operation.schema.test.d.ts.map +1 -0
- package/dist/src/v2/modules/{e2e-operation → global/e2e-operation}/e2e-operation.service.d.ts +2 -2
- package/dist/src/v2/modules/global/e2e-operation/e2e-operation.service.d.ts.map +1 -0
- package/dist/src/v2/modules/global/e2e-operation/e2e-operation.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/global/e2e-operation/index.d.ts.map +1 -0
- package/dist/src/v2/modules/global/locale/index.d.ts +3 -0
- package/dist/src/v2/modules/global/locale/index.d.ts.map +1 -0
- package/dist/src/v2/modules/global/locale/lib.d.ts +3 -0
- package/dist/src/v2/modules/global/locale/lib.d.ts.map +1 -0
- package/dist/src/v2/modules/global/locale/locale.helper.d.ts +17 -0
- package/dist/src/v2/modules/global/locale/locale.helper.d.ts.map +1 -0
- package/dist/src/v2/modules/global/locale/locale.helper.test.d.ts +2 -0
- package/dist/src/v2/modules/global/locale/locale.helper.test.d.ts.map +1 -0
- package/dist/src/v2/modules/global/locale/locale.schema.d.ts +15 -0
- package/dist/src/v2/modules/global/locale/locale.schema.d.ts.map +1 -0
- package/dist/src/v2/modules/project/health-data/health-data.service.d.ts +20 -3
- package/dist/src/v2/modules/project/health-data/health-data.service.d.ts.map +1 -1
- package/dist/src/v2/modules/project/thryve/thryve.service.d.ts +15 -3
- package/dist/src/v2/modules/project/thryve/thryve.service.d.ts.map +1 -1
- package/dist/v1/perseed-api.cjs.map +1 -1
- package/dist/v1/perseed-api.mjs.map +1 -1
- package/package.json +2 -1
- package/dist/src/v2/modules/container_widget/container-widget.service.test.d.ts.map +0 -1
- package/dist/src/v2/modules/e2e-operation/e2e-operation.controller.d.ts.map +0 -1
- package/dist/src/v2/modules/e2e-operation/e2e-operation.controller.test.d.ts.map +0 -1
- package/dist/src/v2/modules/e2e-operation/e2e-operation.middleware.d.ts.map +0 -1
- package/dist/src/v2/modules/e2e-operation/e2e-operation.schema.d.ts.map +0 -1
- package/dist/src/v2/modules/e2e-operation/e2e-operation.schema.test.d.ts.map +0 -1
- package/dist/src/v2/modules/e2e-operation/e2e-operation.service.d.ts.map +0 -1
- package/dist/src/v2/modules/e2e-operation/e2e-operation.service.test.d.ts.map +0 -1
- package/dist/src/v2/modules/e2e-operation/index.d.ts.map +0 -1
- /package/dist/src/v2/modules/{container_widget → ecosystem/container-widget}/container-widget.service.test.d.ts +0 -0
- /package/dist/src/v2/modules/{e2e-operation → global/e2e-operation}/e2e-operation.controller.d.ts +0 -0
- /package/dist/src/v2/modules/{e2e-operation → global/e2e-operation}/e2e-operation.controller.test.d.ts +0 -0
- /package/dist/src/v2/modules/{e2e-operation → global/e2e-operation}/e2e-operation.middleware.d.ts +0 -0
- /package/dist/src/v2/modules/{e2e-operation → global/e2e-operation}/e2e-operation.schema.d.ts +0 -0
- /package/dist/src/v2/modules/{e2e-operation → global/e2e-operation}/e2e-operation.schema.test.d.ts +0 -0
- /package/dist/src/v2/modules/{e2e-operation → global/e2e-operation}/e2e-operation.service.test.d.ts +0 -0
- /package/dist/src/v2/modules/{e2e-operation → global/e2e-operation}/index.d.ts +0 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const globalDates = require("./lib-CDM5aEJG.cjs");
|
|
4
|
+
const globalLocale = require("./global-locale.cjs");
|
|
5
|
+
function resolveTrendWindow(nowMs, config, weekStart = globalLocale.getWeekStart(), utc = false) {
|
|
6
|
+
const { fromValue, unit } = config;
|
|
7
|
+
const toValue = config.toValue ?? 0;
|
|
8
|
+
return {
|
|
9
|
+
start: globalDates.getPeriodStart(globalDates.subtractPeriods(nowMs, fromValue, unit, utc), unit, weekStart, utc),
|
|
10
|
+
end: globalDates.getPeriodStart(globalDates.subtractPeriods(nowMs, toValue - 1, unit, utc), unit, weekStart, utc)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function resolveRelativePeriod(nowMs, { value, unit, excludeCurrentPeriod = false }, weekStart = globalLocale.getWeekStart(), utc = false) {
|
|
14
|
+
return resolveTrendWindow(
|
|
15
|
+
nowMs,
|
|
16
|
+
{ fromValue: excludeCurrentPeriod ? value : value - 1, toValue: excludeCurrentPeriod ? 1 : 0, unit },
|
|
17
|
+
weekStart,
|
|
18
|
+
utc
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function resolveRelativeDateRange(nowMs, config, format, weekStart = globalLocale.getWeekStart(), utc = false) {
|
|
22
|
+
const { start, end } = resolveRelativePeriod(nowMs, config, weekStart, utc);
|
|
23
|
+
const cappedEnd = Math.min(end, nowMs);
|
|
24
|
+
const startDate = globalDates.toCalendar(start, utc);
|
|
25
|
+
if (format === "discrete") {
|
|
26
|
+
return { start_date: startDate.toISOString(), end_date: globalDates.toCalendar(cappedEnd, utc).toISOString() };
|
|
27
|
+
}
|
|
28
|
+
const endDate = config.excludeCurrentPeriod ? globalDates.toCalendar(end, utc).subtract(1, "day") : globalDates.toCalendar(cappedEnd, utc);
|
|
29
|
+
return { start_date: startDate.format("YYYY-MM-DD"), end_date: endDate.format("YYYY-MM-DD") };
|
|
30
|
+
}
|
|
31
|
+
exports.resolveRelativeDateRange = resolveRelativeDateRange;
|
|
32
|
+
exports.resolveRelativePeriod = resolveRelativePeriod;
|
|
33
|
+
exports.resolveTrendWindow = resolveTrendWindow;
|
|
34
|
+
//# sourceMappingURL=ecosystem-container-widget.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ecosystem-container-widget.cjs","sources":["../../src/v2/modules/ecosystem/container-widget/container-widget.helper.ts"],"sourcesContent":["import { getPeriodStart, subtractPeriods, toCalendar } from '../../global/dates/dates.helper'\nimport { getWeekStart } from '../../global/locale/locale.helper'\nimport { type RelativePeriodConfig, type TrendWindow, type TrendWindowConfig } from './container-widget.schema'\n\n/**\n * Trend-widget time windows: the `value`/`from`/`to` → concrete-window resolution shared by the trend\n * widget (front, viewer-local) and the health-data time-range filter (backend, UTC). Built on the\n * generic calendar primitives of `global/dates` (which take the week start as a plain number) and the\n * locale week-start resolver of `global/locale`, so the trend-specific rules live here in one place.\n *\n * The `utc` flag is forwarded to the primitives: `false` (default) uses the ambient local calendar\n * (the front, viewer's timezone); `true` uses UTC (the backend). Both callers produce the exact same\n * window for the same inputs and timezone.\n */\n\n/**\n * Resolves a `from`/`to` range into a concrete, calendar-aligned window. `fromValue` and `toValue`\n * are inclusive bucket offsets (\"N units ago\"), so the window covers the **complete** buckets from\n * `toValue`-ago up to `fromValue`-ago (both ends inclusive) and spans `fromValue − toValue + 1`\n * buckets:\n *\n * - `start` (inclusive) = `getPeriodStart(now − fromValue·unit)` — start of the oldest bucket.\n * - `end` (exclusive ms bound) = `getPeriodStart(now − (toValue − 1)·unit)` — the start of the\n * bucket just after the newest included one, i.e. the end of the `toValue` bucket. When\n * `toValue = 0` this is the start of the next bucket, so the current (in-progress) bucket is\n * included in full — the window has no `now` cap, both extremes are complete buckets.\n *\n * Example (unit = week, weekStart = 1 Monday, now = Tue 2026-07-07):\n * from 2, to 0 → [Mon 22 Jun, Mon 13 Jul) (3 weeks, the current one included in full)\n * from 3, to 1 → [Mon 15 Jun, Mon 06 Jul) (3 complete weeks, the current one excluded)\n */\nexport function resolveTrendWindow(\n nowMs: number,\n config: TrendWindowConfig,\n weekStart: number = getWeekStart(),\n utc = false,\n): TrendWindow {\n const { fromValue, unit } = config\n const toValue = config.toValue ?? 0\n return {\n start: getPeriodStart(subtractPeriods(nowMs, fromValue, unit, utc), unit, weekStart, utc),\n end: getPeriodStart(subtractPeriods(nowMs, toValue - 1, unit, utc), unit, weekStart, utc),\n }\n}\n\n/**\n * Resolves a count-based relative period into a concrete window — the single source of truth for the\n * `value` → from/to mapping shared by every consumer (backend health-data filter, front trend widget),\n * so the \"current period counts as one of the N\" rule is defined exactly once:\n * - including it → `from = value - 1`, `to = 0` (buckets `value-1`…0 ago, ending now);\n * - excluding it → `from = value`, `to = 1` (`value` complete buckets before the current one).\n */\nexport function resolveRelativePeriod(\n nowMs: number,\n { value, unit, excludeCurrentPeriod = false }: RelativePeriodConfig,\n weekStart: number = getWeekStart(),\n utc = false,\n): TrendWindow {\n return resolveTrendWindow(\n nowMs,\n { fromValue: excludeCurrentPeriod ? value : value - 1, toValue: excludeCurrentPeriod ? 1 : 0, unit },\n weekStart,\n utc,\n )\n}\n\n/**\n * Resolves a count-based relative period into a formatted date range for the backend health-data\n * query, keeping the whole calculation (from/to mapping + the day-level rule + formatting) in one\n * shared place:\n * - `daily`: date-only `YYYY-MM-DD`; when excluding the current period the inclusive end becomes the\n * last completed calendar day (the day before the current period's start).\n * - `discrete`: ISO-8601.\n *\n * Unlike `resolveTrendWindow` (which now covers the current bucket in full for the front display), the\n * query end is **capped at `now`**: a data query must never reach past the present into the rest of an\n * in-progress bucket, so `to = 0` yields \"up to now\", not \"up to the end of the current bucket\".\n */\nexport function resolveRelativeDateRange(\n nowMs: number,\n config: RelativePeriodConfig,\n format: 'daily' | 'discrete',\n weekStart: number = getWeekStart(),\n utc = false,\n): { start_date: string; end_date: string } {\n const { start, end } = resolveRelativePeriod(nowMs, config, weekStart, utc)\n const cappedEnd = Math.min(end, nowMs)\n const startDate = toCalendar(start, utc)\n if (format === 'discrete') {\n return { start_date: startDate.toISOString(), end_date: toCalendar(cappedEnd, utc).toISOString() }\n }\n const endDate = config.excludeCurrentPeriod ? toCalendar(end, utc).subtract(1, 'day') : toCalendar(cappedEnd, utc)\n return { start_date: startDate.format('YYYY-MM-DD'), end_date: endDate.format('YYYY-MM-DD') }\n}\n"],"names":["getWeekStart","getPeriodStart","subtractPeriods","toCalendar"],"mappings":";;;;AA+BO,SAAS,mBACd,OACA,QACA,YAAoBA,aAAAA,aAAA,GACpB,MAAM,OACO;AACb,QAAM,EAAE,WAAW,KAAA,IAAS;AAC5B,QAAM,UAAU,OAAO,WAAW;AAClC,SAAO;AAAA,IACL,OAAOC,YAAAA,eAAeC,4BAAgB,OAAO,WAAW,MAAM,GAAG,GAAG,MAAM,WAAW,GAAG;AAAA,IACxF,KAAKD,YAAAA,eAAeC,4BAAgB,OAAO,UAAU,GAAG,MAAM,GAAG,GAAG,MAAM,WAAW,GAAG;AAAA,EAAA;AAE5F;AASO,SAAS,sBACd,OACA,EAAE,OAAO,MAAM,uBAAuB,MAAA,GACtC,YAAoBF,aAAAA,gBACpB,MAAM,OACO;AACb,SAAO;AAAA,IACL;AAAA,IACA,EAAE,WAAW,uBAAuB,QAAQ,QAAQ,GAAG,SAAS,uBAAuB,IAAI,GAAG,KAAA;AAAA,IAC9F;AAAA,IACA;AAAA,EAAA;AAEJ;AAcO,SAAS,yBACd,OACA,QACA,QACA,YAAoBA,0BAAA,GACpB,MAAM,OACoC;AAC1C,QAAM,EAAE,OAAO,QAAQ,sBAAsB,OAAO,QAAQ,WAAW,GAAG;AAC1E,QAAM,YAAY,KAAK,IAAI,KAAK,KAAK;AACrC,QAAM,YAAYG,YAAAA,WAAW,OAAO,GAAG;AACvC,MAAI,WAAW,YAAY;AACzB,WAAO,EAAE,YAAY,UAAU,eAAe,UAAUA,YAAAA,WAAW,WAAW,GAAG,EAAE,cAAY;AAAA,EACjG;AACA,QAAM,UAAU,OAAO,uBAAuBA,YAAAA,WAAW,KAAK,GAAG,EAAE,SAAS,GAAG,KAAK,IAAIA,YAAAA,WAAW,WAAW,GAAG;AACjH,SAAO,EAAE,YAAY,UAAU,OAAO,YAAY,GAAG,UAAU,QAAQ,OAAO,YAAY,EAAA;AAC5F;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/v2/modules/ecosystem/container-widget/lib'
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { t as toCalendar, g as getPeriodStart, s as subtractPeriods } from "./lib-XRCJ_UAQ.js";
|
|
2
|
+
import { getWeekStart } from "./global-locale.mjs";
|
|
3
|
+
function resolveTrendWindow(nowMs, config, weekStart = getWeekStart(), utc = false) {
|
|
4
|
+
const { fromValue, unit } = config;
|
|
5
|
+
const toValue = config.toValue ?? 0;
|
|
6
|
+
return {
|
|
7
|
+
start: getPeriodStart(subtractPeriods(nowMs, fromValue, unit, utc), unit, weekStart, utc),
|
|
8
|
+
end: getPeriodStart(subtractPeriods(nowMs, toValue - 1, unit, utc), unit, weekStart, utc)
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function resolveRelativePeriod(nowMs, { value, unit, excludeCurrentPeriod = false }, weekStart = getWeekStart(), utc = false) {
|
|
12
|
+
return resolveTrendWindow(
|
|
13
|
+
nowMs,
|
|
14
|
+
{ fromValue: excludeCurrentPeriod ? value : value - 1, toValue: excludeCurrentPeriod ? 1 : 0, unit },
|
|
15
|
+
weekStart,
|
|
16
|
+
utc
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function resolveRelativeDateRange(nowMs, config, format, weekStart = getWeekStart(), utc = false) {
|
|
20
|
+
const { start, end } = resolveRelativePeriod(nowMs, config, weekStart, utc);
|
|
21
|
+
const cappedEnd = Math.min(end, nowMs);
|
|
22
|
+
const startDate = toCalendar(start, utc);
|
|
23
|
+
if (format === "discrete") {
|
|
24
|
+
return { start_date: startDate.toISOString(), end_date: toCalendar(cappedEnd, utc).toISOString() };
|
|
25
|
+
}
|
|
26
|
+
const endDate = config.excludeCurrentPeriod ? toCalendar(end, utc).subtract(1, "day") : toCalendar(cappedEnd, utc);
|
|
27
|
+
return { start_date: startDate.format("YYYY-MM-DD"), end_date: endDate.format("YYYY-MM-DD") };
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
resolveRelativeDateRange,
|
|
31
|
+
resolveRelativePeriod,
|
|
32
|
+
resolveTrendWindow
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=ecosystem-container-widget.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ecosystem-container-widget.mjs","sources":["../../src/v2/modules/ecosystem/container-widget/container-widget.helper.ts"],"sourcesContent":["import { getPeriodStart, subtractPeriods, toCalendar } from '../../global/dates/dates.helper'\nimport { getWeekStart } from '../../global/locale/locale.helper'\nimport { type RelativePeriodConfig, type TrendWindow, type TrendWindowConfig } from './container-widget.schema'\n\n/**\n * Trend-widget time windows: the `value`/`from`/`to` → concrete-window resolution shared by the trend\n * widget (front, viewer-local) and the health-data time-range filter (backend, UTC). Built on the\n * generic calendar primitives of `global/dates` (which take the week start as a plain number) and the\n * locale week-start resolver of `global/locale`, so the trend-specific rules live here in one place.\n *\n * The `utc` flag is forwarded to the primitives: `false` (default) uses the ambient local calendar\n * (the front, viewer's timezone); `true` uses UTC (the backend). Both callers produce the exact same\n * window for the same inputs and timezone.\n */\n\n/**\n * Resolves a `from`/`to` range into a concrete, calendar-aligned window. `fromValue` and `toValue`\n * are inclusive bucket offsets (\"N units ago\"), so the window covers the **complete** buckets from\n * `toValue`-ago up to `fromValue`-ago (both ends inclusive) and spans `fromValue − toValue + 1`\n * buckets:\n *\n * - `start` (inclusive) = `getPeriodStart(now − fromValue·unit)` — start of the oldest bucket.\n * - `end` (exclusive ms bound) = `getPeriodStart(now − (toValue − 1)·unit)` — the start of the\n * bucket just after the newest included one, i.e. the end of the `toValue` bucket. When\n * `toValue = 0` this is the start of the next bucket, so the current (in-progress) bucket is\n * included in full — the window has no `now` cap, both extremes are complete buckets.\n *\n * Example (unit = week, weekStart = 1 Monday, now = Tue 2026-07-07):\n * from 2, to 0 → [Mon 22 Jun, Mon 13 Jul) (3 weeks, the current one included in full)\n * from 3, to 1 → [Mon 15 Jun, Mon 06 Jul) (3 complete weeks, the current one excluded)\n */\nexport function resolveTrendWindow(\n nowMs: number,\n config: TrendWindowConfig,\n weekStart: number = getWeekStart(),\n utc = false,\n): TrendWindow {\n const { fromValue, unit } = config\n const toValue = config.toValue ?? 0\n return {\n start: getPeriodStart(subtractPeriods(nowMs, fromValue, unit, utc), unit, weekStart, utc),\n end: getPeriodStart(subtractPeriods(nowMs, toValue - 1, unit, utc), unit, weekStart, utc),\n }\n}\n\n/**\n * Resolves a count-based relative period into a concrete window — the single source of truth for the\n * `value` → from/to mapping shared by every consumer (backend health-data filter, front trend widget),\n * so the \"current period counts as one of the N\" rule is defined exactly once:\n * - including it → `from = value - 1`, `to = 0` (buckets `value-1`…0 ago, ending now);\n * - excluding it → `from = value`, `to = 1` (`value` complete buckets before the current one).\n */\nexport function resolveRelativePeriod(\n nowMs: number,\n { value, unit, excludeCurrentPeriod = false }: RelativePeriodConfig,\n weekStart: number = getWeekStart(),\n utc = false,\n): TrendWindow {\n return resolveTrendWindow(\n nowMs,\n { fromValue: excludeCurrentPeriod ? value : value - 1, toValue: excludeCurrentPeriod ? 1 : 0, unit },\n weekStart,\n utc,\n )\n}\n\n/**\n * Resolves a count-based relative period into a formatted date range for the backend health-data\n * query, keeping the whole calculation (from/to mapping + the day-level rule + formatting) in one\n * shared place:\n * - `daily`: date-only `YYYY-MM-DD`; when excluding the current period the inclusive end becomes the\n * last completed calendar day (the day before the current period's start).\n * - `discrete`: ISO-8601.\n *\n * Unlike `resolveTrendWindow` (which now covers the current bucket in full for the front display), the\n * query end is **capped at `now`**: a data query must never reach past the present into the rest of an\n * in-progress bucket, so `to = 0` yields \"up to now\", not \"up to the end of the current bucket\".\n */\nexport function resolveRelativeDateRange(\n nowMs: number,\n config: RelativePeriodConfig,\n format: 'daily' | 'discrete',\n weekStart: number = getWeekStart(),\n utc = false,\n): { start_date: string; end_date: string } {\n const { start, end } = resolveRelativePeriod(nowMs, config, weekStart, utc)\n const cappedEnd = Math.min(end, nowMs)\n const startDate = toCalendar(start, utc)\n if (format === 'discrete') {\n return { start_date: startDate.toISOString(), end_date: toCalendar(cappedEnd, utc).toISOString() }\n }\n const endDate = config.excludeCurrentPeriod ? toCalendar(end, utc).subtract(1, 'day') : toCalendar(cappedEnd, utc)\n return { start_date: startDate.format('YYYY-MM-DD'), end_date: endDate.format('YYYY-MM-DD') }\n}\n"],"names":[],"mappings":";;AA+BO,SAAS,mBACd,OACA,QACA,YAAoB,aAAA,GACpB,MAAM,OACO;AACb,QAAM,EAAE,WAAW,KAAA,IAAS;AAC5B,QAAM,UAAU,OAAO,WAAW;AAClC,SAAO;AAAA,IACL,OAAO,eAAe,gBAAgB,OAAO,WAAW,MAAM,GAAG,GAAG,MAAM,WAAW,GAAG;AAAA,IACxF,KAAK,eAAe,gBAAgB,OAAO,UAAU,GAAG,MAAM,GAAG,GAAG,MAAM,WAAW,GAAG;AAAA,EAAA;AAE5F;AASO,SAAS,sBACd,OACA,EAAE,OAAO,MAAM,uBAAuB,MAAA,GACtC,YAAoB,gBACpB,MAAM,OACO;AACb,SAAO;AAAA,IACL;AAAA,IACA,EAAE,WAAW,uBAAuB,QAAQ,QAAQ,GAAG,SAAS,uBAAuB,IAAI,GAAG,KAAA;AAAA,IAC9F;AAAA,IACA;AAAA,EAAA;AAEJ;AAcO,SAAS,yBACd,OACA,QACA,QACA,YAAoB,aAAA,GACpB,MAAM,OACoC;AAC1C,QAAM,EAAE,OAAO,QAAQ,sBAAsB,OAAO,QAAQ,WAAW,GAAG;AAC1E,QAAM,YAAY,KAAK,IAAI,KAAK,KAAK;AACrC,QAAM,YAAY,WAAW,OAAO,GAAG;AACvC,MAAI,WAAW,YAAY;AACzB,WAAO,EAAE,YAAY,UAAU,eAAe,UAAU,WAAW,WAAW,GAAG,EAAE,cAAY;AAAA,EACjG;AACA,QAAM,UAAU,OAAO,uBAAuB,WAAW,KAAK,GAAG,EAAE,SAAS,GAAG,KAAK,IAAI,WAAW,WAAW,GAAG;AACjH,SAAO,EAAE,YAAY,UAAU,OAAO,YAAY,GAAG,UAAU,QAAQ,OAAO,YAAY,EAAA;AAC5F;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const globalDates = require("./lib-CDM5aEJG.cjs");
|
|
4
|
+
exports.getPeriodStart = globalDates.getPeriodStart;
|
|
5
|
+
exports.subtractPeriods = globalDates.subtractPeriods;
|
|
6
|
+
//# sourceMappingURL=global-dates.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-dates.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/v2/modules/global/dates/lib'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-dates.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const DEFAULT_LOCALE = "es-ES";
|
|
4
|
+
const FALLBACK_WEEK_START = 1;
|
|
5
|
+
function toLocale(raw) {
|
|
6
|
+
const tag = raw?.trim().replace(/_/g, "-");
|
|
7
|
+
if (!tag) return DEFAULT_LOCALE;
|
|
8
|
+
try {
|
|
9
|
+
const loc = new Intl.Locale(tag);
|
|
10
|
+
const region = loc.region ?? loc.maximize().region;
|
|
11
|
+
if (region) return `${loc.language}-${region}`;
|
|
12
|
+
} catch {
|
|
13
|
+
}
|
|
14
|
+
return DEFAULT_LOCALE;
|
|
15
|
+
}
|
|
16
|
+
function getWeekStart(locale = DEFAULT_LOCALE) {
|
|
17
|
+
try {
|
|
18
|
+
const loc = new Intl.Locale(locale);
|
|
19
|
+
const info = loc.weekInfo ?? loc.getWeekInfo?.();
|
|
20
|
+
if (info && typeof info.firstDay === "number") return info.firstDay;
|
|
21
|
+
} catch {
|
|
22
|
+
}
|
|
23
|
+
return FALLBACK_WEEK_START;
|
|
24
|
+
}
|
|
25
|
+
exports.DEFAULT_LOCALE = DEFAULT_LOCALE;
|
|
26
|
+
exports.getWeekStart = getWeekStart;
|
|
27
|
+
exports.toLocale = toLocale;
|
|
28
|
+
//# sourceMappingURL=global-locale.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-locale.cjs","sources":["../../src/v2/modules/global/locale/locale.schema.ts","../../src/v2/modules/global/locale/locale.helper.ts"],"sourcesContent":["/**\n * Locale contracts owned by this module. Pure types/constants only — the normalization and week-info\n * logic that consumes them lives in `locale.helper.ts`.\n */\n\n// Canonical locale: BCP-47 `language-REGION`, region ALWAYS present (e.g. `es-ES`, `en-US`).\n// Every consumer works on this fixed shape — normalize raw input once with `toLocale`, never re-parse.\nexport type Locale = `${Lowercase<string>}-${Uppercase<string>}`\n\n// Platform default, unified with the default timezone (Europe/Madrid → Spain → week starts Monday).\nexport const DEFAULT_LOCALE: Locale = 'es-ES'\n\n// `weekInfo` (getter) / `getWeekInfo()` are not yet in the TS `Intl.Locale` lib types.\nexport type LocaleWithWeekInfo = Intl.Locale & {\n weekInfo?: { firstDay: number }\n getWeekInfo?: () => { firstDay: number }\n}\n","import { DEFAULT_LOCALE, type Locale, type LocaleWithWeekInfo } from './locale.schema'\n\n/**\n * Locale normalization and calendar week-info derived from the user's locale. Kept separate from\n * `global/dates`: this module answers cultural questions about a locale (canonical shape, which\n * weekday starts the week), while `dates` does calendar arithmetic and takes the week start as an\n * already-resolved number. That split keeps `dates` locale-agnostic and free of any v2-module import.\n */\n\n// ISO Monday: the week start of DEFAULT_LOCALE. Only used if the runtime lacks Intl week info.\nconst FALLBACK_WEEK_START = 1\n\n/**\n * Normalizes any raw locale into the canonical {@link Locale}. Converts `_`→`-`, and when the tag\n * carries no region, resolves the language's OWN default region via `Intl.Locale.maximize()` (CLDR\n * likely-subtags): `en` → `en-US`, `es` → `es-ES`, `de` → `de-DE`. An explicit region is preserved\n * (`en-GB` stays `en-GB`). Empty/blank/unparseable input falls back to {@link DEFAULT_LOCALE}. Call\n * this ONCE at each boundary; downstream functions take an already-normalized `Locale`.\n */\nexport function toLocale(raw?: string | null): Locale {\n const tag = raw?.trim().replace(/_/g, '-')\n if (!tag) return DEFAULT_LOCALE\n try {\n const loc = new Intl.Locale(tag)\n const region = loc.region ?? loc.maximize().region\n if (region) return `${loc.language}-${region}` as Locale\n } catch {\n // Unparseable tag — fall back to the platform default.\n }\n return DEFAULT_LOCALE\n}\n\n/**\n * Returns the ISO weekday number (1 = Monday … 7 = Sunday) that starts the week for `locale`. Takes\n * an already-canonical {@link Locale} (normalize raw input with {@link toLocale} first), so no format\n * parsing happens here. Falls back to {@link DEFAULT_LOCALE}'s week start only on runtimes without\n * Intl week info.\n */\nexport function getWeekStart(locale: Locale = DEFAULT_LOCALE): number {\n try {\n const loc = new Intl.Locale(locale) as LocaleWithWeekInfo\n const info = loc.weekInfo ?? loc.getWeekInfo?.()\n if (info && typeof info.firstDay === 'number') return info.firstDay\n } catch {\n // Runtime without Intl week info, or a locale Intl rejects — use the default week start.\n }\n return FALLBACK_WEEK_START\n}\n"],"names":[],"mappings":";;AAUO,MAAM,iBAAyB;ACAtC,MAAM,sBAAsB;AASrB,SAAS,SAAS,KAA6B;AACpD,QAAM,MAAM,KAAK,KAAA,EAAO,QAAQ,MAAM,GAAG;AACzC,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI;AACF,UAAM,MAAM,IAAI,KAAK,OAAO,GAAG;AAC/B,UAAM,SAAS,IAAI,UAAU,IAAI,WAAW;AAC5C,QAAI,OAAQ,QAAO,GAAG,IAAI,QAAQ,IAAI,MAAM;AAAA,EAC9C,QAAQ;AAAA,EAER;AACA,SAAO;AACT;AAQO,SAAS,aAAa,SAAiB,gBAAwB;AACpE,MAAI;AACF,UAAM,MAAM,IAAI,KAAK,OAAO,MAAM;AAClC,UAAM,OAAO,IAAI,YAAY,IAAI,cAAA;AACjC,QAAI,QAAQ,OAAO,KAAK,aAAa,iBAAiB,KAAK;AAAA,EAC7D,QAAQ;AAAA,EAER;AACA,SAAO;AACT;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/v2/modules/global/locale/lib'
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const DEFAULT_LOCALE = "es-ES";
|
|
2
|
+
const FALLBACK_WEEK_START = 1;
|
|
3
|
+
function toLocale(raw) {
|
|
4
|
+
const tag = raw?.trim().replace(/_/g, "-");
|
|
5
|
+
if (!tag) return DEFAULT_LOCALE;
|
|
6
|
+
try {
|
|
7
|
+
const loc = new Intl.Locale(tag);
|
|
8
|
+
const region = loc.region ?? loc.maximize().region;
|
|
9
|
+
if (region) return `${loc.language}-${region}`;
|
|
10
|
+
} catch {
|
|
11
|
+
}
|
|
12
|
+
return DEFAULT_LOCALE;
|
|
13
|
+
}
|
|
14
|
+
function getWeekStart(locale = DEFAULT_LOCALE) {
|
|
15
|
+
try {
|
|
16
|
+
const loc = new Intl.Locale(locale);
|
|
17
|
+
const info = loc.weekInfo ?? loc.getWeekInfo?.();
|
|
18
|
+
if (info && typeof info.firstDay === "number") return info.firstDay;
|
|
19
|
+
} catch {
|
|
20
|
+
}
|
|
21
|
+
return FALLBACK_WEEK_START;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
DEFAULT_LOCALE,
|
|
25
|
+
getWeekStart,
|
|
26
|
+
toLocale
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=global-locale.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-locale.mjs","sources":["../../src/v2/modules/global/locale/locale.schema.ts","../../src/v2/modules/global/locale/locale.helper.ts"],"sourcesContent":["/**\n * Locale contracts owned by this module. Pure types/constants only — the normalization and week-info\n * logic that consumes them lives in `locale.helper.ts`.\n */\n\n// Canonical locale: BCP-47 `language-REGION`, region ALWAYS present (e.g. `es-ES`, `en-US`).\n// Every consumer works on this fixed shape — normalize raw input once with `toLocale`, never re-parse.\nexport type Locale = `${Lowercase<string>}-${Uppercase<string>}`\n\n// Platform default, unified with the default timezone (Europe/Madrid → Spain → week starts Monday).\nexport const DEFAULT_LOCALE: Locale = 'es-ES'\n\n// `weekInfo` (getter) / `getWeekInfo()` are not yet in the TS `Intl.Locale` lib types.\nexport type LocaleWithWeekInfo = Intl.Locale & {\n weekInfo?: { firstDay: number }\n getWeekInfo?: () => { firstDay: number }\n}\n","import { DEFAULT_LOCALE, type Locale, type LocaleWithWeekInfo } from './locale.schema'\n\n/**\n * Locale normalization and calendar week-info derived from the user's locale. Kept separate from\n * `global/dates`: this module answers cultural questions about a locale (canonical shape, which\n * weekday starts the week), while `dates` does calendar arithmetic and takes the week start as an\n * already-resolved number. That split keeps `dates` locale-agnostic and free of any v2-module import.\n */\n\n// ISO Monday: the week start of DEFAULT_LOCALE. Only used if the runtime lacks Intl week info.\nconst FALLBACK_WEEK_START = 1\n\n/**\n * Normalizes any raw locale into the canonical {@link Locale}. Converts `_`→`-`, and when the tag\n * carries no region, resolves the language's OWN default region via `Intl.Locale.maximize()` (CLDR\n * likely-subtags): `en` → `en-US`, `es` → `es-ES`, `de` → `de-DE`. An explicit region is preserved\n * (`en-GB` stays `en-GB`). Empty/blank/unparseable input falls back to {@link DEFAULT_LOCALE}. Call\n * this ONCE at each boundary; downstream functions take an already-normalized `Locale`.\n */\nexport function toLocale(raw?: string | null): Locale {\n const tag = raw?.trim().replace(/_/g, '-')\n if (!tag) return DEFAULT_LOCALE\n try {\n const loc = new Intl.Locale(tag)\n const region = loc.region ?? loc.maximize().region\n if (region) return `${loc.language}-${region}` as Locale\n } catch {\n // Unparseable tag — fall back to the platform default.\n }\n return DEFAULT_LOCALE\n}\n\n/**\n * Returns the ISO weekday number (1 = Monday … 7 = Sunday) that starts the week for `locale`. Takes\n * an already-canonical {@link Locale} (normalize raw input with {@link toLocale} first), so no format\n * parsing happens here. Falls back to {@link DEFAULT_LOCALE}'s week start only on runtimes without\n * Intl week info.\n */\nexport function getWeekStart(locale: Locale = DEFAULT_LOCALE): number {\n try {\n const loc = new Intl.Locale(locale) as LocaleWithWeekInfo\n const info = loc.weekInfo ?? loc.getWeekInfo?.()\n if (info && typeof info.firstDay === 'number') return info.firstDay\n } catch {\n // Runtime without Intl week info, or a locale Intl rejects — use the default week start.\n }\n return FALLBACK_WEEK_START\n}\n"],"names":[],"mappings":"AAUO,MAAM,iBAAyB;ACAtC,MAAM,sBAAsB;AASrB,SAAS,SAAS,KAA6B;AACpD,QAAM,MAAM,KAAK,KAAA,EAAO,QAAQ,MAAM,GAAG;AACzC,MAAI,CAAC,IAAK,QAAO;AACjB,MAAI;AACF,UAAM,MAAM,IAAI,KAAK,OAAO,GAAG;AAC/B,UAAM,SAAS,IAAI,UAAU,IAAI,WAAW;AAC5C,QAAI,OAAQ,QAAO,GAAG,IAAI,QAAQ,IAAI,MAAM;AAAA,EAC9C,QAAQ;AAAA,EAER;AACA,SAAO;AACT;AAQO,SAAS,aAAa,SAAiB,gBAAwB;AACpE,MAAI;AACF,UAAM,MAAM,IAAI,KAAK,OAAO,MAAM;AAClC,UAAM,OAAO,IAAI,YAAY,IAAI,cAAA;AACjC,QAAI,QAAQ,OAAO,KAAK,aAAa,iBAAiB,KAAK;AAAA,EAC7D,QAAQ;AAAA,EAER;AACA,SAAO;AACT;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const dayjs = require("dayjs");
|
|
3
|
+
const utcPlugin = require("dayjs/plugin/utc");
|
|
4
|
+
dayjs.extend(utcPlugin);
|
|
5
|
+
const DEFAULT_WEEK_START = 1;
|
|
6
|
+
function toCalendar(ms, utc) {
|
|
7
|
+
return utc ? dayjs.utc(ms) : dayjs(ms);
|
|
8
|
+
}
|
|
9
|
+
function isoWeekday(d) {
|
|
10
|
+
const day = d.day();
|
|
11
|
+
return day === 0 ? 7 : day;
|
|
12
|
+
}
|
|
13
|
+
function getPeriodStart(ms, unit, weekStart = DEFAULT_WEEK_START, utc = false) {
|
|
14
|
+
const d = toCalendar(ms, utc);
|
|
15
|
+
if (unit === "week") {
|
|
16
|
+
const diff = (isoWeekday(d) - weekStart + 7) % 7;
|
|
17
|
+
return d.subtract(diff, "day").startOf("day").valueOf();
|
|
18
|
+
}
|
|
19
|
+
return d.startOf(unit).valueOf();
|
|
20
|
+
}
|
|
21
|
+
function subtractPeriods(ms, value, unit, utc = false) {
|
|
22
|
+
return toCalendar(ms, utc).subtract(value, unit).valueOf();
|
|
23
|
+
}
|
|
24
|
+
exports.getPeriodStart = getPeriodStart;
|
|
25
|
+
exports.subtractPeriods = subtractPeriods;
|
|
26
|
+
exports.toCalendar = toCalendar;
|
|
27
|
+
//# sourceMappingURL=lib-CDM5aEJG.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib-CDM5aEJG.cjs","sources":["../../src/v2/modules/global/dates/dates.helper.ts"],"sourcesContent":["import dayjs from 'dayjs'\nimport utcPlugin from 'dayjs/plugin/utc'\nimport { type PeriodUnit } from './dates.schema'\n\n/**\n * Generic calendar primitives — period alignment and whole-period arithmetic. Built on `dayjs`\n * (already used by every consumer), so calendar arithmetic and month-end clamping come for free.\n *\n * These functions are locale-agnostic: the week start is always an injected number (1 = Monday …\n * 7 = Sunday), never derived here. Callers that need a locale-aware week start resolve it with\n * `global/locale`'s `getWeekStart(locale)` and pass the result in. That keeps this module free of\n * any dependency on other v2 modules.\n *\n * The `utc` flag selects the calendar the alignment runs in: `false` (default) uses the ambient\n * local calendar (a viewer's timezone); `true` uses UTC (the backend). Everything else is shared.\n */\n\ndayjs.extend(utcPlugin)\n\n// ISO Monday — the week start assumed when the caller doesn't inject a locale-derived one. Matches\n// DEFAULT_LOCALE (es-ES), whose week also starts on Monday.\nexport const DEFAULT_WEEK_START = 1\n\n// Builds the dayjs instance in the requested calendar (UTC or ambient local).\nexport function toCalendar(ms: number, utc: boolean): dayjs.Dayjs {\n return utc ? dayjs.utc(ms) : dayjs(ms)\n}\n\n// dayjs `.day()` is 0 = Sunday … 6 = Saturday; convert to ISO 1 = Monday … 7 = Sunday.\nfunction isoWeekday(d: dayjs.Dayjs): number {\n const day = d.day()\n return day === 0 ? 7 : day\n}\n\n/**\n * Aligns an instant to the start of the calendar period it falls in:\n * weeks → the injected first weekday at midnight, months → the 1st at midnight,\n * days → midnight, hours → the start of the hour. `utc` runs the alignment in UTC.\n */\nexport function getPeriodStart(\n ms: number,\n unit: PeriodUnit,\n weekStart: number = DEFAULT_WEEK_START,\n utc = false,\n): number {\n const d = toCalendar(ms, utc)\n if (unit === 'week') {\n // Not `startOf('week')`: that follows the dayjs locale, but the week start here is caller-driven.\n const diff = (isoWeekday(d) - weekStart + 7) % 7\n return d.subtract(diff, 'day').startOf('day').valueOf()\n }\n return d.startOf(unit).valueOf()\n}\n\n/**\n * Subtracts `value` whole calendar periods from an instant, without aligning. Month subtraction\n * clamps to the last day of the target month (e.g. 31 Mar − 1 month → 28 Feb), which dayjs does\n * natively. `utc` runs the arithmetic in UTC.\n */\nexport function subtractPeriods(ms: number, value: number, unit: PeriodUnit, utc = false): number {\n return toCalendar(ms, utc).subtract(value, unit).valueOf()\n}\n"],"names":[],"mappings":";;;AAiBA,MAAM,OAAO,SAAS;AAIf,MAAM,qBAAqB;AAG3B,SAAS,WAAW,IAAY,KAA2B;AAChE,SAAO,MAAM,MAAM,IAAI,EAAE,IAAI,MAAM,EAAE;AACvC;AAGA,SAAS,WAAW,GAAwB;AAC1C,QAAM,MAAM,EAAE,IAAA;AACd,SAAO,QAAQ,IAAI,IAAI;AACzB;AAOO,SAAS,eACd,IACA,MACA,YAAoB,oBACpB,MAAM,OACE;AACR,QAAM,IAAI,WAAW,IAAI,GAAG;AAC5B,MAAI,SAAS,QAAQ;AAEnB,UAAM,QAAQ,WAAW,CAAC,IAAI,YAAY,KAAK;AAC/C,WAAO,EAAE,SAAS,MAAM,KAAK,EAAE,QAAQ,KAAK,EAAE,QAAA;AAAA,EAChD;AACA,SAAO,EAAE,QAAQ,IAAI,EAAE,QAAA;AACzB;AAOO,SAAS,gBAAgB,IAAY,OAAe,MAAkB,MAAM,OAAe;AAChG,SAAO,WAAW,IAAI,GAAG,EAAE,SAAS,OAAO,IAAI,EAAE,QAAA;AACnD;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import utcPlugin from "dayjs/plugin/utc";
|
|
3
|
+
dayjs.extend(utcPlugin);
|
|
4
|
+
const DEFAULT_WEEK_START = 1;
|
|
5
|
+
function toCalendar(ms, utc) {
|
|
6
|
+
return utc ? dayjs.utc(ms) : dayjs(ms);
|
|
7
|
+
}
|
|
8
|
+
function isoWeekday(d) {
|
|
9
|
+
const day = d.day();
|
|
10
|
+
return day === 0 ? 7 : day;
|
|
11
|
+
}
|
|
12
|
+
function getPeriodStart(ms, unit, weekStart = DEFAULT_WEEK_START, utc = false) {
|
|
13
|
+
const d = toCalendar(ms, utc);
|
|
14
|
+
if (unit === "week") {
|
|
15
|
+
const diff = (isoWeekday(d) - weekStart + 7) % 7;
|
|
16
|
+
return d.subtract(diff, "day").startOf("day").valueOf();
|
|
17
|
+
}
|
|
18
|
+
return d.startOf(unit).valueOf();
|
|
19
|
+
}
|
|
20
|
+
function subtractPeriods(ms, value, unit, utc = false) {
|
|
21
|
+
return toCalendar(ms, utc).subtract(value, unit).valueOf();
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
getPeriodStart as g,
|
|
25
|
+
subtractPeriods as s,
|
|
26
|
+
toCalendar as t
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=lib-XRCJ_UAQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib-XRCJ_UAQ.js","sources":["../../src/v2/modules/global/dates/dates.helper.ts"],"sourcesContent":["import dayjs from 'dayjs'\nimport utcPlugin from 'dayjs/plugin/utc'\nimport { type PeriodUnit } from './dates.schema'\n\n/**\n * Generic calendar primitives — period alignment and whole-period arithmetic. Built on `dayjs`\n * (already used by every consumer), so calendar arithmetic and month-end clamping come for free.\n *\n * These functions are locale-agnostic: the week start is always an injected number (1 = Monday …\n * 7 = Sunday), never derived here. Callers that need a locale-aware week start resolve it with\n * `global/locale`'s `getWeekStart(locale)` and pass the result in. That keeps this module free of\n * any dependency on other v2 modules.\n *\n * The `utc` flag selects the calendar the alignment runs in: `false` (default) uses the ambient\n * local calendar (a viewer's timezone); `true` uses UTC (the backend). Everything else is shared.\n */\n\ndayjs.extend(utcPlugin)\n\n// ISO Monday — the week start assumed when the caller doesn't inject a locale-derived one. Matches\n// DEFAULT_LOCALE (es-ES), whose week also starts on Monday.\nexport const DEFAULT_WEEK_START = 1\n\n// Builds the dayjs instance in the requested calendar (UTC or ambient local).\nexport function toCalendar(ms: number, utc: boolean): dayjs.Dayjs {\n return utc ? dayjs.utc(ms) : dayjs(ms)\n}\n\n// dayjs `.day()` is 0 = Sunday … 6 = Saturday; convert to ISO 1 = Monday … 7 = Sunday.\nfunction isoWeekday(d: dayjs.Dayjs): number {\n const day = d.day()\n return day === 0 ? 7 : day\n}\n\n/**\n * Aligns an instant to the start of the calendar period it falls in:\n * weeks → the injected first weekday at midnight, months → the 1st at midnight,\n * days → midnight, hours → the start of the hour. `utc` runs the alignment in UTC.\n */\nexport function getPeriodStart(\n ms: number,\n unit: PeriodUnit,\n weekStart: number = DEFAULT_WEEK_START,\n utc = false,\n): number {\n const d = toCalendar(ms, utc)\n if (unit === 'week') {\n // Not `startOf('week')`: that follows the dayjs locale, but the week start here is caller-driven.\n const diff = (isoWeekday(d) - weekStart + 7) % 7\n return d.subtract(diff, 'day').startOf('day').valueOf()\n }\n return d.startOf(unit).valueOf()\n}\n\n/**\n * Subtracts `value` whole calendar periods from an instant, without aligning. Month subtraction\n * clamps to the last day of the target month (e.g. 31 Mar − 1 month → 28 Feb), which dayjs does\n * natively. `utc` runs the arithmetic in UTC.\n */\nexport function subtractPeriods(ms: number, value: number, unit: PeriodUnit, utc = false): number {\n return toCalendar(ms, utc).subtract(value, unit).valueOf()\n}\n"],"names":[],"mappings":";;AAiBA,MAAM,OAAO,SAAS;AAIf,MAAM,qBAAqB;AAG3B,SAAS,WAAW,IAAY,KAA2B;AAChE,SAAO,MAAM,MAAM,IAAI,EAAE,IAAI,MAAM,EAAE;AACvC;AAGA,SAAS,WAAW,GAAwB;AAC1C,QAAM,MAAM,EAAE,IAAA;AACd,SAAO,QAAQ,IAAI,IAAI;AACzB;AAOO,SAAS,eACd,IACA,MACA,YAAoB,oBACpB,MAAM,OACE;AACR,QAAM,IAAI,WAAW,IAAI,GAAG;AAC5B,MAAI,SAAS,QAAQ;AAEnB,UAAM,QAAQ,WAAW,CAAC,IAAI,YAAY,KAAK;AAC/C,WAAO,EAAE,SAAS,MAAM,KAAK,EAAE,QAAQ,KAAK,EAAE,QAAA;AAAA,EAChD;AACA,SAAO,EAAE,QAAQ,IAAI,EAAE,QAAA;AACzB;AAOO,SAAS,gBAAgB,IAAY,OAAe,MAAkB,MAAM,OAAe;AAChG,SAAO,WAAW,IAAI,GAAG,EAAE,SAAS,OAAO,IAAI,EAAE,QAAA;AACnD;"}
|
package/dist/src/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AAOrB,OAAO,EAAE,mBAAmB,EAA4B,MAAM,gCAAgC,CAAA;AAoC9F,iBAAe,MAAM,CAAC,QAAQ,UAAQ,EAAE,WAAW,CAAC,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAA;AAOrB,OAAO,EAAE,mBAAmB,EAA4B,MAAM,gCAAgC,CAAA;AAoC9F,iBAAe,MAAM,CAAC,QAAQ,UAAQ,EAAE,WAAW,CAAC,EAAE,OAAO,2SAoN5D;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/config/config.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;AAC5C,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAA;AACpE,wBAAgB,OAAO,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAA;AACxC,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAyBlF,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/config/config.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;AAC5C,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAA;AACpE,wBAAgB,OAAO,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAA;AACxC,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAyBlF,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCd,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -10,6 +10,17 @@ import { MFALoginData } from '../schemas';
|
|
|
10
10
|
import { FastifyReply, FastifyRequest } from 'fastify';
|
|
11
11
|
import { FingerprintResult } from '../v2/modules/global/request-fingerprint';
|
|
12
12
|
import { Scopes } from '../v2/modules/global/auth';
|
|
13
|
+
import { EncryptedCredentials } from './thryve-credentials-crypto';
|
|
14
|
+
/**
|
|
15
|
+
* Thryve SDK client credentials (former appId / appSecret). Delivered to the app in the login
|
|
16
|
+
* response body (never in the JWT) so the native Thryve SDK can be initialised device-side. The
|
|
17
|
+
* secret is a shared secret that the SDK requires on the client — it is sourced exclusively from
|
|
18
|
+
* the server-side credentials file, never committed to the app bundle. See the login flow.
|
|
19
|
+
*/
|
|
20
|
+
export interface ThryveClientCredentials {
|
|
21
|
+
authId: string;
|
|
22
|
+
authSecret: string;
|
|
23
|
+
}
|
|
13
24
|
export interface UserData {
|
|
14
25
|
language?: string;
|
|
15
26
|
userId: number;
|
|
@@ -22,6 +33,14 @@ export interface UserData {
|
|
|
22
33
|
ecosystemLabel: string;
|
|
23
34
|
tz: string;
|
|
24
35
|
settings?: SettingResponse[];
|
|
36
|
+
thryveCredentials?: EncryptedCredentials;
|
|
37
|
+
/**
|
|
38
|
+
* Thryve `partnerUserId` (persisted server-side as `user_settings.THRYVE_USER_ID`, keyed by
|
|
39
|
+
* loginId → stable per human). The native Thryve SDK must use this as its `endUserAlias` so the
|
|
40
|
+
* device connection and the server-side cloud / health-data flow operate on the SAME Thryve end
|
|
41
|
+
* user. Present only for ecosystems with Thryve enabled.
|
|
42
|
+
*/
|
|
43
|
+
thryvePartnerUserId?: string;
|
|
25
44
|
}
|
|
26
45
|
export interface AppUserData extends UserData {
|
|
27
46
|
profile: UserProfileData;
|
|
@@ -109,7 +128,22 @@ declare function getLogedUsersFromRequest(req: FastifyRequest): Promise<GetUsers
|
|
|
109
128
|
declare function setPendingLogAccessUsers(req: FastifyRequest, users: UserData[]): void;
|
|
110
129
|
export declare function registerActionWithToken(ecosystemPool: Objection.TransactionOrKnex | undefined, token: string, userAgent: string | null | undefined, ip: string, action: string, userId: number, requestId: string, fingerprint?: FingerprintResult, countryCode?: string | null, regionCode?: string | null, deviceCode?: string | null): Promise<void>;
|
|
111
130
|
declare function getScopedToken(ctx: RequestContext, scope: Scopes, duration: number, storeClearToken?: boolean, extraPayload?: Record<string, any>, dontSaveInDB?: boolean): Promise<any>;
|
|
112
|
-
|
|
131
|
+
/**
|
|
132
|
+
* Resolves the Thryve SDK client credentials (`authId` / `authSecret`) for an ecosystem from the
|
|
133
|
+
* server-side credentials file — the same source the API uses to build the cloud `AppAuthorization`
|
|
134
|
+
* header (`credentials/{env}.json` → `thryve[<ecosystem>] | thryve.default → appAuthorization`).
|
|
135
|
+
* The stored value is `authId:authSecret`, either as plain text or base64-encoded (matching the
|
|
136
|
+
* Basic-auth convention). Returns `undefined` when no Thryve entry is configured.
|
|
137
|
+
*/
|
|
138
|
+
/**
|
|
139
|
+
* Parses a raw `appAuthorization` value (`authId:authSecret`, plain or base64, optionally prefixed
|
|
140
|
+
* with `Basic `) into credentials. Returns `undefined` when the value is absent or malformed (no
|
|
141
|
+
* `:` separator). Pure — extracted from {@link resolveThryveClientCredentials} so every branch is
|
|
142
|
+
* unit-testable without mocking the credentials file.
|
|
143
|
+
*/
|
|
144
|
+
declare function parseThryveAppAuthorization(raw?: string): ThryveClientCredentials | undefined;
|
|
145
|
+
declare function resolveThryveClientCredentials(ecosystem: string): ThryveClientCredentials | undefined;
|
|
146
|
+
declare function addAppDataToUsers(req: FastifyRequest, users: UserData[], token: string, pushToken?: string, deviceId?: string): Promise<Record<string, UserData>>;
|
|
113
147
|
declare function searchUsersFromRequest(req: FastifyRequest): Promise<GetUsersResult>;
|
|
114
148
|
declare function checkMFA(req: FastifyRequest, users: UserData[], mfaLoginData?: MFALoginData, deviceId?: string): Promise<true>;
|
|
115
149
|
declare function doLogin(req: FastifyRequest, preMFARequest?: boolean): Promise<WithTokens & ({
|
|
@@ -190,6 +224,8 @@ export declare const __AuthControllerTestUtils: {
|
|
|
190
224
|
registerActionWithToken: typeof registerActionWithToken;
|
|
191
225
|
getScopedToken: typeof getScopedToken;
|
|
192
226
|
addAppDataToUsers: typeof addAppDataToUsers;
|
|
227
|
+
parseThryveAppAuthorization: typeof parseThryveAppAuthorization;
|
|
228
|
+
resolveThryveClientCredentials: typeof resolveThryveClientCredentials;
|
|
193
229
|
searchUsersFromRequest: typeof searchUsersFromRequest;
|
|
194
230
|
checkMFA: typeof checkMFA;
|
|
195
231
|
doLogin: typeof doLogin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthController.d.ts","sourceRoot":"","sources":["../../../../src/controllers/AuthController.ts"],"names":[],"mappings":"AAEA,OAAY,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzD,OAAO,SAAS,MAAM,WAAW,CAAA;AAEjC,OAAoB,EAAE,eAA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AAE,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,YAAY,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,MAAM,iBAwC7G;AAED,iBAAe,OAAO,CAAC,GAAG,EAAE,cAAc,EAAE,aAAa,CAAC,EAAE,OAAO;eAh3BK,MAAM;;;cACJ,MAAM;;IAo4B/E;AAED,QAAA,MAAM,cAAc;;;IAGlB;;OAEG;oBACmB,cAAc,QAAQ,YAAY;;;;;;;;;wBAiB9B,cAAc,QAAQ,YAAY;mBA95BU,MAAM;;;kBACJ,MAAM;;;IAi6B9E;;OAEG;4BAC2B,cAAc,QAAQ,YAAY;;6BAuBjC,cAAc,OAAO,YAAY;gCAK9B,cAAc,OAAO,YAAY;;;yBAuCxC,cAAc,OAAO,YAAY;uBAUnC,cAAc,OAAO,YAAY;uBAKjC,cAAc,OAAO,YAAY;wBAShC,cAAc,OAAO,YAAY;oBAiDrC,cAAc,OAAO,YAAY;uBAc9B,cAAc,OAAO,YAAY;kBAqBtC,cAAc,OAAO,YAAY;CAgCtD,CAAA;AAED,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCrC,CAAA;AAED,eAAe,cAAc,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encrypted representation of the Thryve SDK client credentials, ready to travel in the login
|
|
3
|
+
* response body. Both fields are hex-encoded.
|
|
4
|
+
*
|
|
5
|
+
* CONTRACT (must not change without coordinating with the app):
|
|
6
|
+
* - key = SHA-256(token) → 32 bytes
|
|
7
|
+
* - iv = 12 random bytes
|
|
8
|
+
* - cipher = AES-256-GCM
|
|
9
|
+
* - plaintext = JSON.stringify({ authId, authSecret })
|
|
10
|
+
* - data = ciphertext || authTag (16 bytes) — concatenated so `@noble/ciphers` `gcm().decrypt`
|
|
11
|
+
* on the app side can verify and decrypt in a single call.
|
|
12
|
+
*/
|
|
13
|
+
export interface EncryptedCredentials {
|
|
14
|
+
iv: string;
|
|
15
|
+
data: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Encrypts the Thryve SDK client credentials with a key derived from the login JWT, so that only
|
|
19
|
+
* a client holding that exact token can decrypt them.
|
|
20
|
+
*/
|
|
21
|
+
export declare function encryptCredentialsForToken(token: string, plain: {
|
|
22
|
+
authId: string;
|
|
23
|
+
authSecret: string;
|
|
24
|
+
}): EncryptedCredentials;
|
|
25
|
+
//# sourceMappingURL=thryve-credentials-crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thryve-credentials-crypto.d.ts","sourceRoot":"","sources":["../../../../src/controllers/thryve-credentials-crypto.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAC5C,oBAAoB,CAQtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thryve-credentials-crypto.test.d.ts","sourceRoot":"","sources":["../../../../src/controllers/thryve-credentials-crypto.test.ts"],"names":[],"mappings":""}
|
|
@@ -1829,7 +1829,7 @@
|
|
|
1829
1829
|
"type": "boolean"
|
|
1830
1830
|
},
|
|
1831
1831
|
"basePeriod": {
|
|
1832
|
-
"$ref": "#/definitions/
|
|
1832
|
+
"$ref": "#/definitions/TrendPeriodConfig"
|
|
1833
1833
|
},
|
|
1834
1834
|
"conditionalProps": {
|
|
1835
1835
|
"type": "array",
|
|
@@ -1860,36 +1860,23 @@
|
|
|
1860
1860
|
"TrendPeriodConfig": {
|
|
1861
1861
|
"type": "object",
|
|
1862
1862
|
"properties": {
|
|
1863
|
-
"value": {
|
|
1864
|
-
"type": "number"
|
|
1865
|
-
},
|
|
1866
1863
|
"unit": {
|
|
1867
1864
|
"$ref": "#/definitions/TrendPeriodUnit"
|
|
1868
|
-
}
|
|
1869
|
-
},
|
|
1870
|
-
"required": ["value", "unit"],
|
|
1871
|
-
"additionalProperties": false
|
|
1872
|
-
},
|
|
1873
|
-
"TrendPeriodUnit": {
|
|
1874
|
-
"type": "string",
|
|
1875
|
-
"enum": ["hour", "day", "week", "month", "records"]
|
|
1876
|
-
},
|
|
1877
|
-
"TrendBasePeriodConfig": {
|
|
1878
|
-
"type": "object",
|
|
1879
|
-
"properties": {
|
|
1865
|
+
},
|
|
1880
1866
|
"fromValue": {
|
|
1881
1867
|
"type": "number"
|
|
1882
1868
|
},
|
|
1883
1869
|
"toValue": {
|
|
1884
1870
|
"type": "number"
|
|
1885
|
-
},
|
|
1886
|
-
"unit": {
|
|
1887
|
-
"$ref": "#/definitions/TrendPeriodUnit"
|
|
1888
1871
|
}
|
|
1889
1872
|
},
|
|
1890
|
-
"required": ["fromValue", "
|
|
1873
|
+
"required": ["unit", "fromValue", "toValue"],
|
|
1891
1874
|
"additionalProperties": false
|
|
1892
1875
|
},
|
|
1876
|
+
"TrendPeriodUnit": {
|
|
1877
|
+
"type": "string",
|
|
1878
|
+
"enum": ["hour", "day", "week", "month", "records"]
|
|
1879
|
+
},
|
|
1893
1880
|
"TrendConditionalStyleProps": {
|
|
1894
1881
|
"type": "object",
|
|
1895
1882
|
"properties": {
|
|
@@ -1403,7 +1403,7 @@
|
|
|
1403
1403
|
"type": "boolean"
|
|
1404
1404
|
},
|
|
1405
1405
|
"basePeriod": {
|
|
1406
|
-
"$ref": "#/definitions/
|
|
1406
|
+
"$ref": "#/definitions/TrendPeriodConfig"
|
|
1407
1407
|
},
|
|
1408
1408
|
"conditionalProps": {
|
|
1409
1409
|
"type": "array",
|
|
@@ -1434,36 +1434,23 @@
|
|
|
1434
1434
|
"TrendPeriodConfig": {
|
|
1435
1435
|
"type": "object",
|
|
1436
1436
|
"properties": {
|
|
1437
|
-
"value": {
|
|
1438
|
-
"type": "number"
|
|
1439
|
-
},
|
|
1440
1437
|
"unit": {
|
|
1441
1438
|
"$ref": "#/definitions/TrendPeriodUnit"
|
|
1442
|
-
}
|
|
1443
|
-
},
|
|
1444
|
-
"required": ["value", "unit"],
|
|
1445
|
-
"additionalProperties": false
|
|
1446
|
-
},
|
|
1447
|
-
"TrendPeriodUnit": {
|
|
1448
|
-
"type": "string",
|
|
1449
|
-
"enum": ["hour", "day", "week", "month", "records"]
|
|
1450
|
-
},
|
|
1451
|
-
"TrendBasePeriodConfig": {
|
|
1452
|
-
"type": "object",
|
|
1453
|
-
"properties": {
|
|
1439
|
+
},
|
|
1454
1440
|
"fromValue": {
|
|
1455
1441
|
"type": "number"
|
|
1456
1442
|
},
|
|
1457
1443
|
"toValue": {
|
|
1458
1444
|
"type": "number"
|
|
1459
|
-
},
|
|
1460
|
-
"unit": {
|
|
1461
|
-
"$ref": "#/definitions/TrendPeriodUnit"
|
|
1462
1445
|
}
|
|
1463
1446
|
},
|
|
1464
|
-
"required": ["fromValue", "
|
|
1447
|
+
"required": ["unit", "fromValue", "toValue"],
|
|
1465
1448
|
"additionalProperties": false
|
|
1466
1449
|
},
|
|
1450
|
+
"TrendPeriodUnit": {
|
|
1451
|
+
"type": "string",
|
|
1452
|
+
"enum": ["hour", "day", "week", "month", "records"]
|
|
1453
|
+
},
|
|
1467
1454
|
"TrendConditionalStyleProps": {
|
|
1468
1455
|
"type": "object",
|
|
1469
1456
|
"properties": {
|
|
@@ -101,13 +101,9 @@ export interface SelectOptionMapping {
|
|
|
101
101
|
chartValue: number;
|
|
102
102
|
}
|
|
103
103
|
export interface TrendPeriodConfig {
|
|
104
|
-
value: number;
|
|
105
104
|
unit: TrendPeriodUnit;
|
|
106
|
-
}
|
|
107
|
-
export interface TrendBasePeriodConfig {
|
|
108
105
|
fromValue: number;
|
|
109
|
-
toValue
|
|
110
|
-
unit: TrendPeriodUnit;
|
|
106
|
+
toValue: number;
|
|
111
107
|
}
|
|
112
108
|
export interface TrendPresentationWidgetStyleFields {
|
|
113
109
|
template?: string;
|
|
@@ -129,7 +125,7 @@ export interface TrendPresentationWidgetProps extends TrendPresentationWidgetSty
|
|
|
129
125
|
aggregationType: string;
|
|
130
126
|
comparisonPeriod?: TrendPeriodConfig;
|
|
131
127
|
basePeriodSameAsComparison?: boolean;
|
|
132
|
-
basePeriod?:
|
|
128
|
+
basePeriod?: TrendPeriodConfig;
|
|
133
129
|
conditionalProps?: TrendConditionalStyleProps[];
|
|
134
130
|
}
|
|
135
131
|
export type PresentationWidgetSettingsV2 = TextPresentationWidgetProps | IconPresentationWidgetProps | IconTextPresentationWidgetProps | LinkPresentationWidgetFields | TrendPresentationWidgetProps;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PatientListProps.d.ts","sourceRoot":"","sources":["../../../../../../src/schemas/container_widget/widgetTypes/PatientListProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AACxE,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAA;AAE9F;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,oEAAoE;IACpE,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,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AAU,EAAE,CAAA;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;AAE3E,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CACnB;
|
|
1
|
+
{"version":3,"file":"PatientListProps.d.ts","sourceRoot":"","sources":["../../../../../../src/schemas/container_widget/widgetTypes/PatientListProps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAA;AACxE,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,4BAA4B,EAC5B,2BAA2B,EAC5B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAA;AAE9F;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,oEAAoE;IACpE,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACtC,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,qBAAqB,CAAA;IAClC,aAAa,CAAC,EA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