@amohamud23/notihub 1.0.178 → 1.0.179

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
@@ -173,14 +173,21 @@ var DocumentNotFoundException = class _DocumentNotFoundException extends Error {
173
173
  var import_client_dynamodb = require("@aws-sdk/client-dynamodb");
174
174
  var import_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
175
175
  var isOffline = process.env.IS_OFFLINE === "true";
176
- var ddbClient = new import_client_dynamodb.DynamoDBClient({
177
- region: "localhost",
178
- endpoint: "http://0.0.0.0:8000",
179
- credentials: {
180
- accessKeyId: "MockAccessKeyId",
181
- secretAccessKey: "MockSecretAccessKey"
182
- }
183
- });
176
+ var ddbClient;
177
+ if (isOffline) {
178
+ console.log("Running in offline mode");
179
+ ddbClient = new import_client_dynamodb.DynamoDBClient({
180
+ region: "localhost",
181
+ endpoint: "http://0.0.0.0:8000",
182
+ credentials: {
183
+ accessKeyId: "MockAccessKeyId",
184
+ secretAccessKey: "MockSecretAccessKey"
185
+ }
186
+ });
187
+ } else {
188
+ console.log("Running in production mode");
189
+ ddbClient = new import_client_dynamodb.DynamoDBClient();
190
+ }
184
191
  var ddbDocClient = import_lib_dynamodb.DynamoDBDocumentClient.from(ddbClient, {
185
192
  marshallOptions: {
186
193
  removeUndefinedValues: true
package/dist/index.js CHANGED
@@ -134,14 +134,21 @@ var DocumentNotFoundException = class _DocumentNotFoundException extends Error {
134
134
  import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
135
135
  import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
136
136
  var isOffline = process.env.IS_OFFLINE === "true";
137
- var ddbClient = new DynamoDBClient({
138
- region: "localhost",
139
- endpoint: "http://0.0.0.0:8000",
140
- credentials: {
141
- accessKeyId: "MockAccessKeyId",
142
- secretAccessKey: "MockSecretAccessKey"
143
- }
144
- });
137
+ var ddbClient;
138
+ if (isOffline) {
139
+ console.log("Running in offline mode");
140
+ ddbClient = new DynamoDBClient({
141
+ region: "localhost",
142
+ endpoint: "http://0.0.0.0:8000",
143
+ credentials: {
144
+ accessKeyId: "MockAccessKeyId",
145
+ secretAccessKey: "MockSecretAccessKey"
146
+ }
147
+ });
148
+ } else {
149
+ console.log("Running in production mode");
150
+ ddbClient = new DynamoDBClient();
151
+ }
145
152
  var ddbDocClient = DynamoDBDocumentClient.from(ddbClient, {
146
153
  marshallOptions: {
147
154
  removeUndefinedValues: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amohamud23/notihub",
3
- "version": "1.0.178",
3
+ "version": "1.0.179",
4
4
  "description": "Notihub Package",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.cts",