@openinc/parse-server-opendash 4.34.0 → 4.35.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.
@@ -115,7 +115,6 @@
115
115
  "OD3_RAG_Request": "RAG",
116
116
  "OD3_Report": "CORE",
117
117
  "OD3_Service_Equipment": "SERVICE",
118
- "OD3_Service_EquipmentAnnotation": "SERVICE",
119
118
  "OD3_Service_FormConfig": "SERVICE",
120
119
  "OD3_Service_KpiDefinition": "SERVICE",
121
120
  "OD3_Service_MigrationMap": "SERVICE",
@@ -22,12 +22,15 @@ const index_js_1 = require("../../../types/index.js");
22
22
  */
23
23
  async function resolveEquipment(tenant, event, equipmentId, logPrefix) {
24
24
  if (equipmentId) {
25
+ // Master key reads every tenant: the alarm's tenant (from its secret) must
26
+ // own the machine, or a plan would point at another tenant's machine.
25
27
  const explicit = await new node_1.default.Query(index_js_1.Service_Equipment)
26
28
  .equalTo("objectId", equipmentId)
29
+ .equalTo("tenant", tenant)
27
30
  .first({ useMasterKey: true });
28
31
  if (explicit)
29
32
  return explicit;
30
- console.warn(`${logPrefix} Configured machine ${equipmentId} does not exist`);
33
+ console.warn(`${logPrefix} Configured machine ${equipmentId} does not exist for this tenant`);
31
34
  }
32
35
  const candidates = [event.item_id, event.item_source].filter((value) => !!value);
33
36
  if (candidates.length === 0)
@@ -41,6 +41,20 @@ export interface AlarmTicketParams {
41
41
  assignedUserIds?: string[];
42
42
  assignedRoleIds?: string[];
43
43
  tagIds?: string[];
44
+ /**
45
+ * Ticket form config (`OD3_Service_FormConfig`) the ticket is created
46
+ * through: its field defaults pre-fill the ticket, its rules run on save.
47
+ * Unset or not the tenant's: the tenant's default form.
48
+ */
49
+ formConfigId?: string;
50
+ /**
51
+ * The ticket as configured with the ticket form in template mode, under
52
+ * {@link formConfigId}: field values keyed by ticket field, references as
53
+ * ids (see `readTicketDefaults`). Wins over the flat fields above, which
54
+ * alarms configured with the generic form carry; both win over the form
55
+ * config's defaults.
56
+ */
57
+ ticket?: Record<string, unknown>;
44
58
  /**
45
59
  * Reopen behaviour. `false` (default) keeps **one open ticket per alarm**: a
46
60
  * flapping sensor does not produce a hundred tickets, and closing the ticket
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Values the ticket an alarm creates starts out with — the alarm's template
3
+ * (the ticket form in template mode) or what its form config pre-fills
4
+ * (`defaultValue` of its fields). Both in the form's edit shape: field values
5
+ * keyed by ticket field, references as ids.
6
+ *
7
+ * Read here into exactly the fields a default may set. Dates are left out (a
8
+ * fixed date makes no sense for an alarm that fires later; the config's
9
+ * relative value rules still apply on save), and so are the fields the server
10
+ * owns (tenant, number, origin, closedAt …). Title and description come back
11
+ * apart: the alarm's own title wins over them, and the alarm's details are
12
+ * appended to the description (`alarmTicketFields`). Whether a referenced row
13
+ * belongs to the tenant is the `Service_Ticket` hook's call, as on every write
14
+ * path.
15
+ */
16
+ export interface AlarmTicketDefaults {
17
+ title?: string;
18
+ description?: string;
19
+ status?: string;
20
+ equipment?: string;
21
+ project?: string;
22
+ /** The remaining fields, ready for `ticket.set`. */
23
+ values: Record<string, unknown>;
24
+ }
25
+ /**
26
+ * The defaults of a form config's `fields` (its JSON column). Hidden fields
27
+ * count: the create form keeps them as hidden inputs and saves their default.
28
+ *
29
+ * shortcut: `visibleWhen` is not evaluated — a default of a field hidden by
30
+ * condition is applied anyway; read it with the ticket's values if a config
31
+ * ever relies on that.
32
+ */
33
+ export declare function formConfigDefaults(fields: string | undefined): AlarmTicketDefaults;
34
+ export declare function readTicketDefaults(raw: unknown): AlarmTicketDefaults;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.formConfigDefaults = formConfigDefaults;
4
+ exports.readTicketDefaults = readTicketDefaults;
5
+ const actionParams_js_1 = require("../actionParams.js");
6
+ /** Arrays of ids — the schema stores them as plain id strings. */
7
+ const ID_LISTS = ["tags", "assignedUsers", "assignedRoles"];
8
+ const NUMBERS = [
9
+ "priority",
10
+ "downtime",
11
+ "frequency",
12
+ "restriction",
13
+ "estimatedDuration",
14
+ "actualDuration",
15
+ ];
16
+ /** Stored raw, as the ticket form stores them. */
17
+ const JSON_FIELDS = ["checklist", "material"];
18
+ const BOOLEANS = [
19
+ "excludeFromProductionDashboard",
20
+ "useForSimilarCases",
21
+ ];
22
+ /**
23
+ * The defaults of a form config's `fields` (its JSON column). Hidden fields
24
+ * count: the create form keeps them as hidden inputs and saves their default.
25
+ *
26
+ * shortcut: `visibleWhen` is not evaluated — a default of a field hidden by
27
+ * condition is applied anyway; read it with the ticket's values if a config
28
+ * ever relies on that.
29
+ */
30
+ function formConfigDefaults(fields) {
31
+ let entries;
32
+ try {
33
+ entries = JSON.parse(fields ?? "[]");
34
+ }
35
+ catch {
36
+ entries = [];
37
+ }
38
+ const raw = {};
39
+ for (const entry of Array.isArray(entries) ? entries : []) {
40
+ if (typeof entry?.key === "string" && entry.defaultValue != null) {
41
+ raw[entry.key] = entry.defaultValue;
42
+ }
43
+ }
44
+ return readTicketDefaults(raw);
45
+ }
46
+ function readTicketDefaults(raw) {
47
+ const source = raw && typeof raw === "object" && !Array.isArray(raw)
48
+ ? raw
49
+ : {};
50
+ const values = {};
51
+ for (const key of ID_LISTS) {
52
+ const list = Array.isArray(source[key]) ? source[key] : [];
53
+ const ids = list
54
+ .map(actionParams_js_1.paramId)
55
+ .filter((id) => id !== undefined);
56
+ if (ids.length > 0)
57
+ values[key] = ids;
58
+ }
59
+ for (const key of NUMBERS) {
60
+ const value = (0, actionParams_js_1.paramNumber)(source[key]);
61
+ if (value !== undefined)
62
+ values[key] = value;
63
+ }
64
+ for (const key of JSON_FIELDS) {
65
+ if (source[key] != null)
66
+ values[key] = source[key];
67
+ }
68
+ for (const key of BOOLEANS) {
69
+ if (typeof source[key] === "boolean")
70
+ values[key] = source[key];
71
+ }
72
+ return {
73
+ title: (0, actionParams_js_1.paramString)(source.title),
74
+ description: (0, actionParams_js_1.paramString)(source.description),
75
+ status: (0, actionParams_js_1.paramId)(source.status),
76
+ equipment: (0, actionParams_js_1.paramId)(source.equipment),
77
+ project: (0, actionParams_js_1.paramId)(source.project),
78
+ values,
79
+ };
80
+ }
@@ -8,11 +8,13 @@ exports.tenantForAlarmTicket = tenantForAlarmTicket;
8
8
  const node_1 = __importDefault(require("parse/node"));
9
9
  const openservice_shared_1 = require("@opendash/openservice-shared");
10
10
  const index_js_1 = require("../../../../types/index.js");
11
+ const ticketFormConfig_js_1 = require("../../tickets/ticketFormConfig.js");
11
12
  const actionParams_js_1 = require("../actionParams.js");
12
13
  const alarmIdentity_js_1 = require("../alarmIdentity.js");
13
14
  const resolveEquipment_js_1 = require("../resolveEquipment.js");
14
15
  const tenantForSecret_js_1 = require("../tenantForSecret.js");
15
16
  const alarmTicketFields_js_1 = require("./alarmTicketFields.js");
17
+ const alarmTicketDefaults_js_1 = require("./alarmTicketDefaults.js");
16
18
  const AlarmTicketTypes_js_1 = require("./AlarmTicketTypes.js");
17
19
  /**
18
20
  * Create the ticket a fired alarm asks for — or return the one that is already
@@ -31,13 +33,25 @@ async function createAlarmTicket(tenant, event, rawParams = {}) {
31
33
  if (!(0, alarmIdentity_js_1.alarmKey)(event)) {
32
34
  throw new node_1.default.Error(node_1.default.Error.INVALID_QUERY, "The alarm payload identifies no alarm: pass alarmId, or item_source/item_id.");
33
35
  }
34
- // Same normalisation as the schedule action: the reference fields can arrive
35
- // as whole objects from alarms configured before the form set a `valueField`
36
- // (see `actionParams.ts`).
36
+ // The ticket is created through a form config, as in the frontend. Per
37
+ // field the alarm's template wins (the ticket form in template mode), then
38
+ // the flat fields of the generic action form, then the config's defaults.
39
+ // Same normalisation as the schedule action for the flat ones: references
40
+ // can arrive as whole objects from alarms configured before the form set a
41
+ // `valueField` (see `actionParams.ts`).
42
+ const config = await alarmFormConfig(tenant, (0, actionParams_js_1.paramId)(rawParams.formConfigId));
43
+ const template = (0, alarmTicketDefaults_js_1.readTicketDefaults)(rawParams.ticket);
44
+ const defaults = (0, alarmTicketDefaults_js_1.formConfigDefaults)(config?.fields);
37
45
  const params = {
38
46
  ...rawParams,
39
- equipmentId: (0, actionParams_js_1.paramId)(rawParams.equipmentId),
40
- projectId: (0, actionParams_js_1.paramId)(rawParams.projectId),
47
+ title: template.title ?? (0, actionParams_js_1.paramString)(rawParams.title) ?? defaults.title,
48
+ description: template.description ??
49
+ (0, actionParams_js_1.paramString)(rawParams.description) ??
50
+ defaults.description,
51
+ equipmentId: template.equipment ??
52
+ (0, actionParams_js_1.paramId)(rawParams.equipmentId) ??
53
+ defaults.equipment,
54
+ projectId: template.project ?? (0, actionParams_js_1.paramId)(rawParams.projectId) ?? defaults.project,
41
55
  };
42
56
  const fields = (0, alarmTicketFields_js_1.alarmTicketFields)(event, params);
43
57
  if (!params.duplicate) {
@@ -51,7 +65,8 @@ async function createAlarmTicket(tenant, event, rawParams = {}) {
51
65
  };
52
66
  }
53
67
  }
54
- const status = await resolveDefaultStatus(tenant);
68
+ const status = (await presetStatus(tenant, template.status ?? defaults.status)) ??
69
+ (await resolveDefaultStatus(tenant));
55
70
  if (!status) {
56
71
  throw new node_1.default.Error(node_1.default.Error.INVALID_QUERY, `No "${openservice_shared_1.DEFAULT_STATUS_CATEGORY}" status configured for this tenant — cannot create a ticket.`);
57
72
  }
@@ -68,6 +83,11 @@ async function createAlarmTicket(tenant, event, rawParams = {}) {
68
83
  ticket.set("startDate", (0, alarmIdentity_js_1.firedAt)(event));
69
84
  if (equipment)
70
85
  ticket.set("equipment", equipment);
86
+ // The config's remaining defaults first: the flat fields below and the
87
+ // template after them override them.
88
+ for (const [key, value] of Object.entries(defaults.values)) {
89
+ ticket.set(key, value);
90
+ }
71
91
  if (params.priority != null)
72
92
  ticket.set("priority", params.priority);
73
93
  if (params.projectId) {
@@ -85,7 +105,16 @@ async function createAlarmTicket(tenant, event, rawParams = {}) {
85
105
  }
86
106
  if (params.tagIds?.length)
87
107
  ticket.set("tags", params.tagIds);
88
- await ticket.save(null, { useMasterKey: true });
108
+ for (const [key, value] of Object.entries(template.values)) {
109
+ ticket.set(key, value);
110
+ }
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
+ useMasterKey: true,
116
+ context: { formConfig: config?.id },
117
+ });
89
118
  return {
90
119
  ticketId: ticket.id,
91
120
  created: true,
@@ -114,6 +143,36 @@ async function findOpenTicket(tenant, origin) {
114
143
  return !(0, openservice_shared_1.isDoneCategory)(category);
115
144
  });
116
145
  }
146
+ /**
147
+ * The form config the alarm names, if it is the tenant's — else the tenant's
148
+ * default form, the one a save without a user gets (`applicableFormConfig`).
149
+ */
150
+ async function alarmFormConfig(tenant, id) {
151
+ const chosen = await (0, ticketFormConfig_js_1.configFromContext)(id, tenant, {
152
+ master: true,
153
+ sessionToken: undefined,
154
+ });
155
+ if (id && !chosen) {
156
+ console.warn(`[${AlarmTicketTypes_js_1.ALARM_TICKET_ACTION_ID}] Form config ${id} is not this tenant's — using the tenant's default form`);
157
+ }
158
+ return chosen ?? (await (0, ticketFormConfig_js_1.applicableFormConfig)(tenant, undefined));
159
+ }
160
+ /**
161
+ * The status the template or the form config names, if it is the tenant's or
162
+ * a global one.
163
+ */
164
+ async function presetStatus(tenant, statusId) {
165
+ if (!statusId)
166
+ return undefined;
167
+ const status = await node_1.default.Query.or(new node_1.default.Query(index_js_1.Service_Status).equalTo("tenant", tenant), new node_1.default.Query(index_js_1.Service_Status).doesNotExist("tenant"))
168
+ .equalTo("objectId", statusId)
169
+ .equalTo("deleted", false)
170
+ .first({ useMasterKey: true });
171
+ if (!status) {
172
+ console.warn(`[${AlarmTicketTypes_js_1.ALARM_TICKET_ACTION_ID}] Preset status ${statusId} is not available — using the inbox`);
173
+ }
174
+ return status;
175
+ }
117
176
  /** The tenant's inbox status, else a global one — never another tenant's. */
118
177
  async function resolveDefaultStatus(tenant) {
119
178
  // Only this tenant's and the global ones: across all tenants a plain `find`
@@ -85,22 +85,40 @@ async function ensureAlarmTicketAction() {
85
85
  * `AlarmTicketParams` — the executor hands the form's values back to us as
86
86
  * `params`.
87
87
  *
88
+ * The ticket's content comes from a **ticket form** of the administration
89
+ * (its field defaults and rules), so the alarm only adds what is its own:
90
+ * title, note, machine.
91
+ *
88
92
  * The machine is a plain picker rather than something derived from the sensor,
89
93
  * because nothing in the data model links the two. Whoever sets the alarm up
90
94
  * knows which machine it watches; guessing it later is worse than asking now.
91
95
  */
92
96
  const FORM_FIELDS = [
97
+ {
98
+ key: "formConfigId",
99
+ label: "Ticketformular",
100
+ type: "select.parse",
101
+ settings: {
102
+ className: index_js_1.Service_FormConfig.className,
103
+ displayField: "label",
104
+ mode: "single",
105
+ // Without this the picker stores the whole selected object instead of
106
+ // its id — see actionParams.ts.
107
+ valueField: "objectId",
108
+ },
109
+ hint: "Das Ticket entsteht wie über dieses Formular: mit seinen Standardwerten und Regeln. Leer = Standardformular.",
110
+ },
93
111
  {
94
112
  key: "title",
95
113
  label: "Titel des Tickets",
96
114
  type: "input",
97
- hint: "Platzhalter: {{alarm}}, {{sensor}}, {{value}}. Leer = Name des Alarms.",
115
+ hint: "Platzhalter: {{alarm}}, {{sensor}}, {{value}}. Leer = Titel aus dem Formular, sonst Name des Alarms.",
98
116
  },
99
117
  {
100
118
  key: "description",
101
119
  label: "Notiz",
102
120
  type: "textarea",
103
- hint: "Wird dem Ticket vorangestellt; Sensor, Wert, Regel und Zeitpunkt kommen automatisch dazu.",
121
+ hint: "Leer = Beschreibung aus dem Formular. Sensor, Wert, Regel und Zeitpunkt kommen automatisch dazu.",
104
122
  },
105
123
  {
106
124
  key: "equipmentId",
@@ -114,25 +132,7 @@ const FORM_FIELDS = [
114
132
  // its id — see actionParams.ts.
115
133
  valueField: "objectId",
116
134
  },
117
- hint: "Ohne Angabe wird über die Quellen-Tags der Maschine geraten — oder das Ticket bleibt ohne Maschine.",
118
- },
119
- {
120
- key: "projectId",
121
- label: "Projekt",
122
- type: "select.parse",
123
- settings: {
124
- className: "OD3_Service_Project",
125
- displayField: "label",
126
- mode: "single",
127
- // Without this the picker stores the whole selected object instead of
128
- // its id — see actionParams.ts.
129
- valueField: "objectId",
130
- },
131
- },
132
- {
133
- key: "priority",
134
- label: "Priorität",
135
- type: "input.number",
135
+ hint: "Ohne Angabe die Maschine aus dem Formular, sonst wird über die Quellen-Tags der Maschine geraten.",
136
136
  },
137
137
  {
138
138
  key: "duplicate",
@@ -5,6 +5,7 @@ export interface Service_TagAttributes {
5
5
  objectId: string;
6
6
  createdAt: Date;
7
7
  updatedAt: Date;
8
+ category?: string | undefined;
8
9
  color?: string | undefined;
9
10
  deleted: boolean;
10
11
  label?: string | undefined;
@@ -15,6 +16,8 @@ export interface Service_TagAttributes {
15
16
  export declare class Service_Tag extends Parse.Object<Service_TagAttributes> {
16
17
  static className: string;
17
18
  constructor(data?: Partial<Service_TagAttributes>);
19
+ get category(): string | undefined;
20
+ set category(value: string | undefined);
18
21
  get color(): string | undefined;
19
22
  set color(value: string | undefined);
20
23
  get deleted(): boolean;
@@ -10,6 +10,12 @@ class Service_Tag extends node_1.default.Object {
10
10
  constructor(data) {
11
11
  super("OD3_Service_Tag", data);
12
12
  }
13
+ get category() {
14
+ return super.get("category");
15
+ }
16
+ set category(value) {
17
+ super.set("category", value);
18
+ }
13
19
  get color() {
14
20
  return super.get("color");
15
21
  }
@@ -226,8 +226,6 @@ export { Report } from "./Report";
226
226
  export type { ReportAttributes } from "./Report";
227
227
  export { Service_Equipment } from "./Service_Equipment";
228
228
  export type { Service_EquipmentAttributes } from "./Service_Equipment";
229
- export { Service_EquipmentAnnotation } from "./Service_EquipmentAnnotation";
230
- export type { Service_EquipmentAnnotationAttributes } from "./Service_EquipmentAnnotation";
231
229
  export { Service_FormConfig } from "./Service_FormConfig";
232
230
  export type { Service_FormConfigAttributes } from "./Service_FormConfig";
233
231
  export { Service_KpiDefinition } from "./Service_KpiDefinition";
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Language = exports.Knowledge_Video = exports.Knowledge_DocumentPage = exports.Knowledge_Document = exports.Knowledge_ChatMessage = exports.Knowledge_Chat = exports.Knowledge_Category = exports.Knowledge_Article = exports.GTFS_Wheelchair_Boarding = exports.GTFS_Wheelchair_Accessible = exports.GTFS_Trip = exports.GTFS_Stop_Times = exports.GTFS_Stop = exports.GTFS_Route_Type = exports.GTFS_Route = exports.GTFS_Location_Type = exports.GTFS_Level = exports.GTFS_Direction = exports.GTFS_Calendar = exports.GTFS_Bikes_Allowed = exports.GTFS_Agency = exports.EMS_ChargePoint = exports.Documentation_Document = exports.Documentation_Config = exports.Documentation_Category = exports.Dashboard = exports.Core_Token = exports.Core_RequestTemplate = exports.Core_Email = exports.Contact = exports.Config = exports.Company = exports.Chat_Message = exports.Changelog = exports.BDE_WorkTime = exports.BDE_WorkOrder = exports.BDE_Unit = exports.BDE_ShiftModel = exports.BDE_ShiftException = exports.BDE_Result = exports.BDE_Page = exports.BDE_ListEntry = exports.BDE_List = exports.BDE_Form = exports.BDE_Article = exports.Attachment = exports.Assets = exports.AlarmWebhook = exports.AlarmAction = exports.Alarm = void 0;
4
4
  exports.NavigationItem = exports.NavigationGroup = exports.Monitoring_Slideshow = exports.Monitoring_ReportImage = exports.Monitoring_ParseTableSensor = exports.Monitoring_Jobs = exports.Monitoring_DataHierachies = exports.Meta_Entry = exports.Meta_Context = exports.Meta_Config = exports.Maintenance_Ticket_Title = exports.Maintenance_Ticket_Source = exports.Maintenance_Ticket_QR_Code = exports.Maintenance_Ticket_Project = exports.Maintenance_Ticket_Material = exports.Maintenance_Ticket_Kanban_State_Current = exports.Maintenance_Ticket_Kanban_State = exports.Maintenance_Ticket_Issuecategory = exports.Maintenance_Ticket_FormConfig = exports.Maintenance_Ticket_Data = exports.Maintenance_Ticket_Assignment = exports.Maintenance_Ticket = exports.Maintenance_Source_File = exports.Maintenance_SourceMeta = exports.Maintenance_Schedule_Template = exports.Maintenance_Schedule_Step = exports.Maintenance_Schedule_Execution_Step = exports.Maintenance_Schedule_Execution = exports.Maintenance_Schedule = exports.Maintenance_Restriction = exports.Maintenance_Project = exports.Maintenance_Priority = exports.Maintenance_Order = exports.Maintenance_Message = exports.Maintenance_Media = exports.Maintenance_Kanban_State = exports.Maintenance_Item = exports.Maintenance_Issuecategory = exports.Maintenance_Frequency = exports.Maintenance_Duedate = exports.Maintenance_Downtime = exports.Mail_Groups = exports.MailTemplate = exports.ML_DataSelection = exports.MIAAS_MDSEndpoint = exports.MES_RessourceOverview = exports.MES_OrderPlan = exports.MES_Order = exports.MES_Article = exports.Log = void 0;
5
- exports.WidgetPreset = exports.Widget = exports.WebPush = exports.VirtualKPI = exports.User_Setting = exports.UserData = exports.TenantTrustedDomain = exports.TenantMeta = exports.Tenant = exports.Spreadsheet_Workbook = exports.SourceMeta = exports.Source = exports.Share = exports.Service_TicketCounter = exports.Service_Ticket = exports.Service_Tag = exports.Service_Status = exports.Service_Schedule_Template = exports.Service_Schedule_Execution = exports.Service_Schedule = exports.Service_Project = exports.Service_Occurrence = exports.Service_MigrationMap = exports.Service_KpiDefinition = exports.Service_FormConfig = exports.Service_EquipmentAnnotation = exports.Service_Equipment = exports.Report = exports.RAG_Request = exports.RAG_Questions = exports.RAG_Prompts = exports.RAG_Meta = exports.RAG_Interview = exports.RAG_Data = exports.Push = exports.Permission = exports.OWPlcItem = exports.OWPlcDevice = exports.Notification_Setting = exports.Notification = void 0;
5
+ exports.WidgetPreset = exports.Widget = exports.WebPush = exports.VirtualKPI = exports.User_Setting = exports.UserData = exports.TenantTrustedDomain = exports.TenantMeta = exports.Tenant = exports.Spreadsheet_Workbook = exports.SourceMeta = exports.Source = exports.Share = exports.Service_TicketCounter = exports.Service_Ticket = exports.Service_Tag = exports.Service_Status = exports.Service_Schedule_Template = exports.Service_Schedule_Execution = exports.Service_Schedule = exports.Service_Project = exports.Service_Occurrence = exports.Service_MigrationMap = exports.Service_KpiDefinition = exports.Service_FormConfig = exports.Service_Equipment = exports.Report = exports.RAG_Request = exports.RAG_Questions = exports.RAG_Prompts = exports.RAG_Meta = exports.RAG_Interview = exports.RAG_Data = exports.Push = exports.Permission = exports.OWPlcItem = exports.OWPlcDevice = exports.Notification_Setting = exports.Notification = void 0;
6
6
  var Alarm_1 = require("./Alarm");
7
7
  Object.defineProperty(exports, "Alarm", { enumerable: true, get: function () { return Alarm_1.Alarm; } });
8
8
  var AlarmAction_1 = require("./AlarmAction");
@@ -231,8 +231,6 @@ var Report_1 = require("./Report");
231
231
  Object.defineProperty(exports, "Report", { enumerable: true, get: function () { return Report_1.Report; } });
232
232
  var Service_Equipment_1 = require("./Service_Equipment");
233
233
  Object.defineProperty(exports, "Service_Equipment", { enumerable: true, get: function () { return Service_Equipment_1.Service_Equipment; } });
234
- var Service_EquipmentAnnotation_1 = require("./Service_EquipmentAnnotation");
235
- Object.defineProperty(exports, "Service_EquipmentAnnotation", { enumerable: true, get: function () { return Service_EquipmentAnnotation_1.Service_EquipmentAnnotation; } });
236
234
  var Service_FormConfig_1 = require("./Service_FormConfig");
237
235
  Object.defineProperty(exports, "Service_FormConfig", { enumerable: true, get: function () { return Service_FormConfig_1.Service_FormConfig; } });
238
236
  var Service_KpiDefinition_1 = require("./Service_KpiDefinition");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openinc/parse-server-opendash",
3
- "version": "4.34.0",
3
+ "version": "4.35.0",
4
4
  "description": "Parse Server Cloud Code for open.INC Stack.",
5
5
  "packageManager": "pnpm@12.16.1",
6
6
  "keywords": [
@@ -1,5 +1,8 @@
1
1
  {
2
2
  "fields": {
3
+ "category": {
4
+ "type": "String"
5
+ },
3
6
  "color": {
4
7
  "type": "String"
5
8
  },
@@ -1 +0,0 @@
1
- export declare function init(): Promise<void>;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.init = init;
4
- const index_js_1 = require("../features/schema/index.js");
5
- const index_js_2 = require("../types/index.js");
6
- async function init() {
7
- // A note on a machine at a point in time — a conversion, a new control
8
- // program — so the reporting can compare its KPIs before and after. Anyone
9
- // of the tenant may write one, like a ticket; required fields come from the
10
- // schema.
11
- (0, index_js_1.beforeSaveHook)(index_js_2.Service_EquipmentAnnotation, async (request) => {
12
- await (0, index_js_1.defaultHandler)(request);
13
- await (0, index_js_1.defaultAclHandler)(request);
14
- });
15
- }
@@ -1,35 +0,0 @@
1
- import Parse from "parse/node";
2
- import type { Service_Equipment } from "./Service_Equipment";
3
- import type { Tenant } from "./Tenant";
4
- import type { _User } from "./_User";
5
- export interface Service_EquipmentAnnotationAttributes {
6
- id: string;
7
- objectId: string;
8
- createdAt: Date;
9
- updatedAt: Date;
10
- category?: string | undefined;
11
- date: Date;
12
- description?: string | undefined;
13
- equipment: Service_Equipment;
14
- tenant?: Tenant | undefined;
15
- title: string;
16
- user?: _User | undefined;
17
- }
18
- export declare class Service_EquipmentAnnotation extends Parse.Object<Service_EquipmentAnnotationAttributes> {
19
- static className: string;
20
- constructor(data?: Partial<Service_EquipmentAnnotationAttributes>);
21
- get category(): string | undefined;
22
- set category(value: string | undefined);
23
- get date(): Date;
24
- set date(value: Date);
25
- get description(): string | undefined;
26
- set description(value: string | undefined);
27
- get equipment(): Service_Equipment;
28
- set equipment(value: Service_Equipment);
29
- get tenant(): Tenant | undefined;
30
- set tenant(value: Tenant | undefined);
31
- get title(): string;
32
- set title(value: string);
33
- get user(): _User | undefined;
34
- set user(value: _User | undefined);
35
- }
@@ -1,57 +0,0 @@
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.Service_EquipmentAnnotation = void 0;
7
- const node_1 = __importDefault(require("parse/node"));
8
- class Service_EquipmentAnnotation extends node_1.default.Object {
9
- static className = "OD3_Service_EquipmentAnnotation";
10
- constructor(data) {
11
- super("OD3_Service_EquipmentAnnotation", data);
12
- }
13
- get category() {
14
- return super.get("category");
15
- }
16
- set category(value) {
17
- super.set("category", value);
18
- }
19
- get date() {
20
- return super.get("date");
21
- }
22
- set date(value) {
23
- super.set("date", value);
24
- }
25
- get description() {
26
- return super.get("description");
27
- }
28
- set description(value) {
29
- super.set("description", value);
30
- }
31
- get equipment() {
32
- return super.get("equipment");
33
- }
34
- set equipment(value) {
35
- super.set("equipment", value);
36
- }
37
- get tenant() {
38
- return super.get("tenant");
39
- }
40
- set tenant(value) {
41
- super.set("tenant", value);
42
- }
43
- get title() {
44
- return super.get("title");
45
- }
46
- set title(value) {
47
- super.set("title", value);
48
- }
49
- get user() {
50
- return super.get("user");
51
- }
52
- set user(value) {
53
- super.set("user", value);
54
- }
55
- }
56
- exports.Service_EquipmentAnnotation = Service_EquipmentAnnotation;
57
- node_1.default.Object.registerSubclass("OD3_Service_EquipmentAnnotation", Service_EquipmentAnnotation);
@@ -1,57 +0,0 @@
1
- {
2
- "fields": {
3
- "equipment": {
4
- "type": "Pointer",
5
- "targetClass": "{{PREFIX}}Service_Equipment",
6
- "required": true
7
- },
8
- "date": {
9
- "type": "Date",
10
- "required": true
11
- },
12
- "category": {
13
- "type": "String"
14
- },
15
- "title": {
16
- "type": "String",
17
- "required": true
18
- },
19
- "description": {
20
- "type": "String"
21
- },
22
- "tenant": {
23
- "type": "Pointer",
24
- "targetClass": "{{PREFIX}}Tenant"
25
- },
26
- "user": {
27
- "type": "Pointer",
28
- "targetClass": "_User"
29
- }
30
- },
31
- "classLevelPermissions": {
32
- "find": {
33
- "*": true
34
- },
35
- "count": {
36
- "*": true
37
- },
38
- "get": {
39
- "*": true
40
- },
41
- "create": {
42
- "*": true
43
- },
44
- "update": {
45
- "*": true
46
- },
47
- "delete": {
48
- "*": true
49
- },
50
- "addField": {
51
- "*": true
52
- },
53
- "protectedFields": {
54
- "*": []
55
- }
56
- }
57
- }