Compare commits
35 Commits
v1.1.2
...
690ba697b6
Author | SHA1 | Date | |
---|---|---|---|
690ba697b6 | |||
71343d6742 | |||
3f6e558d39 | |||
ca259c5f24 | |||
b1c581ca6e | |||
96189c2392 | |||
700353cff4 | |||
0d3c62c6ad | |||
5816db48e6 | |||
66f843b399 | |||
d82a7cffd2 | |||
8a06a661fa | |||
4084f675cd | |||
3bd26a9d6c | |||
e7b21fa658 | |||
2d32f9b680 | |||
5503aa8713 | |||
25bb676fda | |||
9f5abb8a90 | |||
0e67252976 | |||
37b798818c | |||
af414d0bad | |||
c32434a7eb | |||
c133570d8c | |||
65cdee36e9 | |||
6b0e84669a | |||
dd72f8e165 | |||
a6f19ccd2b | |||
c39f9c6ee1 | |||
f41194ba71 | |||
fa49dc0f76 | |||
e52e845851 | |||
61544feaba | |||
1966640239 | |||
fa9998e92c |
7
.editorconfig
Normal file
7
.editorconfig
Normal file
@ -0,0 +1,7 @@
|
||||
root = true
|
||||
[*]
|
||||
indent_style = tab
|
||||
tab_width = 4
|
||||
[*.ts]
|
||||
indent_style = tab
|
||||
tab_width = 4
|
@ -14,4 +14,4 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Build Container
|
||||
run: docker build .
|
||||
run: docker build --target compile .
|
||||
|
@ -11,7 +11,6 @@ env:
|
||||
jobs:
|
||||
build-docker-image:
|
||||
runs-on: ubuntu-latest
|
||||
#if: gitea.ref == 'refs/heads/master'
|
||||
container: catthehacker/ubuntu:act-latest
|
||||
permissions:
|
||||
contents: read
|
||||
@ -22,6 +21,8 @@ jobs:
|
||||
- name: Log in to the Container registry
|
||||
run: docker login -u ${{ env.USER }} -p ${{ secrets.TOKEN }} ${{ env.REGISTRY }}
|
||||
- name: Build Container
|
||||
run: docker build -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" .
|
||||
run: docker build --target compile -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" -t "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}" .
|
||||
env:
|
||||
version: $(cat package.json | awk 'match($0, /version/) {print $2}' | sed 's/[\",]//g') # extracts the version number from the package.json with bash magic
|
||||
- name: Push Container
|
||||
run: docker push --all-tags "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
|
||||
|
18
.gitea/workflows/test.yaml
Normal file
18
.gitea/workflows/test.yaml
Normal file
@ -0,0 +1,18 @@
|
||||
name: Run unit tests
|
||||
on: [pull_request]
|
||||
env:
|
||||
REGISTRY: gitea.brudi.xyz
|
||||
IMAGE_NAME: ${{ gitea.repository }}
|
||||
USER: ${{ gitea.actor }}
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container: catthehacker/ubuntu:act-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Run Tests
|
||||
run: docker build --target test .
|
||||
|
19
Dockerfile
19
Dockerfile
@ -1,11 +1,22 @@
|
||||
FROM node:alpine as Build
|
||||
ENV NODE_ENV=production
|
||||
FROM node:alpine as files
|
||||
ENV TZ="Europe/Berlin"
|
||||
WORKDIR /app
|
||||
|
||||
COPY [ "package-lock.json", "package.json", "index.ts", "tsconfig.json", "./" ]
|
||||
COPY server ./server
|
||||
|
||||
FROM files as proddependencies
|
||||
ENV NODE_ENV=production
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
FROM proddependencies as compile
|
||||
COPY server ./server
|
||||
RUN npm run build
|
||||
CMD ["npm","run","start"]
|
||||
|
||||
FROM files as dependencies
|
||||
RUN npm ci
|
||||
|
||||
FROM dependencies as test
|
||||
COPY server ./server
|
||||
COPY jest.config.js .
|
||||
COPY tests ./tests
|
||||
RUN npm run test
|
||||
|
19
jest.config.js
Normal file
19
jest.config.js
Normal file
@ -0,0 +1,19 @@
|
||||
module.exports = {
|
||||
'roots': [
|
||||
'<rootDir>/tests',
|
||||
'<rootDir>/server'
|
||||
],
|
||||
'transform': {
|
||||
'^.+\\.tsx?$': 'ts-jest'
|
||||
},
|
||||
'testRegex': '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
|
||||
'setupFiles': ["<rootDir>/tests/testenv.js"],
|
||||
'moduleFileExtensions': [
|
||||
'ts',
|
||||
'tsx',
|
||||
'js',
|
||||
'jsx',
|
||||
'json',
|
||||
'node'
|
||||
],
|
||||
};
|
46
package-lock.json
generated
46
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "node-jellyfin-discord-bot",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "node-jellyfin-discord-bot",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@discordjs/rest": "^1.7.0",
|
||||
@ -17,6 +17,7 @@
|
||||
"@types/uuid": "^9.0.1",
|
||||
"axios": "^1.3.5",
|
||||
"date-fns": "^2.29.3",
|
||||
"date-fns-tz": "^2.0.0",
|
||||
"discord-api-types": "^0.37.38",
|
||||
"discord.js": "^14.9.0",
|
||||
"dotenv": "^16.0.3",
|
||||
@ -29,12 +30,13 @@
|
||||
"winston": "^3.8.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.0",
|
||||
"@types/jest": "^29.5.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
||||
"@typescript-eslint/parser": "^5.58.0",
|
||||
"eslint": "^8.38.0",
|
||||
"jest": "^29.5.0",
|
||||
"jest-cli": "^29.5.0",
|
||||
"mockdate": "^3.0.5",
|
||||
"nodemon": "^2.0.22",
|
||||
"rimraf": "^5.0.0",
|
||||
"ts-jest": "^29.1.0"
|
||||
@ -1567,9 +1569,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/jest": {
|
||||
"version": "29.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.0.tgz",
|
||||
"integrity": "sha512-3Emr5VOl/aoBwnWcH/EFQvlSAmjV+XtV9GGu5mwdYew5vhQh0IUZx/60x0TzHDu09Bi7HMx10t/namdJw5QIcg==",
|
||||
"version": "29.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.2.tgz",
|
||||
"integrity": "sha512-mSoZVJF5YzGVCk+FsDxzDuH7s+SCkzrgKZzf0Z0T2WudhBUPoF6ktoTPC4R0ZoCPCV5xUvuU6ias5NvxcBcMMg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"expect": "^29.0.0",
|
||||
@ -2626,6 +2628,14 @@
|
||||
"url": "https://opencollective.com/date-fns"
|
||||
}
|
||||
},
|
||||
"node_modules/date-fns-tz": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-2.0.0.tgz",
|
||||
"integrity": "sha512-OAtcLdB9vxSXTWHdT8b398ARImVwQMyjfYGkKD2zaGpHseG2UPHbHjXELReErZFxWdSLph3c2zOaaTyHfOhERQ==",
|
||||
"peerDependencies": {
|
||||
"date-fns": ">=2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/debug": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||
@ -4980,6 +4990,12 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/mockdate": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/mockdate/-/mockdate-3.0.5.tgz",
|
||||
"integrity": "sha512-iniQP4rj1FhBdBYS/+eQv7j1tadJ9lJtdzgOpvsOHng/GbcDh2Fhdeq+ZRldrPYdXvCyfFUmFeEwEGXZB5I/AQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
@ -8130,9 +8146,9 @@
|
||||
}
|
||||
},
|
||||
"@types/jest": {
|
||||
"version": "29.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.0.tgz",
|
||||
"integrity": "sha512-3Emr5VOl/aoBwnWcH/EFQvlSAmjV+XtV9GGu5mwdYew5vhQh0IUZx/60x0TzHDu09Bi7HMx10t/namdJw5QIcg==",
|
||||
"version": "29.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.2.tgz",
|
||||
"integrity": "sha512-mSoZVJF5YzGVCk+FsDxzDuH7s+SCkzrgKZzf0Z0T2WudhBUPoF6ktoTPC4R0ZoCPCV5xUvuU6ias5NvxcBcMMg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"expect": "^29.0.0",
|
||||
@ -8905,6 +8921,12 @@
|
||||
"resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.29.3.tgz",
|
||||
"integrity": "sha512-dDCnyH2WnnKusqvZZ6+jA1O51Ibt8ZMRNkDZdyAyK4YfbDwa/cEmuztzG5pk6hqlp9aSBPYcjOlktquahGwGeA=="
|
||||
},
|
||||
"date-fns-tz": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-2.0.0.tgz",
|
||||
"integrity": "sha512-OAtcLdB9vxSXTWHdT8b398ARImVwQMyjfYGkKD2zaGpHseG2UPHbHjXELReErZFxWdSLph3c2zOaaTyHfOhERQ==",
|
||||
"requires": {}
|
||||
},
|
||||
"debug": {
|
||||
"version": "4.3.4",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
|
||||
@ -10705,6 +10727,12 @@
|
||||
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz",
|
||||
"integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="
|
||||
},
|
||||
"mockdate": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/mockdate/-/mockdate-3.0.5.tgz",
|
||||
"integrity": "sha512-iniQP4rj1FhBdBYS/+eQv7j1tadJ9lJtdzgOpvsOHng/GbcDh2Fhdeq+ZRldrPYdXvCyfFUmFeEwEGXZB5I/AQ==",
|
||||
"dev": true
|
||||
},
|
||||
"ms": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
||||
|
10
package.json
10
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "node-jellyfin-discord-bot",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.3",
|
||||
"description": "A discord bot to sync jellyfin accounts with discord roles",
|
||||
"main": "index.js",
|
||||
"license": "MIT",
|
||||
@ -13,6 +13,7 @@
|
||||
"@types/uuid": "^9.0.1",
|
||||
"axios": "^1.3.5",
|
||||
"date-fns": "^2.29.3",
|
||||
"date-fns-tz": "^2.0.0",
|
||||
"discord-api-types": "^0.37.38",
|
||||
"discord.js": "^14.9.0",
|
||||
"dotenv": "^16.0.3",
|
||||
@ -32,15 +33,18 @@
|
||||
"debuggable": "node build/index.js --inspect-brk",
|
||||
"monitor": "nodemon build/index.js",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"lint-fix": "eslint . --ext .ts --fix"
|
||||
"lint-fix": "eslint . --ext .ts --fix",
|
||||
"test": "jest --runInBand",
|
||||
"test-watch": "jest --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^29.5.0",
|
||||
"@types/jest": "^29.5.2",
|
||||
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
||||
"@typescript-eslint/parser": "^5.58.0",
|
||||
"eslint": "^8.38.0",
|
||||
"jest": "^29.5.0",
|
||||
"jest-cli": "^29.5.0",
|
||||
"mockdate": "^3.0.5",
|
||||
"nodemon": "^2.0.22",
|
||||
"rimraf": "^5.0.0",
|
||||
"ts-jest": "^29.1.0"
|
||||
|
@ -1,6 +1,8 @@
|
||||
import { format } from "date-fns";
|
||||
import { format, isToday, toDate } from "date-fns";
|
||||
import { utcToZonedTime } from "date-fns-tz"
|
||||
import { GuildScheduledEvent } from "discord.js";
|
||||
import { logger } from "../logger";
|
||||
import de from "date-fns/locale/de";
|
||||
|
||||
export function createDateStringFromEvent(event: GuildScheduledEvent, requestId: string, guildId?: string): string {
|
||||
if (!event.scheduledStartAt) {
|
||||
@ -8,9 +10,14 @@ export function createDateStringFromEvent(event: GuildScheduledEvent, requestId:
|
||||
return `"habe keinen Startzeitpunkt ermitteln können"`
|
||||
}
|
||||
|
||||
const date = format(event.scheduledStartAt, "dd.MM")
|
||||
const time = format(event.scheduledStartAt, "HH:mm")
|
||||
const timeZone = 'Europe/Berlin'
|
||||
const zonedDateTime = utcToZonedTime(event.scheduledStartAt, timeZone)
|
||||
const time = format(zonedDateTime, "HH:mm", { locale: de })
|
||||
|
||||
if (isToday(zonedDateTime)) {
|
||||
return `heute um ${time}`
|
||||
}
|
||||
|
||||
const date = format(zonedDateTime, "eeee dd.MM", { locale: de })
|
||||
return `am ${date} um ${time}`
|
||||
}
|
@ -2,7 +2,7 @@ import { GuildMember } from "discord.js";
|
||||
import { JellyfinConfig, Maybe, PermissionLevel } from "../interfaces";
|
||||
import { logger } from "../logger";
|
||||
import { CreateUserByNameOperationRequest, DeleteUserRequest, GetItemsRequest, ItemsApi, SystemApi, UpdateUserPasswordOperationRequest, UpdateUserPolicyOperationRequest, UserApi } from "./apis";
|
||||
import { BaseItemDto, UpdateUserPasswordRequest } from "./models";
|
||||
import { BaseItemDto, UpdateUserPasswordRequest, UpdateUserPolicyRequest } from "./models";
|
||||
import { UserDto } from "./models/UserDto";
|
||||
import { Configuration, ConfigurationParameters } from "./runtime";
|
||||
|
||||
@ -52,24 +52,46 @@ export class JellyfinHandler {
|
||||
return (Math.random() * 10000 + 10000).toFixed(0)
|
||||
}
|
||||
|
||||
public async createUserAccountForDiscordUser(discordUser: GuildMember, level: PermissionLevel, guildId?: string, requestId?: string): Promise<UserDto> {
|
||||
public async createUserAccountForDiscordUser(discordUser: GuildMember, level: PermissionLevel, requestId: string, guildId?: string): Promise<UserDto> {
|
||||
const newUserName = this.generateJFUserName(discordUser, level)
|
||||
logger.info(`New Username for ${discordUser.displayName}: ${newUserName}`, { guildId, requestId })
|
||||
const req: CreateUserByNameOperationRequest = {
|
||||
createUserByNameRequest: {
|
||||
name: newUserName,
|
||||
password: this.generatePasswordForUser(),
|
||||
password: this.generatePasswordForUser()
|
||||
}
|
||||
}
|
||||
logger.debug(JSON.stringify(req), { requestId, guildId })
|
||||
const createResult = await this.userApi.createUserByName(req)
|
||||
if (createResult) {
|
||||
if (createResult.policy) {
|
||||
this.setUserPermissions(createResult, requestId, guildId)
|
||||
}
|
||||
(await discordUser.createDM()).send(`Ich hab dir mal nen Account angelegt :)\nDein Username ist ${createResult.name}, dein Password ist "${req.createUserByNameRequest.password}"!`)
|
||||
return createResult
|
||||
}
|
||||
else throw new Error('Could not create User in Jellyfin')
|
||||
}
|
||||
|
||||
public async setUserPermissions(user: UserDto, requestId: string, guildId?: string) {
|
||||
if (!user.policy || !user.id) {
|
||||
logger.error(`Cannot update user policy. User ${user.name} has no policy to modify`, { guildId, requestId })
|
||||
return
|
||||
}
|
||||
user.policy.enableVideoPlaybackTranscoding = false
|
||||
|
||||
const operation: UpdateUserPolicyRequest = {
|
||||
...user.policy,
|
||||
enableVideoPlaybackTranscoding: false
|
||||
}
|
||||
|
||||
const request: UpdateUserPolicyOperationRequest = {
|
||||
userId: user.id,
|
||||
updateUserPolicyRequest: operation
|
||||
}
|
||||
this.userApi.updateUserPolicy(request)
|
||||
}
|
||||
|
||||
public async isUserAlreadyPresent(discordUser: GuildMember, requestId?: string): Promise<boolean> {
|
||||
const jfuser = await this.getUser(discordUser, requestId)
|
||||
logger.debug(`Presence for DiscordUser ${discordUser.id}:${jfuser !== undefined}`, { guildId: discordUser.guild.id, requestId })
|
||||
|
@ -1,5 +1,8 @@
|
||||
import { createLogger, format, transports } from "winston"
|
||||
import { config } from "./configuration"
|
||||
import { v4 } from "uuid"
|
||||
export function newRequestId() { return v4() }
|
||||
export const noGuildId = 'NoGuildId'
|
||||
|
||||
|
||||
const printFn = format.printf(({ guildId, level, message, errorCode, requestId, timestamp: logTimestamp }: { [k: string]: string }) => {
|
||||
@ -13,7 +16,8 @@ const logFormat = format.combine(
|
||||
|
||||
const consoleTransports = [
|
||||
new transports.Console({
|
||||
format: logFormat
|
||||
format: logFormat,
|
||||
silent: process.env.NODE_ENV === 'testing'
|
||||
})
|
||||
]
|
||||
export const logger = createLogger({
|
||||
|
16
tests/helpers/date.test.ts
Normal file
16
tests/helpers/date.test.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { GuildScheduledEvent } from "discord.js"
|
||||
import { createDateStringFromEvent } from "../../server/helper/dateHelper"
|
||||
import MockDate from 'mockdate'
|
||||
|
||||
beforeAll(() => {
|
||||
MockDate.set('01-01-2023')
|
||||
})
|
||||
|
||||
function getTestDate(date: string): GuildScheduledEvent {
|
||||
return <GuildScheduledEvent>{ scheduledStartAt: new Date(date) }
|
||||
}
|
||||
test('createDateStringFromEvent - correct formatting', () => {
|
||||
expect(createDateStringFromEvent(getTestDate('01-01-2023 12:30'), "")).toEqual('heute um 12:30')
|
||||
expect(createDateStringFromEvent(getTestDate('01-02-2023 12:30'), "")).toEqual('am Montag 02.01 um 12:30')
|
||||
expect(createDateStringFromEvent(getTestDate('01-03-2023 12:30'), "")).toEqual('am Dienstag 03.01 um 12:30')
|
||||
})
|
28
tests/helpers/memberRoles.test.ts
Normal file
28
tests/helpers/memberRoles.test.ts
Normal file
@ -0,0 +1,28 @@
|
||||
import { Collection, GuildMember, Role } from "discord.js"
|
||||
import { filterRolesFromMemberUpdate } from "../../server/helper/roleFilter"
|
||||
|
||||
function buildFakeRole(id: string, name: string): Role {
|
||||
return <Role>{ id, name }
|
||||
|
||||
}
|
||||
test('filterRolesFromMemberUpdate', () => {
|
||||
const oldMemberRoles: Collection<string, Role> = new Collection<string, Role>()
|
||||
oldMemberRoles.set('1', buildFakeRole('01', 'Role01'))
|
||||
oldMemberRoles.set('2', buildFakeRole('02', 'Role02'))
|
||||
|
||||
const newMemberRoles: Collection<string, Role> = new Collection<string, Role>()
|
||||
newMemberRoles.set('1', buildFakeRole('01', 'Role01'))
|
||||
newMemberRoles.set('2', buildFakeRole('02', 'Role02'))
|
||||
newMemberRoles.set('3', buildFakeRole('03', 'Role03'))
|
||||
|
||||
const oldMember: GuildMember = <GuildMember>{ roles: { cache: oldMemberRoles }, guild: { id: "guildid" } }
|
||||
const newMember: GuildMember = <GuildMember>{ roles: { cache: newMemberRoles }, guild: { id: "guildid" } }
|
||||
const output = filterRolesFromMemberUpdate(oldMember, newMember)
|
||||
|
||||
const expectedAddedRoles: Collection<string, Role> = new Collection<string, Role>()
|
||||
expectedAddedRoles.set('3', buildFakeRole('03', 'Role03'))
|
||||
const expectedRemovedRoles: Collection<string, Role> = new Collection<string, Role>()
|
||||
|
||||
expect(output.addedRoles).toEqual(expectedAddedRoles)
|
||||
expect(output.removedRoles).toEqual(expectedRemovedRoles)
|
||||
})
|
15
tests/testenv.js
Normal file
15
tests/testenv.js
Normal file
@ -0,0 +1,15 @@
|
||||
process.env.CLIENT_ID = "CLIENT_ID"
|
||||
process.env.SECRET = "SECRET"
|
||||
process.env.BOT_TOKEN = "BOT_TOKEN"
|
||||
process.env.WATCHER_ROLE = "WATCHER_ROLE"
|
||||
process.env.ADMIN_ROLE = "ADMIN_ROLE"
|
||||
process.env.CHANNEL_ID = "CHANNEL_ID"
|
||||
process.env.WATCHPARTY_ANNOUNCEMENT_ROLE = "WATCHPARTY_ANNOUNCEMENT_ROLE"
|
||||
process.env.YAVIN_JELLYFIN_URL = "YAVIN_JELLYFIN_URL"
|
||||
process.env.YAVIN_COLLECTION_ID = "YAVIN_COLLECTION_ID"
|
||||
process.env.YAVIN_COLLECTION_USER = "YAVIN_COLLECTION_USER"
|
||||
process.env.YAVIN_TOKEN = "YAVIN_TOKEN"
|
||||
process.env.TOKEN = "TOKEN"
|
||||
process.env.JELLYFIN_USER = "JELLYFIN_USER"
|
||||
process.env.JELLYFIN_COLLECTION_ID = "JELLYFIN_COLLECTION_ID"
|
||||
process.env.JELLYFIN_URL = "JELLYFIN_URL"
|
@ -1,61 +1,44 @@
|
||||
{
|
||||
"extends": "@tsconfig/recommended/tsconfig.json",
|
||||
"exclude":["node_modules"],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
],
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
|
||||
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
||||
"resolveJsonModule": true,
|
||||
// "lib": [], /* Specify library files to be included in the compilation. */
|
||||
// "allowJs": true, /* Allow javascript files to be compiled. */
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
// "declaration": true, /* Generates corresponding '.d.ts' file. */
|
||||
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
||||
// "sourceMap": true, /* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
"outDir": "./build" /* Redirect output structure to the directory. */,
|
||||
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
// "composite": true, /* Enable project compilation */
|
||||
// "removeComments": true, /* Do not emit comments to output. */
|
||||
// "noEmit": true, /* Do not emit outputs. */
|
||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||
|
||||
"removeComments": true, /* Do not emit comments to output. */
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true /* Enable all strict type-checking options. */,
|
||||
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
// "strictNullChecks": true, /* Enable strict null checks. */
|
||||
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
||||
"noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
"strictNullChecks": true, /* Enable strict null checks. */
|
||||
"strictFunctionTypes": true, /* Enable strict checking of function types. */
|
||||
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
||||
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
||||
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||
|
||||
"alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
||||
//"noUncheckedIndexedAccess": true,
|
||||
/* Additional Checks */
|
||||
//"noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
|
||||
/* Module Resolution Options */
|
||||
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
// "types": [], /* Type declaration files to be included in compilation. */
|
||||
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
"inlineSourceMap": true /* Emit a single file with source maps instead of having a separate file. */
|
||||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
|
Reference in New Issue
Block a user