dicoshot-nest 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.
Files changed (45) hide show
  1. package/README.md +98 -0
  2. package/dist/dicoshot-core/src/client/dicoshot.client.d.ts +4 -0
  3. package/dist/dicoshot-core/src/client/dicoshot.client.impl.d.ts +8 -0
  4. package/dist/dicoshot-core/src/client/dicoshot.client.impl.js +21 -0
  5. package/dist/dicoshot-core/src/client/dicoshot.client.impl.js.map +1 -0
  6. package/dist/dicoshot-core/src/client/dicoshot.client.js +3 -0
  7. package/dist/dicoshot-core/src/client/dicoshot.client.js.map +1 -0
  8. package/dist/dicoshot-core/src/index.d.ts +5 -0
  9. package/dist/dicoshot-core/src/index.js +8 -0
  10. package/dist/dicoshot-core/src/index.js.map +1 -0
  11. package/dist/dicoshot-core/src/message/discord.message.d.ts +16 -0
  12. package/dist/dicoshot-core/src/message/discord.message.js +3 -0
  13. package/dist/dicoshot-core/src/message/discord.message.js.map +1 -0
  14. package/dist/dicoshot-core/src/message/message.factory.d.ts +10 -0
  15. package/dist/dicoshot-core/src/message/message.factory.js +90 -0
  16. package/dist/dicoshot-core/src/message/message.factory.js.map +1 -0
  17. package/dist/dicoshot-core/src/options/dicoshot.options.d.ts +9 -0
  18. package/dist/dicoshot-core/src/options/dicoshot.options.js +3 -0
  19. package/dist/dicoshot-core/src/options/dicoshot.options.js.map +1 -0
  20. package/dist/dicoshot-nest/src/app.controller.d.ts +6 -0
  21. package/dist/dicoshot-nest/src/app.controller.js +35 -0
  22. package/dist/dicoshot-nest/src/app.controller.js.map +1 -0
  23. package/dist/dicoshot-nest/src/app.module.d.ts +2 -0
  24. package/dist/dicoshot-nest/src/app.module.js +23 -0
  25. package/dist/dicoshot-nest/src/app.module.js.map +1 -0
  26. package/dist/dicoshot-nest/src/app.service.d.ts +3 -0
  27. package/dist/dicoshot-nest/src/app.service.js +20 -0
  28. package/dist/dicoshot-nest/src/app.service.js.map +1 -0
  29. package/dist/dicoshot-nest/src/dicoshot.constants.d.ts +1 -0
  30. package/dist/dicoshot-nest/src/dicoshot.constants.js +5 -0
  31. package/dist/dicoshot-nest/src/dicoshot.constants.js.map +1 -0
  32. package/dist/dicoshot-nest/src/dicoshot.listener.d.ts +11 -0
  33. package/dist/dicoshot-nest/src/dicoshot.listener.js +61 -0
  34. package/dist/dicoshot-nest/src/dicoshot.listener.js.map +1 -0
  35. package/dist/dicoshot-nest/src/dicoshot.module.d.ts +11 -0
  36. package/dist/dicoshot-nest/src/dicoshot.module.js +41 -0
  37. package/dist/dicoshot-nest/src/dicoshot.module.js.map +1 -0
  38. package/dist/dicoshot-nest/src/index.d.ts +4 -0
  39. package/dist/dicoshot-nest/src/index.js +10 -0
  40. package/dist/dicoshot-nest/src/index.js.map +1 -0
  41. package/dist/dicoshot-nest/src/main.d.ts +1 -0
  42. package/dist/dicoshot-nest/src/main.js +10 -0
  43. package/dist/dicoshot-nest/src/main.js.map +1 -0
  44. package/dist/tsconfig.build.tsbuildinfo +1 -0
  45. package/package.json +81 -0
