@rh-support/utils 0.2.10 → 0.2.11

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.
@@ -2,6 +2,7 @@ declare enum APP_HOST_NAMES {
2
2
  supportHubHostName = "supportHubHostName"
3
3
  }
4
4
  declare const getAppHostName: (appName: APP_HOST_NAMES) => string;
5
- declare const getSHCaseLink: (caseNumber: string) => string;
6
- export { getAppHostName, APP_HOST_NAMES, getSHCaseLink };
5
+ declare const getSFDCEnv: () => string;
6
+ declare const getSFDCSecureSupportCaseLink: (caseNumber: string) => string;
7
+ export { getAppHostName, APP_HOST_NAMES, getSFDCEnv, getSFDCSecureSupportCaseLink };
7
8
  //# sourceMappingURL=hostNameUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hostNameUtils.d.ts","sourceRoot":"","sources":["../../src/hostNameUtils.ts"],"names":[],"mappings":"AAAA,aAAK,cAAc;IACf,kBAAkB,uBAAuB;CAC5C;AAMD,QAAA,MAAM,cAAc,YAAa,cAAc,WAE9C,CAAC;AAEF,QAAA,MAAM,aAAa,eAAgB,MAAM,WAExC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"hostNameUtils.d.ts","sourceRoot":"","sources":["../../src/hostNameUtils.ts"],"names":[],"mappings":"AAEA,aAAK,cAAc;IACf,kBAAkB,uBAAuB;CAC5C;AAMD,QAAA,MAAM,cAAc,YAAa,cAAc,WAE9C,CAAC;AAEF,QAAA,MAAM,UAAU,cAoBf,CAAC;AAEF,QAAA,MAAM,4BAA4B,eAAgB,MAAM,WAGvD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,4BAA4B,EAAE,CAAC"}
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  var _a;
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getSHCaseLink = exports.APP_HOST_NAMES = exports.getAppHostName = void 0;
4
+ exports.getSFDCSecureSupportCaseLink = exports.getSFDCEnv = exports.APP_HOST_NAMES = exports.getAppHostName = void 0;
5
+ var hydrajs_1 = require("@cee-eng/hydrajs");
5
6
  var APP_HOST_NAMES;
