@amohamud23/notihub 1.1.31 → 1.1.33

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.cjs CHANGED
@@ -1190,10 +1190,14 @@ var NotiTypeStats = class _NotiTypeStats {
1190
1190
  * Increment the count of views for a specific notification type.
1191
1191
  * @param id - The ID of the notification type stats entry.
1192
1192
  */
1193
- static async incrementViews(id) {
1193
+ static async incrementViews(id, notiTypeId) {
1194
1194
  const command = new import_lib_dynamodb8.UpdateCommand({
1195
1195
  TableName: _NotiTypeStats.TABLE_NAME,
1196
- Key: { id },
1196
+ Key: {
1197
+ id,
1198
+ notiTypeId
1199
+ // Include the sort key
1200
+ },
1197
1201
  UpdateExpression: "ADD #views :inc",
1198
1202
  ExpressionAttributeNames: {
1199
1203
  "#views": "views"
@@ -1630,10 +1634,14 @@ var NotificationStats = class _NotificationStats {
1630
1634
  * Increments the view count for a notification stats entry.
1631
1635
  * @param id - The ID of the notification stats entry.
1632
1636
  */
1633
- static async incrementViewCount(id) {
1637
+ static async incrementViewCount(id, customerId) {
1634
1638
  const command = new import_lib_dynamodb13.UpdateCommand({
1635
1639
  TableName: _NotificationStats.TABLE_NAME,
1636
- Key: { id },
1640
+ Key: {
1641
+ id,
1642
+ customerId
1643
+ // Include the sort key
1644
+ },
1637
1645
  UpdateExpression: "ADD #views :inc",
1638
1646
  ExpressionAttributeNames: {
1639
1647
  "#views": "views"
@@ -1670,8 +1678,8 @@ var NotiHubStatsHistory = class _NotiHubStatsHistory {
1670
1678
  Item: statsHistory
1671
1679
  });
1672
1680
  try {
1673
- const result = await ddbDocClient.send(command);
1674
- return result.Attributes;
1681
+ await ddbDocClient.send(command);
1682
+ return statsHistory;
1675
1683
  } catch (error) {
1676
1684
  console.error("Error creating NotiHub stats history:", error);
1677
1685
  throw new Error("Could not create NotiHub stats history");
package/dist/index.d.cts CHANGED
@@ -533,7 +533,7 @@ declare class NotiTypeStats {
533
533
  * Increment the count of views for a specific notification type.
534
534
  * @param id - The ID of the notification type stats entry.
535
535
  */
536
- static incrementViews(id: string): Promise<INotiTypeStats>;
536
+ static incrementViews(id: string, notiTypeId: string): Promise<INotiTypeStats>;
537
537
  }
538
538
 
539
539
  declare class Views {
@@ -672,7 +672,7 @@ declare class NotificationStats {
672
672
  * Increments the view count for a notification stats entry.
673
673
  * @param id - The ID of the notification stats entry.
674
674
  */
675
- static incrementViewCount(id: string): Promise<INotiHubNotificationStats>;
675
+ static incrementViewCount(id: string, customerId: string): Promise<INotiHubNotificationStats>;
676
676
  }
677
677
 
678
678
  declare class NotiHubStatsHistory {
package/dist/index.d.ts CHANGED
@@ -533,7 +533,7 @@ declare class NotiTypeStats {
533
533
  * Increment the count of views for a specific notification type.
534
534
  * @param id - The ID of the notification type stats entry.
535
535
  */
536
- static incrementViews(id: string): Promise<INotiTypeStats>;
536
+ static incrementViews(id: string, notiTypeId: string): Promise<INotiTypeStats>;
537
537
  }
538
538
 
539
539
  declare class Views {
@@ -672,7 +672,7 @@ declare class NotificationStats {
672
672
  * Increments the view count for a notification stats entry.
673
673
  * @param id - The ID of the notification stats entry.
674
674
  */
675
- static incrementViewCount(id: string): Promise<INotiHubNotificationStats>;
675
+ static incrementViewCount(id: string, customerId: string): Promise<INotiHubNotificationStats>;
676
676
  }
677
677
 
678
678
  declare class NotiHubStatsHistory {
package/dist/index.js CHANGED
@@ -1190,10 +1190,14 @@ var NotiTypeStats = class _NotiTypeStats {
1190
1190
  * Increment the count of views for a specific notification type.
1191
1191
  * @param id - The ID of the notification type stats entry.
1192
1192
  */
1193
- static async incrementViews(id) {
1193
+ static async incrementViews(id, notiTypeId) {
1194
1194
  const command = new UpdateCommand7({
1195
1195
  TableName: _NotiTypeStats.TABLE_NAME,
1196
- Key: { id },
1196
+ Key: {
1197
+ id,
1198
+ notiTypeId
1199
+ // Include the sort key
1200
+ },
1197
1201
  UpdateExpression: "ADD #views :inc",
1198
1202
  ExpressionAttributeNames: {
1199
1203
  "#views": "views"
@@ -1651,10 +1655,14 @@ var NotificationStats = class _NotificationStats {
1651
1655
  * Increments the view count for a notification stats entry.
1652
1656
  * @param id - The ID of the notification stats entry.
1653
1657
  */
1654
- static async incrementViewCount(id) {
1658
+ static async incrementViewCount(id, customerId) {
1655
1659
  const command = new UpdateCommand11({
1656
1660
  TableName: _NotificationStats.TABLE_NAME,
1657
- Key: { id },
1661
+ Key: {
1662
+ id,
1663
+ customerId
1664
+ // Include the sort key
1665
+ },
1658
1666
  UpdateExpression: "ADD #views :inc",
1659
1667
  ExpressionAttributeNames: {
1660
1668
  "#views": "views"
@@ -1694,8 +1702,8 @@ var NotiHubStatsHistory = class _NotiHubStatsHistory {
1694
1702
  Item: statsHistory
1695
1703
  });
1696
1704
  try {
1697
- const result = await ddbDocClient.send(command);
1698
- return result.Attributes;
1705
+ await ddbDocClient.send(command);
1706
+ return statsHistory;
1699
1707
  } catch (error) {
1700
1708
  console.error("Error creating NotiHub stats history:", error);
1701
1709
  throw new Error("Could not create NotiHub stats history");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amohamud23/notihub",
3
- "version": "1.1.31",
3
+ "version": "1.1.33",
4
4
  "description": "Notihub Package",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.cts",