@serhii.mazur/directus-gu-logs 1.0.5 → 1.0.6

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/index.d.ts CHANGED
@@ -9,5 +9,5 @@ export declare class Logs {
9
9
  private createOne;
10
10
  printLogs(functionName: string, error: string): Promise<void>;
11
11
  createActivity(action: string, collection: string, id: PrimaryKey): Promise<void>;
12
- createNotification(message: string, customSubject?: string | null, recipientOverride?: string | null): Promise<void>;
12
+ createNotification(message: string, customSubject?: string | null, recipientOverride?: string | null, collection?: string | null, item?: string | null): Promise<void>;
13
13
  }
package/dist/index.js CHANGED
@@ -55,7 +55,7 @@ export class Logs {
55
55
  console.error("❌ Failed to create activity log:", error);
56
56
  }
57
57
  }
58
- async createNotification(message, customSubject = null, recipientOverride = null) {
58
+ async createNotification(message, customSubject = null, recipientOverride = null, collection = null, item = null) {
59
59
  try {
60
60
  const schema = await this.getSchema();
61
61
  const { database, services } = this.context;
@@ -100,8 +100,8 @@ ${message}<br><br>
100
100
  sender: recipient,
101
101
  subject,
102
102
  message: fullMessage,
103
- collection: null,
104
- item: null,
103
+ collection,
104
+ item,
105
105
  });
106
106
  }
107
107
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serhii.mazur/directus-gu-logs",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Helper class Logs for using in Directus extensions",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/index.ts CHANGED
@@ -81,7 +81,9 @@ export class Logs {
81
81
  async createNotification(
82
82
  message: string,
83
83
  customSubject: string | null = null,
84
- recipientOverride: string | null = null
84
+ recipientOverride: string | null = null,
85
+ collection: string | null = null,
86
+ item: string | null = null
85
87
  ) {
86
88
  try {
87
89
  const schema = await this.getSchema();
@@ -134,8 +136,8 @@ ${message}<br><br>
134
136
  sender: recipient,
135
137
  subject,
136
138
  message: fullMessage,
137
- collection: null,
138
- item: null,
139
+ collection,
140
+ item,
139
141
  });
140
142
  } catch (error) {
141
143
  console.error("❌ Failed to create notification:", error);