@arbiwallet/contracts 1.0.58 → 1.0.59
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/gen/user.ts +23 -0
- package/package.json +1 -1
- package/proto/user.proto +14 -0
package/gen/user.ts
CHANGED
|
@@ -114,6 +114,18 @@ export interface GetCrmSessionResponse {
|
|
|
114
114
|
expiresAtUnix: number;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
export interface CrmExchangeHttpRequest {
|
|
118
|
+
method: string;
|
|
119
|
+
path: string;
|
|
120
|
+
queryString?: string | undefined;
|
|
121
|
+
jsonBody?: string | undefined;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface CrmExchangeHttpResponse {
|
|
125
|
+
httpStatus: number;
|
|
126
|
+
bodyJson: string;
|
|
127
|
+
}
|
|
128
|
+
|
|
117
129
|
export interface UserBalance {
|
|
118
130
|
asset: string;
|
|
119
131
|
network: string;
|
|
@@ -151,6 +163,10 @@ export interface UserServiceClient {
|
|
|
151
163
|
/** CRM Arbi Exchange: логин сервисным аккаунтом (env), OTP из TOTP-секрета; session_id для X-Session-ID. */
|
|
152
164
|
|
|
153
165
|
getCrmSession(request: GetCrmSessionRequest): Observable<GetCrmSessionResponse>;
|
|
166
|
+
|
|
167
|
+
/** HTTP к CRM Exchange: сессия и X-Session-ID только внутри user-service. */
|
|
168
|
+
|
|
169
|
+
crmExchangeHttp(request: CrmExchangeHttpRequest): Observable<CrmExchangeHttpResponse>;
|
|
154
170
|
}
|
|
155
171
|
|
|
156
172
|
export interface UserServiceController {
|
|
@@ -176,6 +192,12 @@ export interface UserServiceController {
|
|
|
176
192
|
getCrmSession(
|
|
177
193
|
request: GetCrmSessionRequest,
|
|
178
194
|
): Promise<GetCrmSessionResponse> | Observable<GetCrmSessionResponse> | GetCrmSessionResponse;
|
|
195
|
+
|
|
196
|
+
/** HTTP к CRM Exchange: сессия и X-Session-ID только внутри user-service. */
|
|
197
|
+
|
|
198
|
+
crmExchangeHttp(
|
|
199
|
+
request: CrmExchangeHttpRequest,
|
|
200
|
+
): Promise<CrmExchangeHttpResponse> | Observable<CrmExchangeHttpResponse> | CrmExchangeHttpResponse;
|
|
179
201
|
}
|
|
180
202
|
|
|
181
203
|
export function UserServiceControllerMethods() {
|
|
@@ -187,6 +209,7 @@ export function UserServiceControllerMethods() {
|
|
|
187
209
|
"listUsers",
|
|
188
210
|
"resolveUserForTransfer",
|
|
189
211
|
"getCrmSession",
|
|
212
|
+
"crmExchangeHttp",
|
|
190
213
|
];
|
|
191
214
|
for (const method of grpcMethods) {
|
|
192
215
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbiwallet/contracts",
|
|
3
3
|
"descriptions": "Generate and manage smart contracts for ArbiWallet",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.59",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
|
|
7
7
|
},
|
package/proto/user.proto
CHANGED
|
@@ -10,6 +10,8 @@ service UserService {
|
|
|
10
10
|
rpc ResolveUserForTransfer (ResolveUserForTransferRequest) returns (ResolveUserForTransferResponse);
|
|
11
11
|
// CRM Arbi Exchange: логин сервисным аккаунтом (env), OTP из TOTP-секрета; session_id для X-Session-ID.
|
|
12
12
|
rpc GetCrmSession (GetCrmSessionRequest) returns (GetCrmSessionResponse);
|
|
13
|
+
// HTTP к CRM Exchange: сессия и X-Session-ID только внутри user-service.
|
|
14
|
+
rpc CrmExchangeHttp (CrmExchangeHttpRequest) returns (CrmExchangeHttpResponse);
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
enum UserStatus {
|
|
@@ -112,6 +114,18 @@ message GetCrmSessionResponse {
|
|
|
112
114
|
int64 expires_at_unix = 2;
|
|
113
115
|
}
|
|
114
116
|
|
|
117
|
+
message CrmExchangeHttpRequest {
|
|
118
|
+
string method = 1;
|
|
119
|
+
string path = 2;
|
|
120
|
+
optional string query_string = 3;
|
|
121
|
+
optional string json_body = 4;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
message CrmExchangeHttpResponse {
|
|
125
|
+
int32 http_status = 1;
|
|
126
|
+
string body_json = 2;
|
|
127
|
+
}
|
|
128
|
+
|
|
115
129
|
message UserBalance {
|
|
116
130
|
string asset = 1;
|
|
117
131
|
string network = 2;
|