@openinc/parse-server-opendash 4.34.0 → 4.36.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.
Files changed (39) hide show
  1. package/dist/featuremap.json +0 -1
  2. package/dist/features/openservice/alarms/ensureAlarmActionRow.d.ts +32 -0
  3. package/dist/features/openservice/alarms/ensureAlarmActionRow.js +67 -0
  4. package/dist/features/openservice/alarms/ensureOpenwareWebhook.d.ts +22 -0
  5. package/dist/features/openservice/alarms/ensureOpenwareWebhook.js +81 -0
  6. package/dist/features/openservice/alarms/index.d.ts +9 -1
  7. package/dist/features/openservice/alarms/index.js +17 -2
  8. package/dist/features/openservice/alarms/openwareAlarm.d.ts +76 -0
  9. package/dist/features/openservice/alarms/openwareAlarm.js +96 -0
  10. package/dist/features/openservice/alarms/readAlarmCall.d.ts +26 -0
  11. package/dist/features/openservice/alarms/readAlarmCall.js +67 -0
  12. package/dist/features/openservice/alarms/resolveAlarmUser.d.ts +16 -0
  13. package/dist/features/openservice/alarms/resolveAlarmUser.js +35 -0
  14. package/dist/features/openservice/alarms/resolveEquipment.js +4 -1
  15. package/dist/features/openservice/alarms/schedule/createAlarmSchedule.js +2 -8
  16. package/dist/features/openservice/alarms/schedule/ensureAlarmScheduleAction.d.ts +3 -36
  17. package/dist/features/openservice/alarms/schedule/ensureAlarmScheduleAction.js +12 -140
  18. package/dist/features/openservice/alarms/ticket/AlarmTicketTypes.d.ts +14 -0
  19. package/dist/features/openservice/alarms/ticket/alarmTicketDefaults.d.ts +34 -0
  20. package/dist/features/openservice/alarms/ticket/alarmTicketDefaults.js +80 -0
  21. package/dist/features/openservice/alarms/ticket/createAlarmTicket.js +72 -7
  22. package/dist/features/openservice/alarms/ticket/ensureAlarmTicketAction.d.ts +3 -19
  23. package/dist/features/openservice/alarms/ticket/ensureAlarmTicketAction.js +33 -91
  24. package/dist/features/openservice/init.js +11 -3
  25. package/dist/functions/openinc-openservice-alarm-create-schedule.d.ts +7 -9
  26. package/dist/functions/openinc-openservice-alarm-create-schedule.js +11 -31
  27. package/dist/functions/openinc-openservice-alarm-create-ticket.d.ts +7 -9
  28. package/dist/functions/openinc-openservice-alarm-create-ticket.js +11 -31
  29. package/dist/types/Service_Tag.d.ts +3 -0
  30. package/dist/types/Service_Tag.js +6 -0
  31. package/dist/types/index.d.ts +0 -2
  32. package/dist/types/index.js +1 -3
  33. package/package.json +1 -1
  34. package/schema/Service_Tag.json +3 -0
  35. package/dist/hooks/Service_EquipmentAnnotation.d.ts +0 -1
  36. package/dist/hooks/Service_EquipmentAnnotation.js +0 -15
  37. package/dist/types/Service_EquipmentAnnotation.d.ts +0 -35
  38. package/dist/types/Service_EquipmentAnnotation.js +0 -57
  39. package/schema/Service_EquipmentAnnotation.json +0 -57
