@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,53 @@
|
|
|
1
|
+
import { RelativePeriodConfig, TrendWindow, TrendWindowConfig } from './container-widget.schema';
|
|
2
|
+
/**
|
|
3
|
+
* Trend-widget time windows: the `value`/`from`/`to` → concrete-window resolution shared by the trend
|
|
4
|
+
* widget (front, viewer-local) and the health-data time-range filter (backend, UTC). Built on the
|
|
5
|
+
* generic calendar primitives of `global/dates` (which take the week start as a plain number) and the
|
|
6
|
+
* locale week-start resolver of `global/locale`, so the trend-specific rules live here in one place.
|
|
7
|
+
*
|
|
8
|
+
* The `utc` flag is forwarded to the primitives: `false` (default) uses the ambient local calendar
|
|
9
|
+
* (the front, viewer's timezone); `true` uses UTC (the backend). Both callers produce the exact same
|
|
10
|
+
* window for the same inputs and timezone.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Resolves a `from`/`to` range into a concrete, calendar-aligned window. `fromValue` and `toValue`
|
|
14
|
+
* are inclusive bucket offsets ("N units ago"), so the window covers the **complete** buckets from
|
|
15
|
+
* `toValue`-ago up to `fromValue`-ago (both ends inclusive) and spans `fromValue − toValue + 1`
|
|
16
|
+
* buckets:
|
|
17
|
+
*
|
|
18
|
+
* - `start` (inclusive) = `getPeriodStart(now − fromValue·unit)` — start of the oldest bucket.
|
|
19
|
+
* - `end` (exclusive ms bound) = `getPeriodStart(now − (toValue − 1)·unit)` — the start of the
|
|
20
|
+
* bucket just after the newest included one, i.e. the end of the `toValue` bucket. When
|
|
21
|
+
* `toValue = 0` this is the start of the next bucket, so the current (in-progress) bucket is
|
|
22
|
+
* included in full — the window has no `now` cap, both extremes are complete buckets.
|
|
23
|
+
*
|
|
24
|
+
* Example (unit = week, weekStart = 1 Monday, now = Tue 2026-07-07):
|
|
25
|
+
* from 2, to 0 → [Mon 22 Jun, Mon 13 Jul) (3 weeks, the current one included in full)
|
|
26
|
+
* from 3, to 1 → [Mon 15 Jun, Mon 06 Jul) (3 complete weeks, the current one excluded)
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolveTrendWindow(nowMs: number, config: TrendWindowConfig, weekStart?: number, utc?: boolean): TrendWindow;
|
|
29
|
+
/**
|
|
30
|
+
* Resolves a count-based relative period into a concrete window — the single source of truth for the
|
|
31
|
+
* `value` → from/to mapping shared by every consumer (backend health-data filter, front trend widget),
|
|
32
|
+
* so the "current period counts as one of the N" rule is defined exactly once:
|
|
33
|
+
* - including it → `from = value - 1`, `to = 0` (buckets `value-1`…0 ago, ending now);
|
|
34
|
+
* - excluding it → `from = value`, `to = 1` (`value` complete buckets before the current one).
|
|
35
|
+
*/
|
|
36
|
+
export declare function resolveRelativePeriod(nowMs: number, { value, unit, excludeCurrentPeriod }: RelativePeriodConfig, weekStart?: number, utc?: boolean): TrendWindow;
|
|
37
|
+
/**
|
|
38
|
+
* Resolves a count-based relative period into a formatted date range for the backend health-data
|
|
39
|
+
* query, keeping the whole calculation (from/to mapping + the day-level rule + formatting) in one
|
|
40
|
+
* shared place:
|
|
41
|
+
* - `daily`: date-only `YYYY-MM-DD`; when excluding the current period the inclusive end becomes the
|
|
42
|
+
* last completed calendar day (the day before the current period's start).
|
|
43
|
+
* - `discrete`: ISO-8601.
|
|
44
|
+
*
|
|
45
|
+
* Unlike `resolveTrendWindow` (which now covers the current bucket in full for the front display), the
|
|
46
|
+
* query end is **capped at `now`**: a data query must never reach past the present into the rest of an
|
|
47
|
+
* in-progress bucket, so `to = 0` yields "up to now", not "up to the end of the current bucket".
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveRelativeDateRange(nowMs: number, config: RelativePeriodConfig, format: 'daily' | 'discrete', weekStart?: number, utc?: boolean): {
|
|
50
|
+
start_date: string;
|
|
51
|
+
end_date: string;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=container-widget.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-widget.helper.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/ecosystem/container-widget/container-widget.helper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAE/G;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,iBAAiB,EACzB,SAAS,GAAE,MAAuB,EAClC,GAAG,UAAQ,GACV,WAAW,CAOb;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,EAAE,KAAK,EAAE,IAAI,EAAE,oBAA4B,EAAE,EAAE,oBAAoB,EACnE,SAAS,GAAE,MAAuB,EAClC,GAAG,UAAQ,GACV,WAAW,CAOb;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,OAAO,GAAG,UAAU,EAC5B,SAAS,GAAE,MAAuB,EAClC,GAAG,UAAQ,GACV;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAS1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-widget.helper.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/ecosystem/container-widget/container-widget.helper.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PeriodUnit } from '../../global/dates/dates.schema';
|
|
2
|
+
/**
|
|
3
|
+
* Calendar-aligned relative time window contracts, shared by the trend widget (front, viewer-local)
|
|
4
|
+
* and the health-data time-range filter (backend, UTC). Pure types/constants only — the calculation
|
|
5
|
+
* logic that consumes them lives in `container-widget.helper.ts`.
|
|
6
|
+
*/
|
|
7
|
+
export type TrendWindowUnit = PeriodUnit;
|
|
8
|
+
export interface TrendWindowConfig {
|
|
9
|
+
fromValue: number;
|
|
10
|
+
toValue?: number;
|
|
11
|
+
unit: TrendWindowUnit;
|
|
12
|
+
}
|
|
13
|
+
export interface TrendWindow {
|
|
14
|
+
start: number;
|
|
15
|
+
end: number;
|
|
16
|
+
}
|
|
17
|
+
export interface RelativePeriodConfig {
|
|
18
|
+
value: number;
|
|
19
|
+
unit: TrendWindowUnit;
|
|
20
|
+
excludeCurrentPeriod?: boolean;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=container-widget.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-widget.schema.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/ecosystem/container-widget/container-widget.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAEjE;;;;GAIG;AAIH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAA;AAExC,MAAM,WAAW,iBAAiB;IAEhC,SAAS,EAAE,MAAM,CAAA;IAGjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,eAAe,CAAA;CACtB;AAGD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACZ;AAID,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,eAAe,CAAA;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-widget.service.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/ecosystem/container-widget/container-widget.service.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/ecosystem/container-widget/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,2BAA2B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/ecosystem/container-widget/lib.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as dayjs } from 'dayjs';
|
|
2
|
+
import { PeriodUnit } from './dates.schema';
|
|
3
|
+
export declare const DEFAULT_WEEK_START = 1;
|
|
4
|
+
export declare function toCalendar(ms: number, utc: boolean): dayjs.Dayjs;
|
|
5
|
+
/**
|
|
6
|
+
* Aligns an instant to the start of the calendar period it falls in:
|
|
7
|
+
* weeks → the injected first weekday at midnight, months → the 1st at midnight,
|
|
8
|
+
* days → midnight, hours → the start of the hour. `utc` runs the alignment in UTC.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getPeriodStart(ms: number, unit: PeriodUnit, weekStart?: number, utc?: boolean): number;
|
|
11
|
+
/**
|
|
12
|
+
* Subtracts `value` whole calendar periods from an instant, without aligning. Month subtraction
|
|
13
|
+
* clamps to the last day of the target month (e.g. 31 Mar − 1 month → 28 Feb), which dayjs does
|
|
14
|
+
* natively. `utc` runs the arithmetic in UTC.
|
|
15
|
+
*/
|
|
16
|
+
export declare function subtractPeriods(ms: number, value: number, unit: PeriodUnit, utc?: boolean): number;
|
|
17
|
+
//# sourceMappingURL=dates.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dates.helper.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/dates/dates.helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAmBhD,eAAO,MAAM,kBAAkB,IAAI,CAAA;AAGnC,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,KAAK,CAAC,KAAK,CAEhE;AAQD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,UAAU,EAChB,SAAS,GAAE,MAA2B,EACtC,GAAG,UAAQ,GACV,MAAM,CAQR;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,UAAQ,GAAG,MAAM,CAEhG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dates.helper.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/dates/dates.helper.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic calendar unit shared by the date primitives. Pure type — the calendar arithmetic that
|
|
3
|
+
* consumes it lives in `dates.helper.ts`. Domain modules that need a narrower alias (e.g. the trend
|
|
4
|
+
* widget's `TrendWindowUnit`) build it on top of this one, so the set of units is defined once here.
|
|
5
|
+
*/
|
|
6
|
+
export type PeriodUnit = 'hour' | 'day' | 'week' | 'month';
|
|
7
|
+
//# sourceMappingURL=dates.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dates.schema.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/dates/dates.schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/dates/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/dates/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/dates/lib.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-operation.controller.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/e2e-operation/e2e-operation.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAmC1E,eAAO,MAAM,sBAAsB;;CAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-operation.controller.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/e2e-operation/e2e-operation.controller.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-operation.middleware.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/e2e-operation/e2e-operation.middleware.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,kBAAkB,qRAS7B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-operation.schema.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/e2e-operation/e2e-operation.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEtC,eAAO,MAAM,wBAAwB;;EASpC,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAExE,eAAO,MAAM,sBAAsB;;;;;EAUlC,CAAA;AAED,eAAO,MAAM,oBAAoB;;;EAGhC,CAAA;AAED,eAAO,MAAM,uBAAuB;;EAGnC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-operation.schema.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/e2e-operation/e2e-operation.schema.test.ts"],"names":[],"mappings":""}
|
package/dist/src/v2/modules/{e2e-operation → global/e2e-operation}/e2e-operation.service.d.ts
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { E2eOperationParams } from './e2e-operation.schema';
|
|
2
2
|
export interface TrxLike {
|
|
3
|
-
raw
|
|
3
|
+
raw<Row = {
|
|
4
4
|
id: number;
|
|
5
|
-
}[]]>;
|
|
5
|
+
}>(sql: string, bindings?: unknown[]): Promise<[Row[]]>;
|
|
6
6
|
}
|
|
7
7
|
export interface WorldOptions {
|
|
8
8
|
projectName?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-operation.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/e2e-operation/e2e-operation.service.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AA4ChE,MAAM,WAAW,OAAO;IAGtB,GAAG,CAAC,GAAG,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;CAC/E;AAKD,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AA+BD,eAAO,MAAM,aAAa,GAAU,KAAK,OAAO,EAAE,SAAS,MAAM,EAAE,OAAM,YAAiB,KAAG,OAAO,CAAC,IAAI,CAwDxG,CAAA;AAYD,eAAO,MAAM,eAAe,GAC1B,KAAK,OAAO,EACZ,SAAS,MAAM,EACf,OAAM,YAAiB,KACtB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAmFtF,CAAA;AAmPD,eAAO,MAAM,mBAAmB;sCATQ,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC;mBAWrD,MAAM,UAAU,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAQxE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-operation.service.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/e2e-operation/e2e-operation.service.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/e2e-operation/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/locale/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/locale/lib.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Locale } from './locale.schema';
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes any raw locale into the canonical {@link Locale}. Converts `_`→`-`, and when the tag
|
|
4
|
+
* carries no region, resolves the language's OWN default region via `Intl.Locale.maximize()` (CLDR
|
|
5
|
+
* likely-subtags): `en` → `en-US`, `es` → `es-ES`, `de` → `de-DE`. An explicit region is preserved
|
|
6
|
+
* (`en-GB` stays `en-GB`). Empty/blank/unparseable input falls back to {@link DEFAULT_LOCALE}. Call
|
|
7
|
+
* this ONCE at each boundary; downstream functions take an already-normalized `Locale`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function toLocale(raw?: string | null): Locale;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the ISO weekday number (1 = Monday … 7 = Sunday) that starts the week for `locale`. Takes
|
|
12
|
+
* an already-canonical {@link Locale} (normalize raw input with {@link toLocale} first), so no format
|
|
13
|
+
* parsing happens here. Falls back to {@link DEFAULT_LOCALE}'s week start only on runtimes without
|
|
14
|
+
* Intl week info.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getWeekStart(locale?: Locale): number;
|
|
17
|
+
//# sourceMappingURL=locale.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.helper.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/locale/locale.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,MAAM,EAA2B,MAAM,iBAAiB,CAAA;AAYtF;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAWpD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,GAAE,MAAuB,GAAG,MAAM,CASpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.helper.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/locale/locale.helper.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale contracts owned by this module. Pure types/constants only — the normalization and week-info
|
|
3
|
+
* logic that consumes them lives in `locale.helper.ts`.
|
|
4
|
+
*/
|
|
5
|
+
export type Locale = `${Lowercase<string>}-${Uppercase<string>}`;
|
|
6
|
+
export declare const DEFAULT_LOCALE: Locale;
|
|
7
|
+
export type LocaleWithWeekInfo = Intl.Locale & {
|
|
8
|
+
weekInfo?: {
|
|
9
|
+
firstDay: number;
|
|
10
|
+
};
|
|
11
|
+
getWeekInfo?: () => {
|
|
12
|
+
firstDay: number;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=locale.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale.schema.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/locale/locale.schema.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,MAAM,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,SAAS,CAAC,MAAM,CAAC,EAAE,CAAA;AAGhE,eAAO,MAAM,cAAc,EAAE,MAAgB,CAAA;AAG7C,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,MAAM,GAAG;IAC7C,QAAQ,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/B,WAAW,CAAC,EAAE,MAAM;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CACzC,CAAA"}
|
|
@@ -19,11 +19,28 @@ export interface ExternalDataRow {
|
|
|
19
19
|
declare function isUserAuthorized(providerUserId: string): Promise<boolean>;
|
|
20
20
|
declare function getDailyDataForPatients(ctx: RequestContext, patientIds: number[], filters: HealthDataFilters): Promise<PatientDailyHealthData[]>;
|
|
21
21
|
declare function getDiscreteDataForPatients(ctx: RequestContext, patientIds: number[], filters: HealthDataFilters): Promise<PatientDiscreteHealthData[]>;
|
|
22
|
-
|
|
22
|
+
type HealthDataTimeUnit = 'days' | 'weeks' | 'months' | 'hours';
|
|
23
|
+
/**
|
|
24
|
+
* Validates raw config values into a typed (value, unit) pair, or null when out of range.
|
|
25
|
+
* Accepts 'hours' only for the 'discrete' endpoint type.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseRelativeTimeRange(rawValue: unknown, rawUnit: unknown, endpointType?: 'daily' | 'discrete'): {
|
|
28
|
+
value: number;
|
|
29
|
+
unit: HealthDataTimeUnit;
|
|
30
|
+
} | null;
|
|
31
|
+
/**
|
|
32
|
+
* Resolves a relative time range (`value` + `excludeCurrentPeriod`) into concrete start/end dates.
|
|
33
|
+
* The whole calculation — from/to mapping, the day-level rule and formatting — lives in the shared
|
|
34
|
+
* `resolveRelativeDateRange` primitive (UTC) so it can never diverge between backend and front.
|
|
35
|
+
*
|
|
36
|
+
* Receives already-validated, typed values — call `parseRelativeTimeRange` first to validate raw
|
|
37
|
+
* inputs.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveRelativeTimeRange(value: number, unit: HealthDataTimeUnit, endpointType?: 'daily' | 'discrete', excludeCurrentPeriod?: boolean, weekStart?: number): {
|
|
23
40
|
start_date: string;
|
|
24
41
|
end_date: string;
|
|
25
|
-
}
|
|
26
|
-
declare function resolveFilters(config: FormListDataConfig, paramValues: Record<string, unknown>, sourceType?: ExternalSourceType): HealthDataFilters;
|
|
42
|
+
};
|
|
43
|
+
declare function resolveFilters(config: FormListDataConfig, paramValues: Record<string, unknown>, sourceType?: ExternalSourceType, weekStart?: number): HealthDataFilters;
|
|
27
44
|
declare function getDataForPatients(ctx: RequestContext, patientIds: number[], key: string, sourceType: ExternalSourceType, config: FormListDataConfig, paramValues: Record<string, unknown>): Promise<ExternalDataRow[]>;
|
|
28
45
|
export declare const HealthDataService: {
|
|
29
46
|
getDailyDataForPatients: typeof getDailyDataForPatients;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"health-data.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/project/health-data/health-data.service.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"health-data.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/project/health-data/health-data.service.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIzE,OAAO,KAAK,EAGV,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EAG1B,MAAM,sBAAsB,CAAA;AAI7B,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE;QAAE,IAAI,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,IAAI,CAAA;SAAE,CAAA;KAAE,CAAA;IACxD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAChC;AA0FD;;;;GAIG;AACH,iBAAe,gBAAgB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CA2BxE;AA+ED,iBAAe,uBAAuB,CACpC,GAAG,EAAE,cAAc,EACnB,UAAU,EAAE,MAAM,EAAE,EACpB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAMnC;AAED,iBAAe,0BAA0B,CACvC,GAAG,EAAE,cAAc,EACnB,UAAU,EAAE,MAAM,EAAE,EACpB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAMtC;AAsBD,KAAK,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;AAU/D;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,OAAO,EAChB,YAAY,GAAE,OAAO,GAAG,UAAoB,GAC3C;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAAG,IAAI,CAMpD;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,kBAAkB,EACxB,YAAY,GAAE,OAAO,GAAG,UAAoB,EAC5C,oBAAoB,UAAQ,EAC5B,SAAS,GAAE,MAAuB,GACjC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAQ1C;AAMD,iBAAS,cAAc,CACrB,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,UAAU,CAAC,EAAE,kBAAkB,EAC/B,SAAS,GAAE,MAAuB,GACjC,iBAAiB,CA4CnB;AAMD,iBAAe,kBAAkB,CAC/B,GAAG,EAAE,cAAc,EACnB,UAAU,EAAE,MAAM,EAAE,EACpB,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,kBAAkB,EAC9B,MAAM,EAAE,kBAAkB,EAC1B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,OAAO,CAAC,eAAe,EAAE,CAAC,CAsB5B;AAED,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAA"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { default as RequestContext } from '../../../../models/request/RequestContext';
|
|
2
2
|
/**
|
|
3
|
-
* Checks the `
|
|
4
|
-
* or at ecosystem level as a fallback. When it is not set to a truthy value, the Thryve
|
|
5
|
-
* is considered disabled for that project and every endpoint will return 404 to the
|
|
3
|
+
* Checks the `SYNC_CLOUD_WEARABLES` config flag. The value can be defined at project level
|
|
4
|
+
* (winning) or at ecosystem level as a fallback. When it is not set to a truthy value, the Thryve
|
|
5
|
+
* feature is considered disabled for that project and every endpoint will return 404 to the
|
|
6
|
+
* client.
|
|
6
7
|
*
|
|
7
8
|
* Fails fast if the caller did not resolve a `projectId` — every Thryve endpoint is mounted
|
|
8
9
|
* under `/v2/ecosystem/:ecosystemName/project/:projectName/thryve/...` so the upstream middleware
|
|
@@ -10,6 +11,16 @@ import { default as RequestContext } from '../../../../models/request/RequestCon
|
|
|
10
11
|
* middleware regressions.
|
|
11
12
|
*/
|
|
12
13
|
declare function isEnabled(ctx: RequestContext): Promise<boolean>;
|
|
14
|
+
/**
|
|
15
|
+
* Resolves the opaque `partnerUserID` used by Thryve for the current user. The value lives in
|
|
16
|
+
* the `user_settings` table under the key `THRYVE_USER_ID` (not scoped to ecosystem, project or
|
|
17
|
+
* device), so the same human reuses the same Thryve end user across projects. On the first call
|
|
18
|
+
* for a user we generate a UUID v4, upsert the setting, and return it.
|
|
19
|
+
*
|
|
20
|
+
* The read-generate-insert section is guarded by a MySQL advisory lock keyed on the loginId to
|
|
21
|
+
* prevent two concurrent calls for a brand-new user from inserting two different UUIDs.
|
|
22
|
+
*/
|
|
23
|
+
declare function resolveOrCreatePartnerUserId(ctx: RequestContext): Promise<string>;
|
|
13
24
|
/**
|
|
14
25
|
* Requests a short-lived Thryve Connection Widget URL. The caller embeds this URL in an iframe
|
|
15
26
|
* (web) or a WebView (native) so the end user can authorize their wearable sources.
|
|
@@ -25,6 +36,7 @@ export declare const ThryveService: {
|
|
|
25
36
|
isEnabled: typeof isEnabled;
|
|
26
37
|
getIframeUrl: typeof getIframeUrl;
|
|
27
38
|
isUserAuthorized: typeof isUserAuthorized;
|
|
39
|
+
resolveOrCreatePartnerUserId: typeof resolveOrCreatePartnerUserId;
|
|
28
40
|
};
|
|
29
41
|
export {};
|
|
30
42
|
//# sourceMappingURL=thryve.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thryve.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/project/thryve/thryve.service.ts"],"names":[],"mappings":"AAOA,OAAO,cAAc,MAAM,mCAAmC,CAAA;AAyE9D
|
|
1
|
+
{"version":3,"file":"thryve.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/project/thryve/thryve.service.ts"],"names":[],"mappings":"AAOA,OAAO,cAAc,MAAM,mCAAmC,CAAA;AAyE9D;;;;;;;;;;GAUG;AACH,iBAAe,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAO9D;AAoFD;;;;;;;;GAQG;AACH,iBAAe,4BAA4B,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAYhF;AAoCD;;;GAGG;AACH,iBAAe,YAAY,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAehE;AAED;;;;GAIG;AACH,iBAAe,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAIrE;AAED,eAAO,MAAM,aAAa;;;;;CAKzB,CAAA"}
|