@amohamud23/notihub 1.1.58 → 1.1.60

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
@@ -2015,6 +2015,35 @@ var TABLES = {
2015
2015
  PaymentSession: PaymentSession_default
2016
2016
  };
2017
2017
 
2018
+ // src/client/ParameterStoreClient.ts
2019
+ var import_client_ssm = require("@aws-sdk/client-ssm");
2020
+ var ParameterStore = class {
2021
+ ssmClient;
2022
+ constructor() {
2023
+ this.ssmClient = new import_client_ssm.SSMClient({
2024
+ region: process.env.AWS_REGION
2025
+ });
2026
+ }
2027
+ async getParameter(paramName, withDecryption = true) {
2028
+ const command = new import_client_ssm.GetParameterCommand({
2029
+ Name: paramName,
2030
+ WithDecryption: withDecryption
2031
+ });
2032
+ try {
2033
+ const response = await this.ssmClient.send(command);
2034
+ if (response.Parameter && response.Parameter.Value) {
2035
+ return response.Parameter.Value;
2036
+ } else {
2037
+ throw new Error(`Parameter ${paramName} not found or has no value.`);
2038
+ }
2039
+ } catch (error) {
2040
+ console.error(`Error retrieving parameter ${paramName}:`, error);
2041
+ throw error;
2042
+ }
2043
+ }
2044
+ };
2045
+ var ParameterStoreClient_default = new ParameterStore();
2046
+
2018
2047
  // src/errorcodes.ts
2019
2048
  var errorcodes_exports = {};
2020
2049
  __export(errorcodes_exports, {
package/dist/index.js CHANGED
@@ -2061,6 +2061,35 @@ var TABLES = {
2061
2061
  PaymentSession: PaymentSession_default
2062
2062
  };
2063
2063
 
2064
+ // src/client/ParameterStoreClient.ts
2065
+ import { SSMClient, GetParameterCommand } from "@aws-sdk/client-ssm";
2066
+ var ParameterStore = class {
2067
+ ssmClient;
2068
+ constructor() {
2069
+ this.ssmClient = new SSMClient({
2070
+ region: process.env.AWS_REGION
2071
+ });
2072
+ }
2073
+ async getParameter(paramName, withDecryption = true) {
2074
+ const command = new GetParameterCommand({
2075
+ Name: paramName,
2076
+ WithDecryption: withDecryption
2077
+ });
2078
+ try {
2079
+ const response = await this.ssmClient.send(command);
2080
+ if (response.Parameter && response.Parameter.Value) {
2081
+ return response.Parameter.Value;
2082
+ } else {
2083
+ throw new Error(`Parameter ${paramName} not found or has no value.`);
2084
+ }
2085
+ } catch (error) {
2086
+ console.error(`Error retrieving parameter ${paramName}:`, error);
2087
+ throw error;
2088
+ }
2089
+ }
2090
+ };
2091
+ var ParameterStoreClient_default = new ParameterStore();
2092
+
2064
2093
  // src/errorcodes.ts
2065
2094
  var errorcodes_exports = {};
2066
2095
  __export(errorcodes_exports, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amohamud23/notihub",
3
- "version": "1.1.58",
3
+ "version": "1.1.60",
4
4
  "description": "Notihub Package",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.cts",
@@ -32,6 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@aws-sdk/client-dynamodb": "^3.821.0",
35
+ "@aws-sdk/client-ssm": "^3.939.0",
35
36
  "@aws-sdk/lib-dynamodb": "^3.821.0",
36
37
  "aws-sdk-client-mock": "^4.1.0",
37
38
  "date-fns": "^4.1.0",