@amohamud23/notihub 1.0.173 → 1.0.175
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 +5 -7
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +5 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -175,12 +175,10 @@ var import_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
|
|
|
175
175
|
var isOffline = process.env.IS_OFFLINE === "true";
|
|
176
176
|
var ddbClient = new import_client_dynamodb.DynamoDBClient({
|
|
177
177
|
region: "localhost",
|
|
178
|
-
endpoint: "http://
|
|
178
|
+
endpoint: "http://0.0.0.0:8000",
|
|
179
179
|
credentials: {
|
|
180
|
-
accessKeyId: "
|
|
181
|
-
|
|
182
|
-
secretAccessKey: "DEFAULT_SECRET"
|
|
183
|
-
// needed if you don't have aws credentials at all in env
|
|
180
|
+
accessKeyId: "MockAccessKeyId",
|
|
181
|
+
secretAccessKey: "MockSecretAccessKey"
|
|
184
182
|
}
|
|
185
183
|
});
|
|
186
184
|
var ddbDocClient = import_lib_dynamodb.DynamoDBDocumentClient.from(ddbClient, {
|
|
@@ -490,10 +488,10 @@ var NotiHubStats = class _NotiHubStats {
|
|
|
490
488
|
await ddbDocClient.send(command);
|
|
491
489
|
return stats;
|
|
492
490
|
}
|
|
493
|
-
static async
|
|
491
|
+
static async getStatsByCustomerId(customerId) {
|
|
494
492
|
const command = new import_lib_dynamodb5.GetCommand({
|
|
495
493
|
TableName: _NotiHubStats.TABLE_NAME,
|
|
496
|
-
Key: {
|
|
494
|
+
Key: { customerId }
|
|
497
495
|
});
|
|
498
496
|
const result = await ddbDocClient.send(command);
|
|
499
497
|
return result.Item || null;
|
package/dist/index.d.cts
CHANGED
|
@@ -129,7 +129,7 @@ type INotiHubStats = {
|
|
|
129
129
|
type INotiHubStatsHistory = {
|
|
130
130
|
id: string;
|
|
131
131
|
customerId: string;
|
|
132
|
-
type: "MONTH" | "YEAR";
|
|
132
|
+
type: "DAY" | "MONTH" | "YEAR";
|
|
133
133
|
subscription: number;
|
|
134
134
|
notifications: number;
|
|
135
135
|
views: number;
|
|
@@ -357,7 +357,7 @@ declare class NotiHubStats {
|
|
|
357
357
|
static ENV: string;
|
|
358
358
|
static TABLE_NAME: string;
|
|
359
359
|
static createStats(stats: INotiHubStats): Promise<INotiHubStats>;
|
|
360
|
-
static
|
|
360
|
+
static getStatsByCustomerId(customerId: string): Promise<INotiHubStats | null>;
|
|
361
361
|
static incrementViews(id: string, customerId: string): Promise<INotiHubStats>;
|
|
362
362
|
static getStatsInDateRange(customerId: string, startDate: string, endDate: string): Promise<INotiHubStats[]>;
|
|
363
363
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -129,7 +129,7 @@ type INotiHubStats = {
|
|
|
129
129
|
type INotiHubStatsHistory = {
|
|
130
130
|
id: string;
|
|
131
131
|
customerId: string;
|
|
132
|
-
type: "MONTH" | "YEAR";
|
|
132
|
+
type: "DAY" | "MONTH" | "YEAR";
|
|
133
133
|
subscription: number;
|
|
134
134
|
notifications: number;
|
|
135
135
|
views: number;
|
|
@@ -357,7 +357,7 @@ declare class NotiHubStats {
|
|
|
357
357
|
static ENV: string;
|
|
358
358
|
static TABLE_NAME: string;
|
|
359
359
|
static createStats(stats: INotiHubStats): Promise<INotiHubStats>;
|
|
360
|
-
static
|
|
360
|
+
static getStatsByCustomerId(customerId: string): Promise<INotiHubStats | null>;
|
|
361
361
|
static incrementViews(id: string, customerId: string): Promise<INotiHubStats>;
|
|
362
362
|
static getStatsInDateRange(customerId: string, startDate: string, endDate: string): Promise<INotiHubStats[]>;
|
|
363
363
|
}
|
package/dist/index.js
CHANGED
|
@@ -136,12 +136,10 @@ import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
|
|
|
136
136
|
var isOffline = process.env.IS_OFFLINE === "true";
|
|
137
137
|
var ddbClient = new DynamoDBClient({
|
|
138
138
|
region: "localhost",
|
|
139
|
-
endpoint: "http://
|
|
139
|
+
endpoint: "http://0.0.0.0:8000",
|
|
140
140
|
credentials: {
|
|
141
|
-
accessKeyId: "
|
|
142
|
-
|
|
143
|
-
secretAccessKey: "DEFAULT_SECRET"
|
|
144
|
-
// needed if you don't have aws credentials at all in env
|
|
141
|
+
accessKeyId: "MockAccessKeyId",
|
|
142
|
+
secretAccessKey: "MockSecretAccessKey"
|
|
145
143
|
}
|
|
146
144
|
});
|
|
147
145
|
var ddbDocClient = DynamoDBDocumentClient.from(ddbClient, {
|
|
@@ -470,10 +468,10 @@ var NotiHubStats = class _NotiHubStats {
|
|
|
470
468
|
await ddbDocClient.send(command);
|
|
471
469
|
return stats;
|
|
472
470
|
}
|
|
473
|
-
static async
|
|
471
|
+
static async getStatsByCustomerId(customerId) {
|
|
474
472
|
const command = new GetCommand4({
|
|
475
473
|
TableName: _NotiHubStats.TABLE_NAME,
|
|
476
|
-
Key: {
|
|
474
|
+
Key: { customerId }
|
|
477
475
|
});
|
|
478
476
|
const result = await ddbDocClient.send(command);
|
|
479
477
|
return result.Item || null;
|