@theshelf/notification 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import NotificationError from './NotificationError';
1
+ import NotificationError from './NotificationError.js';
2
2
  export default class NotConnected extends NotificationError {
3
3
  constructor(message?: string);
4
4
  }
@@ -1,4 +1,4 @@
1
- import NotificationError from './NotificationError';
1
+ import NotificationError from './NotificationError.js';
2
2
  export default class NotConnected extends NotificationError {
3
3
  constructor(message) {
4
4
  super(message ?? 'Notification service not connected');
@@ -1,4 +1,4 @@
1
- import NotificationError from './NotificationError';
1
+ import NotificationError from './NotificationError.js';
2
2
  export default class SubscriptionNotFound extends NotificationError {
3
3
  constructor(recipientId?: string);
4
4
  }
@@ -1,4 +1,4 @@
1
- import NotificationError from './NotificationError';
1
+ import NotificationError from './NotificationError.js';
2
2
  export default class SubscriptionNotFound extends NotificationError {
3
3
  constructor(recipientId) {
4
4
  super(recipientId ? `Subscription not found for: ${recipientId}` : 'Subscription not found');
@@ -1,4 +1,4 @@
1
- import NotificationError from './NotificationError';
1
+ import NotificationError from './NotificationError.js';
2
2
  export default class UnknownImplementation extends NotificationError {
3
3
  constructor(name: string);
4
4
  }
@@ -1,4 +1,4 @@
1
- import NotificationError from './NotificationError';
1
+ import NotificationError from './NotificationError.js';
2
2
  export default class UnknownImplementation extends NotificationError {
3
3
  constructor(name) {
4
4
  super(`Unknown notification implementation: ${name}`);
@@ -1,3 +1,3 @@
1
- import type { NotificationService } from './definitions/interfaces';
1
+ import type { NotificationService } from './definitions/interfaces.js';
2
2
  declare const _default: NotificationService;
3
3
  export default _default;
@@ -1,6 +1,6 @@
1
- import UnknownImplementation from './errors/UnknownImplementation';
2
- import createMemory from './implementations/memory/create';
3
- import createWebPush from './implementations/webpush/create';
1
+ import UnknownImplementation from './errors/UnknownImplementation.js';
2
+ import createMemory from './implementations/memory/create.js';
3
+ import createWebPush from './implementations/webpush/create.js';
4
4
  const implementations = new Map([
5
5
  ['memory', createMemory],
6
6
  ['webpush', createWebPush],
@@ -1,4 +1,4 @@
1
- import type { NotificationService } from '../../definitions/interfaces';
1
+ import type { NotificationService } from '../../definitions/interfaces.js';
2
2
  type Notification = {
3
3
  title: string;
4
4
  body: string;
@@ -1,5 +1,5 @@
1
- import NotConnected from '../../errors/NotConnected';
2
- import SubscriptionNotFound from '../../errors/SubscriptionNotFound';
1
+ import NotConnected from '../../errors/NotConnected.js';
2
+ import SubscriptionNotFound from '../../errors/SubscriptionNotFound.js';
3
3
  export default class Memory {
4
4
  #subscriptions;
5
5
  get connected() {
@@ -1,2 +1,2 @@
1
- import Memory from './Memory';
1
+ import Memory from './Memory.js';
2
2
  export default function create(): Memory;
@@ -1,4 +1,4 @@
1
- import Memory from './Memory';
1
+ import Memory from './Memory.js';
2
2
  export default function create() {
3
3
  return new Memory();
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import type { PushSubscription } from 'web-push';
2
- import type { NotificationService } from '../../definitions/interfaces';
2
+ import type { NotificationService } from '../../definitions/interfaces.js';
3
3
  type VapidDetails = {
4
4
  subject: string;
5
5
  publicKey: string;
@@ -1,6 +1,6 @@
1
1
  import webpush from 'web-push';
2
- import NotConnected from '../../errors/NotConnected';
3
- import SubscriptionNotFound from '../../errors/SubscriptionNotFound';
2
+ import NotConnected from '../../errors/NotConnected.js';
3
+ import SubscriptionNotFound from '../../errors/SubscriptionNotFound.js';
4
4
  export default class WebPush {
5
5
  #configuration;
6
6
  #subscriptions;
@@ -1,2 +1,2 @@
1
- import WebPush from './WebPush';
1
+ import WebPush from './WebPush.js';
2
2
  export default function create(): WebPush;
@@ -1,4 +1,4 @@
1
- import WebPush from './WebPush';
1
+ import WebPush from './WebPush.js';
2
2
  export default function create() {
3
3
  const subject = process.env.WEBPUSH_SUBJECT ?? 'undefined';
4
4
  const publicKey = process.env.WEBPUSH_PUBLIC_KEY ?? 'undefined';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export type { NotificationService } from './definitions/interfaces';
2
- export { default as NotConnected } from './errors/NotConnected';
3
- export { default as NotificationError } from './errors/NotificationError';
4
- export { default as SubscriptionNotFound } from './errors/SubscriptionNotFound';
5
- export { default as UnknownImplementation } from './errors/UnknownImplementation';
6
- export { default } from './implementation';
1
+ export type { NotificationService } from './definitions/interfaces.js';
2
+ export { default as NotConnected } from './errors/NotConnected.js';
3
+ export { default as NotificationError } from './errors/NotificationError.js';
4
+ export { default as SubscriptionNotFound } from './errors/SubscriptionNotFound.js';
5
+ export { default as UnknownImplementation } from './errors/UnknownImplementation.js';
6
+ export { default } from './implementation.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- export { default as NotConnected } from './errors/NotConnected';
2
- export { default as NotificationError } from './errors/NotificationError';
3
- export { default as SubscriptionNotFound } from './errors/SubscriptionNotFound';
4
- export { default as UnknownImplementation } from './errors/UnknownImplementation';
5
- export { default } from './implementation';
1
+ export { default as NotConnected } from './errors/NotConnected.js';
2
+ export { default as NotificationError } from './errors/NotificationError.js';
3
+ export { default as SubscriptionNotFound } from './errors/SubscriptionNotFound.js';
4
+ export { default as UnknownImplementation } from './errors/UnknownImplementation.js';
5
+ export { default } from './implementation.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@theshelf/notification",
3
3
  "private": false,
4
- "version": "0.0.1",
4
+ "version": "0.0.3",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsc",