tering-serieuze-sdk 3.13.2 → 3.13.3
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/biome.json +2 -1
- package/dist/index.mjs +9 -2
- package/dist/index.mjs.map +2 -2
- package/package.json +7 -5
- package/src/api/auth.ts +8 -1
- package/src/cache/abstractCache.ts +1 -1
- package/src/index.ts +1 -1
- package/tsconfig.json +12 -3
package/biome.json
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
"$schema": "https://biomejs.dev/schemas/2.1.2/schema.json",
|
|
3
3
|
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
|
|
4
4
|
"files": {
|
|
5
|
-
"includes": ["**/*.ts", "**/*.js", "**/*.mts", "**/*.json", "**/*.md", "!package*.json"]
|
|
5
|
+
"includes": ["**/*.ts", "**/*.js", "**/*.mts", "**/*.json", "**/*.md", "!package*.json"],
|
|
6
|
+
"experimentalScannerIgnores": ["dist"]
|
|
6
7
|
},
|
|
7
8
|
"formatter": {
|
|
8
9
|
"enabled": true,
|
package/dist/index.mjs
CHANGED
|
@@ -23,9 +23,16 @@ var BaseModule = class {
|
|
|
23
23
|
function parseJwt(token) {
|
|
24
24
|
let jsonPayload = "";
|
|
25
25
|
if (typeof Buffer !== "undefined") {
|
|
26
|
-
|
|
26
|
+
const payload = token.split(".")?.[1];
|
|
27
|
+
if (!payload) {
|
|
28
|
+
throw new Error("Invalid token");
|
|
29
|
+
}
|
|
30
|
+
jsonPayload = Buffer.from(payload, "base64").toString();
|
|
27
31
|
} else {
|
|
28
32
|
const base64Url = token.split(".")[1];
|
|
33
|
+
if (!base64Url) {
|
|
34
|
+
throw new Error("Invalid token");
|
|
35
|
+
}
|
|
29
36
|
const base64 = base64Url.replace(/-/g, "+").replace(/_/g, "/");
|
|
30
37
|
jsonPayload = decodeURIComponent(
|
|
31
38
|
window.atob(base64).split("").map((c) => "%" + ("00" + c.charCodeAt(0).toString(16)).slice(-2)).join("")
|
|
@@ -144,7 +151,7 @@ var AbstractCache = class {
|
|
|
144
151
|
if (trace.length < 3) {
|
|
145
152
|
throw new Error(errorMessage);
|
|
146
153
|
}
|
|
147
|
-
const functionName = get()[2]
|
|
154
|
+
const functionName = get()?.[2]?.getFunctionName();
|
|
148
155
|
if (!functionName) {
|
|
149
156
|
throw new Error(errorMessage);
|
|
150
157
|
}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/api/base.ts", "../src/api/auth.ts", "../node_modules/stack-trace/index.js", "../src/cache/abstractCache.ts", "../src/cache/cookieCache.ts", "../src/cache/filesystemCache.ts", "../src/cache/nullCache.ts", "../src/cache/onePasswordCache.ts", "../src/api/jingle.ts", "../src/api/k8s.ts", "../src/api/user.ts", "../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { AbstractCache } from '../cache';\nimport { TssApi } from '../index';\n\nexport class BaseModule {\n constructor(\n protected api: TssApi,\n protected cache: AbstractCache,\n ) {}\n\n public getCache() {\n return this.cache;\n }\n\n public setCache(cache: AbstractCache) {\n this.cache = cache;\n }\n}\n", "import type {\n AuthenticationResponseJSON,\n PublicKeyCredentialCreationOptionsJSON,\n RegistrationResponseJSON,\n} from '@simplewebauthn/types';\nimport { AuthenticationOptionsDto, type FrontendTokenContent, VerificationResponseDto } from 'tering-serieuze-types';\nimport { BaseModule } from './base';\n\nexport function parseJwt<T>(token: string): T {\n let jsonPayload = '';\n\n if (typeof Buffer !== 'undefined') {\n jsonPayload = Buffer.from(token.split('.')[1], 'base64').toString();\n } else {\n const base64Url = token.split('.')[1];\n const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');\n jsonPayload = decodeURIComponent(\n window\n .atob(base64)\n .split('')\n // biome-ignore lint/style/useTemplate: Hier wel handig\n .map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))\n .join(''),\n );\n }\n\n return JSON.parse(jsonPayload) as T;\n}\n\nexport class AuthModule extends BaseModule {\n public static cacheKey = 'TSS-TOKEN';\n\n getToken(): Promise<string | undefined> {\n return process.env.TSS_TOKEN ? Promise.resolve(process.env.TSS_TOKEN) : this.cache.get(AuthModule.cacheKey);\n }\n\n setToken(token: string, lifetime?: number) {\n return this.cache.set(AuthModule.cacheKey, token, lifetime);\n }\n\n removeToken() {\n return this.cache.remove(AuthModule.cacheKey);\n }\n\n async getSessionId() {\n const token = await this.getToken();\n const { sessionId } = parseJwt<FrontendTokenContent>(token ?? '');\n return sessionId;\n }\n\n async removeSession(sessionId?: string) {\n const session = sessionId ?? (await this.getSessionId());\n await this.api.delete(`session/${session}`, { credentials: 'include' });\n }\n\n async logout() {\n await this.removeSession();\n this.removeToken();\n }\n\n getRegistrationOptions(registrationToken: string) {\n return this.api.get<PublicKeyCredentialCreationOptionsJSON>(`auth/registration-options/${registrationToken}`);\n }\n\n getAuthenticationOptions() {\n return this.api.get<AuthenticationOptionsDto>('auth/authentication-options');\n }\n\n verifyRegistration(registrationToken: string, registrationResponse: RegistrationResponseJSON) {\n return this.api.post<VerificationResponseDto>(\n `auth/verify-registration/${registrationToken}`,\n registrationResponse,\n { credentials: 'include' },\n );\n }\n\n verifyAuthentication(token: string, response: AuthenticationResponseJSON) {\n return this.api.post<VerificationResponseDto>(`auth/verify-authentication/${token}`, response, {\n credentials: 'include',\n });\n }\n}\n", "export function get(belowFn) {\r\n const oldLimit = Error.stackTraceLimit;\r\n Error.stackTraceLimit = Infinity;\r\n\r\n const dummyObject = {};\r\n\r\n const v8Handler = Error.prepareStackTrace;\r\n Error.prepareStackTrace = function(dummyObject, v8StackTrace) {\r\n return v8StackTrace;\r\n };\r\n Error.captureStackTrace(dummyObject, belowFn || get);\r\n\r\n const v8StackTrace = dummyObject.stack;\r\n Error.prepareStackTrace = v8Handler;\r\n Error.stackTraceLimit = oldLimit;\r\n\r\n return v8StackTrace;\r\n}\r\n\r\nexport function parse(err) {\r\n if (!err.stack) {\r\n return [];\r\n }\r\n\r\n const lines = err.stack.split('\\n').slice(1);\r\n return lines\r\n .map(function(line) {\r\n if (line.match(/^\\s*[-]{4,}$/)) {\r\n return createParsedCallSite({\r\n fileName: line,\r\n lineNumber: null,\r\n functionName: null,\r\n typeName: null,\r\n methodName: null,\r\n columnNumber: null,\r\n 'native': null,\r\n });\r\n }\r\n\r\n const lineMatch = line.match(/at (?:(.+?)\\s+\\()?(?:(.+?):(\\d+)(?::(\\d+))?|([^)]+))\\)?/);\r\n if (!lineMatch) {\r\n return;\r\n }\r\n\r\n let object = null;\r\n let method = null;\r\n let functionName = null;\r\n let typeName = null;\r\n let methodName = null;\r\n let isNative = (lineMatch[5] === 'native');\r\n\r\n if (lineMatch[1]) {\r\n functionName = lineMatch[1];\r\n let methodStart = functionName.lastIndexOf('.');\r\n if (functionName[methodStart-1] == '.')\r\n methodStart--;\r\n if (methodStart > 0) {\r\n object = functionName.substr(0, methodStart);\r\n method = functionName.substr(methodStart + 1);\r\n const objectEnd = object.indexOf('.Module');\r\n if (objectEnd > 0) {\r\n functionName = functionName.substr(objectEnd + 1);\r\n object = object.substr(0, objectEnd);\r\n }\r\n }\r\n }\r\n\r\n if (method) {\r\n typeName = object;\r\n methodName = method;\r\n }\r\n\r\n if (method === '<anonymous>') {\r\n methodName = null;\r\n functionName = null;\r\n }\r\n\r\n const properties = {\r\n fileName: lineMatch[2] || null,\r\n lineNumber: parseInt(lineMatch[3], 10) || null,\r\n functionName: functionName,\r\n typeName: typeName,\r\n methodName: methodName,\r\n columnNumber: parseInt(lineMatch[4], 10) || null,\r\n 'native': isNative,\r\n };\r\n\r\n return createParsedCallSite(properties);\r\n })\r\n .filter(function(callSite) {\r\n return !!callSite;\r\n });\r\n}\r\n\r\nfunction CallSite(properties) {\r\n for (const property in properties) {\r\n this[property] = properties[property];\r\n }\r\n}\r\n\r\nconst strProperties = [\r\n 'this',\r\n 'typeName',\r\n 'functionName',\r\n 'methodName',\r\n 'fileName',\r\n 'lineNumber',\r\n 'columnNumber',\r\n 'function',\r\n 'evalOrigin'\r\n];\r\n\r\nconst boolProperties = [\r\n 'topLevel',\r\n 'eval',\r\n 'native',\r\n 'constructor'\r\n];\r\n\r\nstrProperties.forEach(function (property) {\r\n CallSite.prototype[property] = null;\r\n CallSite.prototype['get' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nboolProperties.forEach(function (property) {\r\n CallSite.prototype[property] = false;\r\n CallSite.prototype['is' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nfunction createParsedCallSite(properties) {\r\n return new CallSite(properties);\r\n}\r\n", "import { get } from 'stack-trace';\n\nexport enum CacheLifetime {\n Day = 60 * 60 * 24 * 1000,\n Week = 60 * 60 * 24 * 7 * 1000,\n}\n\nexport abstract class AbstractCache {\n constructor(protected cacheName: string) {}\n\n public abstract cacheOrGet<T>(callbackWhenEmpty: () => Promise<T>, key?: string, lifetime?: number): Promise<T>;\n\n public abstract get<T>(key: string): Promise<T | undefined>;\n\n public abstract set<T>(key: string, value: T, lifetime?: number): void;\n\n public abstract remove(key: string): void;\n\n public abstract clear(): void;\n\n public getCacheKey(): string {\n const errorMessage = 'Could not determine cache key. Please provide a key manually.';\n const trace = get();\n if (trace.length < 3) {\n throw new Error(errorMessage);\n }\n\n const functionName = get()[2].getFunctionName();\n if (!functionName) {\n throw new Error(errorMessage);\n }\n\n return functionName;\n }\n}\n", "/** biome-ignore-all lint/suspicious/noDocumentCookie: Hier mag het hoor */\nimport { AbstractCache } from './abstractCache';\n\nexport class CookieCache extends AbstractCache {\n public cacheOrGet<T>(): Promise<T> {\n throw new Error('Not implemented, use get() and set()');\n }\n\n public get<T>(key: string): Promise<T | undefined> {\n if (document.cookie.includes(`${key}=`)) {\n return Promise.resolve(document.cookie.split(`${key}=`)[1]?.split(';')[0] as T);\n }\n\n return Promise.resolve(undefined);\n }\n\n public set<T>(key: string, value: T, lifetime?: number): void {\n const expires = lifetime ? new Date(Date.now() + lifetime).toUTCString() : '';\n document.cookie = `${key}=${value}; expires=${expires}; path=/; samesite=strict; secure`;\n }\n\n public remove(key: string): void {\n document.cookie = `${key}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;\n }\n\n public clear(): void {\n throw new Error('Not implemented, use remove()');\n }\n}\n", "import fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { AbstractCache } from './abstractCache';\n\ntype CacheItem<T> = {\n value: T;\n expiresAt?: number;\n};\n\nexport class FilesystemCache<T = unknown> extends AbstractCache {\n protected initialized = false;\n\n protected state = new Map<string, CacheItem<T>>();\n\n public async cacheOrGet<T>(callbackWhenEmpty: () => Promise<T>, key?: string, lifetime?: number): Promise<T> {\n const usedKey = key ?? this.getCacheKey();\n\n const cachedValue = await this.get<T>(usedKey);\n if (cachedValue) {\n return cachedValue;\n }\n\n const result = await callbackWhenEmpty();\n this.set(usedKey, result, lifetime);\n return result;\n }\n\n public get<T>(key: string): Promise<T | undefined> {\n if (!this.initialized) {\n this._initialize();\n }\n\n const item = this.state.get(key);\n\n if (item) {\n const expires = item.expiresAt;\n if (expires === undefined || expires > Date.now()) {\n return Promise.resolve(item.value as unknown as T);\n }\n }\n\n return Promise.resolve(undefined);\n }\n\n public set<T>(key: string, value: T, lifetime?: number): void {\n const expiresAt = lifetime ? Date.now() + lifetime : undefined;\n\n // 'content' is typed as the Method's T\n const content: CacheItem<T> = { value };\n if (expiresAt) {\n content.expiresAt = expiresAt;\n }\n\n // biome-ignore lint/suspicious/noExplicitAny: hier mag alles\n this.state.set(key, content as any);\n\n this.writeState();\n }\n\n public remove(key: string): void {\n this.state.delete(key);\n this.writeState();\n }\n\n public clear(): void {\n this.state.clear();\n if (fs.existsSync(this.getFilePath())) {\n fs.unlinkSync(this.getFilePath());\n }\n }\n\n public getFilePath() {\n return path.join(os.homedir(), '.tss', `${this.cacheName}.json`);\n }\n\n protected _initialize() {\n this.initialized = true;\n if (fs.existsSync(this.getFilePath())) {\n try {\n const fileContent = fs.readFileSync(this.getFilePath(), 'utf8');\n const parsed = JSON.parse(fileContent);\n this.state = new Map(Object.entries(parsed)) as Map<string, CacheItem<T>>;\n } catch (_e) {\n this.state = new Map();\n }\n }\n }\n\n protected writeState() {\n if (!fs.existsSync(path.dirname(this.getFilePath()))) {\n fs.mkdirSync(path.dirname(this.getFilePath()), { recursive: true });\n }\n\n const plainObject = Object.fromEntries(this.state);\n fs.writeFileSync(this.getFilePath(), JSON.stringify(plainObject));\n }\n}\n", "import { AbstractCache } from './abstractCache';\n\nexport class NullCache extends AbstractCache {\n public cacheOrGet<T>(callbackWhenEmpty: () => Promise<T>): Promise<T> {\n return callbackWhenEmpty();\n }\n\n public get<T>(): Promise<T | undefined> {\n return Promise.resolve(undefined);\n }\n\n public set(): void {\n // void\n }\n\n public remove(): void {\n // void\n }\n\n public clear(): void {\n // void\n }\n}\n", "import child_process from 'node:child_process';\nimport util from 'node:util';\nimport { AbstractCache } from './abstractCache';\n\n// TODO error handling en lifetime\nexport class OnePasswordCache extends AbstractCache {\n protected asyncExec = util.promisify(child_process.exec);\n\n public cacheOrGet<T>(): Promise<T> {\n throw new Error('Not implemented, use get() and set()');\n }\n\n public async get<T>(key: string): Promise<T | undefined> {\n const { stdout, stderr } = await this.asyncExec(`op item get \"${key}\" --fields label=credential --format json`);\n\n if (stderr) {\n console.log(stderr);\n throw new Error('ERROR');\n }\n\n return JSON.parse(stdout).value;\n }\n\n public async set<T>(key: string, value: T): Promise<void> {\n let action = `op item edit '${key}' 'credential=${value}'`;\n\n try {\n await this.get(key);\n } catch (_e) {\n action = `op item create --category=\"API Credential\" --title ${key} 'credential=${value}'`;\n }\n\n const { stderr } = await this.asyncExec(action);\n\n if (stderr) {\n console.log(stderr);\n throw new Error('ERROR');\n }\n }\n\n public async remove(key: string): Promise<void> {\n await this.asyncExec(`op item delete '${key}'`);\n }\n\n public clear(): void {\n // Loopje maken en heel 1password leeg maken?\n }\n}\n", "import type { BigBrotherItem, Jingle, JingleFolder, PlayJingleDto } from 'tering-serieuze-types';\nimport { CacheLifetime } from '../cache';\nimport { BaseModule } from './base';\n\nexport class JingleModule extends BaseModule {\n getGrouped(): Promise<JingleFolder[]> {\n return this.cache.cacheOrGet(\n () => {\n return this.api.get<JingleFolder[]>('jingle/grouped');\n },\n 'getGrouped',\n CacheLifetime.Day,\n );\n }\n\n getAll(): Promise<Jingle[]> {\n return this.cache.cacheOrGet(\n () => {\n return this.api.get<Jingle[]>('jingle');\n },\n 'getAll',\n CacheLifetime.Day,\n );\n }\n\n async getRecentlyAdded(): Promise<Jingle[]> {\n const jingles = await this.getAll();\n return jingles.sort((a, b) => b.mtime - a.mtime).slice(0, 30);\n }\n\n play(playJingleDto: PlayJingleDto): Promise<{ success: boolean }> {\n console.log(`Playing jingle ${playJingleDto.folder}/${playJingleDto.file}`);\n return this.api.post<{ success: boolean }>('jingle/play', playJingleDto);\n }\n\n getBigBrotherData(): Promise<BigBrotherItem[]> {\n return this.api.get<BigBrotherItem[]>('jingle/bigbrother');\n }\n\n async find(query: string, jingles: Jingle[] = []): Promise<Jingle[]> {\n const items = jingles.length > 0 ? jingles : await this.getAll();\n\n const queryParts = query.split(' ');\n const matches = items.filter((jingle) =>\n queryParts.every((queryPart) => `${jingle.folder}/${jingle.file}`.includes(queryPart)),\n );\n\n return matches.sort((a, b) => {\n const aScore = a.keywords.filter((keyword) => query.includes(keyword)).length;\n const bScore = b.keywords.filter((keyword) => query.includes(keyword)).length;\n\n return bScore - aScore;\n });\n }\n}\n", "import type { Pod } from 'tering-serieuze-types';\nimport { BaseModule } from './base';\n\nexport class K8sModule extends BaseModule {\n getPods() {\n return this.api.get<Pod[]>('k8s');\n }\n\n async deletePod(podName: string) {\n return await this.api.delete(`k8s/${podName}`);\n }\n}\n", "import type { SetWindowStateDto, User } from 'tering-serieuze-types';\nimport { BaseModule } from './base';\n\nexport class UserModule extends BaseModule {\n async get(userId?: string) {\n return await this.cache.cacheOrGet(() => {\n const userIdParam = userId ? `/${userId}` : '';\n return this.api.get<User>(`user${userIdParam}`);\n });\n }\n\n async getAll() {\n return await this.cache.cacheOrGet(() => {\n return this.api.get<User[]>('user/all');\n });\n }\n\n async setWindowState(setWindowStateDto: SetWindowStateDto) {\n return await this.api.putPossibleEmptyResponse('user/windowState', setWindowStateDto);\n }\n}\n", "import type { Dto } from 'tering-serieuze-types';\nimport { AuthModule, JingleModule, K8sModule, UserModule } from './api';\nimport { AbstractCache, NullCache } from './cache';\n\nexport * from './api';\nexport * from './cache';\n\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n\nexport interface SDKRequestInit extends RequestInit {\n method?: HttpMethod;\n}\n\nexport enum CacheType {\n jingle = 'jingle',\n auth = 'auth',\n k8s = 'k8s',\n user = 'user',\n}\n\nexport type ApiConfiguration = {\n API_URL: string;\n};\n\nexport type CacheConfiguration = {\n [key in keyof typeof CacheType]?: AbstractCache;\n};\n\nexport class ErrorResponse extends Error {\n constructor(\n public readonly status: number,\n public readonly message: string,\n ) {\n super();\n }\n}\n\nexport class TssApi {\n auth: AuthModule;\n jingle: JingleModule;\n k8s: K8sModule;\n user: UserModule;\n\n constructor(\n protected readonly apiConfiguration: ApiConfiguration,\n cacheConfiguration?: CacheConfiguration,\n ) {\n this.jingle = new JingleModule(this, cacheConfiguration?.jingle ?? new NullCache('jingle'));\n this.auth = new AuthModule(this, cacheConfiguration?.auth ?? new NullCache('auth'));\n this.k8s = new K8sModule(this, cacheConfiguration?.k8s ?? new NullCache('k8s'));\n this.user = new UserModule(this, cacheConfiguration?.user ?? new NullCache('user'));\n }\n\n async fetch(url: string, config: SDKRequestInit = {}) {\n config.method = config.method ?? 'GET';\n config.headers = {\n ...config.headers,\n Authorization: `Bearer ${await this.auth.getToken()}`,\n };\n\n // @ts-ignore\n if (!config.headers['Content-Type']) {\n // @ts-ignore\n config.headers['Content-Type'] = config.body ? 'application/json' : 'text/plain';\n }\n\n const apiPrefix = this.apiConfiguration.API_URL;\n\n if (apiPrefix.match(/^https?:\\/\\/localhost/) !== null && typeof process !== 'undefined' && process.env) {\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';\n }\n\n const fullUrl = `${apiPrefix}/api/${url}`;\n console.log('Fetching url', fullUrl);\n\n let response: Response;\n try {\n response = await fetch(fullUrl, config);\n } catch (_e) {\n throw new ErrorResponse(503, 'API erg dood');\n }\n\n if (response.status >= 400) {\n const error = await response.json();\n throw new ErrorResponse(error.statusCode, error.message ?? error.error);\n }\n\n return response;\n }\n\n protected fetchPossibleEmptyResponse(method: HttpMethod, url: string, dto: Dto, config: SDKRequestInit = {}) {\n return this.fetch(url, {\n method,\n ...config,\n body: JSON.stringify(dto),\n });\n }\n\n async get<T>(url: string): Promise<T> {\n const response = await this.fetch(url);\n return (await response.json()) as Promise<T>;\n }\n\n async post<T>(url: string, dto: Dto, config: SDKRequestInit = {}) {\n const response = await this.fetchPossibleEmptyResponse('POST', url, dto, config);\n if (response === undefined) {\n throw new Error('Response was undefined');\n }\n return (await response.json()) as Promise<T>;\n }\n\n postPossibleEmptyResponse(url: string, dto: Dto) {\n return this.fetchPossibleEmptyResponse('POST', url, dto);\n }\n\n async put<T>(url: string, dto: Dto) {\n const response = await this.fetchPossibleEmptyResponse('PUT', url, dto);\n if (response === undefined) {\n throw new Error('Response was undefined');\n }\n return (await response.json()) as Promise<T>;\n }\n\n putPossibleEmptyResponse(url: string, dto: Dto) {\n return this.fetchPossibleEmptyResponse('PUT', url, dto);\n }\n\n delete(url: string, config: SDKRequestInit = {}) {\n return this.fetch(url, {\n method: 'DELETE',\n ...config,\n });\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAGO,IAAM,aAAN,MAAiB;AAAA,EACpB,YACc,KACA,OACZ;AAFY;AACA;AAAA,EACX;AAAA,EAEI,WAAW;AACd,WAAO,KAAK;AAAA,EAChB;AAAA,EAEO,SAAS,OAAsB;AAClC,SAAK,QAAQ;AAAA,EACjB;AACJ;;;ACRO,SAAS,SAAY,OAAkB;AAC1C,MAAI,cAAc;AAElB,MAAI,OAAO,WAAW,aAAa;AAC/B,
|
|
4
|
+
"sourcesContent": ["import { AbstractCache } from '../cache';\nimport { TssApi } from '../index';\n\nexport class BaseModule {\n constructor(\n protected api: TssApi,\n protected cache: AbstractCache,\n ) {}\n\n public getCache() {\n return this.cache;\n }\n\n public setCache(cache: AbstractCache) {\n this.cache = cache;\n }\n}\n", "import type {\n AuthenticationResponseJSON,\n PublicKeyCredentialCreationOptionsJSON,\n RegistrationResponseJSON,\n} from '@simplewebauthn/types';\nimport { AuthenticationOptionsDto, type FrontendTokenContent, VerificationResponseDto } from 'tering-serieuze-types';\nimport { BaseModule } from './base';\n\nexport function parseJwt<T>(token: string): T {\n let jsonPayload = '';\n\n if (typeof Buffer !== 'undefined') {\n const payload = token.split('.')?.[1];\n if (!payload) {\n throw new Error('Invalid token');\n }\n jsonPayload = Buffer.from(payload, 'base64').toString();\n } else {\n const base64Url = token.split('.')[1];\n if (!base64Url) {\n throw new Error('Invalid token');\n }\n const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');\n jsonPayload = decodeURIComponent(\n window\n .atob(base64)\n .split('')\n // biome-ignore lint/style/useTemplate: Hier wel handig\n .map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))\n .join(''),\n );\n }\n\n return JSON.parse(jsonPayload) as T;\n}\n\nexport class AuthModule extends BaseModule {\n public static cacheKey = 'TSS-TOKEN';\n\n getToken(): Promise<string | undefined> {\n return process.env.TSS_TOKEN ? Promise.resolve(process.env.TSS_TOKEN) : this.cache.get(AuthModule.cacheKey);\n }\n\n setToken(token: string, lifetime?: number) {\n return this.cache.set(AuthModule.cacheKey, token, lifetime);\n }\n\n removeToken() {\n return this.cache.remove(AuthModule.cacheKey);\n }\n\n async getSessionId() {\n const token = await this.getToken();\n const { sessionId } = parseJwt<FrontendTokenContent>(token ?? '');\n return sessionId;\n }\n\n async removeSession(sessionId?: string) {\n const session = sessionId ?? (await this.getSessionId());\n await this.api.delete(`session/${session}`, { credentials: 'include' });\n }\n\n async logout() {\n await this.removeSession();\n this.removeToken();\n }\n\n getRegistrationOptions(registrationToken: string) {\n return this.api.get<PublicKeyCredentialCreationOptionsJSON>(`auth/registration-options/${registrationToken}`);\n }\n\n getAuthenticationOptions() {\n return this.api.get<AuthenticationOptionsDto>('auth/authentication-options');\n }\n\n verifyRegistration(registrationToken: string, registrationResponse: RegistrationResponseJSON) {\n return this.api.post<VerificationResponseDto>(\n `auth/verify-registration/${registrationToken}`,\n registrationResponse,\n { credentials: 'include' },\n );\n }\n\n verifyAuthentication(token: string, response: AuthenticationResponseJSON) {\n return this.api.post<VerificationResponseDto>(`auth/verify-authentication/${token}`, response, {\n credentials: 'include',\n });\n }\n}\n", "export function get(belowFn) {\r\n const oldLimit = Error.stackTraceLimit;\r\n Error.stackTraceLimit = Infinity;\r\n\r\n const dummyObject = {};\r\n\r\n const v8Handler = Error.prepareStackTrace;\r\n Error.prepareStackTrace = function(dummyObject, v8StackTrace) {\r\n return v8StackTrace;\r\n };\r\n Error.captureStackTrace(dummyObject, belowFn || get);\r\n\r\n const v8StackTrace = dummyObject.stack;\r\n Error.prepareStackTrace = v8Handler;\r\n Error.stackTraceLimit = oldLimit;\r\n\r\n return v8StackTrace;\r\n}\r\n\r\nexport function parse(err) {\r\n if (!err.stack) {\r\n return [];\r\n }\r\n\r\n const lines = err.stack.split('\\n').slice(1);\r\n return lines\r\n .map(function(line) {\r\n if (line.match(/^\\s*[-]{4,}$/)) {\r\n return createParsedCallSite({\r\n fileName: line,\r\n lineNumber: null,\r\n functionName: null,\r\n typeName: null,\r\n methodName: null,\r\n columnNumber: null,\r\n 'native': null,\r\n });\r\n }\r\n\r\n const lineMatch = line.match(/at (?:(.+?)\\s+\\()?(?:(.+?):(\\d+)(?::(\\d+))?|([^)]+))\\)?/);\r\n if (!lineMatch) {\r\n return;\r\n }\r\n\r\n let object = null;\r\n let method = null;\r\n let functionName = null;\r\n let typeName = null;\r\n let methodName = null;\r\n let isNative = (lineMatch[5] === 'native');\r\n\r\n if (lineMatch[1]) {\r\n functionName = lineMatch[1];\r\n let methodStart = functionName.lastIndexOf('.');\r\n if (functionName[methodStart-1] == '.')\r\n methodStart--;\r\n if (methodStart > 0) {\r\n object = functionName.substr(0, methodStart);\r\n method = functionName.substr(methodStart + 1);\r\n const objectEnd = object.indexOf('.Module');\r\n if (objectEnd > 0) {\r\n functionName = functionName.substr(objectEnd + 1);\r\n object = object.substr(0, objectEnd);\r\n }\r\n }\r\n }\r\n\r\n if (method) {\r\n typeName = object;\r\n methodName = method;\r\n }\r\n\r\n if (method === '<anonymous>') {\r\n methodName = null;\r\n functionName = null;\r\n }\r\n\r\n const properties = {\r\n fileName: lineMatch[2] || null,\r\n lineNumber: parseInt(lineMatch[3], 10) || null,\r\n functionName: functionName,\r\n typeName: typeName,\r\n methodName: methodName,\r\n columnNumber: parseInt(lineMatch[4], 10) || null,\r\n 'native': isNative,\r\n };\r\n\r\n return createParsedCallSite(properties);\r\n })\r\n .filter(function(callSite) {\r\n return !!callSite;\r\n });\r\n}\r\n\r\nfunction CallSite(properties) {\r\n for (const property in properties) {\r\n this[property] = properties[property];\r\n }\r\n}\r\n\r\nconst strProperties = [\r\n 'this',\r\n 'typeName',\r\n 'functionName',\r\n 'methodName',\r\n 'fileName',\r\n 'lineNumber',\r\n 'columnNumber',\r\n 'function',\r\n 'evalOrigin'\r\n];\r\n\r\nconst boolProperties = [\r\n 'topLevel',\r\n 'eval',\r\n 'native',\r\n 'constructor'\r\n];\r\n\r\nstrProperties.forEach(function (property) {\r\n CallSite.prototype[property] = null;\r\n CallSite.prototype['get' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nboolProperties.forEach(function (property) {\r\n CallSite.prototype[property] = false;\r\n CallSite.prototype['is' + property[0].toUpperCase() + property.substr(1)] = function () {\r\n return this[property];\r\n }\r\n});\r\n\r\nfunction createParsedCallSite(properties) {\r\n return new CallSite(properties);\r\n}\r\n", "import { get } from 'stack-trace';\n\nexport enum CacheLifetime {\n Day = 60 * 60 * 24 * 1000,\n Week = 60 * 60 * 24 * 7 * 1000,\n}\n\nexport abstract class AbstractCache {\n constructor(protected cacheName: string) {}\n\n public abstract cacheOrGet<T>(callbackWhenEmpty: () => Promise<T>, key?: string, lifetime?: number): Promise<T>;\n\n public abstract get<T>(key: string): Promise<T | undefined>;\n\n public abstract set<T>(key: string, value: T, lifetime?: number): void;\n\n public abstract remove(key: string): void;\n\n public abstract clear(): void;\n\n public getCacheKey(): string {\n const errorMessage = 'Could not determine cache key. Please provide a key manually.';\n const trace = get();\n if (trace.length < 3) {\n throw new Error(errorMessage);\n }\n\n const functionName = get()?.[2]?.getFunctionName();\n if (!functionName) {\n throw new Error(errorMessage);\n }\n\n return functionName;\n }\n}\n", "/** biome-ignore-all lint/suspicious/noDocumentCookie: Hier mag het hoor */\nimport { AbstractCache } from './abstractCache';\n\nexport class CookieCache extends AbstractCache {\n public cacheOrGet<T>(): Promise<T> {\n throw new Error('Not implemented, use get() and set()');\n }\n\n public get<T>(key: string): Promise<T | undefined> {\n if (document.cookie.includes(`${key}=`)) {\n return Promise.resolve(document.cookie.split(`${key}=`)[1]?.split(';')[0] as T);\n }\n\n return Promise.resolve(undefined);\n }\n\n public set<T>(key: string, value: T, lifetime?: number): void {\n const expires = lifetime ? new Date(Date.now() + lifetime).toUTCString() : '';\n document.cookie = `${key}=${value}; expires=${expires}; path=/; samesite=strict; secure`;\n }\n\n public remove(key: string): void {\n document.cookie = `${key}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;`;\n }\n\n public clear(): void {\n throw new Error('Not implemented, use remove()');\n }\n}\n", "import fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\nimport { AbstractCache } from './abstractCache';\n\ntype CacheItem<T> = {\n value: T;\n expiresAt?: number;\n};\n\nexport class FilesystemCache<T = unknown> extends AbstractCache {\n protected initialized = false;\n\n protected state = new Map<string, CacheItem<T>>();\n\n public async cacheOrGet<T>(callbackWhenEmpty: () => Promise<T>, key?: string, lifetime?: number): Promise<T> {\n const usedKey = key ?? this.getCacheKey();\n\n const cachedValue = await this.get<T>(usedKey);\n if (cachedValue) {\n return cachedValue;\n }\n\n const result = await callbackWhenEmpty();\n this.set(usedKey, result, lifetime);\n return result;\n }\n\n public get<T>(key: string): Promise<T | undefined> {\n if (!this.initialized) {\n this._initialize();\n }\n\n const item = this.state.get(key);\n\n if (item) {\n const expires = item.expiresAt;\n if (expires === undefined || expires > Date.now()) {\n return Promise.resolve(item.value as unknown as T);\n }\n }\n\n return Promise.resolve(undefined);\n }\n\n public set<T>(key: string, value: T, lifetime?: number): void {\n const expiresAt = lifetime ? Date.now() + lifetime : undefined;\n\n // 'content' is typed as the Method's T\n const content: CacheItem<T> = { value };\n if (expiresAt) {\n content.expiresAt = expiresAt;\n }\n\n // biome-ignore lint/suspicious/noExplicitAny: hier mag alles\n this.state.set(key, content as any);\n\n this.writeState();\n }\n\n public remove(key: string): void {\n this.state.delete(key);\n this.writeState();\n }\n\n public clear(): void {\n this.state.clear();\n if (fs.existsSync(this.getFilePath())) {\n fs.unlinkSync(this.getFilePath());\n }\n }\n\n public getFilePath() {\n return path.join(os.homedir(), '.tss', `${this.cacheName}.json`);\n }\n\n protected _initialize() {\n this.initialized = true;\n if (fs.existsSync(this.getFilePath())) {\n try {\n const fileContent = fs.readFileSync(this.getFilePath(), 'utf8');\n const parsed = JSON.parse(fileContent);\n this.state = new Map(Object.entries(parsed)) as Map<string, CacheItem<T>>;\n } catch (_e) {\n this.state = new Map();\n }\n }\n }\n\n protected writeState() {\n if (!fs.existsSync(path.dirname(this.getFilePath()))) {\n fs.mkdirSync(path.dirname(this.getFilePath()), { recursive: true });\n }\n\n const plainObject = Object.fromEntries(this.state);\n fs.writeFileSync(this.getFilePath(), JSON.stringify(plainObject));\n }\n}\n", "import { AbstractCache } from './abstractCache';\n\nexport class NullCache extends AbstractCache {\n public cacheOrGet<T>(callbackWhenEmpty: () => Promise<T>): Promise<T> {\n return callbackWhenEmpty();\n }\n\n public get<T>(): Promise<T | undefined> {\n return Promise.resolve(undefined);\n }\n\n public set(): void {\n // void\n }\n\n public remove(): void {\n // void\n }\n\n public clear(): void {\n // void\n }\n}\n", "import child_process from 'node:child_process';\nimport util from 'node:util';\nimport { AbstractCache } from './abstractCache';\n\n// TODO error handling en lifetime\nexport class OnePasswordCache extends AbstractCache {\n protected asyncExec = util.promisify(child_process.exec);\n\n public cacheOrGet<T>(): Promise<T> {\n throw new Error('Not implemented, use get() and set()');\n }\n\n public async get<T>(key: string): Promise<T | undefined> {\n const { stdout, stderr } = await this.asyncExec(`op item get \"${key}\" --fields label=credential --format json`);\n\n if (stderr) {\n console.log(stderr);\n throw new Error('ERROR');\n }\n\n return JSON.parse(stdout).value;\n }\n\n public async set<T>(key: string, value: T): Promise<void> {\n let action = `op item edit '${key}' 'credential=${value}'`;\n\n try {\n await this.get(key);\n } catch (_e) {\n action = `op item create --category=\"API Credential\" --title ${key} 'credential=${value}'`;\n }\n\n const { stderr } = await this.asyncExec(action);\n\n if (stderr) {\n console.log(stderr);\n throw new Error('ERROR');\n }\n }\n\n public async remove(key: string): Promise<void> {\n await this.asyncExec(`op item delete '${key}'`);\n }\n\n public clear(): void {\n // Loopje maken en heel 1password leeg maken?\n }\n}\n", "import type { BigBrotherItem, Jingle, JingleFolder, PlayJingleDto } from 'tering-serieuze-types';\nimport { CacheLifetime } from '../cache';\nimport { BaseModule } from './base';\n\nexport class JingleModule extends BaseModule {\n getGrouped(): Promise<JingleFolder[]> {\n return this.cache.cacheOrGet(\n () => {\n return this.api.get<JingleFolder[]>('jingle/grouped');\n },\n 'getGrouped',\n CacheLifetime.Day,\n );\n }\n\n getAll(): Promise<Jingle[]> {\n return this.cache.cacheOrGet(\n () => {\n return this.api.get<Jingle[]>('jingle');\n },\n 'getAll',\n CacheLifetime.Day,\n );\n }\n\n async getRecentlyAdded(): Promise<Jingle[]> {\n const jingles = await this.getAll();\n return jingles.sort((a, b) => b.mtime - a.mtime).slice(0, 30);\n }\n\n play(playJingleDto: PlayJingleDto): Promise<{ success: boolean }> {\n console.log(`Playing jingle ${playJingleDto.folder}/${playJingleDto.file}`);\n return this.api.post<{ success: boolean }>('jingle/play', playJingleDto);\n }\n\n getBigBrotherData(): Promise<BigBrotherItem[]> {\n return this.api.get<BigBrotherItem[]>('jingle/bigbrother');\n }\n\n async find(query: string, jingles: Jingle[] = []): Promise<Jingle[]> {\n const items = jingles.length > 0 ? jingles : await this.getAll();\n\n const queryParts = query.split(' ');\n const matches = items.filter((jingle) =>\n queryParts.every((queryPart) => `${jingle.folder}/${jingle.file}`.includes(queryPart)),\n );\n\n return matches.sort((a, b) => {\n const aScore = a.keywords.filter((keyword) => query.includes(keyword)).length;\n const bScore = b.keywords.filter((keyword) => query.includes(keyword)).length;\n\n return bScore - aScore;\n });\n }\n}\n", "import type { Pod } from 'tering-serieuze-types';\nimport { BaseModule } from './base';\n\nexport class K8sModule extends BaseModule {\n getPods() {\n return this.api.get<Pod[]>('k8s');\n }\n\n async deletePod(podName: string) {\n return await this.api.delete(`k8s/${podName}`);\n }\n}\n", "import type { SetWindowStateDto, User } from 'tering-serieuze-types';\nimport { BaseModule } from './base';\n\nexport class UserModule extends BaseModule {\n async get(userId?: string) {\n return await this.cache.cacheOrGet(() => {\n const userIdParam = userId ? `/${userId}` : '';\n return this.api.get<User>(`user${userIdParam}`);\n });\n }\n\n async getAll() {\n return await this.cache.cacheOrGet(() => {\n return this.api.get<User[]>('user/all');\n });\n }\n\n async setWindowState(setWindowStateDto: SetWindowStateDto) {\n return await this.api.putPossibleEmptyResponse('user/windowState', setWindowStateDto);\n }\n}\n", "import type { Dto } from 'tering-serieuze-types';\nimport { AuthModule, JingleModule, K8sModule, UserModule } from './api';\nimport { AbstractCache, NullCache } from './cache';\n\nexport * from './api';\nexport * from './cache';\n\nexport type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';\n\nexport interface SDKRequestInit extends RequestInit {\n method?: HttpMethod;\n}\n\nexport enum CacheType {\n jingle = 'jingle',\n auth = 'auth',\n k8s = 'k8s',\n user = 'user',\n}\n\nexport type ApiConfiguration = {\n API_URL: string;\n};\n\nexport type CacheConfiguration = {\n [key in keyof typeof CacheType]?: AbstractCache;\n};\n\nexport class ErrorResponse extends Error {\n constructor(\n public readonly status: number,\n public override readonly message: string,\n ) {\n super();\n }\n}\n\nexport class TssApi {\n auth: AuthModule;\n jingle: JingleModule;\n k8s: K8sModule;\n user: UserModule;\n\n constructor(\n protected readonly apiConfiguration: ApiConfiguration,\n cacheConfiguration?: CacheConfiguration,\n ) {\n this.jingle = new JingleModule(this, cacheConfiguration?.jingle ?? new NullCache('jingle'));\n this.auth = new AuthModule(this, cacheConfiguration?.auth ?? new NullCache('auth'));\n this.k8s = new K8sModule(this, cacheConfiguration?.k8s ?? new NullCache('k8s'));\n this.user = new UserModule(this, cacheConfiguration?.user ?? new NullCache('user'));\n }\n\n async fetch(url: string, config: SDKRequestInit = {}) {\n config.method = config.method ?? 'GET';\n config.headers = {\n ...config.headers,\n Authorization: `Bearer ${await this.auth.getToken()}`,\n };\n\n // @ts-ignore\n if (!config.headers['Content-Type']) {\n // @ts-ignore\n config.headers['Content-Type'] = config.body ? 'application/json' : 'text/plain';\n }\n\n const apiPrefix = this.apiConfiguration.API_URL;\n\n if (apiPrefix.match(/^https?:\\/\\/localhost/) !== null && typeof process !== 'undefined' && process.env) {\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';\n }\n\n const fullUrl = `${apiPrefix}/api/${url}`;\n console.log('Fetching url', fullUrl);\n\n let response: Response;\n try {\n response = await fetch(fullUrl, config);\n } catch (_e) {\n throw new ErrorResponse(503, 'API erg dood');\n }\n\n if (response.status >= 400) {\n const error = await response.json();\n throw new ErrorResponse(error.statusCode, error.message ?? error.error);\n }\n\n return response;\n }\n\n protected fetchPossibleEmptyResponse(method: HttpMethod, url: string, dto: Dto, config: SDKRequestInit = {}) {\n return this.fetch(url, {\n method,\n ...config,\n body: JSON.stringify(dto),\n });\n }\n\n async get<T>(url: string): Promise<T> {\n const response = await this.fetch(url);\n return (await response.json()) as Promise<T>;\n }\n\n async post<T>(url: string, dto: Dto, config: SDKRequestInit = {}) {\n const response = await this.fetchPossibleEmptyResponse('POST', url, dto, config);\n if (response === undefined) {\n throw new Error('Response was undefined');\n }\n return (await response.json()) as Promise<T>;\n }\n\n postPossibleEmptyResponse(url: string, dto: Dto) {\n return this.fetchPossibleEmptyResponse('POST', url, dto);\n }\n\n async put<T>(url: string, dto: Dto) {\n const response = await this.fetchPossibleEmptyResponse('PUT', url, dto);\n if (response === undefined) {\n throw new Error('Response was undefined');\n }\n return (await response.json()) as Promise<T>;\n }\n\n putPossibleEmptyResponse(url: string, dto: Dto) {\n return this.fetchPossibleEmptyResponse('PUT', url, dto);\n }\n\n delete(url: string, config: SDKRequestInit = {}) {\n return this.fetch(url, {\n method: 'DELETE',\n ...config,\n });\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAGO,IAAM,aAAN,MAAiB;AAAA,EACpB,YACc,KACA,OACZ;AAFY;AACA;AAAA,EACX;AAAA,EAEI,WAAW;AACd,WAAO,KAAK;AAAA,EAChB;AAAA,EAEO,SAAS,OAAsB;AAClC,SAAK,QAAQ;AAAA,EACjB;AACJ;;;ACRO,SAAS,SAAY,OAAkB;AAC1C,MAAI,cAAc;AAElB,MAAI,OAAO,WAAW,aAAa;AAC/B,UAAM,UAAU,MAAM,MAAM,GAAG,IAAI,CAAC;AACpC,QAAI,CAAC,SAAS;AACV,YAAM,IAAI,MAAM,eAAe;AAAA,IACnC;AACA,kBAAc,OAAO,KAAK,SAAS,QAAQ,EAAE,SAAS;AAAA,EAC1D,OAAO;AACH,UAAM,YAAY,MAAM,MAAM,GAAG,EAAE,CAAC;AACpC,QAAI,CAAC,WAAW;AACZ,Y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C,GAAG;AAC7C,WAAO,KAAK,MAAM,KAAK;AAAA,MACnB,QAAQ;AAAA,MACR,GAAG;AAAA,IACP,CAAC;AAAA,EACL;AACJ;",
|
|
6
6
|
"names": ["dummyObject", "v8StackTrace", "CacheLifetime", "CacheType"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tering-serieuze-sdk",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.3",
|
|
4
4
|
"description": "Teringserieuze sdk",
|
|
5
5
|
"author": "Frank",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
"coverage": "vitest run --coverage",
|
|
14
14
|
"dev": "esbuild src/index.ts --bundle --platform=node --outfile=dist/index.mjs --packages=external --sourcemap=external --format=esm --watch",
|
|
15
15
|
"prebuild": "npm run lint && npm run test",
|
|
16
|
-
"build": "esbuild src/index.ts --bundle --platform=node --outfile=dist/index.mjs --sourcemap=external --format=esm",
|
|
16
|
+
"build": "npm run typecheck && esbuild src/index.ts --bundle --platform=node --outfile=dist/index.mjs --sourcemap=external --format=esm",
|
|
17
17
|
"webstorm-integration": "vitest --watch --reporter=dot --reporter=json --outputFile=.vitest-result.json",
|
|
18
|
-
"version": "npm run build && git add -A dist"
|
|
18
|
+
"version": "npm run build && git add -A dist",
|
|
19
|
+
"typecheck": "tsc --noEmit"
|
|
19
20
|
},
|
|
20
21
|
"repository": {
|
|
21
22
|
"type": "git",
|
|
@@ -33,10 +34,11 @@
|
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@biomejs/biome": "^2.1.2",
|
|
35
36
|
"@simplewebauthn/types": "^12.0.0",
|
|
36
|
-
"@types/node": "^
|
|
37
|
+
"@types/node": "^25.0.6",
|
|
37
38
|
"@vitest/coverage-c8": "^0.28.5",
|
|
38
39
|
"esbuild": "^0.17.12",
|
|
39
|
-
"tering-serieuze-types": "^3.3.
|
|
40
|
+
"tering-serieuze-types": "^3.3.3",
|
|
41
|
+
"typescript": "^5.9.3",
|
|
40
42
|
"vitest": "^0.28.5"
|
|
41
43
|
}
|
|
42
44
|
}
|
package/src/api/auth.ts
CHANGED
|
@@ -10,9 +10,16 @@ export function parseJwt<T>(token: string): T {
|
|
|
10
10
|
let jsonPayload = '';
|
|
11
11
|
|
|
12
12
|
if (typeof Buffer !== 'undefined') {
|
|
13
|
-
|
|
13
|
+
const payload = token.split('.')?.[1];
|
|
14
|
+
if (!payload) {
|
|
15
|
+
throw new Error('Invalid token');
|
|
16
|
+
}
|
|
17
|
+
jsonPayload = Buffer.from(payload, 'base64').toString();
|
|
14
18
|
} else {
|
|
15
19
|
const base64Url = token.split('.')[1];
|
|
20
|
+
if (!base64Url) {
|
|
21
|
+
throw new Error('Invalid token');
|
|
22
|
+
}
|
|
16
23
|
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
|
|
17
24
|
jsonPayload = decodeURIComponent(
|
|
18
25
|
window
|
package/src/index.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"rootDir": "src",
|
|
4
4
|
"outDir": "dist",
|
|
5
5
|
"strict": true,
|
|
6
|
-
"target": "
|
|
6
|
+
"target": "esnext",
|
|
7
7
|
"module": "ES2022",
|
|
8
8
|
"sourceMap": true,
|
|
9
9
|
"esModuleInterop": true,
|
|
@@ -12,6 +12,15 @@
|
|
|
12
12
|
"noImplicitAny": true,
|
|
13
13
|
"experimentalDecorators": true,
|
|
14
14
|
"strictPropertyInitialization": false,
|
|
15
|
-
"
|
|
16
|
-
|
|
15
|
+
"noImplicitOverride": true,
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"moduleDetection": "force",
|
|
18
|
+
"isolatedModules": true,
|
|
19
|
+
"verbatimModuleSyntax": true,
|
|
20
|
+
"noUncheckedIndexedAccess": true,
|
|
21
|
+
"forceConsistentCasingInFileNames": true,
|
|
22
|
+
"noImplicitThis": true
|
|
23
|
+
},
|
|
24
|
+
"include": ["src/**/*.ts"],
|
|
25
|
+
"exclude": ["node_modules", "dist", "test"]
|
|
17
26
|
}
|