@noildm/contracts 1.0.10 → 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/gen/user.d.ts +5 -5
- package/dist/index.d.ts +5 -0
- package/dist/index.js +44 -0
- package/gen/user.ts +5 -5
- package/package.json +1 -1
- package/proto/user.proto +5 -5
|
@@ -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/gen/user.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export interface User {
|
|
|
10
10
|
}
|
|
11
11
|
export interface CreateUserRequest {
|
|
12
12
|
userName: string;
|
|
13
|
-
telegramId
|
|
14
|
-
userImage
|
|
13
|
+
telegramId?: string | undefined;
|
|
14
|
+
userImage?: string | undefined;
|
|
15
15
|
}
|
|
16
16
|
export interface GetUserByIdRequest {
|
|
17
17
|
id: string;
|
|
@@ -21,9 +21,9 @@ export interface GetUserByUserNameRequest {
|
|
|
21
21
|
}
|
|
22
22
|
export interface UpdateUserRequest {
|
|
23
23
|
id: string;
|
|
24
|
-
userName
|
|
25
|
-
telegramId
|
|
26
|
-
userImage
|
|
24
|
+
userName?: string | undefined;
|
|
25
|
+
telegramId?: string | undefined;
|
|
26
|
+
userImage?: string | undefined;
|
|
27
27
|
}
|
|
28
28
|
export interface DeleteUserRequest {
|
|
29
29
|
id: string;
|
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);
|
package/gen/user.ts
CHANGED
|
@@ -21,8 +21,8 @@ export interface User {
|
|
|
21
21
|
|
|
22
22
|
export interface CreateUserRequest {
|
|
23
23
|
userName: string;
|
|
24
|
-
telegramId
|
|
25
|
-
userImage
|
|
24
|
+
telegramId?: string | undefined;
|
|
25
|
+
userImage?: string | undefined;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export interface GetUserByIdRequest {
|
|
@@ -35,9 +35,9 @@ export interface GetUserByUserNameRequest {
|
|
|
35
35
|
|
|
36
36
|
export interface UpdateUserRequest {
|
|
37
37
|
id: string;
|
|
38
|
-
userName
|
|
39
|
-
telegramId
|
|
40
|
-
userImage
|
|
38
|
+
userName?: string | undefined;
|
|
39
|
+
telegramId?: string | undefined;
|
|
40
|
+
userImage?: string | undefined;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
export interface DeleteUserRequest {
|
package/package.json
CHANGED
package/proto/user.proto
CHANGED
|
@@ -22,8 +22,8 @@ message User {
|
|
|
22
22
|
|
|
23
23
|
message CreateUserRequest {
|
|
24
24
|
string user_name = 1;
|
|
25
|
-
string telegram_id = 2;
|
|
26
|
-
string user_image = 3;
|
|
25
|
+
optional string telegram_id = 2;
|
|
26
|
+
optional string user_image = 3;
|
|
27
27
|
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -37,9 +37,9 @@ message GetUserByUserNameRequest {
|
|
|
37
37
|
|
|
38
38
|
message UpdateUserRequest {
|
|
39
39
|
string id = 1;
|
|
40
|
-
string user_name = 2;
|
|
41
|
-
string telegram_id = 3;
|
|
42
|
-
string user_image = 4;
|
|
40
|
+
optional string user_name = 2;
|
|
41
|
+
optional string telegram_id = 3;
|
|
42
|
+
optional string user_image = 4;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
message DeleteUserRequest {
|