@openinc/parse-server-opendash 2.4.34 → 2.4.35

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.
@@ -1,13 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.init = init;
7
4
  const types_1 = require("../types");
8
- const parse_1 = __importDefault(require("parse"));
9
5
  async function init(name) {
10
- parse_1.default.Cloud.define(name, async function (request) {
6
+ Parse.Cloud.define(name, async function (request) {
11
7
  if (typeof request.user === "undefined") {
12
8
  return { success: false, error: "User not found" };
13
9
  }
@@ -15,7 +11,7 @@ async function init(name) {
15
11
  return { success: false, error: "StateID not provided" };
16
12
  const cursor = request.params?.cursor || 0;
17
13
  const limit = request.params?.limit || 10;
18
- const state = new parse_1.default.Query(types_1.Maintenance_Kanban_State).get(request.params?.state);
14
+ const state = new Parse.Query(types_1.Maintenance_Kanban_State).get(request.params?.state);
19
15
  const currentPagePipeline = [
20
16
  { group: { _id: "ticket", doc: { $first: "$$ROOT" } } }, // Group by ticket to only get the latest state of the ticket
21
17
  { match: { state: state } }, // only get tickets with the state provided
@@ -24,7 +20,7 @@ async function init(name) {
24
20
  { limit: limit }, // limit the number of tickets recieved
25
21
  { replaceRoot: { newRoot: "$doc" } }, // replace the root of the document with the ticket
26
22
  ];
27
- const aggregatedTicketKanbanStates = await new parse_1.default.Query(types_1.Maintenance_Ticket_Kanban_State).aggregate(
23
+ const aggregatedTicketKanbanStates = await new Parse.Query(types_1.Maintenance_Ticket_Kanban_State).aggregate(
28
24
  // @ts-expect-error
29
25
  currentPagePipeline);
30
26
  const totalCountPipeline = [
@@ -32,7 +28,7 @@ async function init(name) {
32
28
  { $match: { state: state } }, // only get tickets with the state provided
33
29
  { count: { $sum: 1 } }, // count the number of tickets
34
30
  ];
35
- const totalCount = await new parse_1.default.Query(types_1.Maintenance_Ticket_Kanban_State).aggregate(
31
+ const totalCount = await new Parse.Query(types_1.Maintenance_Ticket_Kanban_State).aggregate(
36
32
  // @ts-expect-error
37
33
  totalCountPipeline);
38
34
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openinc/parse-server-opendash",
3
- "version": "2.4.34",
3
+ "version": "2.4.35",
4
4
  "description": "Parse Server Cloud Code for open.DASH",
5
5
  "keywords": [
6
6
  "parse",