@postpaybr/protos 1.1.0

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 (79) hide show
  1. package/package.json +28 -0
  2. package/src/account-entry.proto +86 -0
  3. package/src/address.proto +64 -0
  4. package/src/admin-card-verification.proto +90 -0
  5. package/src/administrator.proto +192 -0
  6. package/src/anticipation.proto +86 -0
  7. package/src/asset.proto +44 -0
  8. package/src/auth.proto +29 -0
  9. package/src/bank-account.proto +62 -0
  10. package/src/card-vault.proto +36 -0
  11. package/src/card-verification.proto +30 -0
  12. package/src/card.proto +138 -0
  13. package/src/charge-schedule.proto +22 -0
  14. package/src/charge.proto +610 -0
  15. package/src/context.proto +174 -0
  16. package/src/customer.proto +234 -0
  17. package/src/daily-balance.proto +32 -0
  18. package/src/document-verification.proto +111 -0
  19. package/src/email.proto +76 -0
  20. package/src/expo-push.proto +27 -0
  21. package/src/fee.proto +65 -0
  22. package/src/location.proto +40 -0
  23. package/src/notification.proto +207 -0
  24. package/src/order.proto +189 -0
  25. package/src/payable.proto +246 -0
  26. package/src/payer.proto +24 -0
  27. package/src/payment-calculator.proto +165 -0
  28. package/src/payment-card.proto +217 -0
  29. package/src/payment-gateway.proto +94 -0
  30. package/src/payment-pix.proto +115 -0
  31. package/src/receipt.proto +212 -0
  32. package/src/recipient-payment-gateway.proto +101 -0
  33. package/src/recipient.proto +237 -0
  34. package/src/role.proto +57 -0
  35. package/src/sms.proto +36 -0
  36. package/src/tax.proto +323 -0
  37. package/src/transfer.proto +206 -0
  38. package/src/two-factor.proto +67 -0
  39. package/src/typescript/account-entry.ts +177 -0
  40. package/src/typescript/address.ts +133 -0
  41. package/src/typescript/admin-card-verification.ts +181 -0
  42. package/src/typescript/administrator.ts +375 -0
  43. package/src/typescript/anticipation.ts +187 -0
  44. package/src/typescript/asset.ts +123 -0
  45. package/src/typescript/auth.ts +84 -0
  46. package/src/typescript/bank-account.ts +157 -0
  47. package/src/typescript/card-vault.ts +92 -0
  48. package/src/typescript/card-verification.ts +93 -0
  49. package/src/typescript/card.ts +283 -0
  50. package/src/typescript/charge-schedule.ts +86 -0
  51. package/src/typescript/charge.ts +930 -0
  52. package/src/typescript/context.ts +296 -0
  53. package/src/typescript/customer.ts +425 -0
  54. package/src/typescript/daily-balance.ts +94 -0
  55. package/src/typescript/document-verification.ts +219 -0
  56. package/src/typescript/email.ts +183 -0
  57. package/src/typescript/expo-push.ts +75 -0
  58. package/src/typescript/fee.ts +131 -0
  59. package/src/typescript/location.ts +96 -0
  60. package/src/typescript/notification.ts +372 -0
  61. package/src/typescript/order.ts +311 -0
  62. package/src/typescript/payable.ts +414 -0
  63. package/src/typescript/payer.ts +68 -0
  64. package/src/typescript/payment-calculator.ts +252 -0
  65. package/src/typescript/payment-card.ts +290 -0
  66. package/src/typescript/payment-gateway.ts +209 -0
  67. package/src/typescript/payment-pix.ts +170 -0
  68. package/src/typescript/receipt.ts +344 -0
  69. package/src/typescript/recipient-payment-gateway.ts +209 -0
  70. package/src/typescript/recipient.ts +413 -0
  71. package/src/typescript/role.ts +144 -0
  72. package/src/typescript/sms.ts +96 -0
  73. package/src/typescript/tax.ts +463 -0
  74. package/src/typescript/transfer.ts +260 -0
  75. package/src/typescript/two-factor.ts +177 -0
  76. package/src/typescript/user.ts +413 -0
  77. package/src/typescript/wallet.ts +63 -0
  78. package/src/user.proto +214 -0
  79. package/src/wallet.proto +18 -0
