Skip to content

Commit

Permalink
refactor: move reponse utils to common
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyTseng committed Sep 9, 2024
1 parent 69063b6 commit 3778e90
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/common/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export * from './crypto.util';
export * from './event.util';
export * from './filter.util';
export * from './proof-of-work.util';
export * from './response.util';
export * from './rxjs.util';
export * from './shared.util';
export * from './time.util';
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { MessageType } from '../constants';
import {
Event,
MessageType,
OutgoingAuthMessage,
OutgoingClosedMessage,
OutgoingEoseMessage,
OutgoingEventMessage,
OutgoingNoticeMessage,
OutgoingOkMessage,
SubscriptionId,
} from '@nostr-relay/common';
} from '../interfaces';

/**
* Create an outgoing OK message.
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './nostr-relay';
export * from './utils/response';
12 changes: 5 additions & 7 deletions packages/core/src/nostr-relay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@ import {
NostrRelayPlugin,
SubscriptionId,
UnauthenticatedError,
} from '@nostr-relay/common';
import { EventService } from './services/event.service';
import { PluginManagerService } from './services/plugin-manager.service';
import { SubscriptionService } from './services/subscription.service';
import {
LazyCache,
createOutgoingAuthMessage,
createOutgoingClosedMessage,
createOutgoingEoseMessage,
createOutgoingEventMessage,
createOutgoingNoticeMessage,
createOutgoingOkMessage,
} from './utils';
} from '@nostr-relay/common';
import { EventService } from './services/event.service';
import { PluginManagerService } from './services/plugin-manager.service';
import { SubscriptionService } from './services/subscription.service';
import { LazyCache } from './utils';

export class NostrRelay {
private readonly options: NostrRelayOptions;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/services/subscription.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
EventUtils,
Filter,
Logger,
createOutgoingEventMessage,
} from '@nostr-relay/common';
import { createOutgoingEventMessage } from '../utils';

export class SubscriptionService {
constructor(
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './lazy-cache';
export * from './response';

0 comments on commit 3778e90

Please sign in to comment.