@ovok/core 0.4.59-dev.563 → 0.4.59-dev.564

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.
@@ -26,7 +26,7 @@ exports.OVOK_CORE_REQUIREMENTS = {
26
26
  description: "The FHIR surface a server must provide for the @ovok/core client library's own methods to function.",
27
27
  software: {
28
28
  name: "@ovok/core",
29
- version: "0.4.59-dev.563+fdd295b",
29
+ version: "0.4.59-dev.564+6c0147c",
30
30
  },
31
31
  fhirVersion: "4.0.1",
32
32
  format: ["json"],
@@ -52,7 +52,7 @@ export type { BotInput, BotOutput } from "./resources/bots/bots-resource";
52
52
  export type { PushDevice, PushDeviceList, PushPlatform, RegisterPushDeviceRequest, } from "./resources/push/push-devices-resource";
53
53
  export type { ApnsEnvironment, ApnsPushProvider, ApnsPushProviderChange, CreatePushProviderRequest, ExpoPushProvider, FcmPushProvider, PushProviderName, PushProviderSettings, RelayPushProvider, UpdatePushProviderRequest, } from "./resources/push/push-provider-resource";
54
54
  export type { NotificationsRule, NotificationsRuleResponse } from "./resources/omnichannel-alerts/notifications-rules-resource";
55
- export type { NotificationsPreviewAlert, NotificationsPreviewRecipient, NotificationsPreviewRequest, NotificationsPreviewResponse, NotificationsPreviewStep, } from "./resources/omnichannel-alerts/omnichannel-alerts-resource";
55
+ export type { NotificationsPreviewAlert, NotificationsPreviewNotify, NotificationsPreviewRecipient, NotificationsPreviewRequest, NotificationsPreviewResponse, OmnichannelAlertEvent, } from "./resources/omnichannel-alerts/omnichannel-alerts-resource";
56
56
  export type * from "./resources/slim/slim-queries";
57
57
  export type { AccountsResource } from "./resources/accounts/accounts-resource";
58
58
  export type { AiResource } from "./resources/ai/ai-resource";
@@ -1,7 +1,8 @@
1
1
  import { HttpClient } from "../../http/http-client";
2
2
  import { RequestOptions } from "../../http/transmit";
3
3
  /**
4
- * The project's alert notifications rule, as Signals runs it. `logic` is JSON Logic that answers the `notify` steps.
4
+ * The project's alert notifications rule, which Ovok runs on each Signals alert event. `logic` is JSON Logic that
5
+ * answers `notify` entries, each naming `channels` and the roles to tell (`to`).
5
6
  *
6
7
  * @category omnichannelAlerts
7
8
  */
@@ -15,7 +16,7 @@ export type NotificationsRule = {
15
16
  * @category omnichannelAlerts
16
17
  */
17
18
  export type NotificationsRuleResponse = {
18
- /** The rule Signals runs for the project, or null when it has none and nobody is told. */
19
+ /** The rule Ovok runs for the project, or null when it has none and nobody is told. */
19
20
  notifications: Record<string, unknown> | null;
20
21
  };
21
22
  /**
@@ -28,7 +29,7 @@ export declare class NotificationsRulesResource {
28
29
  constructor(omnichannelAlerts: HttpClient);
29
30
  /** Reads the rule. Calls `GET v1/omnichannel-alerts/rules`. */
30
31
  retrieve(options?: RequestOptions): Promise<NotificationsRuleResponse>;
31
- /** Sets the rule; Ovok checks its channels and recipients, then Signals checks its steps. Calls `PUT v1/omnichannel-alerts/rules`. */
32
+ /** Sets the rule; Ovok checks the channels and recipients it names. Calls `PUT v1/omnichannel-alerts/rules`. */
32
33
  update(rule: NotificationsRule, options?: RequestOptions): Promise<NotificationsRuleResponse>;
33
34
  /** Removes the rule, so nobody is told of a new alert. Calls `DELETE v1/omnichannel-alerts/rules`. */
34
35
  remove(options?: RequestOptions): Promise<void>;
@@ -15,7 +15,7 @@ class NotificationsRulesResource {
15
15
  retrieve(options) {
16
16
  return this.omnichannelAlerts.get(RULES_PATH, options);
17
17
  }
18
- /** Sets the rule; Ovok checks its channels and recipients, then Signals checks its steps. Calls `PUT v1/omnichannel-alerts/rules`. */
18
+ /** Sets the rule; Ovok checks the channels and recipients it names. Calls `PUT v1/omnichannel-alerts/rules`. */
19
19
  update(rule, options) {
20
20
  return this.omnichannelAlerts.put(RULES_PATH, rule, options);
21
21
  }
@@ -1,36 +1,44 @@
1
1
  import { HttpClient } from "../../http/http-client";
2
2
  import { RequestOptions } from "../../http/transmit";
3
3
  import { NotificationsRule, NotificationsRulesResource } from "./notifications-rules-resource";
4
+ /**
5
+ * A Signals alert event the rule runs on.
6
+ *
7
+ * @category omnichannelAlerts
8
+ */
9
+ export type OmnichannelAlertEvent = "alert.triggered" | "alert.empty" | "alert.note" | "alert.inactive" | "alert.refired" | "alert.resolved" | "alert.acknowledged";
4
10
  /**
5
11
  * A sample alert to preview the rule against.
6
12
  *
7
13
  * @category omnichannelAlerts
8
14
  */
9
15
  export type NotificationsPreviewAlert = {
10
- /** Why the alert fired; `trigger` when omitted. */
11
- reason?: "trigger" | "empty" | "note" | "inactive";
12
- /** The alert code, such as a LOINC code. */
13
- code?: string;
14
- /** The alert variant, such as `high`. */
15
- variant?: string;
16
+ /** Why the alert was raised; `trigger` when omitted. */
17
+ reason?: string;
18
+ /** The alert code. */
19
+ code?: string | null;
16
20
  /** The alert message. */
17
- message?: string;
21
+ message?: string | null;
22
+ /** The alert value. */
23
+ value?: number | null;
18
24
  };
19
25
  /**
20
- * Request body for previewing who an alert's notifications reach.
26
+ * Request body for previewing who an alert event reaches.
21
27
  *
22
28
  * @category omnichannelAlerts
23
29
  */
24
30
  export type NotificationsPreviewRequest = {
25
31
  /** The FHIR Patient id whose people are resolved. */
26
32
  patientId: string;
33
+ /** The event to try the rule on; `alert.triggered` when omitted. */
34
+ event?: OmnichannelAlertEvent;
27
35
  /** The sample alert. */
28
36
  alert?: NotificationsPreviewAlert;
29
37
  /** The rule to try, instead of the project's own. */
30
38
  notifications?: NotificationsRule;
31
39
  };
32
40
  /**
33
- * A person a preview step reaches.
41
+ * A person a `notify` entry reaches.
34
42
  *
35
43
  * @category omnichannelAlerts
36
44
  */
@@ -43,18 +51,14 @@ export type NotificationsPreviewRecipient = {
43
51
  email: boolean;
44
52
  };
45
53
  /**
46
- * One step the rule plans, and the people it reaches.
54
+ * One `notify` entry the rule answers, and the people it reaches.
47
55
  *
48
56
  * @category omnichannelAlerts
49
57
  */
50
- export type NotificationsPreviewStep = {
51
- /** The step number, from 0. */
52
- step: number;
53
- /** Minutes after the alert fired. */
54
- after: number;
55
- /** The channels the step names. */
58
+ export type NotificationsPreviewNotify = {
59
+ /** The channels the entry names. */
56
60
  channels: string[];
57
- /** The recipient roles the step names. */
61
+ /** The recipient roles the entry names. */
58
62
  to: string[];
59
63
  /** The people the roles resolve to. */
60
64
  recipients: NotificationsPreviewRecipient[];
@@ -64,17 +68,17 @@ export type NotificationsPreviewStep = {
64
68
  unknownRoles: string[];
65
69
  };
66
70
  /**
67
- * Each step the rule plans for a sample alert. Nothing is sent.
71
+ * Who the rule tells of a sample alert event. Nothing is sent.
68
72
  *
69
73
  * @category omnichannelAlerts
70
74
  */
71
75
  export type NotificationsPreviewResponse = {
72
- /** The planned steps. */
73
- steps: NotificationsPreviewStep[];
76
+ /** The `notify` entries the rule answers, empty when it tells nobody. */
77
+ notify: NotificationsPreviewNotify[];
74
78
  };
75
79
  /**
76
- * Omni-channel alerts: Signals generates each alert's notification steps from the project's rule, and Ovok delivers
77
- * them by push and email. Calls routes under `v1/omnichannel-alerts`. For project admins.
80
+ * Omni-channel alerts: Ovok runs the project's rule on each Signals alert event and tells the people it names by push
81
+ * and email. Calls routes under `v1/omnichannel-alerts`. For project admins.
78
82
  *
79
83
  * @category omnichannelAlerts
80
84
  */
@@ -83,6 +87,6 @@ export declare class OmnichannelAlertsResource {
83
87
  readonly rules: NotificationsRulesResource;
84
88
  private readonly omnichannelAlerts;
85
89
  constructor(http: HttpClient);
86
- /** Previews who a sample alert's notifications reach, step by step. Sends nothing. Calls `POST v1/omnichannel-alerts/preview`. */
90
+ /** Previews who the rule tells of a sample alert event. Sends nothing. Calls `POST v1/omnichannel-alerts/preview`. */
87
91
  preview(body: NotificationsPreviewRequest, options?: RequestOptions): Promise<NotificationsPreviewResponse>;
88
92
  }
@@ -5,8 +5,8 @@ const notifications_rules_resource_1 = require("./notifications-rules-resource")
5
5
  const OMNICHANNEL_ALERTS_PATH = "v1/omnichannel-alerts";
6
6
  const PREVIEW_PATH = "preview";
7
7
  /**
8
- * Omni-channel alerts: Signals generates each alert's notification steps from the project's rule, and Ovok delivers
9
- * them by push and email. Calls routes under `v1/omnichannel-alerts`. For project admins.
8
+ * Omni-channel alerts: Ovok runs the project's rule on each Signals alert event and tells the people it names by push
9
+ * and email. Calls routes under `v1/omnichannel-alerts`. For project admins.
10
10
  *
11
11
  * @category omnichannelAlerts
12
12
  */
@@ -15,7 +15,7 @@ class OmnichannelAlertsResource {
15
15
  this.omnichannelAlerts = http.under(OMNICHANNEL_ALERTS_PATH);
16
16
  this.rules = new notifications_rules_resource_1.NotificationsRulesResource(this.omnichannelAlerts);
17
17
  }
18
- /** Previews who a sample alert's notifications reach, step by step. Sends nothing. Calls `POST v1/omnichannel-alerts/preview`. */
18
+ /** Previews who the rule tells of a sample alert event. Sends nothing. Calls `POST v1/omnichannel-alerts/preview`. */
19
19
  preview(body, options) {
20
20
  return this.omnichannelAlerts.post(PREVIEW_PATH, body, options);
21
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/core",
3
- "version": "0.4.59-dev.563+fdd295b",
3
+ "version": "0.4.59-dev.564+6c0147c",
4
4
  "private": false,
5
5
  "main": "dist/next/index.js",
6
6
  "types": "dist/next/index.d.ts",