@@ -0,0 +1,375 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.7.0
4
+ // protoc v6.32.1
5
+ // source: administrator.proto
6
+
7
+ /* eslint-disable */
8
+ import {
9
+ HolderType,
10
+ RecipientLegalType,
11
+ UserStatus,
12
+ } from '@postpaybr/contracts/enums';
13
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
14
+ import { Observable } from 'rxjs';
15
+
16
+ export const protobufPackage = 'administrator';
17
+
18
+ export interface CreateAdministratorRequest {
19
+ firstName: string;
20
+ lastName: string;
21
+ email: string;
22
+ roleIds: string[];
23
+ recipientId: string;
24
+ }
25
+
26
+ export interface GetAdministratorByIdRequest {
27
+ id: string;
28
+ }
29
+
30
+ export interface AdministratorResponse {
31
+ id: string;
32
+ firstName: string;
33
+ lastName: string;
34
+ document: string;
35
+ email: string;
36
+ isAccessRestricted: boolean;
37
+ roles?: Role[];
38
+ status?: UserStatus | undefined;
39
+ isSuperAdmin: boolean;
40
+ recipientId: string;
41
+ userId: string;
42
+ twoFactorEnabled?: boolean;
43
+ }
44
+
45
+ export interface UpdateAdministratorRequest {
46
+ id: string;
47
+ firstName?: string | undefined;
48
+ lastName?: string | undefined;
49
+ email?: string | undefined;
50
+ roleIds?: string[];
51
+ document?: string | undefined;
52
+ status?: UserStatus | undefined;
53
+ }
54
+
55
+ export interface Role {
56
+ id: string;
57
+ code: string;
58
+ description: string;
59
+ permissions: string[];
60
+ }
61
+
62
+ export interface GetAllAdministratorsRequest {}
63
+
64
+ export interface GetAllAdministratorsResponse {
65
+ administrators: AdministratorResponse[];
66
+ }
67
+
68
+ export interface ValidateAndSignInRequest {
69
+ email: string;
70
+ password: string;
71
+ }
72
+
73
+ export interface Tokens {
74
+ accessToken: string;
75
+ refreshToken: string;
76
+ }
77
+
78
+ export interface UserInfo {
79
+ id: string;
80
+ email: string;
81
+ name: string;
82
+ }
83
+
84
+ export interface ValidateAndSignInResponse {
85
+ success?: SuccessResponse | undefined;
86
+ twoFactorRequired?: TwoFactorRequiredResponse | undefined;
87
+ }
88
+
89
+ export interface SuccessResponse {
90
+ tokens: Tokens | undefined;
91
+ administrator: AdministratorResponse | undefined;
92
+ recipient: Recipient | undefined;
93
+ }
94
+
95
+ export interface TwoFactorRequiredResponse {
96
+ administratorId: string;
97
+ user: UserInfo | undefined;
98
+ }
99
+
100
+ export interface VerifyTwoFactorAuthenticationRequest {
101
+ administratorId: string;
102
+ token: string;
103
+ }
104
+
105
+ export interface VerifyTwoFactorAuthenticationResponse {
106
+ tokens: Tokens | undefined;
107
+ administrator: AdministratorResponse | undefined;
108
+ recipient: Recipient | undefined;
109
+ }
110
+
111
+ export interface Recipient {
112
+ id: string;
113
+ code: string;
114
+ commercialName: string;
115
+ socialReason: string;
116
+ holderType: HolderType;
117
+ document: string;
118
+ cnaeId: string;
119
+ legalType: RecipientLegalType;
120
+ contactName: string;
121
+ contactEmail: string;
122
+ contactPhone: string;
123
+ foundation: string;
124
+ avatarUrl?: string | undefined;
125
+ isActive: boolean;
126
+ }
127
+
128
+ export interface RefreshTokenRequest {
129
+ refreshToken: string;
130
+ }
131
+
132
+ export interface RefreshTokenResponse {
133
+ accessToken: string;
134
+ refreshToken: string;
135
+ isAccessRestricted: boolean;
136
+ }
137
+
138
+ export interface handleAdministratorChangePasswordRequest {
139
+ administratorId: string;
140
+ newPassword: string;
141
+ }
142
+
143
+ export interface handleAdministratorChangePasswordResponse {
144
+ isFirstChangePassword: boolean;
145
+ }
146
+
147
+ export interface ResendVerificationEmailRequest {
148
+ administratorId: string;
149
+ }
150
+
151
+ export interface Void {}
152
+
153
+ export interface ChangeAdministratorStatusRequest {
154
+ administratorId: string;
155
+ status: string;
156
+ }
157
+
158
+ export interface ChangeAdministratorStatusResponse {
159
+ success: boolean;
160
+ }
161
+
162
+ export interface initiateAdministratorChangePasswordRequest {
163
+ email: string;
164
+ }
165
+
166
+ export interface initiateAdministratorChangePasswordResponse {
167
+ success: boolean;
168
+ }
169
+
170
+ export interface GetAdministratorNameRequest {
171
+ id: string;
172
+ }
173
+
174
+ export interface GetAdministratorNameResponse {
175
+ name: string;
176
+ }
177
+
178
+ export interface GetAdministratorsByRecipientRequest {
179
+ recipientId: string;
180
+ }
181
+
182
+ export interface GetAdministratorsByRecipientResponse {
183
+ administrators: AdministratorResponse[];
184
+ }
185
+
186
+ export const ADMINISTRATOR_PACKAGE_NAME = 'administrator';
187
+
188
+ export interface AdministratorServiceClient {
189
+ createAdministrator(
190
+ request: CreateAdministratorRequest,
191
+ ): Observable<AdministratorResponse>;
192
+
193
+ getAdministratorById(
194
+ request: GetAdministratorByIdRequest,
195
+ ): Observable<AdministratorResponse>;
196
+
197
+ updateAdministrator(
198
+ request: UpdateAdministratorRequest,
199
+ ): Observable<AdministratorResponse>;
200
+
201
+ getAllAdministrators(
202
+ request: GetAllAdministratorsRequest,
203
+ ): Observable<GetAllAdministratorsResponse>;
204
+
205
+ validateAndSignIn(
206
+ request: ValidateAndSignInRequest,
207
+ ): Observable<ValidateAndSignInResponse>;
208
+
209
+ verifyTwoFactorAuthentication(
210
+ request: VerifyTwoFactorAuthenticationRequest,
211
+ ): Observable<VerifyTwoFactorAuthenticationResponse>;
212
+
213
+ refreshAccessToken(
214
+ request: RefreshTokenRequest,
215
+ ): Observable<RefreshTokenResponse>;
216
+
217
+ handleAdministratorChangePassword(
218
+ request: handleAdministratorChangePasswordRequest,
219
+ ): Observable<handleAdministratorChangePasswordResponse>;
220
+
221
+ resendVerificationEmail(
222
+ request: ResendVerificationEmailRequest,
223
+ ): Observable<Void>;
224
+
225
+ changeAdministratorStatus(
226
+ request: ChangeAdministratorStatusRequest,
227
+ ): Observable<ChangeAdministratorStatusResponse>;
228
+
229
+ initiateAdministratorChangePassword(
230
+ request: initiateAdministratorChangePasswordRequest,
231
+ ): Observable<initiateAdministratorChangePasswordResponse>;
232
+
233
+ getAdministratorName(
234
+ request: GetAdministratorNameRequest,
235
+ ): Observable<GetAdministratorNameResponse>;
236
+
237
+ getAdministratorsByRecipient(
238
+ request: GetAdministratorsByRecipientRequest,
239
+ ): Observable<GetAdministratorsByRecipientResponse>;
240
+ }
241
+
242
+ export interface AdministratorServiceController {
243
+ createAdministrator(
244
+ request: CreateAdministratorRequest,
245
+ ):
246
+ | Promise<AdministratorResponse>
247
+ | Observable<AdministratorResponse>
248
+ | AdministratorResponse;
249
+
250
+ getAdministratorById(
251
+ request: GetAdministratorByIdRequest,
252
+ ):
253
+ | Promise<AdministratorResponse>
254
+ | Observable<AdministratorResponse>
255
+ | AdministratorResponse;
256
+
257
+ updateAdministrator(
258
+ request: UpdateAdministratorRequest,
259
+ ):
260
+ | Promise<AdministratorResponse>
261
+ | Observable<AdministratorResponse>
262
+ | AdministratorResponse;
263
+
264
+ getAllAdministrators(
265
+ request: GetAllAdministratorsRequest,
266
+ ):
267
+ | Promise<GetAllAdministratorsResponse>
268
+ | Observable<GetAllAdministratorsResponse>
269
+ | GetAllAdministratorsResponse;
270
+
271
+ validateAndSignIn(
272
+ request: ValidateAndSignInRequest,
273
+ ):
274
+ | Promise<ValidateAndSignInResponse>
275
+ | Observable<ValidateAndSignInResponse>
276
+ | ValidateAndSignInResponse;
277
+
278
+ verifyTwoFactorAuthentication(
279
+ request: VerifyTwoFactorAuthenticationRequest,
280
+ ):
281
+ | Promise<VerifyTwoFactorAuthenticationResponse>
282
+ | Observable<VerifyTwoFactorAuthenticationResponse>
283
+ | VerifyTwoFactorAuthenticationResponse;
284
+
285
+ refreshAccessToken(
286
+ request: RefreshTokenRequest,
287
+ ):
288
+ | Promise<RefreshTokenResponse>
289
+ | Observable<RefreshTokenResponse>
290
+ | RefreshTokenResponse;
291
+
292
+ handleAdministratorChangePassword(
293
+ request: handleAdministratorChangePasswordRequest,
294
+ ):
295
+ | Promise<handleAdministratorChangePasswordResponse>
296
+ | Observable<handleAdministratorChangePasswordResponse>
297
+ | handleAdministratorChangePasswordResponse;
298
+
299
+ resendVerificationEmail(
300
+ request: ResendVerificationEmailRequest,
301
+ ): Promise<Void> | Observable<Void> | Void;
302
+
303
+ changeAdministratorStatus(
304
+ request: ChangeAdministratorStatusRequest,
305
+ ):
306
+ | Promise<ChangeAdministratorStatusResponse>
307
+ | Observable<ChangeAdministratorStatusResponse>
308
+ | ChangeAdministratorStatusResponse;
309
+
310
+ initiateAdministratorChangePassword(
311
+ request: initiateAdministratorChangePasswordRequest,
312
+ ):
313
+ | Promise<initiateAdministratorChangePasswordResponse>
314
+ | Observable<initiateAdministratorChangePasswordResponse>
315
+ | initiateAdministratorChangePasswordResponse;
316
+
317
+ getAdministratorName(
318
+ request: GetAdministratorNameRequest,
319
+ ):
320
+ | Promise<GetAdministratorNameResponse>
321
+ | Observable<GetAdministratorNameResponse>
322
+ | GetAdministratorNameResponse;
323
+
324
+ getAdministratorsByRecipient(
325
+ request: GetAdministratorsByRecipientRequest,
326
+ ):
327
+ | Promise<GetAdministratorsByRecipientResponse>
328
+ | Observable<GetAdministratorsByRecipientResponse>
329
+ | GetAdministratorsByRecipientResponse;
330
+ }
331
+
332
+ export function AdministratorServiceControllerMethods() {
333
+ return function (constructor: Function) {
334
+ const grpcMethods: string[] = [
335
+ 'createAdministrator',
336
+ 'getAdministratorById',
337
+ 'updateAdministrator',
338
+ 'getAllAdministrators',
339
+ 'validateAndSignIn',
340
+ 'verifyTwoFactorAuthentication',
341
+ 'refreshAccessToken',
342
+ 'handleAdministratorChangePassword',
343
+ 'resendVerificationEmail',
344
+ 'changeAdministratorStatus',
345
+ 'initiateAdministratorChangePassword',
346
+ 'getAdministratorName',
347
+ 'getAdministratorsByRecipient',
348
+ ];
349
+ for (const method of grpcMethods) {
350
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
351
+ constructor.prototype,
352
+ method,
353
+ );
354
+ GrpcMethod('AdministratorService', method)(
355
+ constructor.prototype[method],
356
+ method,
357
+ descriptor,
358
+ );
359
+ }
360
+ const grpcStreamMethods: string[] = [];
361
+ for (const method of grpcStreamMethods) {
362
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
363
+ constructor.prototype,
364
+ method,
365
+ );
366
+ GrpcStreamMethod('AdministratorService', method)(
367
+ constructor.prototype[method],
368
+ method,
369
+ descriptor,
370
+ );
371
+ }
372
+ };
373
+ }
374
+
375
+ export const ADMINISTRATOR_SERVICE_NAME = 'AdministratorService';
@@ -0,0 +1,187 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.7.0
4
+ // protoc v3.20.3
5
+ // source: anticipation.proto
6
+
7
+ /* eslint-disable */
8
+ import { AnticipationStatus } from '@postpaybr/contracts/types';
9
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
10
+ import { Observable } from 'rxjs';
11
+
12
+ export const protobufPackage = 'anticipation';
13
+
14
+ export interface SimulateAnticipationsRequest {
15
+ payableIds: string[];
16
+ }
17
+
18
+ export interface CreateAnticipationsRequest {
19
+ payableIds: string[];
20
+ }
21
+
22
+ export interface GetAnticipationsByRecipientRequest {
23
+ recipientId: string;
24
+ }
25
+
26
+ export interface GetAnticipationRequest {
27
+ id: string;
28
+ }
29
+
30
+ export interface UpdateAnticipationStatusRequest {
31
+ anticipationId: string;
32
+ status: string;
33
+ }
34
+
35
+ export interface SimulationResponse {
36
+ payableCount: number;
37
+ totalAmount: number;
38
+ recipientId: string;
39
+ }
40
+
41
+ export interface AnticipationResponse {
42
+ success: boolean;
43
+ }
44
+
45
+ export interface GetAnticipationsResponse {
46
+ anticipations: Anticipation[];
47
+ }
48
+
49
+ export interface Anticipation {
50
+ id: string;
51
+ amount: number;
52
+ fee: number;
53
+ baseFee: number;
54
+ feePercentage: number;
55
+ status: string;
56
+ externalId?: string | undefined;
57
+ anticipatedDays?: number | undefined;
58
+ createdAt: Date;
59
+ updatedAt: Date;
60
+ payable: Payable | undefined;
61
+ }
62
+
63
+ export interface Payable {
64
+ id: string;
65
+ amount: number;
66
+ installment: number;
67
+ status: string;
68
+ dueAt: string;
69
+ createdAt: Date;
70
+ isAnticipated: boolean;
71
+ processedAt: Date;
72
+ chargeId: string;
73
+ recipientId: string;
74
+ }
75
+
76
+ export interface UpdateAnticipationRequest {
77
+ payableId: string;
78
+ externalId?: string | undefined;
79
+ status?: AnticipationStatus | undefined;
80
+ amount?: number | undefined;
81
+ fee?: number | undefined;
82
+ baseFee?: number | undefined;
83
+ feePercentage?: number | undefined;
84
+ anticipatedDays?: number | undefined;
85
+ }
86
+
87
+ export const ANTICIPATION_PACKAGE_NAME = 'anticipation';
88
+
89
+ export interface AnticipationServiceClient {
90
+ simulateAnticipations(
91
+ request: SimulateAnticipationsRequest,
92
+ ): Observable<SimulationResponse>;
93
+
94
+ createAnticipations(
95
+ request: CreateAnticipationsRequest,
96
+ ): Observable<AnticipationResponse>;
97
+
98
+ getAnticipationsByRecipient(
99
+ request: GetAnticipationsByRecipientRequest,
100
+ ): Observable<GetAnticipationsResponse>;
101
+
102
+ getAnticipation(request: GetAnticipationRequest): Observable<Anticipation>;
103
+
104
+ updateAnticipationStatus(
105
+ request: UpdateAnticipationStatusRequest,
106
+ ): Observable<AnticipationResponse>;
107
+
108
+ updateAnticipation(
109
+ request: UpdateAnticipationRequest,
110
+ ): Observable<Anticipation>;
111
+ }
112
+
113
+ export interface AnticipationServiceController {
114
+ simulateAnticipations(
115
+ request: SimulateAnticipationsRequest,
116
+ ):
117
+ | Promise<SimulationResponse>
118
+ | Observable<SimulationResponse>
119
+ | SimulationResponse;
120
+
121
+ createAnticipations(
122
+ request: CreateAnticipationsRequest,
123
+ ):
124
+ | Promise<AnticipationResponse>
125
+ | Observable<AnticipationResponse>
126
+ | AnticipationResponse;
127
+
128
+ getAnticipationsByRecipient(
129
+ request: GetAnticipationsByRecipientRequest,
130
+ ):
131
+ | Promise<GetAnticipationsResponse>
132
+ | Observable<GetAnticipationsResponse>
133
+ | GetAnticipationsResponse;
134
+
135
+ getAnticipation(
136
+ request: GetAnticipationRequest,
137
+ ): Promise<Anticipation> | Observable<Anticipation> | Anticipation;
138
+
139
+ updateAnticipationStatus(
140
+ request: UpdateAnticipationStatusRequest,
141
+ ):
142
+ | Promise<AnticipationResponse>
143
+ | Observable<AnticipationResponse>
144
+ | AnticipationResponse;
145
+
146
+ updateAnticipation(
147
+ request: UpdateAnticipationRequest,
148
+ ): Promise<Anticipation> | Observable<Anticipation> | Anticipation;
149
+ }
150
+
151
+ export function AnticipationServiceControllerMethods() {
152
+ return function (constructor: Function) {
153
+ const grpcMethods: string[] = [
154
+ 'simulateAnticipations',
155
+ 'createAnticipations',
156
+ 'getAnticipationsByRecipient',
157
+ 'getAnticipation',
158
+ 'updateAnticipationStatus',
159
+ 'updateAnticipation',
160
+ ];
161
+ for (const method of grpcMethods) {
162
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
163
+ constructor.prototype,
164
+ method,
165
+ );
166
+ GrpcMethod('AnticipationService', method)(
167
+ constructor.prototype[method],
168
+ method,
169
+ descriptor,
170
+ );
171
+ }
172
+ const grpcStreamMethods: string[] = [];
173
+ for (const method of grpcStreamMethods) {
174
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
175
+ constructor.prototype,
176
+ method,
177
+ );
178
+ GrpcStreamMethod('AnticipationService', method)(
179
+ constructor.prototype[method],
180
+ method,
181
+ descriptor,
182
+ );
183
+ }
184
+ };
185
+ }
186
+
187
+ export const ANTICIPATION_SERVICE_NAME = 'AnticipationService';
@@ -0,0 +1,123 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.7.0
4
+ // protoc v3.20.3
5
+ // source: asset.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from '@nestjs/microservices';
9
+ import { Observable } from 'rxjs';
10
+
11
+ export const protobufPackage = 'asset';
12
+
13
+ export interface WriteFileRequest {
14
+ buffer: Uint8Array;
15
+ mimetype: string;
16
+ folder?: string;
17
+ }
18
+
19
+ export interface WriteFileResponse {
20
+ filename: string;
21
+ }
22
+
23
+ export interface ReadFileRequest {
24
+ identifier: string;
25
+ }
26
+
27
+ export interface ReadFileResponse {
28
+ buffer: Uint8Array;
29
+ }
30
+
31
+ export interface DeleteFileRequest {
32
+ identifier: string;
33
+ }
34
+
35
+ export interface DeleteFileResponse {
36
+ success: boolean;
37
+ }
38
+
39
+ export interface FileExistsRequest {
40
+ identifier: string;
41
+ }
42
+
43
+ export interface FileExistsResponse {
44
+ exists: boolean;
45
+ }
46
+
47
+ export const ASSET_PACKAGE_NAME = 'asset';
48
+
49
+ export interface AssetServiceClient {
50
+ writeFile(request: WriteFileRequest): Observable<WriteFileResponse>;
51
+
52
+ readFile(request: ReadFileRequest): Observable<ReadFileResponse>;
53
+
54
+ deleteFile(request: DeleteFileRequest): Observable<DeleteFileResponse>;
55
+
56
+ fileExists(request: FileExistsRequest): Observable<FileExistsResponse>;
57
+ }
58
+
59
+ export interface AssetServiceController {
60
+ writeFile(
61
+ request: WriteFileRequest,
62
+ ):
63
+ | Promise<WriteFileResponse>
64
+ | Observable<WriteFileResponse>
65
+ | WriteFileResponse;
66
+
67
+ readFile(
68
+ request: ReadFileRequest,
69
+ ):
70
+ | Promise<ReadFileResponse>
71
+ | Observable<ReadFileResponse>
72
+ | ReadFileResponse;
73
+
74
+ deleteFile(
75
+ request: DeleteFileRequest,
76
+ ):
77
+ | Promise<DeleteFileResponse>
78
+ | Observable<DeleteFileResponse>
79
+ | DeleteFileResponse;
80
+
81
+ fileExists(
82
+ request: FileExistsRequest,
83
+ ):
84
+ | Promise<FileExistsResponse>
85
+ | Observable<FileExistsResponse>
86
+ | FileExistsResponse;
87
+ }
88
+
89
+ export function AssetServiceControllerMethods() {
90
+ return function (constructor: Function) {
91
+ const grpcMethods: string[] = [
92
+ 'writeFile',
93
+ 'readFile',
94
+ 'deleteFile',
95
+ 'fileExists',
96
+ ];
97
+ for (const method of grpcMethods) {
98
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
99
+ constructor.prototype,
100
+ method,
101
+ );
102
+ GrpcMethod('AssetService', method)(
103
+ constructor.prototype[method],
104
+ method,
105
+ descriptor,
106
+ );
107
+ }
108
+ const grpcStreamMethods: string[] = [];
109
+ for (const method of grpcStreamMethods) {
110
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(
111
+ constructor.prototype,
112
+ method,
113
+ );
114
+ GrpcStreamMethod('AssetService', method)(
115
+ constructor.prototype[method],
116
+ method,
117
+ descriptor,
118
+ );
119
+ }
120
+ };
121
+ }
122
+
123
+ export const ASSET_SERVICE_NAME = 'AssetService';