package/README.md ADDED
@@ -0,0 +1,98 @@
1
+ <p align="center">
2
+ <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
3
+ </p>
4
+
5
+ [circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
6
+ [circleci-url]: https://circleci.com/gh/nestjs/nest
7
+
8
+ <p align="center">A progressive <a href="http://nodejs.org" target="_blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
9
+ <p align="center">
10
+ <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/v/@nestjs/core.svg" alt="NPM Version" /></a>
11
+ <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/l/@nestjs/core.svg" alt="Package License" /></a>
12
+ <a href="https://www.npmjs.com/~nestjscore" target="_blank"><img src="https://img.shields.io/npm/dm/@nestjs/common.svg" alt="NPM Downloads" /></a>
13
+ <a href="https://circleci.com/gh/nestjs/nest" target="_blank"><img src="https://img.shields.io/circleci/build/github/nestjs/nest/master" alt="CircleCI" /></a>
14
+ <a href="https://discord.gg/G7Qnnhy" target="_blank"><img src="https://img.shields.io/badge/discord-online-brightgreen.svg" alt="Discord"/></a>
15
+ <a href="https://opencollective.com/nest#backer" target="_blank"><img src="https://opencollective.com/nest/backers/badge.svg" alt="Backers on Open Collective" /></a>
16
+ <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://opencollective.com/nest/sponsors/badge.svg" alt="Sponsors on Open Collective" /></a>
17
+ <a href="https://paypal.me/kamilmysliwiec" target="_blank"><img src="https://img.shields.io/badge/Donate-PayPal-ff3f59.svg" alt="Donate us"/></a>
18
+ <a href="https://opencollective.com/nest#sponsor" target="_blank"><img src="https://img.shields.io/badge/Support%20us-Open%20Collective-41B883.svg" alt="Support us"></a>
19
+ <a href="https://twitter.com/nestframework" target="_blank"><img src="https://img.shields.io/twitter/follow/nestframework.svg?style=social&label=Follow" alt="Follow us on Twitter"></a>
20
+ </p>
21
+ <!--[![Backers on Open Collective](https://opencollective.com/nest/backers/badge.svg)](https://opencollective.com/nest#backer)
22
+ [![Sponsors on Open Collective](https://opencollective.com/nest/sponsors/badge.svg)](https://opencollective.com/nest#sponsor)-->
23
+
24
+ ## Description
25
+
26
+ [Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
27
+
28
+ ## Project setup
29
+
30
+ ```bash
31
+ $ npm install
32
+ ```
33
+
34
+ ## Compile and run the project
35
+
36
+ ```bash
37
+ # development
38
+ $ npm run start
39
+
40
+ # watch mode
41
+ $ npm run start:dev
42
+
43
+ # production mode
44
+ $ npm run start:prod
45
+ ```
46
+
47
+ ## Run tests
48
+
49
+ ```bash
50
+ # unit tests
51
+ $ npm run test
52
+
53
+ # e2e tests
54
+ $ npm run test:e2e
55
+
56
+ # test coverage
57
+ $ npm run test:cov
58
+ ```
59
+
60
+ ## Deployment
61
+
62
+ When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the [deployment documentation](https://docs.nestjs.com/deployment) for more information.
63
+
64
+ If you are looking for a cloud-based platform to deploy your NestJS application, check out [Mau](https://mau.nestjs.com), our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:
65
+
66
+ ```bash
67
+ $ npm install -g @nestjs/mau
68
+ $ mau deploy
69
+ ```
70
+
71
+ With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.
72
+
73
+ ## Resources
74
+
75
+ Check out a few resources that may come in handy when working with NestJS:
76
+
77
+ - Visit the [NestJS Documentation](https://docs.nestjs.com) to learn more about the framework.
78
+ - For questions and support, please visit our [Discord channel](https://discord.gg/G7Qnnhy).
79
+ - To dive deeper and get more hands-on experience, check out our official video [courses](https://courses.nestjs.com/).
80
+ - Deploy your application to AWS with the help of [NestJS Mau](https://mau.nestjs.com) in just a few clicks.
81
+ - Visualize your application graph and interact with the NestJS application in real-time using [NestJS Devtools](https://devtools.nestjs.com).
82
+ - Need help with your project (part-time to full-time)? Check out our official [enterprise support](https://enterprise.nestjs.com).
83
+ - To stay in the loop and get updates, follow us on [X](https://x.com/nestframework) and [LinkedIn](https://linkedin.com/company/nestjs).
84
+ - Looking for a job, or have a job to offer? Check out our official [Jobs board](https://jobs.nestjs.com).
85
+
86
+ ## Support
87
+
88
+ Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please [read more here](https://docs.nestjs.com/support).
89
+
90
+ ## Stay in touch
91
+
92
+ - Author - [Kamil Myśliwiec](https://twitter.com/kammysliwiec)
93
+ - Website - [https://nestjs.com](https://nestjs.com/)
94
+ - Twitter - [@nestframework](https://twitter.com/nestframework)
95
+
96
+ ## License
97
+
98
+ Nest is [MIT licensed](https://github.com/nestjs/nest/blob/master/LICENSE).
@@ -0,0 +1,4 @@
1
+ import { DiscordMessage } from '../message/discord.message';
2
+ export interface DicoshotClient {
3
+ send(message: DiscordMessage): Promise<void>;
4
+ }
@@ -0,0 +1,8 @@
1
+ import { DicoshotOptions } from '../options/dicoshot.options';
2
+ import { DiscordMessage } from '../message/discord.message';
3
+ import { DicoshotClient } from './dicoshot.client';
4
+ export declare class DicoshotClientImpl implements DicoshotClient {
5
+ private readonly options;
6
+ constructor(options: DicoshotOptions);
7
+ send(message: DiscordMessage): Promise<void>;
8
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DicoshotClientImpl = void 0;
7
+ const axios_1 = __importDefault(require("axios"));
8
+ class DicoshotClientImpl {
9
+ options;
10
+ constructor(options) {
11
+ this.options = options;
12
+ }
13
+ async send(message) {
14
+ await axios_1.default.post(this.options.webhookUrl, message, {
15
+ timeout: this.options.timeoutMs ?? 5000,
16
+ headers: { 'Content-Type': 'application/json' },
17
+ });
18
+ }
19
+ }
20
+ exports.DicoshotClientImpl = DicoshotClientImpl;
21
+ //# sourceMappingURL=dicoshot.client.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dicoshot.client.impl.js","sourceRoot":"","sources":["../../../../../dicoshot-core/src/client/dicoshot.client.impl.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAK1B,MAAa,kBAAkB;IACA;IAA7B,YAA6B,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;IAAG,CAAC;IAEzD,KAAK,CAAC,IAAI,CAAC,OAAuB;QAChC,MAAM,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE;YACjD,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,IAAI;YACvC,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AATD,gDASC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dicoshot.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dicoshot.client.js","sourceRoot":"","sources":["../../../../../dicoshot-core/src/client/dicoshot.client.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export type { DicoshotOptions } from './options/dicoshot.options';
2
+ export type { DiscordField, DiscordEmbed, DiscordMessage } from './message/discord.message';
3
+ export { MessageFactory } from './message/message.factory';
4
+ export type { DicoshotClient } from './client/dicoshot.client';
5
+ export { DicoshotClientImpl } from './client/dicoshot.client.impl';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DicoshotClientImpl = exports.MessageFactory = void 0;
4
+ var message_factory_1 = require("./message/message.factory");
5
+ Object.defineProperty(exports, "MessageFactory", { enumerable: true, get: function () { return message_factory_1.MessageFactory; } });
6
+ var dicoshot_client_impl_1 = require("./client/dicoshot.client.impl");
7
+ Object.defineProperty(exports, "DicoshotClientImpl", { enumerable: true, get: function () { return dicoshot_client_impl_1.DicoshotClientImpl; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../dicoshot-core/src/index.ts"],"names":[],"mappings":";;;AAEA,6DAA2D;AAAlD,iHAAA,cAAc,OAAA;AAEvB,sEAAmE;AAA1D,0HAAA,kBAAkB,OAAA"}
@@ -0,0 +1,16 @@
1
+ export interface DiscordField {
2
+ name: string;
3
+ value: string;
4
+ inline?: boolean;
5
+ }
6
+ export interface DiscordEmbed {
7
+ title?: string;
8
+ description?: string;
9
+ color?: number;
10
+ fields?: DiscordField[];
11
+ timestamp?: string;
12
+ }
13
+ export interface DiscordMessage {
14
+ username?: string;
15
+ embeds?: DiscordEmbed[];
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=discord.message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discord.message.js","sourceRoot":"","sources":["../../../../../dicoshot-core/src/message/discord.message.ts"],"names":[],"mappings":""}
@@ -0,0 +1,10 @@
1
+ import { DicoshotOptions } from '../options/dicoshot.options';
2
+ import { DiscordMessage } from './discord.message';
3
+ export declare class MessageFactory {
4
+ private readonly options;
5
+ private readonly version;
6
+ private readonly env;
7
+ constructor(options: DicoshotOptions);
8
+ startup(): DiscordMessage;
9
+ shutdown(): DiscordMessage;
10
+ }
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.MessageFactory = void 0;
37
+ const os = __importStar(require("os"));
38
+ const STARTUP_COLOR = 5763719;
39
+ const SHUTDOWN_COLOR = 15548997;
40
+ class MessageFactory {
41
+ options;
42
+ version;
43
+ env;
44
+ constructor(options) {
45
+ this.options = options;
46
+ this.version = process.env['npm_package_version'] ?? '0.0.0';
47
+ this.env = process.env['NODE_ENV'] ?? 'development';
48
+ }
49
+ startup() {
50
+ const now = new Date().toISOString();
51
+ return {
52
+ username: this.options.username,
53
+ embeds: [
54
+ {
55
+ title: '🟢 Application Started',
56
+ color: STARTUP_COLOR,
57
+ fields: [
58
+ { name: 'Service', value: this.options.applicationName ?? 'Unknown', inline: true },
59
+ { name: 'Environment', value: this.env, inline: true },
60
+ { name: 'Version', value: this.version, inline: true },
61
+ { name: 'Hostname', value: os.hostname(), inline: true },
62
+ { name: 'Time', value: now, inline: false },
63
+ ],
64
+ timestamp: now,
65
+ },
66
+ ],
67
+ };
68
+ }
69
+ shutdown() {
70
+ const now = new Date().toISOString();
71
+ return {
72
+ username: this.options.username,
73
+ embeds: [
74
+ {
75
+ title: '🔴 Application Stopped',
76
+ color: SHUTDOWN_COLOR,
77
+ fields: [
78
+ { name: 'Service', value: this.options.applicationName ?? 'Unknown', inline: true },
79
+ { name: 'Environment', value: this.env, inline: true },
80
+ { name: 'Hostname', value: os.hostname(), inline: true },
81
+ { name: 'Time', value: now, inline: false },
82
+ ],
83
+ timestamp: now,
84
+ },
85
+ ],
86
+ };
87
+ }
88
+ }
89
+ exports.MessageFactory = MessageFactory;
90
+ //# sourceMappingURL=message.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.factory.js","sourceRoot":"","sources":["../../../../../dicoshot-core/src/message/message.factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AAIzB,MAAM,aAAa,GAAG,OAAO,CAAC;AAC9B,MAAM,cAAc,GAAG,QAAQ,CAAC;AAEhC,MAAa,cAAc;IAII;IAHZ,OAAO,CAAS;IAChB,GAAG,CAAS;IAE7B,YAA6B,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;QACnD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,OAAO,CAAC;QAC7D,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,aAAa,CAAC;IACtD,CAAC;IAED,OAAO;QACL,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACrC,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;YAC/B,MAAM,EAAE;gBACN;oBACE,KAAK,EAAE,wBAAwB;oBAC/B,KAAK,EAAE,aAAa;oBACpB,MAAM,EAAE;wBACN,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,IAAI,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE;wBACnF,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;wBACtD,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE;wBACtD,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;wBACxD,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE;qBAC5C;oBACD,SAAS,EAAE,GAAG;iBACf;aACF;SACF,CAAC;IACJ,CAAC;IAED,QAAQ;QACN,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACrC,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ;YAC/B,MAAM,EAAE;gBACN;oBACE,KAAK,EAAE,wBAAwB;oBAC/B,KAAK,EAAE,cAAc;oBACrB,MAAM,EAAE;wBACN,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,eAAe,IAAI,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE;wBACnF,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE;wBACtD,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,EAAE,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;wBACxD,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE;qBAC5C;oBACD,SAAS,EAAE,GAAG;iBACf;aACF;SACF,CAAC;IACJ,CAAC;CACF;AAjDD,wCAiDC"}
@@ -0,0 +1,9 @@
1
+ export interface DicoshotOptions {
2
+ webhookUrl: string;
3
+ enabled?: boolean;
4
+ notifyOnStartup?: boolean;
5
+ notifyOnShutdown?: boolean;
6
+ applicationName?: string;
7
+ username?: string;
8
+ timeoutMs?: number;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=dicoshot.options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dicoshot.options.js","sourceRoot":"","sources":["../../../../../dicoshot-core/src/options/dicoshot.options.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ import { AppService } from './app.service';
2
+ export declare class AppController {
3
+ private readonly appService;
4
+ constructor(appService: AppService);
5
+ getHello(): string;
6
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AppController = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const app_service_1 = require("./app.service");
15
+ let AppController = class AppController {
16
+ appService;
17
+ constructor(appService) {
18
+ this.appService = appService;
19
+ }
20
+ getHello() {
21
+ return this.appService.getHello();
22
+ }
23
+ };
24
+ exports.AppController = AppController;
25
+ __decorate([
26
+ (0, common_1.Get)(),
27
+ __metadata("design:type", Function),
28
+ __metadata("design:paramtypes", []),
29
+ __metadata("design:returntype", String)
30
+ ], AppController.prototype, "getHello", null);
31
+ exports.AppController = AppController = __decorate([
32
+ (0, common_1.Controller)(),
33
+ __metadata("design:paramtypes", [app_service_1.AppService])
34
+ ], AppController);
35
+ //# sourceMappingURL=app.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../../../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,+CAA2C;AAGpC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACK;IAA7B,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAGvD,QAAQ;QACN,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IACpC,CAAC;CACF,CAAA;AAPY,sCAAa;AAIxB;IADC,IAAA,YAAG,GAAE;;;;6CAGL;wBANU,aAAa;IADzB,IAAA,mBAAU,GAAE;qCAE8B,wBAAU;GADxC,aAAa,CAOzB"}
@@ -0,0 +1,2 @@
1
+ export declare class AppModule {
2
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.AppModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const app_controller_1 = require("./app.controller");
12
+ const app_service_1 = require("./app.service");
13
+ let AppModule = class AppModule {
14
+ };
15
+ exports.AppModule = AppModule;
16
+ exports.AppModule = AppModule = __decorate([
17
+ (0, common_1.Module)({
18
+ imports: [],
19
+ controllers: [app_controller_1.AppController],
20
+ providers: [app_service_1.AppService],
21
+ })
22
+ ], AppModule);
23
+ //# sourceMappingURL=app.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,qDAAiD;AACjD,+CAA2C;AAOpC,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IALrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,wBAAU,CAAC;KACxB,CAAC;GACW,SAAS,CAAG"}
@@ -0,0 +1,3 @@
1
+ export declare class AppService {
2
+ getHello(): string;
3
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.AppService = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ let AppService = class AppService {
12
+ getHello() {
13
+ return 'Hello World!';
14
+ }
15
+ };
16
+ exports.AppService = AppService;
17
+ exports.AppService = AppService = __decorate([
18
+ (0, common_1.Injectable)()
19
+ ], AppService);
20
+ //# sourceMappingURL=app.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.service.js","sourceRoot":"","sources":["../../../src/app.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,QAAQ;QACN,OAAO,cAAc,CAAC;IACxB,CAAC;CACF,CAAA;AAJY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;GACA,UAAU,CAItB"}
@@ -0,0 +1 @@
1
+ export declare const DICOSHOT_OPTIONS = "DICOSHOT_OPTIONS";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DICOSHOT_OPTIONS = void 0;
4
+ exports.DICOSHOT_OPTIONS = 'DICOSHOT_OPTIONS';
5
+ //# sourceMappingURL=dicoshot.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dicoshot.constants.js","sourceRoot":"","sources":["../../../src/dicoshot.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { OnApplicationBootstrap, OnApplicationShutdown } from '@nestjs/common';
2
+ import type { DicoshotOptions } from "dicoshot-core";
3
+ export declare class DicoshotListener implements OnApplicationBootstrap, OnApplicationShutdown {
4
+ private readonly options;
5
+ private readonly logger;
6
+ private readonly client;
7
+ private readonly factory;
8
+ constructor(options: DicoshotOptions);
9
+ onApplicationBootstrap(): Promise<void>;
10
+ onApplicationShutdown(): Promise<void>;
11
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var DicoshotListener_1;
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.DicoshotListener = void 0;
17
+ const common_1 = require("@nestjs/common");
18
+ const dicoshot_core_1 = require("dicoshot-core");
19
+ const dicoshot_constants_1 = require("./dicoshot.constants");
20
+ let DicoshotListener = DicoshotListener_1 = class DicoshotListener {
21
+ options;
22
+ logger = new common_1.Logger(DicoshotListener_1.name);
23
+ client;
24
+ factory;
25
+ constructor(options) {
26
+ this.options = options;
27
+ this.client = new dicoshot_core_1.DicoshotClientImpl(options);
28
+ this.factory = new dicoshot_core_1.MessageFactory(options);
29
+ }
30
+ async onApplicationBootstrap() {
31
+ if (!this.options.webhookUrl || this.options.enabled === false)
32
+ return;
33
+ if (this.options.notifyOnStartup === false)
34
+ return;
35
+ try {
36
+ await this.client.send(this.factory.startup());
37
+ }
38
+ catch (err) {
39
+ this.logger.warn(`Failed to send startup notification: ${err.message}`);
40
+ }
41
+ }
42
+ async onApplicationShutdown() {
43
+ if (!this.options.webhookUrl || this.options.enabled === false)
44
+ return;
45
+ if (this.options.notifyOnShutdown === false)
46
+ return;
47
+ try {
48
+ await this.client.send(this.factory.shutdown());
49
+ }
50
+ catch (err) {
51
+ this.logger.warn(`Failed to send shutdown notification: ${err.message}`);
52
+ }
53
+ }
54
+ };
55
+ exports.DicoshotListener = DicoshotListener;
56
+ exports.DicoshotListener = DicoshotListener = DicoshotListener_1 = __decorate([
57
+ (0, common_1.Injectable)(),
58
+ __param(0, (0, common_1.Inject)(dicoshot_constants_1.DICOSHOT_OPTIONS)),
59
+ __metadata("design:paramtypes", [Object])
60
+ ], DicoshotListener);
61
+ //# sourceMappingURL=dicoshot.listener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dicoshot.listener.js","sourceRoot":"","sources":["../../../src/dicoshot.listener.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAMwB;AAExB,iDAAmE;AACnE,6DAAwD;AAGjD,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAQkB;IAL5B,MAAM,GAAG,IAAI,eAAM,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,CAAqB;IAC3B,OAAO,CAAiB;IAEzC,YAC6C,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;QAEnE,IAAI,CAAC,MAAM,GAAG,IAAI,kCAAkB,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,GAAG,IAAI,8BAAc,CAAC,OAAO,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,KAAK;YAAE,OAAO;QACvE,IAAI,IAAI,CAAC,OAAO,CAAC,eAAe,KAAK,KAAK;YAAE,OAAO;QACnD,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,wCAAyC,GAAa,CAAC,OAAO,EAAE,CACjE,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,qBAAqB;QACzB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,KAAK;YAAE,OAAO;QACvE,IAAI,IAAI,CAAC,OAAO,CAAC,gBAAgB,KAAK,KAAK;YAAE,OAAO;QACpD,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;QAClD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,yCAA0C,GAAa,CAAC,OAAO,EAAE,CAClE,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AArCY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IASR,WAAA,IAAA,eAAM,EAAC,qCAAgB,CAAC,CAAA;;GARhB,gBAAgB,CAqC5B"}
@@ -0,0 +1,11 @@
1
+ import { DynamicModule, ModuleMetadata } from '@nestjs/common';
2
+ import { DicoshotOptions } from "dicoshot-core";
3
+ interface DicoshotAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
4
+ useFactory: (...args: unknown[]) => Promise<DicoshotOptions> | DicoshotOptions;
5
+ inject?: unknown[];
6
+ }
7
+ export declare class DicoshotModule {
8
+ static register(options: DicoshotOptions): DynamicModule;
9
+ static registerAsync({ useFactory, inject, imports }: DicoshotAsyncOptions): DynamicModule;
10
+ }
11
+ export {};
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var DicoshotModule_1;
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.DicoshotModule = void 0;
11
+ const common_1 = require("@nestjs/common");
12
+ const dicoshot_constants_1 = require("./dicoshot.constants");
13
+ const dicoshot_listener_1 = require("./dicoshot.listener");
14
+ let DicoshotModule = DicoshotModule_1 = class DicoshotModule {
15
+ static register(options) {
16
+ return {
17
+ module: DicoshotModule_1,
18
+ providers: [
19
+ { provide: dicoshot_constants_1.DICOSHOT_OPTIONS, useValue: options },
20
+ dicoshot_listener_1.DicoshotListener,
21
+ ],
22
+ };
23
+ }
24
+ static registerAsync({ useFactory, inject, imports }) {
25
+ const optionsProvider = {
26
+ provide: dicoshot_constants_1.DICOSHOT_OPTIONS,
27
+ useFactory,
28
+ inject: inject ?? [],
29
+ };
30
+ return {
31
+ module: DicoshotModule_1,
32
+ imports: imports ?? [],
33
+ providers: [optionsProvider, dicoshot_listener_1.DicoshotListener],
34
+ };
35
+ }
36
+ };
37
+ exports.DicoshotModule = DicoshotModule;
38
+ exports.DicoshotModule = DicoshotModule = DicoshotModule_1 = __decorate([
39
+ (0, common_1.Module)({})
40
+ ], DicoshotModule);
41
+ //# sourceMappingURL=dicoshot.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dicoshot.module.js","sourceRoot":"","sources":["../../../src/dicoshot.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAAiF;AAEjF,6DAAwD;AACxD,2DAAuD;AAQhD,IAAM,cAAc,sBAApB,MAAM,cAAc;IACzB,MAAM,CAAC,QAAQ,CAAC,OAAwB;QACtC,OAAO;YACL,MAAM,EAAE,gBAAc;YACtB,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,qCAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE;gBAChD,oCAAgB;aACjB;SACF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,aAAa,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAwB;QACxE,MAAM,eAAe,GAAa;YAChC,OAAO,EAAE,qCAAgB;YACzB,UAAU;YACV,MAAM,EAAG,MAAa,IAAI,EAAE;SAC7B,CAAC;QACF,OAAO;YACL,MAAM,EAAE,gBAAc;YACtB,OAAO,EAAE,OAAO,IAAI,EAAE;YACtB,SAAS,EAAE,CAAC,eAAe,EAAE,oCAAgB,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF,CAAA;AAvBY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,cAAc,CAuB1B"}
@@ -0,0 +1,4 @@
1
+ export { DicoshotModule } from './dicoshot.module';
2
+ export { DicoshotListener } from './dicoshot.listener';
3
+ export { DICOSHOT_OPTIONS } from './dicoshot.constants';
4
+ export type { DicoshotOptions } from "dicoshot-core";
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DICOSHOT_OPTIONS = exports.DicoshotListener = exports.DicoshotModule = void 0;
4
+ var dicoshot_module_1 = require("./dicoshot.module");
5
+ Object.defineProperty(exports, "DicoshotModule", { enumerable: true, get: function () { return dicoshot_module_1.DicoshotModule; } });
6
+ var dicoshot_listener_1 = require("./dicoshot.listener");
7
+ Object.defineProperty(exports, "DicoshotListener", { enumerable: true, get: function () { return dicoshot_listener_1.DicoshotListener; } });
8
+ var dicoshot_constants_1 = require("./dicoshot.constants");
9
+ Object.defineProperty(exports, "DICOSHOT_OPTIONS", { enumerable: true, get: function () { return dicoshot_constants_1.DICOSHOT_OPTIONS; } });
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,yDAAuD;AAA9C,qHAAA,gBAAgB,OAAA;AACzB,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@nestjs/core");
4
+ const app_module_1 = require("./app.module");
5
+ async function bootstrap() {
6
+ const app = await core_1.NestFactory.create(app_module_1.AppModule);
7
+ await app.listen(process.env.PORT ?? 3000);
8
+ }
9
+ bootstrap();
10
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../../src/main.ts"],"names":[],"mappings":";;AAAA,uCAA2C;AAC3C,6CAAyC;AAEzC,KAAK,UAAU,SAAS;IACtB,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,CAAC,CAAC;IAChD,MAAM,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;AAC7C,CAAC;AACD,SAAS,EAAE,CAAC"}