@@ -43,9 +43,17 @@ async function init(generations) {
43
43
  if (generations.v2) {
44
44
  await (0, initServiceSchedulesFeature_js_1.initServiceSchedulesFeature)();
45
45
  await (0, initKpiFeature_js_1.initKpiFeature)();
46
- await (0, index_js_2.ensureAlarmTicketAction)();
47
- await (0, index_js_2.ensureAlarmScheduleAction)();
48
- await (0, index_js_2.ensureAlarmScheduleWebhook)();
46
+ // The alarm classes exist only with MONITORING (featuremap). A failure
47
+ // here must not stop the rest of open.SERVICE from coming up.
48
+ if ((0, index_js_1.isFeatureEnabled)("MONITORING")) {
49
+ try {
50
+ await (0, index_js_2.ensureAlarmTicketAction)();
51
+ await (0, index_js_2.ensureAlarmScheduleAction)();
52
+ }
53
+ catch (error) {
54
+ console.error("[open.SERVICE] Alarm actions not set up:", error);
55
+ }
56
+ }
49
57
  }
50
58
  // Last, so the rows it reports as missing are the ones a human still has to
51
59
  // supply rather than ones a later bootstrap would have created anyway. The
@@ -6,18 +6,16 @@
6
6
  * alarm's data and the settings somebody filled into the action's form — above
7
7
  * all the maintenance template to use.
8
8
  *
9
- * **Authentication** — one of:
9
+ * **Authentication and payload** — see `readAlarmCall`:
10
10
  *
11
- * - the **master key** (server-to-server inside the stack), then `tenantId`
12
- * must be given;
13
- * - a **shared secret** matching an `OPENSERVICE_ALARM_SCHEDULE_SECRET` config
14
- * row, which also establishes the tenant. An external executor is not trusted
15
- * to name a tenant, so the secret does it.
11
+ * - **open.WARE** posts `{ alarm }` through the action's `OD3_AlarmWebhook`
12
+ * row (`ensureOpenwareWebhook`) with the webhook token; the tenant is the
13
+ * alarm owner's.
14
+ * - Called directly: `{ event, params?, secret?, tenantId? }` with the master
15
+ * key and a `tenantId`, or a tenant's shared secret.
16
16
  *
17
- * A logged-in user is deliberately *not* enough: this is a machine endpoint,
18
- * and a browser session should not be able to fabricate maintenance plans.
17
+ * A logged-in user is deliberately *not* enough: this is a machine endpoint.
19
18
  *
20
- * Params: `{ event, params?, secret?, tenantId? }`.
21
19
  * Returns `{ scheduleId, created, origin, due, equipmentId?, templateId? }` —
22
20
  * `created: false` means an unperformed appointment for this alarm already
23
21
  * existed (see `createAlarmSchedule`).
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.init = init;
7
7
  const node_1 = __importDefault(require("parse/node"));
8
8
  const index_js_1 = require("../features/openservice/alarms/index.js");
9
- const index_js_2 = require("../types/index.js");
10
9
  /**
11
10
  * Schedule a one-off maintenance appointment for a fired alarm.
12
11
  *
@@ -15,49 +14,30 @@ const index_js_2 = require("../types/index.js");
15
14
  * alarm's data and the settings somebody filled into the action's form — above
16
15
  * all the maintenance template to use.
17
16
  *
18
- * **Authentication** — one of:
17
+ * **Authentication and payload** — see `readAlarmCall`:
19
18
  *
20
- * - the **master key** (server-to-server inside the stack), then `tenantId`
21
- * must be given;
22
- * - a **shared secret** matching an `OPENSERVICE_ALARM_SCHEDULE_SECRET` config
23
- * row, which also establishes the tenant. An external executor is not trusted
24
- * to name a tenant, so the secret does it.
19
+ * - **open.WARE** posts `{ alarm }` through the action's `OD3_AlarmWebhook`
20
+ * row (`ensureOpenwareWebhook`) with the webhook token; the tenant is the
21
+ * alarm owner's.
22
+ * - Called directly: `{ event, params?, secret?, tenantId? }` with the master
23
+ * key and a `tenantId`, or a tenant's shared secret.
25
24
  *
26
- * A logged-in user is deliberately *not* enough: this is a machine endpoint,
27
- * and a browser session should not be able to fabricate maintenance plans.
25
+ * A logged-in user is deliberately *not* enough: this is a machine endpoint.
28
26
  *
29
- * Params: `{ event, params?, secret?, tenantId? }`.
30
27
  * Returns `{ scheduleId, created, origin, due, equipmentId?, templateId? }` —
31
28
  * `created: false` means an unperformed appointment for this alarm already
32
29
  * existed (see `createAlarmSchedule`).
33
30
  */
34
31
  async function init(name) {
35
32
  node_1.default.Cloud.define(name, async (request) => {
36
- const { event, params, secret, tenantId } = request.params;
37
- if (!event || typeof event !== "object") {
38
- throw new node_1.default.Error(node_1.default.Error.INVALID_QUERY, `${name} needs an "event" object describing the alarm`);
39
- }
40
- const tenant = request.master
41
- ? await tenantById(tenantId)
42
- : await (0, index_js_1.tenantForAlarmSchedule)(typeof secret === "string" ? secret : "");
43
- if (!tenant) {
44
- // Same answer for "wrong secret" and "no such tenant": a caller
45
- // guessing secrets learns nothing from the difference.
46
- throw new node_1.default.Error(node_1.default.Error.OPERATION_FORBIDDEN, `${name}: unknown tenant or invalid secret`);
47
- }
48
- const result = await (0, index_js_1.createAlarmSchedule)(tenant, event, params ?? {});
33
+ const { tenant, event, params } = await (0, index_js_1.readAlarmCall)(name, request, index_js_1.tenantForAlarmSchedule);
34
+ const result = await (0, index_js_1.createAlarmSchedule)(tenant, event, params);
49
35
  console.log(`[${name}] ${result.created ? "created" : "reused"} schedule ` +
50
36
  `${result.scheduleId} for ${result.origin}, due ${result.due}` +
51
37
  (result.equipmentId ? ` (machine ${result.equipmentId})` : ""));
52
38
  return result;
53
39
  },
54
- // No `requireUser`: the callers are machines, authenticated above.
40
+ // No `requireUser`: the callers are machines, authenticated in
41
+ // `readAlarmCall`.
55
42
  {});
56
43
  }
57
- async function tenantById(tenantId) {
58
- if (!tenantId)
59
- return undefined;
60
- return ((await new node_1.default.Query(index_js_2.Tenant)
61
- .equalTo("objectId", tenantId)
62
- .first({ useMasterKey: true })) ?? undefined);
63
- }
@@ -6,18 +6,16 @@
6
6
  * this with the alarm's data and the settings someone filled into the action's
7
7
  * form.
8
8
  *
9
- * **Authentication** — one of:
9
+ * **Authentication and payload** — see `readAlarmCall`:
10
10
  *
11
- * - the **master key** (server-to-server inside the stack), then `tenantId`
12
- * must be given;
13
- * - a **shared secret** matching an `OPENSERVICE_ALARM_TICKET_SECRET` config
14
- * row, which also establishes the tenant. An external executor is not
15
- * trusted to name a tenant, so the secret does it.
11
+ * - **open.WARE** posts `{ alarm }` through the action's `OD3_AlarmWebhook`
12
+ * row (`ensureOpenwareWebhook`) with the webhook token; the tenant is the
13
+ * alarm owner's.
14
+ * - Called directly: `{ event, params?, secret?, tenantId? }` with the master
15
+ * key and a `tenantId`, or a tenant's shared secret.
16
16
  *
17
- * A logged-in user is deliberately *not* enough: this is a machine endpoint,
18
- * and a browser session should not be able to fabricate alarm tickets.
17
+ * A logged-in user is deliberately *not* enough: this is a machine endpoint.
19
18
  *
20
- * Params: `{ event, params?, secret?, tenantId? }`.
21
19
  * Returns `{ ticketId, created, origin, equipmentId? }` — `created: false`
22
20
  * means an open ticket for this alarm already existed (see
23
21
  * `createAlarmTicket`).
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.init = init;
7
7
  const node_1 = __importDefault(require("parse/node"));
8
8
  const index_js_1 = require("../features/openservice/alarms/index.js");
9
- const index_js_2 = require("../types/index.js");
10
9
  /**
11
10
  * Raise an open.SERVICE ticket for a fired alarm.
12
11
  *
@@ -15,49 +14,30 @@ const index_js_2 = require("../types/index.js");
15
14
  * this with the alarm's data and the settings someone filled into the action's
16
15
  * form.
17
16
  *
18
- * **Authentication** — one of:
17
+ * **Authentication and payload** — see `readAlarmCall`:
19
18
  *
20
- * - the **master key** (server-to-server inside the stack), then `tenantId`
21
- * must be given;
22
- * - a **shared secret** matching an `OPENSERVICE_ALARM_TICKET_SECRET` config
23
- * row, which also establishes the tenant. An external executor is not
24
- * trusted to name a tenant, so the secret does it.
19
+ * - **open.WARE** posts `{ alarm }` through the action's `OD3_AlarmWebhook`
20
+ * row (`ensureOpenwareWebhook`) with the webhook token; the tenant is the
21
+ * alarm owner's.
22
+ * - Called directly: `{ event, params?, secret?, tenantId? }` with the master
23
+ * key and a `tenantId`, or a tenant's shared secret.
25
24
  *
26
- * A logged-in user is deliberately *not* enough: this is a machine endpoint,
27
- * and a browser session should not be able to fabricate alarm tickets.
25
+ * A logged-in user is deliberately *not* enough: this is a machine endpoint.
28
26
  *
29
- * Params: `{ event, params?, secret?, tenantId? }`.
30
27
  * Returns `{ ticketId, created, origin, equipmentId? }` — `created: false`
31
28
  * means an open ticket for this alarm already existed (see
32
29
  * `createAlarmTicket`).
33
30
  */
34
31
  async function init(name) {
35
32
  node_1.default.Cloud.define(name, async (request) => {
36
- const { event, params, secret, tenantId } = request.params;
37
- if (!event || typeof event !== "object") {
38
- throw new node_1.default.Error(node_1.default.Error.INVALID_QUERY, `${name} needs an "event" object describing the alarm`);
39
- }
40
- const tenant = request.master
41
- ? await tenantById(tenantId)
42
- : await (0, index_js_1.tenantForAlarmTicket)(typeof secret === "string" ? secret : "");
43
- if (!tenant) {
44
- // Same answer for "wrong secret" and "no such tenant": a caller
45
- // guessing secrets learns nothing from the difference.
46
- throw new node_1.default.Error(node_1.default.Error.OPERATION_FORBIDDEN, `${name}: unknown tenant or invalid secret`);
47
- }
48
- const result = await (0, index_js_1.createAlarmTicket)(tenant, event, params ?? {});
33
+ const { tenant, event, params } = await (0, index_js_1.readAlarmCall)(name, request, index_js_1.tenantForAlarmTicket);
34
+ const result = await (0, index_js_1.createAlarmTicket)(tenant, event, params);
49
35
  console.log(`[${name}] ${result.created ? "created" : "reused"} ticket ` +
50
36
  `${result.ticketId} for ${result.origin}` +
51
37
  (result.equipmentId ? ` (machine ${result.equipmentId})` : ""));
52
38
  return result;
53
39
  },
54
- // No `requireUser`: the callers are machines, authenticated above.
40
+ // No `requireUser`: the callers are machines, authenticated in
41
+ // `readAlarmCall`.
55
42
  {});
56
43
  }
57
- async function tenantById(tenantId) {
58
- if (!tenantId)
59
- return undefined;
60
- return ((await new node_1.default.Query(index_js_2.Tenant)
61
- .equalTo("objectId", tenantId)
62
- .first({ useMasterKey: true })) ?? undefined);
63
- }
@@ -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.36.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
- }