@openinc/parse-server-opendash 4.38.1 → 4.39.0
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/features/openservice/alarms/index.d.ts +5 -2
- package/dist/features/openservice/alarms/index.js +6 -5
- package/dist/features/openservice/alarms/schedule/AlarmScheduleTypes.d.ts +4 -2
- package/dist/features/openservice/alarms/schedule/createAlarmSchedule.d.ts +6 -6
- package/dist/features/openservice/alarms/schedule/createAlarmSchedule.js +36 -139
- package/dist/features/openservice/alarms/schedule/ensureAlarmScheduleAction.js +2 -2
- package/dist/features/openservice/alarms/ticket/createAlarmTicket.d.ts +7 -4
- package/dist/features/openservice/alarms/ticket/createAlarmTicket.js +42 -161
- package/dist/features/openservice/alarms/ticket/ensureAlarmTicketAction.js +2 -2
- package/dist/features/openservice/automation/automationCall.d.ts +56 -0
- package/dist/features/openservice/automation/automationCall.js +61 -0
- package/dist/features/openservice/automation/createSchedule.d.ts +124 -0
- package/dist/features/openservice/automation/createSchedule.js +247 -0
- package/dist/features/openservice/automation/createTicket.d.ts +121 -0
- package/dist/features/openservice/automation/createTicket.js +212 -0
- package/dist/features/openservice/automation/index.d.ts +32 -0
- package/dist/features/openservice/automation/index.js +56 -0
- package/dist/features/openservice/{alarms/actionParams.d.ts → automation/params.d.ts} +15 -1
- package/dist/features/openservice/{alarms/actionParams.js → automation/params.js} +58 -1
- package/dist/features/openservice/automation/recordExecution.d.ts +61 -0
- package/dist/features/openservice/automation/recordExecution.js +111 -0
- package/dist/features/openservice/automation/resolveEquipment.d.ts +16 -0
- package/dist/features/openservice/automation/resolveEquipment.js +43 -0
- package/dist/features/openservice/automation/resolveStatus.d.ts +20 -0
- package/dist/features/openservice/automation/resolveStatus.js +57 -0
- package/dist/features/openservice/automation/resolveTenantUser.d.ts +16 -0
- package/dist/features/openservice/automation/resolveTenantUser.js +35 -0
- package/dist/features/openservice/automation/ticketDefaults.d.ts +34 -0
- package/dist/features/openservice/{alarms/ticket/alarmTicketDefaults.js → automation/ticketDefaults.js} +8 -8
- package/dist/features/openservice/automation/updateTicket.d.ts +65 -0
- package/dist/features/openservice/automation/updateTicket.js +141 -0
- package/dist/features/openservice/index.d.ts +2 -0
- package/dist/features/openservice/index.js +2 -0
- package/dist/functions/openinc-openservice-create-schedule.d.ts +20 -0
- package/dist/functions/openinc-openservice-create-schedule.js +41 -0
- package/dist/functions/openinc-openservice-create-ticket.d.ts +24 -0
- package/dist/functions/openinc-openservice-create-ticket.js +48 -0
- package/dist/functions/openinc-openservice-record-execution.d.ts +17 -0
- package/dist/functions/openinc-openservice-record-execution.js +38 -0
- package/dist/functions/openinc-openservice-update-ticket.d.ts +16 -0
- package/dist/functions/openinc-openservice-update-ticket.js +37 -0
- package/dist/hooks/Service_Schedule.js +5 -0
- package/dist/hooks/Service_Schedule_Execution.js +35 -0
- package/package.json +1 -1
- package/dist/features/openservice/alarms/resolveAlarmUser.d.ts +0 -16
- package/dist/features/openservice/alarms/resolveAlarmUser.js +0 -35
- package/dist/features/openservice/alarms/resolveEquipment.d.ts +0 -17
- package/dist/features/openservice/alarms/resolveEquipment.js +0 -45
- package/dist/features/openservice/alarms/ticket/alarmTicketDefaults.d.ts +0 -34
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createTicket = createTicket;
|
|
7
|
+
exports.applyTicketTimes = applyTicketTimes;
|
|
8
|
+
exports.findOpenTicket = findOpenTicket;
|
|
9
|
+
const node_1 = __importDefault(require("parse/node"));
|
|
10
|
+
const openservice_shared_1 = require("@opendash/openservice-shared");
|
|
11
|
+
const index_js_1 = require("../../../types/index.js");
|
|
12
|
+
const ticketFormConfig_js_1 = require("../tickets/ticketFormConfig.js");
|
|
13
|
+
const automationCall_js_1 = require("./automationCall.js");
|
|
14
|
+
const params_js_1 = require("./params.js");
|
|
15
|
+
const resolveEquipment_js_1 = require("./resolveEquipment.js");
|
|
16
|
+
const resolveStatus_js_1 = require("./resolveStatus.js");
|
|
17
|
+
const ticketDefaults_js_1 = require("./ticketDefaults.js");
|
|
18
|
+
/**
|
|
19
|
+
* Create a ticket the way the create form does — through a form config, with
|
|
20
|
+
* its defaults and rules — or, with `unique`, return the open one of the same
|
|
21
|
+
* origin.
|
|
22
|
+
*
|
|
23
|
+
* Deliberately thin: number, ACL, closing stamp, assignment notifications and
|
|
24
|
+
* the form config's rules all happen in the `Service_Ticket` hooks, on every
|
|
25
|
+
* write path. This only settles what a form would have settled before saving:
|
|
26
|
+
* which config, which defaults, which status, which machine.
|
|
27
|
+
*/
|
|
28
|
+
async function createTicket(tenant, params, options) {
|
|
29
|
+
const { auth, actor, logPrefix } = options;
|
|
30
|
+
const origin = (0, params_js_1.paramString)(params.origin);
|
|
31
|
+
if (origin && (0, params_js_1.paramBoolean)(params.unique)) {
|
|
32
|
+
const open = await findOpenTicket(tenant, origin);
|
|
33
|
+
if (open) {
|
|
34
|
+
return {
|
|
35
|
+
ticketId: open.id,
|
|
36
|
+
created: false,
|
|
37
|
+
origin,
|
|
38
|
+
equipmentId: open.get("equipment")?.id,
|
|
39
|
+
number: open.get("number"),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Per field the template wins, then the flat parameters, then the config's
|
|
44
|
+
// defaults — the order the alarm action established.
|
|
45
|
+
const config = await formConfig(tenant, (0, params_js_1.paramId)(params.formConfigId), options);
|
|
46
|
+
const template = (0, ticketDefaults_js_1.readTicketDefaults)(params.ticket);
|
|
47
|
+
const defaults = (0, ticketDefaults_js_1.formConfigDefaults)(config?.fields);
|
|
48
|
+
const merged = {
|
|
49
|
+
title: template.title ??
|
|
50
|
+
(0, params_js_1.paramString)(params.title) ??
|
|
51
|
+
defaults.title ??
|
|
52
|
+
undefined,
|
|
53
|
+
description: template.description ??
|
|
54
|
+
(0, params_js_1.paramString)(params.description) ??
|
|
55
|
+
defaults.description,
|
|
56
|
+
};
|
|
57
|
+
const text = options.finalizeText?.(merged) ?? merged;
|
|
58
|
+
if (!text.title) {
|
|
59
|
+
throw new node_1.default.Error(node_1.default.Error.INVALID_QUERY, `${logPrefix} A ticket needs a title — pass "title", a template or a form config with a default title.`);
|
|
60
|
+
}
|
|
61
|
+
const status = await resolveTicketStatus(tenant, params, logPrefix, [
|
|
62
|
+
template.status,
|
|
63
|
+
defaults.status,
|
|
64
|
+
]);
|
|
65
|
+
if (!status) {
|
|
66
|
+
throw new node_1.default.Error(node_1.default.Error.INVALID_QUERY, `${logPrefix} No "${openservice_shared_1.DEFAULT_STATUS_CATEGORY}" status configured for this tenant — cannot create a ticket.`);
|
|
67
|
+
}
|
|
68
|
+
const equipment = await (0, resolveEquipment_js_1.resolveEquipment)(tenant, template.equipment ?? (0, params_js_1.paramId)(params.equipmentId) ?? defaults.equipment, (0, params_js_1.paramStrings)(params.sourceTags), logPrefix);
|
|
69
|
+
const projectId = template.project ?? (0, params_js_1.paramId)(params.projectId) ?? defaults.project;
|
|
70
|
+
const ticket = new index_js_1.Service_Ticket();
|
|
71
|
+
ticket.set("deleted", false);
|
|
72
|
+
ticket.set("tenant", tenant);
|
|
73
|
+
ticket.set("status", status);
|
|
74
|
+
ticket.set("title", text.title);
|
|
75
|
+
if (text.description)
|
|
76
|
+
ticket.set("description", text.description);
|
|
77
|
+
if (origin)
|
|
78
|
+
ticket.set("origin", origin);
|
|
79
|
+
if (equipment)
|
|
80
|
+
ticket.set("equipment", equipment);
|
|
81
|
+
// The actor is the ticket's creator: it shows up as such, and the ACL gives
|
|
82
|
+
// them write access to what they raised.
|
|
83
|
+
if (actor)
|
|
84
|
+
ticket.set("createdBy", actor);
|
|
85
|
+
// The config's remaining defaults first: the flat parameters and the
|
|
86
|
+
// template after them override them.
|
|
87
|
+
for (const [key, value] of Object.entries(defaults.values)) {
|
|
88
|
+
ticket.set(key, value);
|
|
89
|
+
}
|
|
90
|
+
const priority = (0, params_js_1.paramNumber)(params.priority);
|
|
91
|
+
if (priority != null)
|
|
92
|
+
ticket.set("priority", priority);
|
|
93
|
+
if (projectId)
|
|
94
|
+
ticket.set("project", index_js_1.Service_Project.createWithoutData(projectId));
|
|
95
|
+
// Assignment arrays hold plain ids in this schema (see `refIds` in
|
|
96
|
+
// `@opendash/openservice-shared`, which reads both).
|
|
97
|
+
const users = (0, params_js_1.paramIds)(params.assignedUserIds);
|
|
98
|
+
if (users?.length)
|
|
99
|
+
ticket.set("assignedUsers", users);
|
|
100
|
+
const roles = (0, params_js_1.paramIds)(params.assignedRoleIds);
|
|
101
|
+
if (roles?.length)
|
|
102
|
+
ticket.set("assignedRoles", roles);
|
|
103
|
+
const tags = (0, params_js_1.paramIds)(params.tagIds);
|
|
104
|
+
if (tags?.length)
|
|
105
|
+
ticket.set("tags", tags);
|
|
106
|
+
for (const [key, value] of Object.entries(template.values)) {
|
|
107
|
+
ticket.set(key, value);
|
|
108
|
+
}
|
|
109
|
+
// Dates and durations are the caller's alone — a template has none of them.
|
|
110
|
+
applyTicketTimes(ticket, params);
|
|
111
|
+
// Naming the config makes the `Service_Ticket` hook run exactly its rules
|
|
112
|
+
// (priority formula, value rules, action rules). The hook also rejects master
|
|
113
|
+
// data of another tenant, as on every other way a ticket is written.
|
|
114
|
+
await ticket.save(null, {
|
|
115
|
+
...(0, automationCall_js_1.writeOptions)(auth),
|
|
116
|
+
context: { formConfig: config?.id },
|
|
117
|
+
});
|
|
118
|
+
return {
|
|
119
|
+
ticketId: ticket.id,
|
|
120
|
+
created: true,
|
|
121
|
+
origin,
|
|
122
|
+
equipmentId: equipment?.id,
|
|
123
|
+
number: ticket.get("number"),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Dates and durations a caller may set on create and update alike. Only what
|
|
128
|
+
* was passed is touched; `null` clears a field.
|
|
129
|
+
*/
|
|
130
|
+
function applyTicketTimes(ticket, params) {
|
|
131
|
+
for (const key of [
|
|
132
|
+
"startDate",
|
|
133
|
+
"dueDate",
|
|
134
|
+
"failureStart",
|
|
135
|
+
"failureEnd",
|
|
136
|
+
]) {
|
|
137
|
+
if (params[key] === null)
|
|
138
|
+
ticket.unset(key);
|
|
139
|
+
const date = (0, params_js_1.paramDate)(params[key]);
|
|
140
|
+
if (date)
|
|
141
|
+
ticket.set(key, date);
|
|
142
|
+
}
|
|
143
|
+
for (const key of [
|
|
144
|
+
"downtime",
|
|
145
|
+
"estimatedDuration",
|
|
146
|
+
"actualDuration",
|
|
147
|
+
]) {
|
|
148
|
+
if (params[key] === null)
|
|
149
|
+
ticket.unset(key);
|
|
150
|
+
const minutes = (0, params_js_1.paramInteger)(params[key]);
|
|
151
|
+
if (minutes != null)
|
|
152
|
+
ticket.set(key, minutes);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The status a ticket gets: the explicit id, then the category, then the
|
|
157
|
+
* presets (template, form config), then the inbox.
|
|
158
|
+
*/
|
|
159
|
+
async function resolveTicketStatus(tenant, params, logPrefix, presets) {
|
|
160
|
+
const explicit = await (0, resolveStatus_js_1.statusById)(tenant, (0, params_js_1.paramId)(params.statusId), logPrefix);
|
|
161
|
+
if (explicit)
|
|
162
|
+
return explicit;
|
|
163
|
+
if (params.statusCategory !== undefined) {
|
|
164
|
+
if ((0, resolveStatus_js_1.isStatusCategory)(params.statusCategory)) {
|
|
165
|
+
const byCategory = await (0, resolveStatus_js_1.statusByCategory)(tenant, params.statusCategory);
|
|
166
|
+
if (byCategory)
|
|
167
|
+
return byCategory;
|
|
168
|
+
}
|
|
169
|
+
console.warn(`${logPrefix} No status of category "${String(params.statusCategory)}" — using the presets`);
|
|
170
|
+
}
|
|
171
|
+
for (const preset of presets) {
|
|
172
|
+
const status = await (0, resolveStatus_js_1.statusById)(tenant, preset, logPrefix);
|
|
173
|
+
if (status)
|
|
174
|
+
return status;
|
|
175
|
+
}
|
|
176
|
+
return (0, resolveStatus_js_1.statusByCategory)(tenant);
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The newest unfinished ticket of this origin, if there is one.
|
|
180
|
+
*
|
|
181
|
+
* "Unfinished" is decided by the **status category**, not by `closedAt`: a
|
|
182
|
+
* tenant can name its statuses whatever it likes, the category is the contract
|
|
183
|
+
* (`done` / `cancelled` — the same list core uses).
|
|
184
|
+
*/
|
|
185
|
+
async function findOpenTicket(tenant, origin) {
|
|
186
|
+
const tickets = await new node_1.default.Query(index_js_1.Service_Ticket)
|
|
187
|
+
.equalTo("tenant", tenant)
|
|
188
|
+
.equalTo("origin", origin)
|
|
189
|
+
.equalTo("deleted", false)
|
|
190
|
+
.include("status")
|
|
191
|
+
.descending("createdAt")
|
|
192
|
+
.limit(20)
|
|
193
|
+
.find({ useMasterKey: true });
|
|
194
|
+
return tickets.find((ticket) => {
|
|
195
|
+
const category = ticket.get("status")?.get("category");
|
|
196
|
+
return !(0, openservice_shared_1.isDoneCategory)(category);
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* The form config the caller names, if it is the tenant's — else the form
|
|
201
|
+
* that applies to the actor (the tenant's default form without one).
|
|
202
|
+
*/
|
|
203
|
+
async function formConfig(tenant, id, { auth, actor, logPrefix }) {
|
|
204
|
+
const chosen = await (0, ticketFormConfig_js_1.configFromContext)(id, tenant, {
|
|
205
|
+
master: !("sessionToken" in auth),
|
|
206
|
+
sessionToken: "sessionToken" in auth ? auth.sessionToken : undefined,
|
|
207
|
+
});
|
|
208
|
+
if (id && !chosen) {
|
|
209
|
+
console.warn(`${logPrefix} Form config ${id} is not available here — using the applicable form`);
|
|
210
|
+
}
|
|
211
|
+
return chosen ?? (await (0, ticketFormConfig_js_1.applicableFormConfig)(tenant, actor));
|
|
212
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creating and changing open.SERVICE records from outside the frontend — the
|
|
3
|
+
* one implementation behind every machine path:
|
|
4
|
+
*
|
|
5
|
+
* - the **automation endpoints** (`openinc-openservice-create-ticket`,
|
|
6
|
+
* `-update-ticket`, `-create-schedule`, `-record-execution`), which
|
|
7
|
+
* integrations such as `@openinc/node-red-contrib-openservice` call;
|
|
8
|
+
* - the **alarm actions** (`../alarms/`), which turn a fired alarm into the
|
|
9
|
+
* parameters here and add only what is the alarm's own (placeholders,
|
|
10
|
+
* details, the `alarm:` origin).
|
|
11
|
+
*
|
|
12
|
+
* Each function does what a form would have settled before saving — which form
|
|
13
|
+
* config, which defaults, which status, which machine, which template — and
|
|
14
|
+
* leaves everything else to the hooks, so a record created here is
|
|
15
|
+
* indistinguishable from one a person created. `README.md` has the overview.
|
|
16
|
+
*/
|
|
17
|
+
export { readAutomationCall, writeOptions } from "./automationCall.js";
|
|
18
|
+
export type { AutomationCall, AutomationCallParams, WriteAuth, } from "./automationCall.js";
|
|
19
|
+
export { NO_CALENDAR_SYNC_CONTEXT_FLAG, createSchedule, findOpenSchedule, isOneOffCadence, oneOffCadence, } from "./createSchedule.js";
|
|
20
|
+
export type { Cadence, ScheduleCreateOptions, ScheduleCreateParams, ScheduleCreateResult, } from "./createSchedule.js";
|
|
21
|
+
export { applyTicketTimes, createTicket, findOpenTicket, } from "./createTicket.js";
|
|
22
|
+
export type { TicketCreateOptions, TicketCreateParams, TicketCreateResult, } from "./createTicket.js";
|
|
23
|
+
export { paramBoolean, paramDate, paramId, paramIds, paramInteger, paramNumber, paramString, paramStrings, } from "./params.js";
|
|
24
|
+
export { recordExecution } from "./recordExecution.js";
|
|
25
|
+
export type { ExecutionRecordOptions, ExecutionRecordParams, ExecutionRecordResult, StepResult, } from "./recordExecution.js";
|
|
26
|
+
export { resolveEquipment } from "./resolveEquipment.js";
|
|
27
|
+
export { isStatusCategory, statusByCategory, statusById, } from "./resolveStatus.js";
|
|
28
|
+
export { resolveTenantUser } from "./resolveTenantUser.js";
|
|
29
|
+
export { formConfigDefaults, readTicketDefaults } from "./ticketDefaults.js";
|
|
30
|
+
export type { TicketDefaults } from "./ticketDefaults.js";
|
|
31
|
+
export { updateTicket } from "./updateTicket.js";
|
|
32
|
+
export type { TicketUpdateOptions, TicketUpdateParams, TicketUpdateResult, } from "./updateTicket.js";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Creating and changing open.SERVICE records from outside the frontend — the
|
|
4
|
+
* one implementation behind every machine path:
|
|
5
|
+
*
|
|
6
|
+
* - the **automation endpoints** (`openinc-openservice-create-ticket`,
|
|
7
|
+
* `-update-ticket`, `-create-schedule`, `-record-execution`), which
|
|
8
|
+
* integrations such as `@openinc/node-red-contrib-openservice` call;
|
|
9
|
+
* - the **alarm actions** (`../alarms/`), which turn a fired alarm into the
|
|
10
|
+
* parameters here and add only what is the alarm's own (placeholders,
|
|
11
|
+
* details, the `alarm:` origin).
|
|
12
|
+
*
|
|
13
|
+
* Each function does what a form would have settled before saving — which form
|
|
14
|
+
* config, which defaults, which status, which machine, which template — and
|
|
15
|
+
* leaves everything else to the hooks, so a record created here is
|
|
16
|
+
* indistinguishable from one a person created. `README.md` has the overview.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.updateTicket = exports.readTicketDefaults = exports.formConfigDefaults = exports.resolveTenantUser = exports.statusById = exports.statusByCategory = exports.isStatusCategory = exports.resolveEquipment = exports.recordExecution = exports.paramStrings = exports.paramString = exports.paramNumber = exports.paramInteger = exports.paramIds = exports.paramId = exports.paramDate = exports.paramBoolean = exports.findOpenTicket = exports.createTicket = exports.applyTicketTimes = exports.oneOffCadence = exports.isOneOffCadence = exports.findOpenSchedule = exports.createSchedule = exports.NO_CALENDAR_SYNC_CONTEXT_FLAG = exports.writeOptions = exports.readAutomationCall = void 0;
|
|
20
|
+
var automationCall_js_1 = require("./automationCall.js");
|
|
21
|
+
Object.defineProperty(exports, "readAutomationCall", { enumerable: true, get: function () { return automationCall_js_1.readAutomationCall; } });
|
|
22
|
+
Object.defineProperty(exports, "writeOptions", { enumerable: true, get: function () { return automationCall_js_1.writeOptions; } });
|
|
23
|
+
var createSchedule_js_1 = require("./createSchedule.js");
|
|
24
|
+
Object.defineProperty(exports, "NO_CALENDAR_SYNC_CONTEXT_FLAG", { enumerable: true, get: function () { return createSchedule_js_1.NO_CALENDAR_SYNC_CONTEXT_FLAG; } });
|
|
25
|
+
Object.defineProperty(exports, "createSchedule", { enumerable: true, get: function () { return createSchedule_js_1.createSchedule; } });
|
|
26
|
+
Object.defineProperty(exports, "findOpenSchedule", { enumerable: true, get: function () { return createSchedule_js_1.findOpenSchedule; } });
|
|
27
|
+
Object.defineProperty(exports, "isOneOffCadence", { enumerable: true, get: function () { return createSchedule_js_1.isOneOffCadence; } });
|
|
28
|
+
Object.defineProperty(exports, "oneOffCadence", { enumerable: true, get: function () { return createSchedule_js_1.oneOffCadence; } });
|
|
29
|
+
var createTicket_js_1 = require("./createTicket.js");
|
|
30
|
+
Object.defineProperty(exports, "applyTicketTimes", { enumerable: true, get: function () { return createTicket_js_1.applyTicketTimes; } });
|
|
31
|
+
Object.defineProperty(exports, "createTicket", { enumerable: true, get: function () { return createTicket_js_1.createTicket; } });
|
|
32
|
+
Object.defineProperty(exports, "findOpenTicket", { enumerable: true, get: function () { return createTicket_js_1.findOpenTicket; } });
|
|
33
|
+
var params_js_1 = require("./params.js");
|
|
34
|
+
Object.defineProperty(exports, "paramBoolean", { enumerable: true, get: function () { return params_js_1.paramBoolean; } });
|
|
35
|
+
Object.defineProperty(exports, "paramDate", { enumerable: true, get: function () { return params_js_1.paramDate; } });
|
|
36
|
+
Object.defineProperty(exports, "paramId", { enumerable: true, get: function () { return params_js_1.paramId; } });
|
|
37
|
+
Object.defineProperty(exports, "paramIds", { enumerable: true, get: function () { return params_js_1.paramIds; } });
|
|
38
|
+
Object.defineProperty(exports, "paramInteger", { enumerable: true, get: function () { return params_js_1.paramInteger; } });
|
|
39
|
+
Object.defineProperty(exports, "paramNumber", { enumerable: true, get: function () { return params_js_1.paramNumber; } });
|
|
40
|
+
Object.defineProperty(exports, "paramString", { enumerable: true, get: function () { return params_js_1.paramString; } });
|
|
41
|
+
Object.defineProperty(exports, "paramStrings", { enumerable: true, get: function () { return params_js_1.paramStrings; } });
|
|
42
|
+
var recordExecution_js_1 = require("./recordExecution.js");
|
|
43
|
+
Object.defineProperty(exports, "recordExecution", { enumerable: true, get: function () { return recordExecution_js_1.recordExecution; } });
|
|
44
|
+
var resolveEquipment_js_1 = require("./resolveEquipment.js");
|
|
45
|
+
Object.defineProperty(exports, "resolveEquipment", { enumerable: true, get: function () { return resolveEquipment_js_1.resolveEquipment; } });
|
|
46
|
+
var resolveStatus_js_1 = require("./resolveStatus.js");
|
|
47
|
+
Object.defineProperty(exports, "isStatusCategory", { enumerable: true, get: function () { return resolveStatus_js_1.isStatusCategory; } });
|
|
48
|
+
Object.defineProperty(exports, "statusByCategory", { enumerable: true, get: function () { return resolveStatus_js_1.statusByCategory; } });
|
|
49
|
+
Object.defineProperty(exports, "statusById", { enumerable: true, get: function () { return resolveStatus_js_1.statusById; } });
|
|
50
|
+
var resolveTenantUser_js_1 = require("./resolveTenantUser.js");
|
|
51
|
+
Object.defineProperty(exports, "resolveTenantUser", { enumerable: true, get: function () { return resolveTenantUser_js_1.resolveTenantUser; } });
|
|
52
|
+
var ticketDefaults_js_1 = require("./ticketDefaults.js");
|
|
53
|
+
Object.defineProperty(exports, "formConfigDefaults", { enumerable: true, get: function () { return ticketDefaults_js_1.formConfigDefaults; } });
|
|
54
|
+
Object.defineProperty(exports, "readTicketDefaults", { enumerable: true, get: function () { return ticketDefaults_js_1.readTicketDefaults; } });
|
|
55
|
+
var updateTicket_js_1 = require("./updateTicket.js");
|
|
56
|
+
Object.defineProperty(exports, "updateTicket", { enumerable: true, get: function () { return updateTicket_js_1.updateTicket; } });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Reading the values an alarm action's form
|
|
2
|
+
* Reading the values a caller sends — an alarm action's form, a Node-RED node,
|
|
3
|
+
* any other integration.
|
|
3
4
|
*
|
|
4
5
|
* **Why this is not just `typeof value === "string"`.** The `select.parse` field
|
|
5
6
|
* in `FormGenerator` only stores an id when its settings name a `valueField`;
|
|
@@ -27,3 +28,16 @@ export declare function paramId(value: unknown): string | undefined;
|
|
|
27
28
|
export declare function paramString(value: unknown): string | undefined;
|
|
28
29
|
/** A finite number, or `undefined`. Accepts the numeric strings a form posts. */
|
|
29
30
|
export declare function paramNumber(value: unknown): number | undefined;
|
|
31
|
+
/** A finite number from `value`, or `undefined` — `paramNumber`, rounded. */
|
|
32
|
+
export declare function paramInteger(value: unknown): number | undefined;
|
|
33
|
+
/** The ids of a list, whatever shape each entry arrived in. */
|
|
34
|
+
export declare function paramIds(value: unknown): string[] | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* A date from an ISO string, a timestamp, a `Date` or a Parse date object
|
|
37
|
+
* (`{ __type: "Date", iso }`) — `undefined` for anything unreadable.
|
|
38
|
+
*/
|
|
39
|
+
export declare function paramDate(value: unknown): Date | undefined;
|
|
40
|
+
/** A boolean, accepting the strings `"true"` / `"false"` a form may post. */
|
|
41
|
+
export declare function paramBoolean(value: unknown): boolean | undefined;
|
|
42
|
+
/** Non-empty strings — a single string counts as a list of one. */
|
|
43
|
+
export declare function paramStrings(value: unknown): string[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
|
-
* Reading the values an alarm action's form
|
|
3
|
+
* Reading the values a caller sends — an alarm action's form, a Node-RED node,
|
|
4
|
+
* any other integration.
|
|
4
5
|
*
|
|
5
6
|
* **Why this is not just `typeof value === "string"`.** The `select.parse` field
|
|
6
7
|
* in `FormGenerator` only stores an id when its settings name a `valueField`;
|
|
@@ -19,6 +20,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
20
|
exports.paramId = paramId;
|
|
20
21
|
exports.paramString = paramString;
|
|
21
22
|
exports.paramNumber = paramNumber;
|
|
23
|
+
exports.paramInteger = paramInteger;
|
|
24
|
+
exports.paramIds = paramIds;
|
|
25
|
+
exports.paramDate = paramDate;
|
|
26
|
+
exports.paramBoolean = paramBoolean;
|
|
27
|
+
exports.paramStrings = paramStrings;
|
|
22
28
|
/**
|
|
23
29
|
* The object id behind a form value, whatever shape it arrived in: a plain id,
|
|
24
30
|
* a Parse pointer, a serialised object, or a live `Parse.Object`.
|
|
@@ -61,3 +67,54 @@ function paramNumber(value) {
|
|
|
61
67
|
}
|
|
62
68
|
return undefined;
|
|
63
69
|
}
|
|
70
|
+
/** A finite number from `value`, or `undefined` — `paramNumber`, rounded. */
|
|
71
|
+
function paramInteger(value) {
|
|
72
|
+
const parsed = paramNumber(value);
|
|
73
|
+
return parsed === undefined ? undefined : Math.round(parsed);
|
|
74
|
+
}
|
|
75
|
+
/** The ids of a list, whatever shape each entry arrived in. */
|
|
76
|
+
function paramIds(value) {
|
|
77
|
+
if (!Array.isArray(value))
|
|
78
|
+
return undefined;
|
|
79
|
+
return value.map(paramId).filter((id) => id !== undefined);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* A date from an ISO string, a timestamp, a `Date` or a Parse date object
|
|
83
|
+
* (`{ __type: "Date", iso }`) — `undefined` for anything unreadable.
|
|
84
|
+
*/
|
|
85
|
+
function paramDate(value) {
|
|
86
|
+
let parsed;
|
|
87
|
+
if (value instanceof Date)
|
|
88
|
+
parsed = value;
|
|
89
|
+
else if (typeof value === "string" && value.trim()) {
|
|
90
|
+
parsed = new Date(value.trim());
|
|
91
|
+
}
|
|
92
|
+
else if (typeof value === "number")
|
|
93
|
+
parsed = new Date(value);
|
|
94
|
+
else if (value && typeof value === "object") {
|
|
95
|
+
const iso = value.iso;
|
|
96
|
+
if (typeof iso === "string")
|
|
97
|
+
parsed = new Date(iso);
|
|
98
|
+
}
|
|
99
|
+
return parsed && !Number.isNaN(parsed.getTime()) ? parsed : undefined;
|
|
100
|
+
}
|
|
101
|
+
/** A boolean, accepting the strings `"true"` / `"false"` a form may post. */
|
|
102
|
+
function paramBoolean(value) {
|
|
103
|
+
if (typeof value === "boolean")
|
|
104
|
+
return value;
|
|
105
|
+
if (value === "true")
|
|
106
|
+
return true;
|
|
107
|
+
if (value === "false")
|
|
108
|
+
return false;
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
/** Non-empty strings — a single string counts as a list of one. */
|
|
112
|
+
function paramStrings(value) {
|
|
113
|
+
if (typeof value === "string")
|
|
114
|
+
return value.trim() ? [value.trim()] : [];
|
|
115
|
+
if (!Array.isArray(value))
|
|
116
|
+
return [];
|
|
117
|
+
return value
|
|
118
|
+
.map(paramString)
|
|
119
|
+
.filter((entry) => entry !== undefined);
|
|
120
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Tenant, type _User } from "../../../types/index.js";
|
|
2
|
+
import { type WriteAuth } from "./automationCall.js";
|
|
3
|
+
/** One step's outcome, as the execution runner stores it. */
|
|
4
|
+
export interface StepResult {
|
|
5
|
+
stepId: string;
|
|
6
|
+
done: boolean;
|
|
7
|
+
completedAt?: string;
|
|
8
|
+
note?: string;
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* What a caller may say about a maintenance it reports as done.
|
|
13
|
+
*
|
|
14
|
+
* The plan is named by `scheduleId` or by `scheduleOrigin` (the plan of that
|
|
15
|
+
* origin that still counts, see `findOpenSchedule`). Without a plan,
|
|
16
|
+
* `equipmentId` and `title` record a direct maintenance.
|
|
17
|
+
*/
|
|
18
|
+
export interface ExecutionRecordParams {
|
|
19
|
+
scheduleId?: unknown;
|
|
20
|
+
scheduleOrigin?: unknown;
|
|
21
|
+
/** Direct maintenance: the machine, when there is no plan. */
|
|
22
|
+
equipmentId?: unknown;
|
|
23
|
+
/** Direct maintenance: what was done. */
|
|
24
|
+
title?: unknown;
|
|
25
|
+
description?: unknown;
|
|
26
|
+
/**
|
|
27
|
+
* The due date this execution settles (ISO). Recording it turns the pairing
|
|
28
|
+
* of executions and appointments from a guess into a fact (GRENZEN §3 of
|
|
29
|
+
* the schedule plugin). Omit for an ad-hoc run.
|
|
30
|
+
*/
|
|
31
|
+
occurrence?: unknown;
|
|
32
|
+
/** When it was signed off. Default: now. */
|
|
33
|
+
completedAt?: unknown;
|
|
34
|
+
/**
|
|
35
|
+
* Per-step results. Default: every step of the plan done at `completedAt` —
|
|
36
|
+
* a protocol that reads as complete.
|
|
37
|
+
*/
|
|
38
|
+
stepResults?: unknown;
|
|
39
|
+
/** `false` opens the execution without signing it off. Default `true`. */
|
|
40
|
+
complete?: unknown;
|
|
41
|
+
}
|
|
42
|
+
export interface ExecutionRecordOptions {
|
|
43
|
+
auth: WriteAuth;
|
|
44
|
+
/** Recorded as `performedBy`. With a session the hook enforces the user. */
|
|
45
|
+
actor?: _User;
|
|
46
|
+
logPrefix: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ExecutionRecordResult {
|
|
49
|
+
executionId: string;
|
|
50
|
+
scheduleId?: string;
|
|
51
|
+
completedAt?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Record a maintenance as performed — the protocol the runner writes when a
|
|
55
|
+
* technician signs off.
|
|
56
|
+
*
|
|
57
|
+
* The hook freezes the plan's steps onto the execution, checks
|
|
58
|
+
* `execution_perform` and the plan's readability for a session, and keeps a
|
|
59
|
+
* signed-off protocol from changing afterwards. Nothing here bypasses that.
|
|
60
|
+
*/
|
|
61
|
+
export declare function recordExecution(tenant: Tenant, params: ExecutionRecordParams, { auth, actor, logPrefix }: ExecutionRecordOptions): Promise<ExecutionRecordResult>;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.recordExecution = recordExecution;
|
|
7
|
+
const node_1 = __importDefault(require("parse/node"));
|
|
8
|
+
const index_js_1 = require("../../../types/index.js");
|
|
9
|
+
const automationCall_js_1 = require("./automationCall.js");
|
|
10
|
+
const createSchedule_js_1 = require("./createSchedule.js");
|
|
11
|
+
const params_js_1 = require("./params.js");
|
|
12
|
+
/**
|
|
13
|
+
* Record a maintenance as performed — the protocol the runner writes when a
|
|
14
|
+
* technician signs off.
|
|
15
|
+
*
|
|
16
|
+
* The hook freezes the plan's steps onto the execution, checks
|
|
17
|
+
* `execution_perform` and the plan's readability for a session, and keeps a
|
|
18
|
+
* signed-off protocol from changing afterwards. Nothing here bypasses that.
|
|
19
|
+
*/
|
|
20
|
+
async function recordExecution(tenant, params, { auth, actor, logPrefix }) {
|
|
21
|
+
const schedule = await findSchedule(tenant, params, logPrefix);
|
|
22
|
+
const equipmentId = (0, params_js_1.paramId)(params.equipmentId);
|
|
23
|
+
if (!schedule && !equipmentId) {
|
|
24
|
+
throw new node_1.default.Error(node_1.default.Error.INVALID_QUERY, `${logPrefix} Name the plan ("scheduleId" / "scheduleOrigin") or, for a direct maintenance, the machine ("equipmentId").`);
|
|
25
|
+
}
|
|
26
|
+
const execution = new index_js_1.Service_Schedule_Execution();
|
|
27
|
+
execution.set("tenant", tenant);
|
|
28
|
+
if (schedule)
|
|
29
|
+
execution.set("schedule", schedule);
|
|
30
|
+
if (equipmentId) {
|
|
31
|
+
const equipment = await new node_1.default.Query(index_js_1.Service_Equipment)
|
|
32
|
+
.equalTo("objectId", equipmentId)
|
|
33
|
+
.equalTo("tenant", tenant)
|
|
34
|
+
.first({ useMasterKey: true });
|
|
35
|
+
if (!equipment) {
|
|
36
|
+
throw new node_1.default.Error(node_1.default.Error.OBJECT_NOT_FOUND, `${logPrefix} Machine ${equipmentId} does not exist for this tenant`);
|
|
37
|
+
}
|
|
38
|
+
execution.set("equipment", equipment);
|
|
39
|
+
}
|
|
40
|
+
else if (schedule?.get("equipment")) {
|
|
41
|
+
execution.set("equipment", schedule.get("equipment"));
|
|
42
|
+
}
|
|
43
|
+
const title = (0, params_js_1.paramString)(params.title);
|
|
44
|
+
if (title)
|
|
45
|
+
execution.set("title", title);
|
|
46
|
+
const description = (0, params_js_1.paramString)(params.description);
|
|
47
|
+
if (description)
|
|
48
|
+
execution.set("description", description);
|
|
49
|
+
const occurrence = (0, params_js_1.paramDate)(params.occurrence);
|
|
50
|
+
if (occurrence)
|
|
51
|
+
execution.set("occurrence", occurrence);
|
|
52
|
+
if (actor) {
|
|
53
|
+
execution.set("user", actor);
|
|
54
|
+
execution.set("performedBy", actor);
|
|
55
|
+
}
|
|
56
|
+
const complete = (0, params_js_1.paramBoolean)(params.complete) !== false;
|
|
57
|
+
// A signed-off protocol says who did the work — the compliance record and
|
|
58
|
+
// the duration statistics both read it. Without a person it would distort
|
|
59
|
+
// both (the reason the alarm actions record no executions at all), so a
|
|
60
|
+
// master-key caller has to name one.
|
|
61
|
+
if (complete && !actor) {
|
|
62
|
+
throw new node_1.default.Error(node_1.default.Error.INVALID_QUERY, `${logPrefix} A completed execution needs the person who performed it — pass "actingUserId" (master key) or call with their session.`);
|
|
63
|
+
}
|
|
64
|
+
const completedAt = complete
|
|
65
|
+
? ((0, params_js_1.paramDate)(params.completedAt) ?? new Date())
|
|
66
|
+
: undefined;
|
|
67
|
+
if (completedAt)
|
|
68
|
+
execution.set("completedAt", completedAt);
|
|
69
|
+
execution.set("stepResults", stepResultsOf(params.stepResults, schedule, completedAt));
|
|
70
|
+
await execution.save(null, (0, automationCall_js_1.writeOptions)(auth));
|
|
71
|
+
return {
|
|
72
|
+
executionId: execution.id,
|
|
73
|
+
scheduleId: schedule?.id,
|
|
74
|
+
completedAt: completedAt?.toISOString(),
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
async function findSchedule(tenant, params, logPrefix) {
|
|
78
|
+
const scheduleId = (0, params_js_1.paramId)(params.scheduleId);
|
|
79
|
+
const origin = (0, params_js_1.paramString)(params.scheduleOrigin);
|
|
80
|
+
if (!scheduleId && !origin)
|
|
81
|
+
return undefined;
|
|
82
|
+
const schedule = scheduleId
|
|
83
|
+
? await new node_1.default.Query(index_js_1.Service_Schedule)
|
|
84
|
+
.equalTo("objectId", scheduleId)
|
|
85
|
+
.equalTo("tenant", tenant)
|
|
86
|
+
.doesNotExist("deletedAt")
|
|
87
|
+
.first({ useMasterKey: true })
|
|
88
|
+
: await (0, createSchedule_js_1.findOpenSchedule)(tenant, origin);
|
|
89
|
+
if (!schedule) {
|
|
90
|
+
throw new node_1.default.Error(node_1.default.Error.OBJECT_NOT_FOUND, `${logPrefix} No plan ${scheduleId ?? `of origin "${origin}"`} in this tenant`);
|
|
91
|
+
}
|
|
92
|
+
return schedule;
|
|
93
|
+
}
|
|
94
|
+
/** The caller's results, or every step of the plan done. */
|
|
95
|
+
function stepResultsOf(value, schedule, completedAt) {
|
|
96
|
+
if (Array.isArray(value)) {
|
|
97
|
+
return value.filter((entry) => !!entry &&
|
|
98
|
+
typeof entry === "object" &&
|
|
99
|
+
typeof entry.stepId === "string");
|
|
100
|
+
}
|
|
101
|
+
if (!completedAt)
|
|
102
|
+
return [];
|
|
103
|
+
const steps = schedule?.get("steps") ?? [];
|
|
104
|
+
return steps
|
|
105
|
+
.filter((step) => typeof step?.id === "string")
|
|
106
|
+
.map((step) => ({
|
|
107
|
+
stepId: step.id,
|
|
108
|
+
done: true,
|
|
109
|
+
completedAt: completedAt.toISOString(),
|
|
110
|
+
}));
|
|
111
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Service_Equipment, Tenant } from "../../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* The machine a record created from outside concerns.
|
|
4
|
+
*
|
|
5
|
+
* 1. the id the caller names — the only reliable source, because **nothing in
|
|
6
|
+
* the data model links a sensor to a machine**;
|
|
7
|
+
* 2. otherwise a machine whose `sourceTags` contain one of `candidates` (an
|
|
8
|
+
* alarm passes its sensor id and source). That is a convention, not a
|
|
9
|
+
* relation, so it is a fallback: `sourceTags` was meant for source scoping,
|
|
10
|
+
* and a site-level tag can match several machines — the first one wins,
|
|
11
|
+
* which is a guess.
|
|
12
|
+
*
|
|
13
|
+
* Always within `tenant`: the master key reads every tenant, and a record must
|
|
14
|
+
* not end up pointing at another customer's machine.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveEquipment(tenant: Tenant, equipmentId: string | undefined, candidates: readonly (string | undefined)[], logPrefix: string): Promise<Service_Equipment | undefined>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.resolveEquipment = resolveEquipment;
|
|
7
|
+
const node_1 = __importDefault(require("parse/node"));
|
|
8
|
+
const index_js_1 = require("../../../types/index.js");
|
|
9
|
+
/**
|
|
10
|
+
* The machine a record created from outside concerns.
|
|
11
|
+
*
|
|
12
|
+
* 1. the id the caller names — the only reliable source, because **nothing in
|
|
13
|
+
* the data model links a sensor to a machine**;
|
|
14
|
+
* 2. otherwise a machine whose `sourceTags` contain one of `candidates` (an
|
|
15
|
+
* alarm passes its sensor id and source). That is a convention, not a
|
|
16
|
+
* relation, so it is a fallback: `sourceTags` was meant for source scoping,
|
|
17
|
+
* and a site-level tag can match several machines — the first one wins,
|
|
18
|
+
* which is a guess.
|
|
19
|
+
*
|
|
20
|
+
* Always within `tenant`: the master key reads every tenant, and a record must
|
|
21
|
+
* not end up pointing at another customer's machine.
|
|
22
|
+
*/
|
|
23
|
+
async function resolveEquipment(tenant, equipmentId, candidates, logPrefix) {
|
|
24
|
+
if (equipmentId) {
|
|
25
|
+
const explicit = await new node_1.default.Query(index_js_1.Service_Equipment)
|
|
26
|
+
.equalTo("objectId", equipmentId)
|
|
27
|
+
.equalTo("tenant", tenant)
|
|
28
|
+
.first({ useMasterKey: true });
|
|
29
|
+
if (explicit)
|
|
30
|
+
return explicit;
|
|
31
|
+
console.warn(`${logPrefix} Machine ${equipmentId} does not exist for this tenant`);
|
|
32
|
+
}
|
|
33
|
+
const tags = candidates.filter((value) => !!value);
|
|
34
|
+
if (tags.length === 0)
|
|
35
|
+
return undefined;
|
|
36
|
+
const query = new node_1.default.Query(index_js_1.Service_Equipment)
|
|
37
|
+
.equalTo("tenant", tenant)
|
|
38
|
+
.notEqualTo("deleted", true)
|
|
39
|
+
// `sourceTags` is an Array column: Mongo reads "contained in" as "the array
|
|
40
|
+
// holds one of these". The generated type only knows `any[]`, hence the cast.
|
|
41
|
+
.containedIn("sourceTags", tags);
|
|
42
|
+
return (await query.first({ useMasterKey: true })) ?? undefined;
|
|
43
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Service_Status, Tenant } from "../../../types/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Which status a ticket created or moved from outside gets.
|
|
4
|
+
*
|
|
5
|
+
* A caller rarely knows a tenant's status ids — they are master data, named
|
|
6
|
+
* however the tenant likes. The **category** is the contract (`inbox`,
|
|
7
|
+
* `active`, `pending`, `done`, `cancelled`), so a caller may name that
|
|
8
|
+
* instead and gets the tenant's first status of it.
|
|
9
|
+
*
|
|
10
|
+
* Always the tenant's own or a global one — never another tenant's.
|
|
11
|
+
*/
|
|
12
|
+
/** A status by id, if it is the tenant's or a global one and not archived. */
|
|
13
|
+
export declare function statusById(tenant: Tenant, statusId: string | undefined, logPrefix: string): Promise<Service_Status | undefined>;
|
|
14
|
+
/** Whether `value` names a status category. */
|
|
15
|
+
export declare function isStatusCategory(value: unknown): value is string;
|
|
16
|
+
/**
|
|
17
|
+
* The tenant's first status (by `order`) of a category, else a global one.
|
|
18
|
+
* Without a category: the inbox — where a new ticket lands.
|
|
19
|
+
*/
|
|
20
|
+
export declare function statusByCategory(tenant: Tenant, category?: string): Promise<Service_Status | undefined>;
|