@bucketco/tracking-sdk
Advanced tools
Comparing version 2.1.8 to 2.1.9
{ | ||
"name": "@bucketco/tracking-sdk", | ||
"version": "2.1.8", | ||
"version": "2.1.9", | ||
"license": "MIT", | ||
@@ -37,2 +37,3 @@ "private": false, | ||
"@types/node": "^20.4.4", | ||
"@types/jsdom": "^21.1.6", | ||
"@types/webpack": "^5.28.2", | ||
@@ -68,3 +69,3 @@ "@types/webpack-node-externals": "^3.0.0", | ||
"vitest": "^0.33.0", | ||
"webpack": "^5.88.2", | ||
"webpack": "^5.89.0", | ||
"webpack-cli": "^5.1.4", | ||
@@ -71,0 +72,0 @@ "webpack-node-externals": "^3.0.0" |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getAuthToken = exports.rememberAuthToken = exports.checkPromptMessageCompleted = exports.markPromptMessageCompleted = void 0; | ||
exports.forgetAuthToken = exports.getAuthToken = exports.rememberAuthToken = exports.checkPromptMessageCompleted = exports.markPromptMessageCompleted = void 0; | ||
const js_cookie_1 = __importDefault(require("js-cookie")); | ||
@@ -23,3 +23,3 @@ const markPromptMessageCompleted = (userId, promptId, expiresAt) => { | ||
const rememberAuthToken = (userId, channel, token, expiresAt) => { | ||
js_cookie_1.default.set(`bucket-token-${userId}`, `${channel}:${token}`, { | ||
js_cookie_1.default.set(`bucket-token-${userId}`, JSON.stringify({ channel, token }), { | ||
expires: expiresAt, | ||
@@ -36,12 +36,21 @@ sameSite: "strict", | ||
} | ||
const [channel, token] = val.split(":"); | ||
if (!(channel === null || channel === void 0 ? void 0 : channel.length) || !(token === null || token === void 0 ? void 0 : token.length)) { | ||
try { | ||
const { channel, token } = JSON.parse(val); | ||
if (!(channel === null || channel === void 0 ? void 0 : channel.length) || !(token === null || token === void 0 ? void 0 : token.length)) { | ||
return undefined; | ||
} | ||
return { | ||
channel, | ||
token, | ||
}; | ||
} | ||
catch (e) { | ||
return undefined; | ||
} | ||
return { | ||
channel, | ||
token, | ||
}; | ||
}; | ||
exports.getAuthToken = getAuthToken; | ||
const forgetAuthToken = (userId) => { | ||
js_cookie_1.default.remove(`bucket-token-${userId}`); | ||
}; | ||
exports.forgetAuthToken = forgetAuthToken; | ||
//# sourceMappingURL=prompt-storage.js.map |
@@ -19,4 +19,4 @@ "use strict"; | ||
const prompt_storage_1 = require("./prompt-storage"); | ||
const ABLY_TOKEN_ERROR_MIN = 40140; | ||
const ABLY_TOKEN_ERROR_MAX = 40149; | ||
const ABLY_TOKEN_ERROR_MIN = 40000; | ||
const ABLY_TOKEN_ERROR_MAX = 49999; | ||
class AblySSEChannel { | ||
@@ -109,2 +109,3 @@ constructor(userId, channel, ablyAuthUrl, sseHost, messageHandler, options) { | ||
this.log("event source token expired, refresh required"); | ||
(0, prompt_storage_1.forgetAuthToken)(this.userId); | ||
} | ||
@@ -111,0 +112,0 @@ } |
@@ -8,1 +8,2 @@ export declare const markPromptMessageCompleted: (userId: string, promptId: string, expiresAt: Date) => void; | ||
} | undefined; | ||
export declare const forgetAuthToken: (userId: string) => void; |
{ | ||
"name": "@bucketco/tracking-sdk", | ||
"version": "2.1.8", | ||
"version": "2.1.9", | ||
"license": "MIT", | ||
@@ -37,2 +37,3 @@ "private": false, | ||
"@types/node": "^20.4.4", | ||
"@types/jsdom": "^21.1.6", | ||
"@types/webpack": "^5.28.2", | ||
@@ -68,3 +69,3 @@ "@types/webpack-node-externals": "^3.0.0", | ||
"vitest": "^0.33.0", | ||
"webpack": "^5.88.2", | ||
"webpack": "^5.89.0", | ||
"webpack-cli": "^5.1.4", | ||
@@ -71,0 +72,0 @@ "webpack-node-externals": "^3.0.0" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
359855
2428
0
40