Compare commits
3 Commits
d0f3af72f6
...
bca1cde895
| Author | SHA1 | Date | |
|---|---|---|---|
| bca1cde895 | |||
| 8c1993d39a | |||
| 8762051e7a |
@@ -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"]
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -50,9 +50,11 @@ 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;
|
||||||
this.initialize();
|
if (!skipInitialization) {
|
||||||
|
this.initialize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async create(name: string, description: string, channelOptions: string[] = []): Promise<Channel> {
|
public async create(name: string, description: string, channelOptions: string[] = []): Promise<Channel> {
|
||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user