@develit-io/backend-sdk 5.11.1 → 5.11.2

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
@@ -426,8 +426,7 @@ const getPgDatabaseIdFromWrangler = () => {
426
426
  );
427
427
  }
428
428
  };
429
- const getPgCredentials = () => {
430
- const databaseId = getPgDatabaseIdFromWrangler() ?? "";
429
+ const getPgCredentials = (serviceName) => {
431
430
  if (isRemoteEnvironment()) {
432
431
  return {
433
432
  dbCredentials: {
@@ -435,6 +434,7 @@ const getPgCredentials = () => {
435
434
  }
436
435
  };
437
436
  } else {
437
+ const databaseId = serviceName ? `${serviceName}-db` : getPgDatabaseIdFromWrangler() ?? "";
438
438
  return {
439
439
  dbCredentials: {
440
440
  url: getPgLocalConnectionString(databaseId)
package/dist/index.d.cts CHANGED
@@ -282,7 +282,7 @@ declare const isInternalError: (error: unknown) => error is InternalError;
282
282
 
283
283
  declare const getPgLocalConnectionString: (id: string) => string;
284
284
  declare const getPgDatabaseIdFromWrangler: () => string | undefined;
285
- declare const getPgCredentials: () => {
285
+ declare const getPgCredentials: (serviceName?: string) => {
286
286
  dbCredentials: {
287
287
  url: string;
288
288
  };
package/dist/index.d.mts CHANGED
@@ -282,7 +282,7 @@ declare const isInternalError: (error: unknown) => error is InternalError;
282
282
 
283
283
  declare const getPgLocalConnectionString: (id: string) => string;
284
284
  declare const getPgDatabaseIdFromWrangler: () => string | undefined;
285
- declare const getPgCredentials: () => {
285
+ declare const getPgCredentials: (serviceName?: string) => {
286
286
  dbCredentials: {
287
287
  url: string;
288
288
  };
package/dist/index.d.ts CHANGED
@@ -282,7 +282,7 @@ declare const isInternalError: (error: unknown) => error is InternalError;
282
282
 
283
283
  declare const getPgLocalConnectionString: (id: string) => string;
284
284
  declare const getPgDatabaseIdFromWrangler: () => string | undefined;
285
- declare const getPgCredentials: () => {
285
+ declare const getPgCredentials: (serviceName?: string) => {
286
286
  dbCredentials: {
287
287
  url: string;
288
288
  };
package/dist/index.mjs CHANGED
@@ -404,8 +404,7 @@ const getPgDatabaseIdFromWrangler = () => {
404
404
  );
405
405
  }
406
406
  };
407
- const getPgCredentials = () => {
408
- const databaseId = getPgDatabaseIdFromWrangler() ?? "";
407
+ const getPgCredentials = (serviceName) => {
409
408
  if (isRemoteEnvironment()) {
410
409
  return {
411
410
  dbCredentials: {
@@ -413,6 +412,7 @@ const getPgCredentials = () => {
413
412
  }
414
413
  };
415
414
  } else {
415
+ const databaseId = serviceName ? `${serviceName}-db` : getPgDatabaseIdFromWrangler() ?? "";
416
416
  return {
417
417
  dbCredentials: {
418
418
  url: getPgLocalConnectionString(databaseId)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "5.11.1",
3
+ "version": "5.11.2",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",