studiokit-scaffolding-js 7.0.10-next.1.1 → 7.0.11-alpha.1
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/lib/utils/cookies.js +29 -4
- package/lib/utils/shard.js +11 -9
- package/package.json +1 -1
package/lib/utils/cookies.js
CHANGED
|
@@ -1,16 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
22
|
exports.getCookies = void 0;
|
|
23
|
+
var Sentry = __importStar(require("@sentry/react"));
|
|
4
24
|
/** Get the contents of `document.cookie` as a Record with string keys and values. */
|
|
5
25
|
var getCookies = function () {
|
|
6
26
|
var cookies = {};
|
|
7
27
|
if (document.cookie && document.cookie !== '') {
|
|
8
28
|
var cookieStrings = document.cookie.split(';');
|
|
9
29
|
cookieStrings.forEach(function (cookieString) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
30
|
+
try {
|
|
31
|
+
var cookieParts = cookieString.split('=');
|
|
32
|
+
var name_1 = decodeURIComponent(cookieParts[0].replace(/^ /, ''));
|
|
33
|
+
var value = decodeURIComponent(cookieParts[1]);
|
|
34
|
+
cookies[name_1] = value;
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
Sentry.captureException(error);
|
|
38
|
+
}
|
|
14
39
|
});
|
|
15
40
|
}
|
|
16
41
|
return cookies;
|
package/lib/utils/shard.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getShardKey = exports.isDemoShard = exports.isPurdueShard = void 0;
|
|
4
|
-
var lodash_1 = require("lodash");
|
|
7
|
+
var lodash_1 = __importDefault(require("lodash"));
|
|
5
8
|
var configuration_1 = require("../constants/configuration");
|
|
6
9
|
var shard_1 = require("../constants/shard");
|
|
7
10
|
var windowService_1 = require("../services/windowService");
|
|
@@ -19,16 +22,15 @@ function getShardKey(host, localhostShardKey) {
|
|
|
19
22
|
var finalHost = host || location.host;
|
|
20
23
|
var finalLocalhostShardKey = localhostShardKey || appConfig.LOCALHOST_SHARD_KEY;
|
|
21
24
|
var rootDomain = appConfig.ROOT_DOMAIN;
|
|
22
|
-
if (lodash_1.startsWith(finalHost, 'localhost') && !!finalLocalhostShardKey) {
|
|
25
|
+
if (lodash_1.default.startsWith(finalHost, 'localhost') && !!finalLocalhostShardKey) {
|
|
23
26
|
return finalLocalhostShardKey;
|
|
24
27
|
}
|
|
25
|
-
if (lodash_1.startsWith(finalHost, 'localhost') ||
|
|
26
|
-
lodash_1.includes(finalHost, 'azurewebsites.net') ||
|
|
27
|
-
lodash_1.includes(finalHost, 'web.core.windows.net') ||
|
|
28
|
-
lodash_1.includes(finalHost, 'azureedge.net') ||
|
|
29
|
-
lodash_1.includes(finalHost, 'azurefd.net') ||
|
|
30
|
-
lodash_1.includes(finalHost, '
|
|
31
|
-
lodash_1.includes(finalHost, 'ngrok.io')) {
|
|
28
|
+
if (lodash_1.default.startsWith(finalHost, 'localhost') ||
|
|
29
|
+
lodash_1.default.includes(finalHost, 'azurewebsites.net') ||
|
|
30
|
+
lodash_1.default.includes(finalHost, 'web.core.windows.net') ||
|
|
31
|
+
lodash_1.default.includes(finalHost, 'azureedge.net') ||
|
|
32
|
+
lodash_1.default.includes(finalHost, 'z01.azurefd.net') ||
|
|
33
|
+
lodash_1.default.includes(finalHost, 'ngrok.io')) {
|
|
32
34
|
return shard_1.SHARD.PURDUE;
|
|
33
35
|
}
|
|
34
36
|
var urlParts = finalHost.split('.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "studiokit-scaffolding-js",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.11-alpha.1",
|
|
4
4
|
"description": "Common scaffolding for Studio apps at Purdue",
|
|
5
5
|
"repository": "https://gitlab.com/purdue-informatics/studiokit/studiokit-scaffolding-js",
|
|
6
6
|
"license": "MIT",
|