@amohamud23/notihub 1.1.5 → 1.1.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.cjs CHANGED
@@ -299,18 +299,18 @@ var User = class _User {
299
299
  }
300
300
  }
301
301
  /**
302
- * Searches for users by username and customerId
303
- * @param username - The username to search for.
302
+ * Searches for users by email and customerId
303
+ * @param email - The email to search for.
304
304
  * @param customerId - The customer ID to filter by.
305
305
  * @returns A promise that resolves to an array of user objects.
306
306
  */
307
- static async searchUsersByUsernameAndCustomerId(username, customerId) {
307
+ static async searchUsersByEmailAndCustomerId(email, customerId) {
308
308
  const command = new import_lib_dynamodb2.QueryCommand({
309
309
  TableName: _User.TABLE_NAME,
310
- IndexName: "UsernameIndex",
311
- KeyConditionExpression: "begins_with(username, :uname) and customerId = :customerId",
310
+ IndexName: "EmailCustomerIndex",
311
+ KeyConditionExpression: "begins_with(email, :email) and customerId = :customerId",
312
312
  ExpressionAttributeValues: {
313
- ":uname": username,
313
+ ":email": email,
314
314
  ":customerId": customerId
315
315
  }
316
316
  });
@@ -318,8 +318,8 @@ var User = class _User {
318
318
  const result = await ddbDocClient.send(command);
319
319
  return result.Items || [];
320
320
  } catch (error) {
321
- console.error("Error searching users by username and customerId:", error);
322
- throw new Error("Could not search users by username and customerId");
321
+ console.error("Error searching users by email and customerId:", error);
322
+ throw new Error("Could not search users by email and customerId");
323
323
  }
324
324
  }
325
325
  };
package/dist/index.d.cts CHANGED
@@ -297,12 +297,12 @@ declare class User {
297
297
  */
298
298
  static deleteUser(id: string): Promise<void>;
299
299
  /**
300
- * Searches for users by username and customerId
301
- * @param username - The username to search for.
300
+ * Searches for users by email and customerId
301
+ * @param email - The email to search for.
302
302
  * @param customerId - The customer ID to filter by.
303
303
  * @returns A promise that resolves to an array of user objects.
304
304
  */
305
- static searchUsersByUsernameAndCustomerId(username: string, customerId: string): Promise<INotiHubUser[]>;
305
+ static searchUsersByEmailAndCustomerId(email: string, customerId: string): Promise<INotiHubUser[]>;
306
306
  }
307
307
 
308
308
  declare class Customer {
package/dist/index.d.ts CHANGED
@@ -297,12 +297,12 @@ declare class User {
297
297
  */
298
298
  static deleteUser(id: string): Promise<void>;
299
299
  /**
300
- * Searches for users by username and customerId
301
- * @param username - The username to search for.
300
+ * Searches for users by email and customerId
301
+ * @param email - The email to search for.
302
302
  * @param customerId - The customer ID to filter by.
303
303
  * @returns A promise that resolves to an array of user objects.
304
304
  */
305
- static searchUsersByUsernameAndCustomerId(username: string, customerId: string): Promise<INotiHubUser[]>;
305
+ static searchUsersByEmailAndCustomerId(email: string, customerId: string): Promise<INotiHubUser[]>;
306
306
  }
307
307
 
308
308
  declare class Customer {
package/dist/index.js CHANGED
@@ -266,18 +266,18 @@ var User = class _User {
266
266
  }
267
267
  }
268
268
  /**
269
- * Searches for users by username and customerId
270
- * @param username - The username to search for.
269
+ * Searches for users by email and customerId
270
+ * @param email - The email to search for.
271
271
  * @param customerId - The customer ID to filter by.
272
272
  * @returns A promise that resolves to an array of user objects.
273
273
  */
274
- static async searchUsersByUsernameAndCustomerId(username, customerId) {
274
+ static async searchUsersByEmailAndCustomerId(email, customerId) {
275
275
  const command = new QueryCommand({
276
276
  TableName: _User.TABLE_NAME,
277
- IndexName: "UsernameIndex",
278
- KeyConditionExpression: "begins_with(username, :uname) and customerId = :customerId",
277
+ IndexName: "EmailCustomerIndex",
278
+ KeyConditionExpression: "begins_with(email, :email) and customerId = :customerId",
279
279
  ExpressionAttributeValues: {
280
- ":uname": username,
280
+ ":email": email,
281
281
  ":customerId": customerId
282
282
  }
283
283
  });
@@ -285,8 +285,8 @@ var User = class _User {
285
285
  const result = await ddbDocClient.send(command);
286
286
  return result.Items || [];
287
287
  } catch (error) {
288
- console.error("Error searching users by username and customerId:", error);
289
- throw new Error("Could not search users by username and customerId");
288
+ console.error("Error searching users by email and customerId:", error);
289
+ throw new Error("Could not search users by email and customerId");
290
290
  }
291
291
  }
292
292
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amohamud23/notihub",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "Notihub Package",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.cts",