@medusajs/notification-local 0.0.1
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.
- package/README.md +0 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +9 -0
- package/dist/services/local.d.ts +14 -0
- package/dist/services/local.js +23 -0
- package/package.json +39 -0
package/README.md
ADDED
|
File without changes
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const local_1 = require("./services/local");
|
|
4
|
+
const services = [local_1.LocalNotificationService];
|
|
5
|
+
const providerExport = {
|
|
6
|
+
services,
|
|
7
|
+
};
|
|
8
|
+
exports.default = providerExport;
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFDQSw0Q0FBMkQ7QUFFM0QsTUFBTSxRQUFRLEdBQUcsQ0FBQyxnQ0FBd0IsQ0FBQyxDQUFBO0FBRTNDLE1BQU0sY0FBYyxHQUEwQjtJQUM1QyxRQUFRO0NBQ1QsQ0FBQTtBQUVELGtCQUFlLGNBQWMsQ0FBQSJ9
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Logger, NotificationTypes, LocalNotificationServiceOptions } from "@medusajs/types";
|
|
2
|
+
import { AbstractNotificationProviderService } from "@medusajs/utils";
|
|
3
|
+
type InjectedDependencies = {
|
|
4
|
+
logger: Logger;
|
|
5
|
+
};
|
|
6
|
+
interface LocalServiceConfig {
|
|
7
|
+
}
|
|
8
|
+
export declare class LocalNotificationService extends AbstractNotificationProviderService {
|
|
9
|
+
protected config_: LocalServiceConfig;
|
|
10
|
+
protected logger_: Logger;
|
|
11
|
+
constructor({ logger }: InjectedDependencies, options: LocalNotificationServiceOptions);
|
|
12
|
+
send(notification: NotificationTypes.ProviderSendNotificationDTO): Promise<NotificationTypes.ProviderSendNotificationResultsDTO>;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocalNotificationService = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
|
5
|
+
class LocalNotificationService extends utils_1.AbstractNotificationProviderService {
|
|
6
|
+
constructor({ logger }, options) {
|
|
7
|
+
super();
|
|
8
|
+
this.config_ = options;
|
|
9
|
+
this.logger_ = logger;
|
|
10
|
+
}
|
|
11
|
+
async send(notification) {
|
|
12
|
+
if (!notification) {
|
|
13
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.INVALID_DATA, `No notification information provided`);
|
|
14
|
+
}
|
|
15
|
+
const message = `Attempting to send a notification to: ${notification.to}` +
|
|
16
|
+
` on the channel: ${notification.channel} with template: ${notification.template}` +
|
|
17
|
+
` and data: ${JSON.stringify(notification.data)}`;
|
|
18
|
+
this.logger_.info(message);
|
|
19
|
+
return {};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.LocalNotificationService = LocalNotificationService;
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWwuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VydmljZXMvbG9jYWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBS0EsMkNBR3dCO0FBUXhCLE1BQWEsd0JBQXlCLFNBQVEsMkNBQW1DO0lBSS9FLFlBQ0UsRUFBRSxNQUFNLEVBQXdCLEVBQ2hDLE9BQXdDO1FBRXhDLEtBQUssRUFBRSxDQUFBO1FBQ1AsSUFBSSxDQUFDLE9BQU8sR0FBRyxPQUFPLENBQUE7UUFDdEIsSUFBSSxDQUFDLE9BQU8sR0FBRyxNQUFNLENBQUE7SUFDdkIsQ0FBQztJQUVELEtBQUssQ0FBQyxJQUFJLENBQ1IsWUFBMkQ7UUFFM0QsSUFBSSxDQUFDLFlBQVksRUFBRTtZQUNqQixNQUFNLElBQUksbUJBQVcsQ0FDbkIsbUJBQVcsQ0FBQyxLQUFLLENBQUMsWUFBWSxFQUM5QixzQ0FBc0MsQ0FDdkMsQ0FBQTtTQUNGO1FBRUQsTUFBTSxPQUFPLEdBQ1gseUNBQXlDLFlBQVksQ0FBQyxFQUFFLEVBQUU7WUFDMUQsb0JBQW9CLFlBQVksQ0FBQyxPQUFPLG1CQUFtQixZQUFZLENBQUMsUUFBUSxFQUFFO1lBQ2xGLGNBQWMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQTtRQUVuRCxJQUFJLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQTtRQUMxQixPQUFPLEVBQUUsQ0FBQTtJQUNYLENBQUM7Q0FDRjtBQS9CRCw0REErQkMifQ==
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@medusajs/notification-local",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Local (logging) notification provider for Medusa, useful for testing purposes and log audits",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/medusajs/medusa",
|
|
9
|
+
"directory": "packages/modules/providers/notification-local"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"engines": {
|
|
15
|
+
"node": ">=16"
|
|
16
|
+
},
|
|
17
|
+
"author": "Medusa",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
|
|
21
|
+
"test": "jest --passWithNoTests src",
|
|
22
|
+
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts",
|
|
23
|
+
"build": "rimraf dist && tsc -p ./tsconfig.json",
|
|
24
|
+
"watch": "tsc --watch"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"cross-env": "^5.2.1",
|
|
28
|
+
"jest": "^25.5.4",
|
|
29
|
+
"rimraf": "^5.0.1",
|
|
30
|
+
"typescript": "^4.9.5"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@medusajs/utils": "^1.11.7"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"medusa-provider",
|
|
37
|
+
"medusa-provider-local"
|
|
38
|
+
]
|
|
39
|
+
}
|