@noildm/contracts 1.0.11 → 1.0.12
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/dist/contracts/exchanges/mail.exchange.d.ts +2 -0
- package/dist/contracts/exchanges/mail.exchange.js +7 -0
- package/dist/contracts/queues/mail/request-type.d.ts +7 -0
- package/dist/contracts/queues/mail/request-type.js +2 -0
- package/dist/contracts/queues/mail/send-mail.contract.d.ts +7 -0
- package/dist/contracts/queues/mail/send-mail.contract.js +13 -0
- package/dist/contracts/shared/amqp-base-request.interface.d.ts +8 -0
- package/dist/contracts/shared/amqp-base-request.interface.js +2 -0
- package/dist/contracts/shared/amqp-base-response.interface.d.ts +7 -0
- package/dist/contracts/shared/amqp-base-response.interface.js +2 -0
- package/dist/contracts/shared/queue-declaration.interface.d.ts +30 -0
- package/dist/contracts/shared/queue-declaration.interface.js +2 -0
- package/dist/contracts/shared/rabbit-exchange-config.interface.d.ts +13 -0
- package/dist/contracts/shared/rabbit-exchange-config.interface.js +2 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +44 -0
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AmqpBaseRequest } from "../../shared/amqp-base-request.interface";
|
|
2
|
+
import { QueueDeclaration } from "../../shared/queue-declaration.interface";
|
|
3
|
+
import { SendMailRequest } from "./request-type";
|
|
4
|
+
export declare namespace SendMailContract {
|
|
5
|
+
const queue: QueueDeclaration<unknown>;
|
|
6
|
+
type request = AmqpBaseRequest<SendMailRequest>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SendMailContract = void 0;
|
|
4
|
+
const mail_exchange_1 = require("../../exchanges/mail.exchange");
|
|
5
|
+
var SendMailContract;
|
|
6
|
+
(function (SendMailContract) {
|
|
7
|
+
SendMailContract.queue = {
|
|
8
|
+
exchange: mail_exchange_1.EXCHANGE_MAIL,
|
|
9
|
+
queue: `${mail_exchange_1.EXCHANGE_MAIL.name}-send`,
|
|
10
|
+
routingKey: `${mail_exchange_1.EXCHANGE_MAIL.name}-send`,
|
|
11
|
+
queueOptions: { durable: true },
|
|
12
|
+
};
|
|
13
|
+
})(SendMailContract || (exports.SendMailContract = SendMailContract = {}));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { RabbitExchangeConfig } from "./rabbit-exchange-config.interface";
|
|
2
|
+
interface QueueOptions<ConsumeOptions> {
|
|
3
|
+
durable?: boolean;
|
|
4
|
+
exclusive?: boolean;
|
|
5
|
+
autoDelete?: boolean;
|
|
6
|
+
arguments?: any;
|
|
7
|
+
messageTtl?: number;
|
|
8
|
+
expires?: number;
|
|
9
|
+
deadLetterExchange?: string;
|
|
10
|
+
deadLetterRoutingKey?: string;
|
|
11
|
+
maxLength?: number;
|
|
12
|
+
maxPriority?: number;
|
|
13
|
+
bindQueueArguments?: any;
|
|
14
|
+
/**
|
|
15
|
+
* Set this to the name of the channel you want to consume messages from to enable this feature.
|
|
16
|
+
*
|
|
17
|
+
* If channel does not exist or you haven't specified one, it will use the default channel.
|
|
18
|
+
*
|
|
19
|
+
* For channel to exist it needs to be created in module config.
|
|
20
|
+
*/
|
|
21
|
+
channel?: string;
|
|
22
|
+
consumerOptions?: ConsumeOptions;
|
|
23
|
+
}
|
|
24
|
+
export interface QueueDeclaration<ConsumeOptions> {
|
|
25
|
+
exchange: RabbitExchangeConfig;
|
|
26
|
+
routingKey: string;
|
|
27
|
+
queue: string;
|
|
28
|
+
queueOptions: QueueOptions<ConsumeOptions>;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface RabbitExchangeConfig {
|
|
2
|
+
name: string;
|
|
3
|
+
type: 'topic' | 'direct' | 'fanout';
|
|
4
|
+
options?: AssertExchange;
|
|
5
|
+
}
|
|
6
|
+
interface AssertExchange {
|
|
7
|
+
durable?: boolean;
|
|
8
|
+
internal?: boolean;
|
|
9
|
+
autoDelete?: boolean;
|
|
10
|
+
alternateExchange?: string;
|
|
11
|
+
arguments?: unknown | unknown[];
|
|
12
|
+
}
|
|
13
|
+
export {};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.UserProto = exports.AuthProto = void 0;
|
|
40
|
+
exports.AuthProto = __importStar(require("./gen/auth"));
|
|
41
|
+
exports.UserProto = __importStar(require("./gen/user"));
|
|
42
|
+
__exportStar(require("./contracts/exchanges/mail.exchange"), exports);
|
|
43
|
+
__exportStar(require("./contracts/queues/mail/request-type"), exports);
|
|
44
|
+
__exportStar(require("./contracts/queues/mail/send-mail.contract"), exports);
|