6
7
  (function (APP_HOST_NAMES) {
7
8
  APP_HOST_NAMES["supportHubHostName"] = "supportHubHostName";
@@ -14,7 +15,29 @@ var getAppHostName = function (appName) {
14
15
  return APP_URLS[appName];
15
16
  };
16
17
  exports.getAppHostName = getAppHostName;
17
- var getSHCaseLink = function (caseNumber) {
18
- return getAppHostName(APP_HOST_NAMES.supportHubHostName) + "/#/case/" + caseNumber;
18
+ var getSFDCEnv = function () {
19
+ var env = hydrajs_1.Env.getEnvName();
20
+ // Prod HostName
21
+ var hostName = 'gss.my.salesforce.com';
22
+ switch (env) {
23
+ case hydrajs_1.Env.EnvNames.QA:
24
+ hostName = 'gss--qa.cs53.my.salesforce.com';
25
+ break;
26
+ case hydrajs_1.Env.EnvNames.STAGE:
27
+ hostName = 'gss--stage2.cs70.my.salesforce.com';
28
+ break;
29
+ case hydrajs_1.Env.EnvNames.PROD_BETA:
30
+ case hydrajs_1.Env.EnvNames.PROD:
31
+ hostName = 'gss.my.salesforce.com';
32
+ break;
33
+ default:
34
+ hostName = 'gss.my.salesforce.com';
35
+ }
36
+ return hostName;
19
37
  };
20
- exports.getSHCaseLink = getSHCaseLink;
38
+ exports.getSFDCEnv = getSFDCEnv;
39
+ var getSFDCSecureSupportCaseLink = function (caseNumber) {
40
+ var hostName = getSFDCEnv();
41
+ return "https://" + hostName + "/apex/Support#/cases/" + caseNumber;
42
+ };
43
+ exports.getSFDCSecureSupportCaseLink = getSFDCSecureSupportCaseLink;
@@ -2,6 +2,7 @@ declare enum APP_HOST_NAMES {
2
2
  supportHubHostName = "supportHubHostName"
3
3
  }
4
4
  declare const getAppHostName: (appName: APP_HOST_NAMES) => string;
5
- declare const getSHCaseLink: (caseNumber: string) => string;
6
- export { getAppHostName, APP_HOST_NAMES, getSHCaseLink };
5
+ declare const getSFDCEnv: () => string;
6
+ declare const getSFDCSecureSupportCaseLink: (caseNumber: string) => string;
7
+ export { getAppHostName, APP_HOST_NAMES, getSFDCEnv, getSFDCSecureSupportCaseLink };
7
8
  //# sourceMappingURL=hostNameUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hostNameUtils.d.ts","sourceRoot":"","sources":["../../src/hostNameUtils.ts"],"names":[],"mappings":"AAAA,aAAK,cAAc;IACf,kBAAkB,uBAAuB;CAC5C;AAMD,QAAA,MAAM,cAAc,YAAa,cAAc,WAE9C,CAAC;AAEF,QAAA,MAAM,aAAa,eAAgB,MAAM,WAExC,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"hostNameUtils.d.ts","sourceRoot":"","sources":["../../src/hostNameUtils.ts"],"names":[],"mappings":"AAEA,aAAK,cAAc;IACf,kBAAkB,uBAAuB;CAC5C;AAMD,QAAA,MAAM,cAAc,YAAa,cAAc,WAE9C,CAAC;AAEF,QAAA,MAAM,UAAU,cAoBf,CAAC;AAEF,QAAA,MAAM,4BAA4B,eAAgB,MAAM,WAGvD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,4BAA4B,EAAE,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { Env } from '@cee-eng/hydrajs';
1
2
  var APP_HOST_NAMES;
2
3
  (function (APP_HOST_NAMES) {
3
4
  APP_HOST_NAMES["supportHubHostName"] = "supportHubHostName";
@@ -8,7 +9,28 @@ const APP_URLS = {
8
9
  const getAppHostName = (appName) => {
9
10
  return APP_URLS[appName];
10
11
  };
11
- const getSHCaseLink = (caseNumber) => {
12
- return `${getAppHostName(APP_HOST_NAMES.supportHubHostName)}/#/case/${caseNumber}`;
12
+ const getSFDCEnv = () => {
13
+ const env = Env.getEnvName();
14
+ // Prod HostName
15
+ let hostName = 'gss.my.salesforce.com';
16
+ switch (env) {
17
+ case Env.EnvNames.QA:
18
+ hostName = 'gss--qa.cs53.my.salesforce.com';
19
+ break;
20
+ case Env.EnvNames.STAGE:
21
+ hostName = 'gss--stage2.cs70.my.salesforce.com';
22
+ break;
23
+ case Env.EnvNames.PROD_BETA:
24
+ case Env.EnvNames.PROD:
25
+ hostName = 'gss.my.salesforce.com';
26
+ break;
27
+ default:
28
+ hostName = 'gss.my.salesforce.com';
29
+ }
30
+ return hostName;
13
31
  };
14
- export { getAppHostName, APP_HOST_NAMES, getSHCaseLink };
32
+ const getSFDCSecureSupportCaseLink = (caseNumber) => {
33
+ const hostName = getSFDCEnv();
34
+ return `https://${hostName}/apex/Support#/cases/${caseNumber}`;
35
+ };
36
+ export { getAppHostName, APP_HOST_NAMES, getSFDCEnv, getSFDCSecureSupportCaseLink };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rh-support/utils",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "> TODO: description",
5
5
  "author": "Vikas Rathee <vrathee@redhat.com>",
6
6
  "license": "ISC",
@@ -87,5 +87,5 @@
87
87
  "@types/react-dom": "^17.0.9",
88
88
  "moment-timezone": "^0.5.32"
89
89
  },
90
- "gitHead": "9a2829fecfe0e5755eacfb6f27b67271edb56e33"
90
+ "gitHead": "3dc034eff74761ebe67f6503a13ecf5a1d763071"
91
91
  }