Compare commits

...

3 Commits

Author SHA1 Message Date
bca1cde895 bump version 2025-09-04 20:27:54 -04:00
8c1993d39a maintenance 2025-09-04 20:27:27 -04:00
8762051e7a remove comment 2025-09-01 21:59:58 -04:00
4 changed files with 18 additions and 5 deletions

View File

@@ -3,3 +3,6 @@ save = false
[install.scopes] [install.scopes]
"@techniker-me" = "https://registry-node.techniker.me" "@techniker-me" = "https://registry-node.techniker.me"
[test]
preload = ["./test/setup.ts"]

View File

@@ -1,12 +1,18 @@
{ {
"name": "@techniker-me/pcast-api", "name": "@techniker-me/pcast-api",
"version": "2025.1.5", "version": "2025.1.6",
"type": "module", "type": "module",
"scripts": { "scripts": {
"ci-build": "bun run build", "ci-build": "bun run build",
"test": "bun test", "test": "bun test",
"test:unit": "bun test test/unit",
"test:integration": "bun test test/integration",
"test:watch": "bun test --watch", "test:watch": "bun test --watch",
"test:watch:unit": "bun test --watch test/unit",
"test:watch:integration": "bun test --watch test/integration",
"test:coverage": "bun test --coverage", "test:coverage": "bun test --coverage",
"test:coverage:unit": "bun test --coverage test/unit",
"test:coverage:integration": "bun test --coverage test/integration",
"preformat": "bun install", "preformat": "bun install",
"format": "prettier --write ./", "format": "prettier --write ./",
"prelint:fix": "bun format", "prelint:fix": "bun format",

View File

@@ -50,10 +50,12 @@ export class Channels {
private readonly _httpRequests: PCastHttpRequests; private readonly _httpRequests: PCastHttpRequests;
private readonly _channelsByAlias: Map<ChannelAlias, Channel> = new Map(); private readonly _channelsByAlias: Map<ChannelAlias, Channel> = new Map();
constructor(pcastHttpRequests: PCastHttpRequests) { constructor(pcastHttpRequests: PCastHttpRequests, skipInitialization = false) {
this._httpRequests = pcastHttpRequests; this._httpRequests = pcastHttpRequests;
if (!skipInitialization) {
this.initialize(); this.initialize();
} }
}
public async create(name: string, description: string, channelOptions: string[] = []): Promise<Channel> { public async create(name: string, description: string, channelOptions: string[] = []): Promise<Channel> {
if (!name || name.trim().length === 0) { if (!name || name.trim().length === 0) {
@@ -177,8 +179,8 @@ export class Channels {
throw new ChannelError(`Invalid response format for deleted channel [${channelId}]`, 'INVALID_RESPONSE'); throw new ChannelError(`Invalid response format for deleted channel [${channelId}]`, 'INVALID_RESPONSE');
} }
// Remove from cache if it exists
const deletedChannel = response.channel; const deletedChannel = response.channel;
if (this._channelsByAlias.has(deletedChannel.alias)) { if (this._channelsByAlias.has(deletedChannel.alias)) {
this._channelsByAlias.delete(deletedChannel.alias); this._channelsByAlias.delete(deletedChannel.alias);
} }

View File

@@ -3,5 +3,7 @@ export enum HttpMethod {
POST = 'POST', POST = 'POST',
PUT = 'PUT', PUT = 'PUT',
PATCH = 'PATCH', PATCH = 'PATCH',
DELETE = 'DELETE' DELETE = 'DELETE',
OPTIONS = 'OPTIONS',
HEAD = 'HEAD'
} }