Compare commits
3 Commits
d0f3af72f6
...
bca1cde895
| Author | SHA1 | Date | |
|---|---|---|---|
| bca1cde895 | |||
| 8c1993d39a | |||
| 8762051e7a |
@@ -3,3 +3,6 @@ save = false
|
||||
|
||||
[install.scopes]
|
||||
"@techniker-me" = "https://registry-node.techniker.me"
|
||||
|
||||
[test]
|
||||
preload = ["./test/setup.ts"]
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
{
|
||||
"name": "@techniker-me/pcast-api",
|
||||
"version": "2025.1.5",
|
||||
"version": "2025.1.6",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"ci-build": "bun run build",
|
||||
"test": "bun test",
|
||||
"test:unit": "bun test test/unit",
|
||||
"test:integration": "bun test test/integration",
|
||||
"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:unit": "bun test --coverage test/unit",
|
||||
"test:coverage:integration": "bun test --coverage test/integration",
|
||||
"preformat": "bun install",
|
||||
"format": "prettier --write ./",
|
||||
"prelint:fix": "bun format",
|
||||
|
||||
@@ -50,10 +50,12 @@ export class Channels {
|
||||
private readonly _httpRequests: PCastHttpRequests;
|
||||
private readonly _channelsByAlias: Map<ChannelAlias, Channel> = new Map();
|
||||
|
||||
constructor(pcastHttpRequests: PCastHttpRequests) {
|
||||
constructor(pcastHttpRequests: PCastHttpRequests, skipInitialization = false) {
|
||||
this._httpRequests = pcastHttpRequests;
|
||||
if (!skipInitialization) {
|
||||
this.initialize();
|
||||
}
|
||||
}
|
||||
|
||||
public async create(name: string, description: string, channelOptions: string[] = []): Promise<Channel> {
|
||||
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');
|
||||
}
|
||||
|
||||
// Remove from cache if it exists
|
||||
const deletedChannel = response.channel;
|
||||
|
||||
if (this._channelsByAlias.has(deletedChannel.alias)) {
|
||||
this._channelsByAlias.delete(deletedChannel.alias);
|
||||
}
|
||||
|
||||
@@ -3,5 +3,7 @@ export enum HttpMethod {
|
||||
POST = 'POST',
|
||||
PUT = 'PUT',
|
||||
PATCH = 'PATCH',
|
||||
DELETE = 'DELETE'
|
||||
DELETE = 'DELETE',
|
||||
OPTIONS = 'OPTIONS',
|
||||
HEAD = 'HEAD'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user