@openinc/parse-server-opendash 3.34.0 → 3.34.1

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.
@@ -46,7 +46,6 @@ function createNotification(input) {
46
46
  * Register all notifications in the database, if not already registered.
47
47
  */
48
48
  async function registerNotifications(tenant) {
49
- console.log("[@openinc/parse-server-opendash] Register all notifications");
50
49
  getAllNotifications().forEach((notification) => {
51
50
  new Parse.Query(types_1.Notification_Setting)
52
51
  .equalTo("key", notification.key)
@@ -62,9 +61,6 @@ async function registerNotifications(tenant) {
62
61
  newPermission.set("description", notification.description);
63
62
  newPermission.save({}, { useMasterKey: true });
64
63
  }
65
- else {
66
- console.log("[@openinc/parse-server-opendash] Notification already exists", notification.key);
67
- }
68
64
  });
69
65
  });
70
66
  }
@@ -59,7 +59,6 @@ function createPermission(input) {
59
59
  * @returns {Promise<void>}
60
60
  */
61
61
  async function registerPermissions(tenant) {
62
- console.log("[@openinc/parse-server-opendash] Register all permissions");
63
62
  const allPermissions = getAllPermissions().map(async (permission) => {
64
63
  const [resultError, result] = await (0, catchError_1.catchError)(new Parse.Query(types_1.Permission)
65
64
  .equalTo("key", permission.key)
@@ -80,7 +79,6 @@ async function registerPermissions(tenant) {
80
79
  }
81
80
  });
82
81
  await Promise.all(allPermissions);
83
- console.log("[@openinc/parse-server-opendash] All permissions registered successfully");
84
82
  }
85
83
  /**
86
84
  * Set read access for all admin roles to admin overview permission
@@ -88,7 +86,6 @@ async function registerPermissions(tenant) {
88
86
  * @returns {Promise<void>}
89
87
  */
90
88
  async function ensureDefaultAdminAccess(tenant) {
91
- console.log("[@openinc/parse-server-opendash] Ensure default admin access permissions");
92
89
  const [resultError, result] = await (0, catchError_1.catchError)(new Parse.Query(types_1.Permission)
93
90
  .equalTo("key", __1.Permissions.CORE.adminoverview)
94
91
  .equalTo("tenant", tenant)
@@ -106,9 +103,6 @@ async function ensureDefaultAdminAccess(tenant) {
106
103
  result.setACL(acl);
107
104
  await result.save(null, { useMasterKey: true });
108
105
  }
109
- else {
110
- console.log("[@openinc/parse-server-opendash] Permission not found", __1.Permissions.CORE.adminoverview);
111
- }
112
106
  }
113
107
  /**
114
108
  * Entry point for the permission registration process.
@@ -8,9 +8,6 @@ async function init() {
8
8
  const { object, original, user } = request;
9
9
  await (0, schema_1.defaultHandler)(request);
10
10
  await (0, schema_1.defaultAclHandler)(request);
11
- // TODO
12
- });
13
- (0, schema_1.afterSaveHook)(types_1.Company, async ({ object, original, user }) => {
14
- // TODO
15
11
  });
12
+ (0, schema_1.afterSaveHook)(types_1.Company, async ({ object, original, user }) => { });
16
13
  }
@@ -8,9 +8,6 @@ async function init() {
8
8
  const { object, original, user } = request;
9
9
  await (0, schema_1.defaultHandler)(request);
10
10
  await (0, schema_1.defaultAclHandler)(request);
11
- // TODO
12
- });
13
- (0, schema_1.afterSaveHook)(types_1.Contact, async ({ object, original, user }) => {
14
- // TODO
15
11
  });
12
+ (0, schema_1.afterSaveHook)(types_1.Contact, async ({ object, original, user }) => { });
16
13
  }
@@ -1,4 +1,3 @@
1
- import type { Contact } from "./Contact";
2
1
  import type { Source } from "./Source";
3
2
  import type { Tenant } from "./Tenant";
4
3
  export interface CompanyAttributes {
@@ -6,7 +5,6 @@ export interface CompanyAttributes {
6
5
  objectId: string;
7
6
  createdAt: Date;
8
7
  updatedAt: Date;
9
- contacts: Parse.Relation<Company, Contact>;
10
8
  name?: string | undefined;
11
9
  sources: Parse.Relation<Company, Source>;
12
10
  tenant?: Tenant | undefined;
@@ -14,7 +12,6 @@ export interface CompanyAttributes {
14
12
  export declare class Company extends Parse.Object<CompanyAttributes> {
15
13
  static className: string;
16
14
  constructor(data?: Partial<CompanyAttributes>);
17
- get contacts(): Parse.Relation<Company, Contact>;
18
15
  get name(): string | undefined;
19
16
  set name(value: string | undefined);
20
17
  get sources(): Parse.Relation<Company, Source>;
@@ -5,9 +5,6 @@ class Company extends Parse.Object {
5
5
  constructor(data) {
6
6
  super("OD3_Company", data);
7
7
  }
8
- get contacts() {
9
- return super.relation("contacts");
10
- }
11
8
  get name() {
12
9
  return super.get("name");
13
10
  }
@@ -1,3 +1,4 @@
1
+ import type { Company } from "./Company";
1
2
  import type { Tenant } from "./Tenant";
2
3
  import type { _User } from "./_User";
3
4
  export interface ContactAttributes {
@@ -6,6 +7,7 @@ export interface ContactAttributes {
6
7
  createdAt: Date;
7
8
  updatedAt: Date;
8
9
  city?: string | undefined;
10
+ company?: Company | undefined;
9
11
  department?: string | undefined;
10
12
  description?: string | undefined;
11
13
  email?: string | undefined;
@@ -24,6 +26,8 @@ export declare class Contact extends Parse.Object<ContactAttributes> {
24
26
  constructor(data?: Partial<ContactAttributes>);
25
27
  get city(): string | undefined;
26
28
  set city(value: string | undefined);
29
+ get company(): Company | undefined;
30
+ set company(value: Company | undefined);
27
31
  get department(): string | undefined;
28
32
  set department(value: string | undefined);
29
33
  get description(): string | undefined;
@@ -11,6 +11,12 @@ class Contact extends Parse.Object {
11
11
  set city(value) {
12
12
  super.set("city", value);
13
13
  }
14
+ get company() {
15
+ return super.get("company");
16
+ }
17
+ set company(value) {
18
+ super.set("company", value);
19
+ }
14
20
  get department() {
15
21
  return super.get("department");
16
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openinc/parse-server-opendash",
3
- "version": "3.34.0",
3
+ "version": "3.34.1",
4
4
  "description": "Parse Server Cloud Code for open.INC Stack.",
5
5
  "packageManager": "pnpm@10.28.0",
6
6
  "keywords": [
@@ -1,10 +1,5 @@
1
1
  {
2
2
  "fields": {
3
- "contacts": {
4
- "type": "Relation",
5
- "targetClass": "{{PREFIX}}Contact",
6
- "required": false
7
- },
8
3
  "name": {
9
4
  "type": "String",
10
5
  "required": false
@@ -4,6 +4,11 @@
4
4
  "type": "String",
5
5
  "required": false
6
6
  },
7
+ "company": {
8
+ "type": "Pointer",
9
+ "targetClass": "{{PREFIX}}Company",
10
+ "required": false
11
+ },
7
12
  "department": {
8
13
  "type": "String",
9
14
  "required": false