@amohamud23/notihub 1.1.45 → 1.1.47

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
@@ -1962,10 +1962,10 @@ var PaymentSession = class _PaymentSession {
1962
1962
  throw new Error("Could not create payment session");
1963
1963
  }
1964
1964
  }
1965
- static async getPaymentSessionById(id) {
1965
+ static async getPaymentSessionById(sessionId) {
1966
1966
  const command = new import_lib_dynamodb16.GetCommand({
1967
1967
  TableName: _PaymentSession.TABLE_NAME,
1968
- Key: { id }
1968
+ Key: { sessionId }
1969
1969
  });
1970
1970
  try {
1971
1971
  const result = await ddbDocClient.send(command);
@@ -1991,26 +1991,6 @@ var PaymentSession = class _PaymentSession {
1991
1991
  throw new Error("Could not update payment session");
1992
1992
  }
1993
1993
  }
1994
- static async getPaymentSessionBySessionId(sessionId) {
1995
- const command = new import_lib_dynamodb16.QueryCommand({
1996
- TableName: _PaymentSession.TABLE_NAME,
1997
- IndexName: "SessionIdIndex",
1998
- KeyConditionExpression: "session = :sessionId",
1999
- ExpressionAttributeValues: {
2000
- ":sessionId": sessionId
2001
- }
2002
- });
2003
- try {
2004
- const result = await ddbDocClient.send(command);
2005
- if (!result.Items || result.Items.length === 0) {
2006
- return null;
2007
- }
2008
- return result.Items[0] || null;
2009
- } catch (error) {
2010
- console.error("Error fetching payment session:", error);
2011
- throw new Error("Could not fetch payment session");
2012
- }
2013
- }
2014
1994
  };
2015
1995
  var PaymentSession_default = PaymentSession;
2016
1996
 
package/dist/index.d.cts CHANGED
@@ -759,9 +759,8 @@ declare class PaymentSession {
759
759
  static ENV: string;
760
760
  static TABLE_NAME: string;
761
761
  static createPaymentSession(paymentSession: INotiHubPaymentSession): Promise<INotiHubPaymentSession>;
762
- static getPaymentSessionById(id: string): Promise<INotiHubPaymentSession>;
762
+ static getPaymentSessionById(sessionId: string): Promise<INotiHubPaymentSession>;
763
763
  static updatePaymentSession(id: string, intent: string): Promise<void>;
764
- static getPaymentSessionBySessionId(sessionId: string): Promise<INotiHubPaymentSession | null>;
765
764
  }
766
765
 
767
766
  declare const TABLES: {
package/dist/index.d.ts CHANGED
@@ -759,9 +759,8 @@ declare class PaymentSession {
759
759
  static ENV: string;
760
760
  static TABLE_NAME: string;
761
761
  static createPaymentSession(paymentSession: INotiHubPaymentSession): Promise<INotiHubPaymentSession>;
762
- static getPaymentSessionById(id: string): Promise<INotiHubPaymentSession>;
762
+ static getPaymentSessionById(sessionId: string): Promise<INotiHubPaymentSession>;
763
763
  static updatePaymentSession(id: string, intent: string): Promise<void>;
764
- static getPaymentSessionBySessionId(sessionId: string): Promise<INotiHubPaymentSession | null>;
765
764
  }
766
765
 
767
766
  declare const TABLES: {
package/dist/index.js CHANGED
@@ -1978,7 +1978,6 @@ var StripeSubscriptions_default = StripeSubscription;
1978
1978
  import {
1979
1979
  GetCommand as GetCommand14,
1980
1980
  PutCommand as PutCommand15,
1981
- QueryCommand as QueryCommand14,
1982
1981
  UpdateCommand as UpdateCommand14
1983
1982
  } from "@aws-sdk/lib-dynamodb";
1984
1983
  var PaymentSession = class _PaymentSession {
@@ -1997,10 +1996,10 @@ var PaymentSession = class _PaymentSession {
1997
1996
  throw new Error("Could not create payment session");
1998
1997
  }
1999
1998
  }
2000
- static async getPaymentSessionById(id) {
1999
+ static async getPaymentSessionById(sessionId) {
2001
2000
  const command = new GetCommand14({
2002
2001
  TableName: _PaymentSession.TABLE_NAME,
2003
- Key: { id }
2002
+ Key: { sessionId }
2004
2003
  });
2005
2004
  try {
2006
2005
  const result = await ddbDocClient.send(command);
@@ -2026,26 +2025,6 @@ var PaymentSession = class _PaymentSession {
2026
2025
  throw new Error("Could not update payment session");
2027
2026
  }
2028
2027
  }
2029
- static async getPaymentSessionBySessionId(sessionId) {
2030
- const command = new QueryCommand14({
2031
- TableName: _PaymentSession.TABLE_NAME,
2032
- IndexName: "SessionIdIndex",
2033
- KeyConditionExpression: "session = :sessionId",
2034
- ExpressionAttributeValues: {
2035
- ":sessionId": sessionId
2036
- }
2037
- });
2038
- try {
2039
- const result = await ddbDocClient.send(command);
2040
- if (!result.Items || result.Items.length === 0) {
2041
- return null;
2042
- }
2043
- return result.Items[0] || null;
2044
- } catch (error) {
2045
- console.error("Error fetching payment session:", error);
2046
- throw new Error("Could not fetch payment session");
2047
- }
2048
- }
2049
2028
  };
2050
2029
  var PaymentSession_default = PaymentSession;
2051
2030
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amohamud23/notihub",
3
- "version": "1.1.45",
3
+ "version": "1.1.47",
4
4
  "description": "Notihub Package",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.cts",