@prostgles/app 2.3.6-dev.1792698270 → 2.3.6-dev.1792704561
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/client/build/js/733.bundle.js +1 -1
- package/client/build/js/main.bundle.js +2 -2
- package/dist/common/managedTableSchema.d.ts +3 -1
- package/dist/common/managedTableSchema.d.ts.map +1 -1
- package/dist/common/managedTableSchema.js.map +1 -1
- package/dist/server/package.json +1 -1
- package/dist/server/src/Alerts/AlertTypes.d.ts +16 -10
- package/dist/server/src/Alerts/AlertTypes.d.ts.map +1 -1
- package/dist/server/src/Alerts/AlertTypes.js.map +1 -1
- package/dist/server/src/Alerts/alertRuleSchema.d.ts +76 -0
- package/dist/server/src/Alerts/alertRuleSchema.d.ts.map +1 -0
- package/dist/server/src/Alerts/alertRuleSchema.js +56 -0
- package/dist/server/src/Alerts/alertRuleSchema.js.map +1 -0
- package/dist/server/src/Alerts/enqueueAlerts.d.ts.map +1 -1
- package/dist/server/src/Alerts/enqueueAlerts.js +5 -1
- package/dist/server/src/Alerts/enqueueAlerts.js.map +1 -1
- package/dist/server/src/Alerts/getAlertTableOptions.d.ts +4 -0
- package/dist/server/src/Alerts/getAlertTableOptions.d.ts.map +1 -0
- package/dist/server/src/Alerts/getAlertTableOptions.js +76 -0
- package/dist/server/src/Alerts/getAlertTableOptions.js.map +1 -0
- package/dist/server/src/Alerts/getAlertTables.d.ts +151 -1
- package/dist/server/src/Alerts/getAlertTables.d.ts.map +1 -1
- package/dist/server/src/Alerts/getAlertTables.js +19 -1
- package/dist/server/src/Alerts/getAlertTables.js.map +1 -1
- package/dist/server/src/Alerts/getAlertsPlugin.d.ts.map +1 -1
- package/dist/server/src/Alerts/getAlertsPlugin.js +17 -0
- package/dist/server/src/Alerts/getAlertsPlugin.js.map +1 -1
- package/dist/server/src/Alerts/prepareQueryAlert.d.ts +5 -0
- package/dist/server/src/Alerts/prepareQueryAlert.d.ts.map +1 -0
- package/dist/server/src/Alerts/prepareQueryAlert.js +95 -0
- package/dist/server/src/Alerts/prepareQueryAlert.js.map +1 -0
- package/dist/server/src/Alerts/resolveAlertValue.d.ts +3 -0
- package/dist/server/src/Alerts/resolveAlertValue.d.ts.map +1 -0
- package/dist/server/src/Alerts/resolveAlertValue.js +59 -0
- package/dist/server/src/Alerts/resolveAlertValue.js.map +1 -0
- package/dist/server/src/Alerts/runAlertDelivery.d.ts.map +1 -1
- package/dist/server/src/Alerts/runAlertDelivery.js +12 -3
- package/dist/server/src/Alerts/runAlertDelivery.js.map +1 -1
- package/dist/server/src/ConnectionManager/getHotReloadConfigs.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/getHotReloadConfigs.js +2 -1
- package/dist/server/src/ConnectionManager/getHotReloadConfigs.js.map +1 -1
- package/dist/server/src/ConnectionManager/modifyClientSchema.d.ts +3 -2
- package/dist/server/src/ConnectionManager/modifyClientSchema.d.ts.map +1 -1
- package/dist/server/src/ConnectionManager/modifyClientSchema.js +9 -3
- package/dist/server/src/ConnectionManager/modifyClientSchema.js.map +1 -1
- package/dist/server/src/Emails/renderEmailText.d.ts +4 -0
- package/dist/server/src/Emails/renderEmailText.d.ts.map +1 -0
- package/dist/server/src/Emails/renderEmailText.js +45 -0
- package/dist/server/src/Emails/renderEmailText.js.map +1 -0
- package/dist/server/src/Emails/renderOutboxEmail.d.ts.map +1 -1
- package/dist/server/src/Emails/renderOutboxEmail.js +6 -28
- package/dist/server/src/Emails/renderOutboxEmail.js.map +1 -1
- package/dist/server/src/Plugins/Plugins.d.ts +2 -0
- package/dist/server/src/Plugins/Plugins.d.ts.map +1 -1
- package/dist/server/src/Plugins/parsePlugins.d.ts +2 -0
- package/dist/server/src/Plugins/parsePlugins.d.ts.map +1 -1
- package/dist/server/src/Plugins/parsePlugins.js +33 -0
- package/dist/server/src/Plugins/parsePlugins.js.map +1 -1
- package/dist/server/src/cli/cli.js +0 -0
- package/dist/server/src/schemaConfig.d.ts +1 -0
- package/dist/server/src/schemaConfig.d.ts.map +1 -1
- package/dist/server/src/schemaConfig.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ export type ClientTableAuditConfig = {
|
|
|
11
11
|
};
|
|
12
12
|
export type TableOptions = RequiredKeepUndefined<NonNullable<NonNullable<DBSSchema["connections"]["table_options"]>[string]> & {
|
|
13
13
|
label: string;
|
|
14
|
-
managedTableType?: "files" | "file-annotations";
|
|
14
|
+
managedTableType?: "files" | "file-annotations" | "alerts" | "alert-recipients" | "alert-deliveries";
|
|
15
15
|
}> & {
|
|
16
16
|
audit?: ClientTableAuditConfig;
|
|
17
17
|
defaultColumns?: string[];
|
|
@@ -30,6 +30,8 @@ export type InternalColumnFormat = {
|
|
|
30
30
|
dataKey: string;
|
|
31
31
|
} | {
|
|
32
32
|
component: "FileExtractionStatus";
|
|
33
|
+
} | {
|
|
34
|
+
component: "AlertDefinition";
|
|
33
35
|
} | ({
|
|
34
36
|
component: "ActionColumns";
|
|
35
37
|
dataKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managedTableSchema.d.ts","sourceRoot":"","sources":["../../../common/managedTableSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,eAAO,MAAM,uBAAuB,4DAK1B,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAC9B;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB;IACE,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9B,CAAC;AAEN,MAAM,MAAM,YAAY,GAAG,qBAAqB,CAC9C,WAAW,CACT,WAAW,CAAC,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BAAoB,GAAG;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EACF;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GACtC;QACE,SAAS,EAAE,gBAAgB,CAAC;QAC5B,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,GACD;QAAE,SAAS,EAAE,sBAAsB,CAAA;KAAE,GACrC;QAAE,SAAS,EAAE,iBAAiB,CAAA;KAAE,GAChC,CAAC;QAAE,SAAS,EAAE,eAAe,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,mBAAmB,CAAC,CAAC;CAC7E,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,qBAAqB,CAC/C,IAAI,CACF,WAAW,CACT,WAAW,CACT,WAAW,CACT,WAAW,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,CAC/D,CAAC,SAAS,CAAC,CACb,CAAC,MAAM,CAAC,CACV,EACD,MAAM,GAAG,UAAU,GAAG,OAAO,CAC9B,CACF,GAAG;IACF,eAAe,CAAC,EAAE,oBAAoB,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqC1B,CAAC;AAEX,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"managedTableSchema.js","sourceRoot":"","sources":["../../../common/managedTableSchema.ts"],"names":[],"mappings":";;;AAEA,iFAAsE;AAIzD,QAAA,uBAAuB,GAAG;IACrC,aAAa;IACb,YAAY;IACZ,QAAQ;IACR,QAAQ;CACA,CAAC;
|
|
1
|
+
{"version":3,"file":"managedTableSchema.js","sourceRoot":"","sources":["../../../common/managedTable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EAAE,KAAK,EAAE,EAAE;qBACvC;oBACD;wBACE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE;wBAC7B,KAAK,EAAE,MAAM;wBACb,GAAG,EAAE,MAAM;wBACX,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;wBACtC,eAAe,EAAE,QAAQ;wBACzB,OAAO,EAAE,mDAAoB;qBAC9B;oBACD;wBACE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE;wBAC1B,KAAK,EAAE,SAAS;wBAChB,KAAK,EAAE,MAAM;wBACb,GAAG,EAAE,MAAM;wBACX,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;qBACvC;iBACF;aACF;SACF;KACF;CACO,CAAC"}
|
package/dist/server/package.json
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import type { JSONB, MaybePromise } from "prostgles-types";
|
|
2
2
|
import type { DBHandlerServer, DBHandlerServerRestricted } from "prostgles-server";
|
|
3
3
|
import type { PermissionScope } from "prostgles-server/dist/PublishParser/publishTypesAndUtils";
|
|
4
|
+
import type { AlertRule } from "./alertRuleSchema";
|
|
4
5
|
export type AlertMessage = {
|
|
5
6
|
title: string;
|
|
6
7
|
body: string;
|
|
7
8
|
};
|
|
9
|
+
export type AlertContext<S = void, P extends JSONB.ObjectType["type"] = JSONB.ObjectType["type"]> = {
|
|
10
|
+
clientDb: DBHandlerServerRestricted<S>;
|
|
11
|
+
params: JSONB.GetObjectType<P>;
|
|
12
|
+
recipientId: string;
|
|
13
|
+
localDate: string;
|
|
14
|
+
signal: AbortSignal;
|
|
15
|
+
};
|
|
8
16
|
export type AlertType<S = void, P extends JSONB.ObjectType["type"] = JSONB.ObjectType["type"]> = {
|
|
9
17
|
params: P;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}) => Promise<AlertMessage | null>;
|
|
18
|
-
};
|
|
18
|
+
/** Trusted scope; JSON values may bind {$ref: "recipientId"}. Never stored in editable rules. */
|
|
19
|
+
permissionScope?: PermissionScope | ((recipientId: string) => PermissionScope);
|
|
20
|
+
} & ({
|
|
21
|
+
prepare: (context: AlertContext<S, P>) => Promise<AlertMessage | null>;
|
|
22
|
+
} | {
|
|
23
|
+
rule: AlertRule;
|
|
24
|
+
});
|
|
19
25
|
/** Register reusable behaviour. Individual alerts and recipients live in managed tables. */
|
|
20
|
-
export declare const createAlertDefiner: <S = void>() => <const P extends JSONB.ObjectType["type"]
|
|
26
|
+
export declare const createAlertDefiner: <S = void>() => <const P extends JSONB.ObjectType["type"], Definition extends AlertType<S, P>>(definition: AlertType<S, P> & Definition) => AlertType<S, P> & Definition;
|
|
21
27
|
export type AlertChannel = {
|
|
22
28
|
/** At-least-once delivery: use idempotencyKey when supported. Re-resolve the destination and honour signal. */
|
|
23
29
|
send: (context: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertTypes.d.ts","sourceRoot":"","sources":["../../../../src/Alerts/AlertTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AlertTypes.d.ts","sourceRoot":"","sources":["../../../../src/Alerts/AlertTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAChG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG;IAAE,KAAK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CAAC,OAAO,EAAE;QACd,GAAG,EAAE,eAAe,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,YAAY,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,MAAM,EAAE,WAAW,CAAC;KACrB,KAAK,YAAY,CAAC;QAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;CACnD,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,IAAI,IAAI;IACpC,0FAA0F;IAC1F,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AlertTypes.js","sourceRoot":"","sources":["../../../../src/Alerts/AlertTypes.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"AlertTypes.js","sourceRoot":"","sources":["../../../../src/Alerts/AlertTypes.ts"],"names":[],"mappings":";;;AAgCA,4FAA4F;AACrF,MAAM,kBAAkB,GAC7B,GAAa,EAAE,CACf,CAIE,UAAwC,EACxC,EAAE,CACF,UAAU,CAAC;AARF,QAAA,kBAAkB,sBAQhB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { JSONB } from "prostgles-types";
|
|
2
|
+
/** Query results are available as queries.<name>, alongside params, recipientId and localDate. */
|
|
3
|
+
export declare const alertRuleSchema: {
|
|
4
|
+
readonly type: {
|
|
5
|
+
readonly queries: {
|
|
6
|
+
readonly record: {
|
|
7
|
+
readonly values: {
|
|
8
|
+
readonly type: {
|
|
9
|
+
readonly table: "string";
|
|
10
|
+
readonly filter: {
|
|
11
|
+
readonly record: {
|
|
12
|
+
readonly values: "unknown";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly select: "unknown";
|
|
16
|
+
readonly orderBy: {
|
|
17
|
+
readonly type: "unknown";
|
|
18
|
+
readonly optional: true;
|
|
19
|
+
};
|
|
20
|
+
readonly groupBy: {
|
|
21
|
+
readonly type: "boolean";
|
|
22
|
+
readonly optional: true;
|
|
23
|
+
};
|
|
24
|
+
readonly limit: {
|
|
25
|
+
readonly type: "integer";
|
|
26
|
+
readonly nullable: true;
|
|
27
|
+
readonly optional: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readonly when: {
|
|
34
|
+
readonly optional: true;
|
|
35
|
+
readonly description: "Defaults to sending when any query returns rows.";
|
|
36
|
+
readonly type: {
|
|
37
|
+
readonly match: {
|
|
38
|
+
readonly enum: readonly ["all", "any"];
|
|
39
|
+
};
|
|
40
|
+
readonly conditions: {
|
|
41
|
+
readonly arrayOfType: {
|
|
42
|
+
readonly left: "unknown";
|
|
43
|
+
readonly operator: {
|
|
44
|
+
readonly enum: readonly ["=", "!=", ">", ">=", "<", "<="];
|
|
45
|
+
};
|
|
46
|
+
readonly right: "unknown";
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
readonly template: {
|
|
52
|
+
readonly type: {
|
|
53
|
+
readonly title: "string";
|
|
54
|
+
readonly body: "string";
|
|
55
|
+
readonly data: {
|
|
56
|
+
readonly description: "Render each query row into a named template value.";
|
|
57
|
+
readonly record: {
|
|
58
|
+
readonly values: {
|
|
59
|
+
readonly type: {
|
|
60
|
+
readonly query: "string";
|
|
61
|
+
readonly text: "string";
|
|
62
|
+
readonly separator: "string";
|
|
63
|
+
readonly nullText: {
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
readonly optional: true;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export type AlertRule = JSONB.GetType<typeof alertRuleSchema>;
|
|
76
|
+
//# sourceMappingURL=alertRuleSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alertRuleSchema.d.ts","sourceRoot":"","sources":["../../../../src/Alerts/alertRuleSchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,kGAAkG;AAClG,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDQ,CAAC;AAErC,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.alertRuleSchema = void 0;
|
|
4
|
+
/** Query results are available as queries.<name>, alongside params, recipientId and localDate. */
|
|
5
|
+
exports.alertRuleSchema = {
|
|
6
|
+
type: {
|
|
7
|
+
queries: {
|
|
8
|
+
record: {
|
|
9
|
+
values: {
|
|
10
|
+
type: {
|
|
11
|
+
table: "string",
|
|
12
|
+
filter: { record: { values: "unknown" } },
|
|
13
|
+
select: "unknown",
|
|
14
|
+
orderBy: { type: "unknown", optional: true },
|
|
15
|
+
groupBy: { type: "boolean", optional: true },
|
|
16
|
+
limit: { type: "integer", nullable: true, optional: true },
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
when: {
|
|
22
|
+
optional: true,
|
|
23
|
+
description: "Defaults to sending when any query returns rows.",
|
|
24
|
+
type: {
|
|
25
|
+
match: { enum: ["all", "any"] },
|
|
26
|
+
conditions: {
|
|
27
|
+
arrayOfType: {
|
|
28
|
+
left: "unknown",
|
|
29
|
+
operator: { enum: ["=", "!=", ">", ">=", "<", "<="] },
|
|
30
|
+
right: "unknown",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
template: {
|
|
36
|
+
type: {
|
|
37
|
+
title: "string",
|
|
38
|
+
body: "string",
|
|
39
|
+
data: {
|
|
40
|
+
description: "Render each query row into a named template value.",
|
|
41
|
+
record: {
|
|
42
|
+
values: {
|
|
43
|
+
type: {
|
|
44
|
+
query: "string",
|
|
45
|
+
text: "string",
|
|
46
|
+
separator: "string",
|
|
47
|
+
nullText: { type: "string", optional: true },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=alertRuleSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alertRuleSchema.js","sourceRoot":"","sources":["../../../../src/Alerts/alertRuleSchema.ts"],"names":[],"mappings":";;;AAEA,kGAAkG;AACrF,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,MAAM,EAAE;gBACN,MAAM,EAAE;oBACN,IAAI,EAAE;wBACJ,KAAK,EAAE,QAAQ;wBACf,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;wBACzC,MAAM,EAAE,SAAS;wBACjB,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;wBAC5C,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;wBAC5C,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;qBAC3D;iBACF;aACF;SACF;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,kDAAkD;YAC/D,IAAI,EAAE;gBACJ,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE;gBAC/B,UAAU,EAAE;oBACV,WAAW,EAAE;wBACX,IAAI,EAAE,SAAS;wBACf,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE;wBACrD,KAAK,EAAE,SAAS;qBACjB;iBACF;aACF;SACF;QACD,QAAQ,EAAE;YACR,IAAI,EAAE;gBACJ,KAAK,EAAE,QAAQ;gBACf,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE;oBACJ,WAAW,EAAE,oDAAoD;oBACjE,MAAM,EAAE;wBACN,MAAM,EAAE;4BACN,IAAI,EAAE;gCACJ,KAAK,EAAE,QAAQ;gCACf,IAAI,EAAE,QAAQ;gCACd,SAAS,EAAE,QAAQ;gCACnB,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;6BAC7C;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACiC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enqueueAlerts.d.ts","sourceRoot":"","sources":["../../../../src/Alerts/enqueueAlerts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,+FAA+F;AAC/F,eAAO,MAAM,aAAa,GACxB,KAAK,eAAe,EACpB,SAAS,aAAa,
|
|
1
|
+
{"version":3,"file":"enqueueAlerts.d.ts","sourceRoot":"","sources":["../../../../src/Alerts/enqueueAlerts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,+FAA+F;AAC/F,eAAO,MAAM,aAAa,GACxB,KAAK,eAAe,EACpB,SAAS,aAAa,kBAyCvB,CAAC"}
|
|
@@ -8,6 +8,10 @@ const enqueueAlerts = async (dbo, options) => {
|
|
|
8
8
|
const now = new Date();
|
|
9
9
|
const alerts = await (0, getAlertTables_1.getAlertDb)(dbo, options).alerts.find({ enabled: true }, { limit: null });
|
|
10
10
|
for (const alert of alerts) {
|
|
11
|
+
const definition = options.types[alert.definition.type];
|
|
12
|
+
const savedDefinition = definition && "rule" in definition ?
|
|
13
|
+
{ ...alert.definition, rule: alert.definition.rule ?? definition.rule }
|
|
14
|
+
: alert.definition;
|
|
11
15
|
const occurrence = (0, cronSchedule_1.parseCronSchedule)({
|
|
12
16
|
type: "schedule",
|
|
13
17
|
...alert.schedule,
|
|
@@ -26,7 +30,7 @@ const enqueueAlerts = async (dbo, options) => {
|
|
|
26
30
|
user_id: recipient.user_id,
|
|
27
31
|
channel: recipient.channel,
|
|
28
32
|
occurrence: occurrence.toISOString(),
|
|
29
|
-
definition:
|
|
33
|
+
definition: savedDefinition,
|
|
30
34
|
revision: alert.revision,
|
|
31
35
|
outcome: "pending",
|
|
32
36
|
})), { onConflict: "DoNothing" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enqueueAlerts.js","sourceRoot":"","sources":["../../../../src/Alerts/enqueueAlerts.ts"],"names":[],"mappings":";;;AACA,0EAA4E;AAE5E,qDAA8C;AAE9C,+FAA+F;AACxF,MAAM,aAAa,GAAG,KAAK,EAChC,GAAoB,EACpB,OAAsB,EACtB,EAAE;IACF,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,MAAM,GAAG,MAAM,IAAA,2BAAU,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CACvD,EAAE,OAAO,EAAE,IAAI,EAA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,EAAE,KAAK,CAAC,EAAE;gBAClB,YAAY,EAAE,SAAS,CAAC,EAAE;gBAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;gBAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;gBAC1B,UAAU,EAAE,UAAU,CAAC,WAAW,EAAE;gBACpC,UAAU,EAAE,eAAe;gBAC3B,QAAQ,EAAE,KAAK,CAAC,QAAQ;gBACxB,OAAO,EAAE,SAAS;aACnB,CAAC,CAAC,EACH,EAAE,UAAU,EAAE,WAAW,EAAE,CAC5B,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AA3CW,QAAA,aAAa,iBA2CxB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TableOptions } from "../../../common/managedTableSchema.js";
|
|
2
|
+
import type { getAlertTableNames } from "./getAlertTables";
|
|
3
|
+
export declare const getAlertTableOptions: (names: ReturnType<typeof getAlertTableNames>) => Record<string, Partial<TableOptions>>;
|
|
4
|
+
//# sourceMappingURL=getAlertTableOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAlertTableOptions.d.ts","sourceRoot":"","sources":["../../../../src/Alerts/getAlertTableOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,eAAO,MAAM,oBAAoB,GAC/B,OAAO,UAAU,CAAC,OAAO,kBAAkB,CAAC,KAC3C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,CAsErC,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAlertTableOptions = void 0;
|
|
4
|
+
const getAlertTableOptions = (names) => ({
|
|
5
|
+
[names.alerts]: {
|
|
6
|
+
managedTableType: "alerts",
|
|
7
|
+
icon: "BellOutline",
|
|
8
|
+
defaultColumns: ["name", "enabled", "definition", "schedule"],
|
|
9
|
+
sort: [{ key: "created_at", asc: false }],
|
|
10
|
+
referenceDisplay: { columns: [{ name: "name" }] },
|
|
11
|
+
card: {
|
|
12
|
+
headerColumn: "name",
|
|
13
|
+
visibleColumns: ["enabled", "definition", "schedule"],
|
|
14
|
+
},
|
|
15
|
+
columns: {
|
|
16
|
+
name: { width: 220 },
|
|
17
|
+
definition: { label: "Rule", width: 320 },
|
|
18
|
+
schedule: { width: 220 },
|
|
19
|
+
created_at: { renderAs: { type: "Age" } },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
[names.recipients]: {
|
|
23
|
+
managedTableType: "alert-recipients",
|
|
24
|
+
icon: "AccountMultipleOutline",
|
|
25
|
+
defaultColumns: ["alert_id", "user_id", "channel", "enabled"],
|
|
26
|
+
sort: [{ key: "user_id", asc: true }],
|
|
27
|
+
referenceDisplay: { columns: [{ name: "user_id" }, { name: "channel" }] },
|
|
28
|
+
card: {
|
|
29
|
+
headerColumn: "user_id",
|
|
30
|
+
subHeaderColumn: "channel",
|
|
31
|
+
visibleColumns: ["alert_id", "enabled"],
|
|
32
|
+
},
|
|
33
|
+
columns: {
|
|
34
|
+
alert_id: { label: "Alert" },
|
|
35
|
+
user_id: { label: "Recipient" },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
[names.deliveries]: {
|
|
39
|
+
managedTableType: "alert-deliveries",
|
|
40
|
+
icon: "BellCheckOutline",
|
|
41
|
+
defaultColumns: [
|
|
42
|
+
"occurrence",
|
|
43
|
+
"alert_id",
|
|
44
|
+
"user_id",
|
|
45
|
+
"channel",
|
|
46
|
+
"outcome",
|
|
47
|
+
"reason",
|
|
48
|
+
],
|
|
49
|
+
sort: [{ key: "occurrence", asc: false }],
|
|
50
|
+
card: {
|
|
51
|
+
headerColumn: "outcome",
|
|
52
|
+
subHeaderColumn: "user_id",
|
|
53
|
+
visibleColumns: ["alert_id", "occurrence", "channel", "reason"],
|
|
54
|
+
},
|
|
55
|
+
columns: {
|
|
56
|
+
alert_id: { label: "Alert" },
|
|
57
|
+
recipient_id: { label: "Subscription" },
|
|
58
|
+
user_id: { label: "Recipient" },
|
|
59
|
+
job_id: { label: "Delivery job" },
|
|
60
|
+
definition: { label: "Rule snapshot", width: 320 },
|
|
61
|
+
created_at: { renderAs: { type: "Age" } },
|
|
62
|
+
outcome: {
|
|
63
|
+
style: {
|
|
64
|
+
type: "Conditional",
|
|
65
|
+
conditions: [
|
|
66
|
+
{ operator: "=", condition: "pending", textColor: "#946200" },
|
|
67
|
+
{ operator: "=", condition: "sent", textColor: "#16803c" },
|
|
68
|
+
{ operator: "=", condition: "skipped", textColor: "#666666" },
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
exports.getAlertTableOptions = getAlertTableOptions;
|
|
76
|
+
//# sourceMappingURL=getAlertTableOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAlertTableOptions.js","sourceRoot":"","sources":["../../../../src/Alerts/getAlertTableOptions.ts"],"names":[],"mappings":";;;AAGO,MAAM,oBAAoB,GAAG,CAClC,KAA4C,EACL,EAAE,CAAC,CAAC;IAC3C,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QACd,gBAAgB,EAAE,QAAQ;QAC1B,IAAI,EAAE,aAAa;QACnB,cAAc,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,UAAU,CAAC;QAC7D,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;QACzC,gBAAgB,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE;QACjD,IAAI,EAAE;YACJ,YAAY,EAAE,MAAM;YACp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,IAAI,EAAE;YACJ,YAAY,EAAE,SAAS;YACvB,eAAe,EAAE,SAAS;YAC1B,cAAc,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,CAAC;SAChE;QACD,OAAO,EAAE;YACP,QAAQ,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;YAC5B,YAAY,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE;YACvC,OAAO,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE;YAC/B,MAAM,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE;YACjC,UAAU,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,GAAG,EAAE;YAClD,UAAU,EAAE,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;YACzC,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,IAAI,EAAE,aAAa;oBACnB,UAAU,EAAE;wBACV,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE;wBAC7D,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE;wBAC1D,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE;qBAC9D;iBACF;aACF;SACF;KACF;CACF,CAAC,CAAC;AAxEU,QAAA,oBAAoB,wBAwE9B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { DBTableHandlersFromSchema } from "prostgles-server/dist/DBSchemaBuilder/DBSchemaBuilder";
|
|
2
1
|
import type { DBHandlerServer } from "prostgles-server";
|
|
2
|
+
import type { DBTableHandlersFromSchema } from "prostgles-server/dist/DBSchemaBuilder/DBSchemaBuilder";
|
|
3
3
|
import type { TableInsertRowFromTableConfig } from "prostgles-server/dist/TableConfig/TableRowFromColumnDefinitions";
|
|
4
4
|
import type { AlertsOptions } from "./AlertTypes";
|
|
5
5
|
export declare const getAlertTables: (options: AlertsOptions, jobsTableName: string) => {
|
|
@@ -16,6 +16,79 @@ export declare const getAlertTables: (options: AlertsOptions, jobsTableName: str
|
|
|
16
16
|
readonly nullable: false;
|
|
17
17
|
readonly jsonbSchema: {
|
|
18
18
|
readonly oneOfType: {
|
|
19
|
+
rule?: {
|
|
20
|
+
optional: true;
|
|
21
|
+
type: {
|
|
22
|
+
readonly queries: {
|
|
23
|
+
readonly record: {
|
|
24
|
+
readonly values: {
|
|
25
|
+
readonly type: {
|
|
26
|
+
readonly table: "string";
|
|
27
|
+
readonly filter: {
|
|
28
|
+
readonly record: {
|
|
29
|
+
readonly values: "unknown";
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
readonly select: "unknown";
|
|
33
|
+
readonly orderBy: {
|
|
34
|
+
readonly type: "unknown";
|
|
35
|
+
readonly optional: true;
|
|
36
|
+
};
|
|
37
|
+
readonly groupBy: {
|
|
38
|
+
readonly type: "boolean";
|
|
39
|
+
readonly optional: true;
|
|
40
|
+
};
|
|
41
|
+
readonly limit: {
|
|
42
|
+
readonly type: "integer";
|
|
43
|
+
readonly nullable: true;
|
|
44
|
+
readonly optional: true;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly when: {
|
|
51
|
+
readonly optional: true;
|
|
52
|
+
readonly description: "Defaults to sending when any query returns rows.";
|
|
53
|
+
readonly type: {
|
|
54
|
+
readonly match: {
|
|
55
|
+
readonly enum: readonly ["all", "any"];
|
|
56
|
+
};
|
|
57
|
+
readonly conditions: {
|
|
58
|
+
readonly arrayOfType: {
|
|
59
|
+
readonly left: "unknown";
|
|
60
|
+
readonly operator: {
|
|
61
|
+
readonly enum: readonly ["=", "!=", ">", ">=", "<", "<="];
|
|
62
|
+
};
|
|
63
|
+
readonly right: "unknown";
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
readonly template: {
|
|
69
|
+
readonly type: {
|
|
70
|
+
readonly title: "string";
|
|
71
|
+
readonly body: "string";
|
|
72
|
+
readonly data: {
|
|
73
|
+
readonly description: "Render each query row into a named template value.";
|
|
74
|
+
readonly record: {
|
|
75
|
+
readonly values: {
|
|
76
|
+
readonly type: {
|
|
77
|
+
readonly query: "string";
|
|
78
|
+
readonly text: "string";
|
|
79
|
+
readonly separator: "string";
|
|
80
|
+
readonly nullText: {
|
|
81
|
+
readonly type: "string";
|
|
82
|
+
readonly optional: true;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
} | undefined;
|
|
19
92
|
type: {
|
|
20
93
|
enum: string[];
|
|
21
94
|
};
|
|
@@ -45,6 +118,10 @@ export declare const getAlertTables: (options: AlertsOptions, jobsTableName: str
|
|
|
45
118
|
readonly query: "BEGIN NEW.revision := OLD.revision + 1; RETURN NEW; END;";
|
|
46
119
|
};
|
|
47
120
|
};
|
|
121
|
+
readonly onMount: ({ dbo }: {
|
|
122
|
+
dbo: import("prostgles-server").DBHandlerServerInternal;
|
|
123
|
+
_db: import("prostgles-server/dist/Prostgles").DB;
|
|
124
|
+
}) => Promise<void>;
|
|
48
125
|
};
|
|
49
126
|
readonly recipients: {
|
|
50
127
|
readonly info: {
|
|
@@ -85,6 +162,79 @@ export declare const getAlertTables: (options: AlertsOptions, jobsTableName: str
|
|
|
85
162
|
readonly values: "unknown";
|
|
86
163
|
};
|
|
87
164
|
};
|
|
165
|
+
readonly rule: {
|
|
166
|
+
readonly optional: true;
|
|
167
|
+
readonly type: {
|
|
168
|
+
readonly queries: {
|
|
169
|
+
readonly record: {
|
|
170
|
+
readonly values: {
|
|
171
|
+
readonly type: {
|
|
172
|
+
readonly table: "string";
|
|
173
|
+
readonly filter: {
|
|
174
|
+
readonly record: {
|
|
175
|
+
readonly values: "unknown";
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
readonly select: "unknown";
|
|
179
|
+
readonly orderBy: {
|
|
180
|
+
readonly type: "unknown";
|
|
181
|
+
readonly optional: true;
|
|
182
|
+
};
|
|
183
|
+
readonly groupBy: {
|
|
184
|
+
readonly type: "boolean";
|
|
185
|
+
readonly optional: true;
|
|
186
|
+
};
|
|
187
|
+
readonly limit: {
|
|
188
|
+
readonly type: "integer";
|
|
189
|
+
readonly nullable: true;
|
|
190
|
+
readonly optional: true;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
readonly when: {
|
|
197
|
+
readonly optional: true;
|
|
198
|
+
readonly description: "Defaults to sending when any query returns rows.";
|
|
199
|
+
readonly type: {
|
|
200
|
+
readonly match: {
|
|
201
|
+
readonly enum: readonly ["all", "any"];
|
|
202
|
+
};
|
|
203
|
+
readonly conditions: {
|
|
204
|
+
readonly arrayOfType: {
|
|
205
|
+
readonly left: "unknown";
|
|
206
|
+
readonly operator: {
|
|
207
|
+
readonly enum: readonly ["=", "!=", ">", ">=", "<", "<="];
|
|
208
|
+
};
|
|
209
|
+
readonly right: "unknown";
|
|
210
|
+
};
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
readonly template: {
|
|
215
|
+
readonly type: {
|
|
216
|
+
readonly title: "string";
|
|
217
|
+
readonly body: "string";
|
|
218
|
+
readonly data: {
|
|
219
|
+
readonly description: "Render each query row into a named template value.";
|
|
220
|
+
readonly record: {
|
|
221
|
+
readonly values: {
|
|
222
|
+
readonly type: {
|
|
223
|
+
readonly query: "string";
|
|
224
|
+
readonly text: "string";
|
|
225
|
+
readonly separator: "string";
|
|
226
|
+
readonly nullText: {
|
|
227
|
+
readonly type: "string";
|
|
228
|
+
readonly optional: true;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
};
|
|
88
238
|
};
|
|
89
239
|
};
|
|
90
240
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAlertTables.d.ts","sourceRoot":"","sources":["../../../../src/Alerts/getAlertTables.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getAlertTables.d.ts","sourceRoot":"","sources":["../../../../src/Alerts/getAlertTables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAe,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AACvG,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iEAAiE,CAAC;AAErH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,eAAO,MAAM,cAAc,GACzB,SAAS,aAAa,EACtB,eAAe,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwGtB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC;;;;CAe1C,CAAC;AAEF,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AACrD,MAAM,MAAM,WAAW,GAAG;KACvB,KAAK,IAAI,MAAM,WAAW,GAAG;QAC5B,OAAO,EAAE,6BAA6B,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;KAC5D;CACF,CAAC;AAGF,eAAO,MAAM,UAAU,GACrB,KAAK,yBAAyB,EAC9B,SAAS,aAAa;YAIS,eAAe,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC;gBAG9D,eAAe,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC;gBAG1C,eAAe,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC;CAElD,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAlertDb = exports.getAlertTableNames = exports.getAlertTables = void 0;
|
|
4
4
|
const prostgles_types_1 = require("prostgles-types");
|
|
5
|
+
const alertRuleSchema_1 = require("./alertRuleSchema");
|
|
5
6
|
const getAlertTables = (options, jobsTableName) => {
|
|
6
7
|
const names = (0, exports.getAlertTableNames)(options);
|
|
7
8
|
const id = "UUID PRIMARY KEY DEFAULT gen_random_uuid()";
|
|
@@ -20,6 +21,9 @@ const getAlertTables = (options, jobsTableName) => {
|
|
|
20
21
|
oneOfType: Object.entries(options.types).map(([name, definition]) => ({
|
|
21
22
|
type: { enum: [name] },
|
|
22
23
|
params: { type: definition.params },
|
|
24
|
+
...("rule" in definition && {
|
|
25
|
+
rule: { ...alertRuleSchema_1.alertRuleSchema, optional: true },
|
|
26
|
+
}),
|
|
23
27
|
})),
|
|
24
28
|
},
|
|
25
29
|
},
|
|
@@ -38,6 +42,16 @@ const getAlertTables = (options, jobsTableName) => {
|
|
|
38
42
|
query: "BEGIN NEW.revision := OLD.revision + 1; RETURN NEW; END;",
|
|
39
43
|
},
|
|
40
44
|
},
|
|
45
|
+
onMount: async ({ dbo }) => {
|
|
46
|
+
const alerts = dbo[names.alerts];
|
|
47
|
+
const rows = await alerts.find({}, { limit: null });
|
|
48
|
+
for (const row of rows) {
|
|
49
|
+
const definition = options.types[row.definition.type];
|
|
50
|
+
if (!row.definition.rule && definition && "rule" in definition) {
|
|
51
|
+
await alerts.update({ id: row.id, definition: row.definition }, { definition: { ...row.definition, rule: definition.rule } });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
},
|
|
41
55
|
},
|
|
42
56
|
recipients: {
|
|
43
57
|
info: { label: "Alert recipients" },
|
|
@@ -63,7 +77,11 @@ const getAlertTables = (options, jobsTableName) => {
|
|
|
63
77
|
definition: {
|
|
64
78
|
nullable: false,
|
|
65
79
|
jsonbSchema: {
|
|
66
|
-
type: {
|
|
80
|
+
type: {
|
|
81
|
+
type: "string",
|
|
82
|
+
params: { record: { values: "unknown" } },
|
|
83
|
+
rule: { ...alertRuleSchema_1.alertRuleSchema, optional: true },
|
|
84
|
+
},
|
|
67
85
|
},
|
|
68
86
|
},
|
|
69
87
|
revision: "INTEGER NOT NULL",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAlertTables.js","sourceRoot":"","sources":["../../../../src/Alerts/getAlertTables.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"getAlertTables.js","sourceRoot":"","sources":["../../../../src/Alerts/getAlertTables.ts"],"names":[],"mappings":";;;AAGA,qDAAsE;AAEtE,uDAAoD;AAE7C,MAAM,cAAc,GAAG,CAC5B,OAAsB,EACtB,aAAqB,EACrB,EAAE;IACF,MAAM,KAAK,GAAG,IAAA,0BAAkB,EAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,EAAE,GAAG,4CAA4C,CAAC;IACxD,MAAM,cAAc,GAClB,4BAA4B,IAAA,wBAAM,EAAC,KAAK,CAAC,MAAM,CAAC,MAAe,CAAC;IAClE,OAAO;QACL,MAAM,EAAE;YACN,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;YACzB,OAAO,EAAE;gBACP,EAAE;gBACF,IAAI,EAAE,8CAA8C;gBACpD,OAAO,EAAE,+BAA+B;gBACxC,UAAU,EAAE,eAAe;gBAC3B,UAAU,EAAE;oBACV,QAAQ,EAAE,KAAK;oBACf,WAAW,EAAE;wBACX,SAAS,EAAE,MAAM,CAAC,OAAO,C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