@acequants/aegis-contracts 0.1.1 → 0.1.3
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/src/gen/auth/v1/auth.d.ts +3 -20
- package/dist/src/gen/auth/v1/auth.d.ts.map +1 -1
- package/dist/src/gen/auth/v1/auth.js +21 -92
- package/dist/src/gen/google/protobuf/timestamp.d.ts +114 -0
- package/dist/src/gen/google/protobuf/timestamp.d.ts.map +1 -0
- package/dist/src/gen/google/protobuf/timestamp.js +64 -0
- package/dist/src/gen/user/v1/user.d.ts +95 -21
- package/dist/src/gen/user/v1/user.d.ts.map +1 -1
- package/dist/src/gen/user/v1/user.js +337 -19
- package/dist/src/index.js +5 -1
- package/package.json +1 -1
- package/proto/auth/v1/auth.proto +8 -12
- package/proto/user/v1/user.proto +47 -7
|
@@ -3,36 +3,23 @@ import _m0 from "protobufjs/minimal";
|
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
4
|
export declare const protobufPackage = "aegis.auth.v1";
|
|
5
5
|
export interface AuthContext {
|
|
6
|
-
sessionId: string;
|
|
7
6
|
userId: string;
|
|
8
7
|
email: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
permissions: string[];
|
|
8
|
+
sessionId: string;
|
|
9
|
+
displayName: string;
|
|
12
10
|
}
|
|
13
11
|
export interface ValidateAccessRequest {
|
|
14
|
-
accessToken: string;
|
|
15
12
|
ip: string;
|
|
16
13
|
userAgent: string;
|
|
14
|
+
accessToken: string;
|
|
17
15
|
}
|
|
18
16
|
export interface ValidateAccessResponse {
|
|
19
17
|
valid: boolean;
|
|
20
|
-
/** "expired", "revoked", etc. */
|
|
21
18
|
reason: string;
|
|
22
19
|
context?: AuthContext | undefined;
|
|
23
20
|
}
|
|
24
21
|
export interface AuthorizeRequest {
|
|
25
22
|
context?: AuthContext | undefined;
|
|
26
|
-
/** e.g. "order.read" */
|
|
27
|
-
policy: string;
|
|
28
|
-
/** resource/user attributes for ABAC */
|
|
29
|
-
attributes: {
|
|
30
|
-
[key: string]: string;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export interface AuthorizeRequest_AttributesEntry {
|
|
34
|
-
key: string;
|
|
35
|
-
value: string;
|
|
36
23
|
}
|
|
37
24
|
export interface AuthorizeResponse {
|
|
38
25
|
allowed: boolean;
|
|
@@ -55,10 +42,6 @@ export declare const AuthorizeRequest: {
|
|
|
55
42
|
encode(message: AuthorizeRequest, writer?: _m0.Writer): _m0.Writer;
|
|
56
43
|
decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeRequest;
|
|
57
44
|
};
|
|
58
|
-
export declare const AuthorizeRequest_AttributesEntry: {
|
|
59
|
-
encode(message: AuthorizeRequest_AttributesEntry, writer?: _m0.Writer): _m0.Writer;
|
|
60
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeRequest_AttributesEntry;
|
|
61
|
-
};
|
|
62
45
|
export declare const AuthorizeResponse: {
|
|
63
46
|
encode(message: AuthorizeResponse, writer?: _m0.Writer): _m0.Writer;
|
|
64
47
|
decode(input: _m0.Reader | Uint8Array, length?: number): AuthorizeResponse;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../../src/gen/auth/v1/auth.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAEnF,OAAO,GAAG,MAAM,oBAAoB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,eAAO,MAAM,eAAe,kBAAkB,CAAC;AAE/C,MAAM,WAAW,WAAW;IAC1B,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../../src/gen/auth/v1/auth.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAEnF,OAAO,GAA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SAAS,EAAE,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;CACjE"}
|
|
@@ -8,24 +8,21 @@ import _m0 from "protobufjs/minimal";
|
|
|
8
8
|
export const protobufPackage = "aegis.auth.v1";
|
|
9
9
|
export const AEGIS_AUTH_V1_PACKAGE_NAME = "aegis.auth.v1";
|
|
10
10
|
function createBaseAuthContext() {
|
|
11
|
-
return {
|
|
11
|
+
return { userId: "", email: "", sessionId: "", displayName: "" };
|
|
12
12
|
}
|
|
13
13
|
export const AuthContext = {
|
|
14
14
|
encode(message, writer = _m0.Writer.create()) {
|
|
15
|
-
if (message.sessionId !== "") {
|
|
16
|
-
writer.uint32(10).string(message.sessionId);
|
|
17
|
-
}
|
|
18
15
|
if (message.userId !== "") {
|
|
19
|
-
writer.uint32(
|
|
16
|
+
writer.uint32(10).string(message.userId);
|
|
20
17
|
}
|
|
21
18
|
if (message.email !== "") {
|
|
22
|
-
writer.uint32(
|
|
19
|
+
writer.uint32(18).string(message.email);
|
|
23
20
|
}
|
|
24
|
-
|
|
25
|
-
writer.uint32(
|
|
21
|
+
if (message.sessionId !== "") {
|
|
22
|
+
writer.uint32(26).string(message.sessionId);
|
|
26
23
|
}
|
|
27
|
-
|
|
28
|
-
writer.uint32(
|
|
24
|
+
if (message.displayName !== "") {
|
|
25
|
+
writer.uint32(34).string(message.displayName);
|
|
29
26
|
}
|
|
30
27
|
return writer;
|
|
31
28
|
},
|
|
@@ -40,31 +37,25 @@ export const AuthContext = {
|
|
|
40
37
|
if (tag !== 10) {
|
|
41
38
|
break;
|
|
42
39
|
}
|
|
43
|
-
message.
|
|
40
|
+
message.userId = reader.string();
|
|
44
41
|
continue;
|
|
45
42
|
case 2:
|
|
46
43
|
if (tag !== 18) {
|
|
47
44
|
break;
|
|
48
45
|
}
|
|
49
|
-
message.
|
|
46
|
+
message.email = reader.string();
|
|
50
47
|
continue;
|
|
51
48
|
case 3:
|
|
52
49
|
if (tag !== 26) {
|
|
53
50
|
break;
|
|
54
51
|
}
|
|
55
|
-
message.
|
|
52
|
+
message.sessionId = reader.string();
|
|
56
53
|
continue;
|
|
57
54
|
case 4:
|
|
58
55
|
if (tag !== 34) {
|
|
59
56
|
break;
|
|
60
57
|
}
|
|
61
|
-
message.
|
|
62
|
-
continue;
|
|
63
|
-
case 5:
|
|
64
|
-
if (tag !== 42) {
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
message.permissions.push(reader.string());
|
|
58
|
+
message.displayName = reader.string();
|
|
68
59
|
continue;
|
|
69
60
|
}
|
|
70
61
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -76,18 +67,18 @@ export const AuthContext = {
|
|
|
76
67
|
},
|
|
77
68
|
};
|
|
78
69
|
function createBaseValidateAccessRequest() {
|
|
79
|
-
return {
|
|
70
|
+
return { ip: "", userAgent: "", accessToken: "" };
|
|
80
71
|
}
|
|
81
72
|
export const ValidateAccessRequest = {
|
|
82
73
|
encode(message, writer = _m0.Writer.create()) {
|
|
83
|
-
if (message.accessToken !== "") {
|
|
84
|
-
writer.uint32(10).string(message.accessToken);
|
|
85
|
-
}
|
|
86
74
|
if (message.ip !== "") {
|
|
87
|
-
writer.uint32(
|
|
75
|
+
writer.uint32(10).string(message.ip);
|
|
88
76
|
}
|
|
89
77
|
if (message.userAgent !== "") {
|
|
90
|
-
writer.uint32(
|
|
78
|
+
writer.uint32(18).string(message.userAgent);
|
|
79
|
+
}
|
|
80
|
+
if (message.accessToken !== "") {
|
|
81
|
+
writer.uint32(26).string(message.accessToken);
|
|
91
82
|
}
|
|
92
83
|
return writer;
|
|
93
84
|
},
|
|
@@ -102,19 +93,19 @@ export const ValidateAccessRequest = {
|
|
|
102
93
|
if (tag !== 10) {
|
|
103
94
|
break;
|
|
104
95
|
}
|
|
105
|
-
message.
|
|
96
|
+
message.ip = reader.string();
|
|
106
97
|
continue;
|
|
107
98
|
case 2:
|
|
108
99
|
if (tag !== 18) {
|
|
109
100
|
break;
|
|
110
101
|
}
|
|
111
|
-
message.
|
|
102
|
+
message.userAgent = reader.string();
|
|
112
103
|
continue;
|
|
113
104
|
case 3:
|
|
114
105
|
if (tag !== 26) {
|
|
115
106
|
break;
|
|
116
107
|
}
|
|
117
|
-
message.
|
|
108
|
+
message.accessToken = reader.string();
|
|
118
109
|
continue;
|
|
119
110
|
}
|
|
120
111
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -176,19 +167,13 @@ export const ValidateAccessResponse = {
|
|
|
176
167
|
},
|
|
177
168
|
};
|
|
178
169
|
function createBaseAuthorizeRequest() {
|
|
179
|
-
return {
|
|
170
|
+
return {};
|
|
180
171
|
}
|
|
181
172
|
export const AuthorizeRequest = {
|
|
182
173
|
encode(message, writer = _m0.Writer.create()) {
|
|
183
174
|
if (message.context !== undefined) {
|
|
184
175
|
AuthContext.encode(message.context, writer.uint32(10).fork()).ldelim();
|
|
185
176
|
}
|
|
186
|
-
if (message.policy !== "") {
|
|
187
|
-
writer.uint32(18).string(message.policy);
|
|
188
|
-
}
|
|
189
|
-
Object.entries(message.attributes).forEach(([key, value]) => {
|
|
190
|
-
AuthorizeRequest_AttributesEntry.encode({ key: key, value }, writer.uint32(26).fork()).ldelim();
|
|
191
|
-
});
|
|
192
177
|
return writer;
|
|
193
178
|
},
|
|
194
179
|
decode(input, length) {
|
|
@@ -204,62 +189,6 @@ export const AuthorizeRequest = {
|
|
|
204
189
|
}
|
|
205
190
|
message.context = AuthContext.decode(reader, reader.uint32());
|
|
206
191
|
continue;
|
|
207
|
-
case 2:
|
|
208
|
-
if (tag !== 18) {
|
|
209
|
-
break;
|
|
210
|
-
}
|
|
211
|
-
message.policy = reader.string();
|
|
212
|
-
continue;
|
|
213
|
-
case 3:
|
|
214
|
-
if (tag !== 26) {
|
|
215
|
-
break;
|
|
216
|
-
}
|
|
217
|
-
const entry3 = AuthorizeRequest_AttributesEntry.decode(reader, reader.uint32());
|
|
218
|
-
if (entry3.value !== undefined) {
|
|
219
|
-
message.attributes[entry3.key] = entry3.value;
|
|
220
|
-
}
|
|
221
|
-
continue;
|
|
222
|
-
}
|
|
223
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
224
|
-
break;
|
|
225
|
-
}
|
|
226
|
-
reader.skipType(tag & 7);
|
|
227
|
-
}
|
|
228
|
-
return message;
|
|
229
|
-
},
|
|
230
|
-
};
|
|
231
|
-
function createBaseAuthorizeRequest_AttributesEntry() {
|
|
232
|
-
return { key: "", value: "" };
|
|
233
|
-
}
|
|
234
|
-
export const AuthorizeRequest_AttributesEntry = {
|
|
235
|
-
encode(message, writer = _m0.Writer.create()) {
|
|
236
|
-
if (message.key !== "") {
|
|
237
|
-
writer.uint32(10).string(message.key);
|
|
238
|
-
}
|
|
239
|
-
if (message.value !== "") {
|
|
240
|
-
writer.uint32(18).string(message.value);
|
|
241
|
-
}
|
|
242
|
-
return writer;
|
|
243
|
-
},
|
|
244
|
-
decode(input, length) {
|
|
245
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
246
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
|
247
|
-
const message = createBaseAuthorizeRequest_AttributesEntry();
|
|
248
|
-
while (reader.pos < end) {
|
|
249
|
-
const tag = reader.uint32();
|
|
250
|
-
switch (tag >>> 3) {
|
|
251
|
-
case 1:
|
|
252
|
-
if (tag !== 10) {
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
255
|
-
message.key = reader.string();
|
|
256
|
-
continue;
|
|
257
|
-
case 2:
|
|
258
|
-
if (tag !== 18) {
|
|
259
|
-
break;
|
|
260
|
-
}
|
|
261
|
-
message.value = reader.string();
|
|
262
|
-
continue;
|
|
263
192
|
}
|
|
264
193
|
if ((tag & 7) === 4 || tag === 0) {
|
|
265
194
|
break;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import _m0 from "protobufjs/minimal";
|
|
2
|
+
export declare const protobufPackage = "google.protobuf";
|
|
3
|
+
/**
|
|
4
|
+
* A Timestamp represents a point in time independent of any time zone or local
|
|
5
|
+
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
6
|
+
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
7
|
+
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
8
|
+
* Gregorian calendar backwards to year one.
|
|
9
|
+
*
|
|
10
|
+
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
11
|
+
* second table is needed for interpretation, using a [24-hour linear
|
|
12
|
+
* smear](https://developers.google.com/time/smear).
|
|
13
|
+
*
|
|
14
|
+
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
15
|
+
* restricting to that range, we ensure that we can convert to and from [RFC
|
|
16
|
+
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
17
|
+
*
|
|
18
|
+
* # Examples
|
|
19
|
+
*
|
|
20
|
+
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
21
|
+
*
|
|
22
|
+
* Timestamp timestamp;
|
|
23
|
+
* timestamp.set_seconds(time(NULL));
|
|
24
|
+
* timestamp.set_nanos(0);
|
|
25
|
+
*
|
|
26
|
+
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
27
|
+
*
|
|
28
|
+
* struct timeval tv;
|
|
29
|
+
* gettimeofday(&tv, NULL);
|
|
30
|
+
*
|
|
31
|
+
* Timestamp timestamp;
|
|
32
|
+
* timestamp.set_seconds(tv.tv_sec);
|
|
33
|
+
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
34
|
+
*
|
|
35
|
+
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
36
|
+
*
|
|
37
|
+
* FILETIME ft;
|
|
38
|
+
* GetSystemTimeAsFileTime(&ft);
|
|
39
|
+
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
40
|
+
*
|
|
41
|
+
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
42
|
+
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
43
|
+
* Timestamp timestamp;
|
|
44
|
+
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
45
|
+
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
46
|
+
*
|
|
47
|
+
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
48
|
+
*
|
|
49
|
+
* long millis = System.currentTimeMillis();
|
|
50
|
+
*
|
|
51
|
+
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
52
|
+
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
53
|
+
*
|
|
54
|
+
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
|
55
|
+
*
|
|
56
|
+
* Instant now = Instant.now();
|
|
57
|
+
*
|
|
58
|
+
* Timestamp timestamp =
|
|
59
|
+
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
|
60
|
+
* .setNanos(now.getNano()).build();
|
|
61
|
+
*
|
|
62
|
+
* Example 6: Compute Timestamp from current time in Python.
|
|
63
|
+
*
|
|
64
|
+
* timestamp = Timestamp()
|
|
65
|
+
* timestamp.GetCurrentTime()
|
|
66
|
+
*
|
|
67
|
+
* # JSON Mapping
|
|
68
|
+
*
|
|
69
|
+
* In JSON format, the Timestamp type is encoded as a string in the
|
|
70
|
+
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
71
|
+
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
72
|
+
* where {year} is always expressed using four digits while {month}, {day},
|
|
73
|
+
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
74
|
+
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
75
|
+
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
76
|
+
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
77
|
+
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
78
|
+
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
79
|
+
*
|
|
80
|
+
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
81
|
+
* 01:30 UTC on January 15, 2017.
|
|
82
|
+
*
|
|
83
|
+
* In JavaScript, one can convert a Date object to this format using the
|
|
84
|
+
* standard
|
|
85
|
+
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
86
|
+
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
87
|
+
* to this format using
|
|
88
|
+
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
89
|
+
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
90
|
+
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
91
|
+
* http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
|
92
|
+
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
93
|
+
*/
|
|
94
|
+
export interface Timestamp {
|
|
95
|
+
/**
|
|
96
|
+
* Represents seconds of UTC time since Unix epoch
|
|
97
|
+
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
98
|
+
* 9999-12-31T23:59:59Z inclusive.
|
|
99
|
+
*/
|
|
100
|
+
seconds: number;
|
|
101
|
+
/**
|
|
102
|
+
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
103
|
+
* second values with fractions must still have non-negative nanos values
|
|
104
|
+
* that count forward in time. Must be from 0 to 999,999,999
|
|
105
|
+
* inclusive.
|
|
106
|
+
*/
|
|
107
|
+
nanos: number;
|
|
108
|
+
}
|
|
109
|
+
export declare const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
110
|
+
export declare const Timestamp: {
|
|
111
|
+
encode(message: Timestamp, writer?: _m0.Writer): _m0.Writer;
|
|
112
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp;
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=timestamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.d.ts","sourceRoot":"","sources":["../../../../../src/gen/google/protobuf/timestamp.ts"],"names":[],"mappings":"AAQA,OAAO,GAAG,MAAM,oBAAoB,CAAC;AAErC,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,MAAM,WAAW,SAAS;IACxB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,4BAA4B,oBAAoB,CAAC;AAM9D,eAAO,MAAM,SAAS;oBACJ,SAAS,WAAU,GAAG,CAAC,MAAM,GAAyB,GAAG,CAAC,MAAM;kBAUlE,GAAG,CAAC,MAAM,GAAG,UAAU,WAAW,MAAM,GAAG,SAAS;CA6BnE,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v1.181.2
|
|
4
|
+
// protoc v6.32.0
|
|
5
|
+
// source: google/protobuf/timestamp.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import Long from "long";
|
|
8
|
+
import _m0 from "protobufjs/minimal";
|
|
9
|
+
export const protobufPackage = "google.protobuf";
|
|
10
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
11
|
+
function createBaseTimestamp() {
|
|
12
|
+
return { seconds: 0, nanos: 0 };
|
|
13
|
+
}
|
|
14
|
+
export const Timestamp = {
|
|
15
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
16
|
+
if (message.seconds !== 0) {
|
|
17
|
+
writer.uint32(8).int64(message.seconds);
|
|
18
|
+
}
|
|
19
|
+
if (message.nanos !== 0) {
|
|
20
|
+
writer.uint32(16).int32(message.nanos);
|
|
21
|
+
}
|
|
22
|
+
return writer;
|
|
23
|
+
},
|
|
24
|
+
decode(input, length) {
|
|
25
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
26
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
27
|
+
const message = createBaseTimestamp();
|
|
28
|
+
while (reader.pos < end) {
|
|
29
|
+
const tag = reader.uint32();
|
|
30
|
+
switch (tag >>> 3) {
|
|
31
|
+
case 1:
|
|
32
|
+
if (tag !== 8) {
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
message.seconds = longToNumber(reader.int64());
|
|
36
|
+
continue;
|
|
37
|
+
case 2:
|
|
38
|
+
if (tag !== 16) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
message.nanos = reader.int32();
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
reader.skipType(tag & 7);
|
|
48
|
+
}
|
|
49
|
+
return message;
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
function longToNumber(long) {
|
|
53
|
+
if (long.gt(globalThis.Number.MAX_SAFE_INTEGER)) {
|
|
54
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
55
|
+
}
|
|
56
|
+
if (long.lt(globalThis.Number.MIN_SAFE_INTEGER)) {
|
|
57
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
58
|
+
}
|
|
59
|
+
return long.toNumber();
|
|
60
|
+
}
|
|
61
|
+
if (_m0.util.Long !== Long) {
|
|
62
|
+
_m0.util.Long = Long;
|
|
63
|
+
_m0.configure();
|
|
64
|
+
}
|
|
@@ -1,48 +1,122 @@
|
|
|
1
1
|
import type { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js";
|
|
2
2
|
import _m0 from "protobufjs/minimal";
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
|
+
import { Timestamp } from "../../google/protobuf/timestamp";
|
|
4
5
|
export declare const protobufPackage = "aegis.user.v1";
|
|
5
|
-
/** ----
|
|
6
|
-
export interface
|
|
7
|
-
|
|
6
|
+
/** ---- Request Message ---- */
|
|
7
|
+
export interface InputRegisterUser {
|
|
8
|
+
email: string;
|
|
9
|
+
phone: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
password: string;
|
|
12
|
+
}
|
|
13
|
+
export interface InputGetUsers {
|
|
14
|
+
page: number;
|
|
15
|
+
pageSize: number;
|
|
16
|
+
search: string;
|
|
17
|
+
sortBy: string;
|
|
18
|
+
sortOrder: string;
|
|
19
|
+
}
|
|
20
|
+
export interface InputGetUser {
|
|
21
|
+
publicId: string;
|
|
22
|
+
email: string;
|
|
23
|
+
phone: string;
|
|
8
24
|
}
|
|
9
|
-
|
|
10
|
-
|
|
25
|
+
/** ---- Response Message ---- */
|
|
26
|
+
export interface DtoPaginationMeta {
|
|
27
|
+
totalItems: number;
|
|
28
|
+
totalPages: number;
|
|
29
|
+
currentPage: number;
|
|
30
|
+
pageSize: number;
|
|
31
|
+
}
|
|
32
|
+
export interface DtoUser {
|
|
33
|
+
publicId: string;
|
|
11
34
|
email: string;
|
|
35
|
+
phone: string;
|
|
36
|
+
displayName: string;
|
|
37
|
+
isEmailVerified: boolean;
|
|
38
|
+
createdAt?: Timestamp | undefined;
|
|
39
|
+
updatedAt?: Timestamp | undefined;
|
|
40
|
+
/** google.protobuf.Date (For date only) */
|
|
41
|
+
deletedAt?: Timestamp | undefined;
|
|
42
|
+
}
|
|
43
|
+
export interface DtoUsers {
|
|
44
|
+
users: DtoUser[];
|
|
45
|
+
meta?: DtoPaginationMeta | undefined;
|
|
12
46
|
}
|
|
13
47
|
export declare const AEGIS_USER_V1_PACKAGE_NAME = "aegis.user.v1";
|
|
14
|
-
export declare const
|
|
15
|
-
encode(message:
|
|
16
|
-
decode(input: _m0.Reader | Uint8Array, length?: number):
|
|
48
|
+
export declare const InputRegisterUser: {
|
|
49
|
+
encode(message: InputRegisterUser, writer?: _m0.Writer): _m0.Writer;
|
|
50
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InputRegisterUser;
|
|
51
|
+
};
|
|
52
|
+
export declare const InputGetUsers: {
|
|
53
|
+
encode(message: InputGetUsers, writer?: _m0.Writer): _m0.Writer;
|
|
54
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InputGetUsers;
|
|
55
|
+
};
|
|
56
|
+
export declare const InputGetUser: {
|
|
57
|
+
encode(message: InputGetUser, writer?: _m0.Writer): _m0.Writer;
|
|
58
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): InputGetUser;
|
|
17
59
|
};
|
|
18
|
-
export declare const
|
|
19
|
-
encode(message:
|
|
20
|
-
decode(input: _m0.Reader | Uint8Array, length?: number):
|
|
60
|
+
export declare const DtoPaginationMeta: {
|
|
61
|
+
encode(message: DtoPaginationMeta, writer?: _m0.Writer): _m0.Writer;
|
|
62
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): DtoPaginationMeta;
|
|
21
63
|
};
|
|
22
|
-
|
|
64
|
+
export declare const DtoUser: {
|
|
65
|
+
encode(message: DtoUser, writer?: _m0.Writer): _m0.Writer;
|
|
66
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): DtoUser;
|
|
67
|
+
};
|
|
68
|
+
export declare const DtoUsers: {
|
|
69
|
+
encode(message: DtoUsers, writer?: _m0.Writer): _m0.Writer;
|
|
70
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): DtoUsers;
|
|
71
|
+
};
|
|
72
|
+
/** ---- Services ---- */
|
|
23
73
|
export interface UserServiceClient {
|
|
24
|
-
|
|
74
|
+
getUsers(request: InputGetUsers): Observable<DtoUsers>;
|
|
75
|
+
getUser(request: InputGetUser): Observable<DtoUser>;
|
|
76
|
+
register(request: InputRegisterUser): Observable<DtoUser>;
|
|
25
77
|
}
|
|
26
|
-
/** ----
|
|
78
|
+
/** ---- Services ---- */
|
|
27
79
|
export interface UserServiceController {
|
|
28
|
-
|
|
80
|
+
getUsers(request: InputGetUsers): Promise<DtoUsers> | Observable<DtoUsers> | DtoUsers;
|
|
81
|
+
getUser(request: InputGetUser): Promise<DtoUser> | Observable<DtoUser> | DtoUser;
|
|
82
|
+
register(request: InputRegisterUser): Promise<DtoUser> | Observable<DtoUser> | DtoUser;
|
|
29
83
|
}
|
|
30
84
|
export declare function UserServiceControllerMethods(): (constructor: Function) => void;
|
|
31
85
|
export declare const USER_SERVICE_NAME = "UserService";
|
|
32
|
-
/** ----
|
|
86
|
+
/** ---- Services ---- */
|
|
33
87
|
export type UserServiceService = typeof UserServiceService;
|
|
34
88
|
export declare const UserServiceService: {
|
|
89
|
+
readonly getUsers: {
|
|
90
|
+
readonly path: "/aegis.user.v1.UserService/GetUsers";
|
|
91
|
+
readonly requestStream: false;
|
|
92
|
+
readonly responseStream: false;
|
|
93
|
+
readonly requestSerialize: (value: InputGetUsers) => Buffer<ArrayBuffer>;
|
|
94
|
+
readonly requestDeserialize: (value: Buffer) => InputGetUsers;
|
|
95
|
+
readonly responseSerialize: (value: DtoUsers) => Buffer<ArrayBuffer>;
|
|
96
|
+
readonly responseDeserialize: (value: Buffer) => DtoUsers;
|
|
97
|
+
};
|
|
35
98
|
readonly getUser: {
|
|
36
99
|
readonly path: "/aegis.user.v1.UserService/GetUser";
|
|
37
100
|
readonly requestStream: false;
|
|
38
101
|
readonly responseStream: false;
|
|
39
|
-
readonly requestSerialize: (value:
|
|
40
|
-
readonly requestDeserialize: (value: Buffer) =>
|
|
41
|
-
readonly responseSerialize: (value:
|
|
42
|
-
readonly responseDeserialize: (value: Buffer) =>
|
|
102
|
+
readonly requestSerialize: (value: InputGetUser) => Buffer<ArrayBuffer>;
|
|
103
|
+
readonly requestDeserialize: (value: Buffer) => InputGetUser;
|
|
104
|
+
readonly responseSerialize: (value: DtoUser) => Buffer<ArrayBuffer>;
|
|
105
|
+
readonly responseDeserialize: (value: Buffer) => DtoUser;
|
|
106
|
+
};
|
|
107
|
+
readonly register: {
|
|
108
|
+
readonly path: "/aegis.user.v1.UserService/Register";
|
|
109
|
+
readonly requestStream: false;
|
|
110
|
+
readonly responseStream: false;
|
|
111
|
+
readonly requestSerialize: (value: InputRegisterUser) => Buffer<ArrayBuffer>;
|
|
112
|
+
readonly requestDeserialize: (value: Buffer) => InputRegisterUser;
|
|
113
|
+
readonly responseSerialize: (value: DtoUser) => Buffer<ArrayBuffer>;
|
|
114
|
+
readonly responseDeserialize: (value: Buffer) => DtoUser;
|
|
43
115
|
};
|
|
44
116
|
};
|
|
45
117
|
export interface UserServiceServer extends UntypedServiceImplementation {
|
|
46
|
-
|
|
118
|
+
getUsers: handleUnaryCall<InputGetUsers, DtoUsers>;
|
|
119
|
+
getUser: handleUnaryCall<InputGetUser, DtoUser>;
|
|
120
|
+
register: handleUnaryCall<InputRegisterUser, DtoUser>;
|
|
47
121
|
}
|
|
48
122
|
//# sourceMappingURL=user.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../../src/gen/user/v1/user.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAEnF,OAAO,GAAG,MAAM,oBAAoB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../../src/gen/user/v1/user.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAEnF,OAAO,GAAG,MAAM,oBAAoB,CAAC;AACrC,OAAO,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,EAAE,iBAAiB,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;CAC3D;AAED,yBAAyB;AAEzB,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;IAEtF,OAAO,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAEjF,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;CACxF;AAED,wBAAgB,4BAA4B,KACzB,aAAa,QAAQ,UAYvC;AAED,eAAO,MAAM,iBAAiB,gBAAgB,CAAC;AAE/C,yBAAyB;AACzB,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC;AAC3D,eAAO,MAAM,kBAAkB;;;;;2CAKD,aAAa;6CACX,MAAM;4CACP,QAAQ;8CACN,MAAM;;;;;;2CAMT,YAAY;6CACV,MAAM;4CACP,OAAO;8CACL,MAAM;;;;;;2CAMT,iBAAiB;6CACf,MAAM;4CACP,OAAO;8CACL,MAAM;;CAE7B,CAAC;AAEX,MAAM,WAAW,iBAAkB,SAAQ,4BAA4B;IACrE,QAAQ,EAAE,eAAe,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IACnD,OAAO,EAAE,eAAe,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAChD,QAAQ,EAAE,eAAe,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;CACvD"}
|
|
@@ -5,22 +5,32 @@
|
|
|
5
5
|
// source: user/v1/user.proto
|
|
6
6
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
7
7
|
import _m0 from "protobufjs/minimal";
|
|
8
|
+
import { Timestamp } from "../../google/protobuf/timestamp";
|
|
8
9
|
export const protobufPackage = "aegis.user.v1";
|
|
9
10
|
export const AEGIS_USER_V1_PACKAGE_NAME = "aegis.user.v1";
|
|
10
|
-
function
|
|
11
|
-
return {
|
|
11
|
+
function createBaseInputRegisterUser() {
|
|
12
|
+
return { email: "", phone: "", displayName: "", password: "" };
|
|
12
13
|
}
|
|
13
|
-
export const
|
|
14
|
+
export const InputRegisterUser = {
|
|
14
15
|
encode(message, writer = _m0.Writer.create()) {
|
|
15
|
-
if (message.
|
|
16
|
-
writer.uint32(10).string(message.
|
|
16
|
+
if (message.email !== "") {
|
|
17
|
+
writer.uint32(10).string(message.email);
|
|
18
|
+
}
|
|
19
|
+
if (message.phone !== "") {
|
|
20
|
+
writer.uint32(18).string(message.phone);
|
|
21
|
+
}
|
|
22
|
+
if (message.displayName !== "") {
|
|
23
|
+
writer.uint32(26).string(message.displayName);
|
|
24
|
+
}
|
|
25
|
+
if (message.password !== "") {
|
|
26
|
+
writer.uint32(34).string(message.password);
|
|
17
27
|
}
|
|
18
28
|
return writer;
|
|
19
29
|
},
|
|
20
30
|
decode(input, length) {
|
|
21
31
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
22
32
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
23
|
-
const message =
|
|
33
|
+
const message = createBaseInputRegisterUser();
|
|
24
34
|
while (reader.pos < end) {
|
|
25
35
|
const tag = reader.uint32();
|
|
26
36
|
switch (tag >>> 3) {
|
|
@@ -28,7 +38,25 @@ export const GetUserRequest = {
|
|
|
28
38
|
if (tag !== 10) {
|
|
29
39
|
break;
|
|
30
40
|
}
|
|
31
|
-
message.
|
|
41
|
+
message.email = reader.string();
|
|
42
|
+
continue;
|
|
43
|
+
case 2:
|
|
44
|
+
if (tag !== 18) {
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
message.phone = reader.string();
|
|
48
|
+
continue;
|
|
49
|
+
case 3:
|
|
50
|
+
if (tag !== 26) {
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
message.displayName = reader.string();
|
|
54
|
+
continue;
|
|
55
|
+
case 4:
|
|
56
|
+
if (tag !== 34) {
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
message.password = reader.string();
|
|
32
60
|
continue;
|
|
33
61
|
}
|
|
34
62
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -39,23 +67,94 @@ export const GetUserRequest = {
|
|
|
39
67
|
return message;
|
|
40
68
|
},
|
|
41
69
|
};
|
|
42
|
-
function
|
|
43
|
-
return {
|
|
70
|
+
function createBaseInputGetUsers() {
|
|
71
|
+
return { page: 0, pageSize: 0, search: "", sortBy: "", sortOrder: "" };
|
|
44
72
|
}
|
|
45
|
-
export const
|
|
73
|
+
export const InputGetUsers = {
|
|
46
74
|
encode(message, writer = _m0.Writer.create()) {
|
|
47
|
-
if (message.
|
|
48
|
-
writer.uint32(
|
|
75
|
+
if (message.page !== 0) {
|
|
76
|
+
writer.uint32(8).int32(message.page);
|
|
77
|
+
}
|
|
78
|
+
if (message.pageSize !== 0) {
|
|
79
|
+
writer.uint32(16).int32(message.pageSize);
|
|
80
|
+
}
|
|
81
|
+
if (message.search !== "") {
|
|
82
|
+
writer.uint32(26).string(message.search);
|
|
83
|
+
}
|
|
84
|
+
if (message.sortBy !== "") {
|
|
85
|
+
writer.uint32(34).string(message.sortBy);
|
|
86
|
+
}
|
|
87
|
+
if (message.sortOrder !== "") {
|
|
88
|
+
writer.uint32(42).string(message.sortOrder);
|
|
89
|
+
}
|
|
90
|
+
return writer;
|
|
91
|
+
},
|
|
92
|
+
decode(input, length) {
|
|
93
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
94
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
95
|
+
const message = createBaseInputGetUsers();
|
|
96
|
+
while (reader.pos < end) {
|
|
97
|
+
const tag = reader.uint32();
|
|
98
|
+
switch (tag >>> 3) {
|
|
99
|
+
case 1:
|
|
100
|
+
if (tag !== 8) {
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
message.page = reader.int32();
|
|
104
|
+
continue;
|
|
105
|
+
case 2:
|
|
106
|
+
if (tag !== 16) {
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
message.pageSize = reader.int32();
|
|
110
|
+
continue;
|
|
111
|
+
case 3:
|
|
112
|
+
if (tag !== 26) {
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
message.search = reader.string();
|
|
116
|
+
continue;
|
|
117
|
+
case 4:
|
|
118
|
+
if (tag !== 34) {
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
message.sortBy = reader.string();
|
|
122
|
+
continue;
|
|
123
|
+
case 5:
|
|
124
|
+
if (tag !== 42) {
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
message.sortOrder = reader.string();
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
reader.skipType(tag & 7);
|
|
134
|
+
}
|
|
135
|
+
return message;
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
function createBaseInputGetUser() {
|
|
139
|
+
return { publicId: "", email: "", phone: "" };
|
|
140
|
+
}
|
|
141
|
+
export const InputGetUser = {
|
|
142
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
143
|
+
if (message.publicId !== "") {
|
|
144
|
+
writer.uint32(10).string(message.publicId);
|
|
49
145
|
}
|
|
50
146
|
if (message.email !== "") {
|
|
51
147
|
writer.uint32(18).string(message.email);
|
|
52
148
|
}
|
|
149
|
+
if (message.phone !== "") {
|
|
150
|
+
writer.uint32(26).string(message.phone);
|
|
151
|
+
}
|
|
53
152
|
return writer;
|
|
54
153
|
},
|
|
55
154
|
decode(input, length) {
|
|
56
155
|
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
57
156
|
let end = length === undefined ? reader.len : reader.pos + length;
|
|
58
|
-
const message =
|
|
157
|
+
const message = createBaseInputGetUser();
|
|
59
158
|
while (reader.pos < end) {
|
|
60
159
|
const tag = reader.uint32();
|
|
61
160
|
switch (tag >>> 3) {
|
|
@@ -63,7 +162,7 @@ export const GetUserResponse = {
|
|
|
63
162
|
if (tag !== 10) {
|
|
64
163
|
break;
|
|
65
164
|
}
|
|
66
|
-
message.
|
|
165
|
+
message.publicId = reader.string();
|
|
67
166
|
continue;
|
|
68
167
|
case 2:
|
|
69
168
|
if (tag !== 18) {
|
|
@@ -71,6 +170,207 @@ export const GetUserResponse = {
|
|
|
71
170
|
}
|
|
72
171
|
message.email = reader.string();
|
|
73
172
|
continue;
|
|
173
|
+
case 3:
|
|
174
|
+
if (tag !== 26) {
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
message.phone = reader.string();
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
reader.skipType(tag & 7);
|
|
184
|
+
}
|
|
185
|
+
return message;
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
function createBaseDtoPaginationMeta() {
|
|
189
|
+
return { totalItems: 0, totalPages: 0, currentPage: 0, pageSize: 0 };
|
|
190
|
+
}
|
|
191
|
+
export const DtoPaginationMeta = {
|
|
192
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
193
|
+
if (message.totalItems !== 0) {
|
|
194
|
+
writer.uint32(8).int32(message.totalItems);
|
|
195
|
+
}
|
|
196
|
+
if (message.totalPages !== 0) {
|
|
197
|
+
writer.uint32(16).int32(message.totalPages);
|
|
198
|
+
}
|
|
199
|
+
if (message.currentPage !== 0) {
|
|
200
|
+
writer.uint32(24).int32(message.currentPage);
|
|
201
|
+
}
|
|
202
|
+
if (message.pageSize !== 0) {
|
|
203
|
+
writer.uint32(32).int32(message.pageSize);
|
|
204
|
+
}
|
|
205
|
+
return writer;
|
|
206
|
+
},
|
|
207
|
+
decode(input, length) {
|
|
208
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
209
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
210
|
+
const message = createBaseDtoPaginationMeta();
|
|
211
|
+
while (reader.pos < end) {
|
|
212
|
+
const tag = reader.uint32();
|
|
213
|
+
switch (tag >>> 3) {
|
|
214
|
+
case 1:
|
|
215
|
+
if (tag !== 8) {
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
message.totalItems = reader.int32();
|
|
219
|
+
continue;
|
|
220
|
+
case 2:
|
|
221
|
+
if (tag !== 16) {
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
message.totalPages = reader.int32();
|
|
225
|
+
continue;
|
|
226
|
+
case 3:
|
|
227
|
+
if (tag !== 24) {
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
message.currentPage = reader.int32();
|
|
231
|
+
continue;
|
|
232
|
+
case 4:
|
|
233
|
+
if (tag !== 32) {
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
message.pageSize = reader.int32();
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
reader.skipType(tag & 7);
|
|
243
|
+
}
|
|
244
|
+
return message;
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
function createBaseDtoUser() {
|
|
248
|
+
return { publicId: "", email: "", phone: "", displayName: "", isEmailVerified: false };
|
|
249
|
+
}
|
|
250
|
+
export const DtoUser = {
|
|
251
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
252
|
+
if (message.publicId !== "") {
|
|
253
|
+
writer.uint32(10).string(message.publicId);
|
|
254
|
+
}
|
|
255
|
+
if (message.email !== "") {
|
|
256
|
+
writer.uint32(18).string(message.email);
|
|
257
|
+
}
|
|
258
|
+
if (message.phone !== "") {
|
|
259
|
+
writer.uint32(26).string(message.phone);
|
|
260
|
+
}
|
|
261
|
+
if (message.displayName !== "") {
|
|
262
|
+
writer.uint32(34).string(message.displayName);
|
|
263
|
+
}
|
|
264
|
+
if (message.isEmailVerified !== false) {
|
|
265
|
+
writer.uint32(40).bool(message.isEmailVerified);
|
|
266
|
+
}
|
|
267
|
+
if (message.createdAt !== undefined) {
|
|
268
|
+
Timestamp.encode(message.createdAt, writer.uint32(50).fork()).ldelim();
|
|
269
|
+
}
|
|
270
|
+
if (message.updatedAt !== undefined) {
|
|
271
|
+
Timestamp.encode(message.updatedAt, writer.uint32(58).fork()).ldelim();
|
|
272
|
+
}
|
|
273
|
+
if (message.deletedAt !== undefined) {
|
|
274
|
+
Timestamp.encode(message.deletedAt, writer.uint32(66).fork()).ldelim();
|
|
275
|
+
}
|
|
276
|
+
return writer;
|
|
277
|
+
},
|
|
278
|
+
decode(input, length) {
|
|
279
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
280
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
281
|
+
const message = createBaseDtoUser();
|
|
282
|
+
while (reader.pos < end) {
|
|
283
|
+
const tag = reader.uint32();
|
|
284
|
+
switch (tag >>> 3) {
|
|
285
|
+
case 1:
|
|
286
|
+
if (tag !== 10) {
|
|
287
|
+
break;
|
|
288
|
+
}
|
|
289
|
+
message.publicId = reader.string();
|
|
290
|
+
continue;
|
|
291
|
+
case 2:
|
|
292
|
+
if (tag !== 18) {
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
message.email = reader.string();
|
|
296
|
+
continue;
|
|
297
|
+
case 3:
|
|
298
|
+
if (tag !== 26) {
|
|
299
|
+
break;
|
|
300
|
+
}
|
|
301
|
+
message.phone = reader.string();
|
|
302
|
+
continue;
|
|
303
|
+
case 4:
|
|
304
|
+
if (tag !== 34) {
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
message.displayName = reader.string();
|
|
308
|
+
continue;
|
|
309
|
+
case 5:
|
|
310
|
+
if (tag !== 40) {
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
313
|
+
message.isEmailVerified = reader.bool();
|
|
314
|
+
continue;
|
|
315
|
+
case 6:
|
|
316
|
+
if (tag !== 50) {
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
message.createdAt = Timestamp.decode(reader, reader.uint32());
|
|
320
|
+
continue;
|
|
321
|
+
case 7:
|
|
322
|
+
if (tag !== 58) {
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
message.updatedAt = Timestamp.decode(reader, reader.uint32());
|
|
326
|
+
continue;
|
|
327
|
+
case 8:
|
|
328
|
+
if (tag !== 66) {
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
message.deletedAt = Timestamp.decode(reader, reader.uint32());
|
|
332
|
+
continue;
|
|
333
|
+
}
|
|
334
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
reader.skipType(tag & 7);
|
|
338
|
+
}
|
|
339
|
+
return message;
|
|
340
|
+
},
|
|
341
|
+
};
|
|
342
|
+
function createBaseDtoUsers() {
|
|
343
|
+
return { users: [] };
|
|
344
|
+
}
|
|
345
|
+
export const DtoUsers = {
|
|
346
|
+
encode(message, writer = _m0.Writer.create()) {
|
|
347
|
+
for (const v of message.users) {
|
|
348
|
+
DtoUser.encode(v, writer.uint32(10).fork()).ldelim();
|
|
349
|
+
}
|
|
350
|
+
if (message.meta !== undefined) {
|
|
351
|
+
DtoPaginationMeta.encode(message.meta, writer.uint32(18).fork()).ldelim();
|
|
352
|
+
}
|
|
353
|
+
return writer;
|
|
354
|
+
},
|
|
355
|
+
decode(input, length) {
|
|
356
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
357
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
358
|
+
const message = createBaseDtoUsers();
|
|
359
|
+
while (reader.pos < end) {
|
|
360
|
+
const tag = reader.uint32();
|
|
361
|
+
switch (tag >>> 3) {
|
|
362
|
+
case 1:
|
|
363
|
+
if (tag !== 10) {
|
|
364
|
+
break;
|
|
365
|
+
}
|
|
366
|
+
message.users.push(DtoUser.decode(reader, reader.uint32()));
|
|
367
|
+
continue;
|
|
368
|
+
case 2:
|
|
369
|
+
if (tag !== 18) {
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
message.meta = DtoPaginationMeta.decode(reader, reader.uint32());
|
|
373
|
+
continue;
|
|
74
374
|
}
|
|
75
375
|
if ((tag & 7) === 4 || tag === 0) {
|
|
76
376
|
break;
|
|
@@ -82,7 +382,7 @@ export const GetUserResponse = {
|
|
|
82
382
|
};
|
|
83
383
|
export function UserServiceControllerMethods() {
|
|
84
384
|
return function (constructor) {
|
|
85
|
-
const grpcMethods = ["getUser"];
|
|
385
|
+
const grpcMethods = ["getUsers", "getUser", "register"];
|
|
86
386
|
for (const method of grpcMethods) {
|
|
87
387
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
88
388
|
GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -96,13 +396,31 @@ export function UserServiceControllerMethods() {
|
|
|
96
396
|
}
|
|
97
397
|
export const USER_SERVICE_NAME = "UserService";
|
|
98
398
|
export const UserServiceService = {
|
|
399
|
+
getUsers: {
|
|
400
|
+
path: "/aegis.user.v1.UserService/GetUsers",
|
|
401
|
+
requestStream: false,
|
|
402
|
+
responseStream: false,
|
|
403
|
+
requestSerialize: (value) => Buffer.from(InputGetUsers.encode(value).finish()),
|
|
404
|
+
requestDeserialize: (value) => InputGetUsers.decode(value),
|
|
405
|
+
responseSerialize: (value) => Buffer.from(DtoUsers.encode(value).finish()),
|
|
406
|
+
responseDeserialize: (value) => DtoUsers.decode(value),
|
|
407
|
+
},
|
|
99
408
|
getUser: {
|
|
100
409
|
path: "/aegis.user.v1.UserService/GetUser",
|
|
101
410
|
requestStream: false,
|
|
102
411
|
responseStream: false,
|
|
103
|
-
requestSerialize: (value) => Buffer.from(
|
|
104
|
-
requestDeserialize: (value) =>
|
|
105
|
-
responseSerialize: (value) => Buffer.from(
|
|
106
|
-
responseDeserialize: (value) =>
|
|
412
|
+
requestSerialize: (value) => Buffer.from(InputGetUser.encode(value).finish()),
|
|
413
|
+
requestDeserialize: (value) => InputGetUser.decode(value),
|
|
414
|
+
responseSerialize: (value) => Buffer.from(DtoUser.encode(value).finish()),
|
|
415
|
+
responseDeserialize: (value) => DtoUser.decode(value),
|
|
416
|
+
},
|
|
417
|
+
register: {
|
|
418
|
+
path: "/aegis.user.v1.UserService/Register",
|
|
419
|
+
requestStream: false,
|
|
420
|
+
responseStream: false,
|
|
421
|
+
requestSerialize: (value) => Buffer.from(InputRegisterUser.encode(value).finish()),
|
|
422
|
+
requestDeserialize: (value) => InputRegisterUser.decode(value),
|
|
423
|
+
responseSerialize: (value) => Buffer.from(DtoUser.encode(value).finish()),
|
|
424
|
+
responseDeserialize: (value) => DtoUser.decode(value),
|
|
107
425
|
},
|
|
108
426
|
};
|
package/dist/src/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export * as userV1 from "./gen/user/v1/user";
|
|
2
2
|
export * as authV1 from "./gen/auth/v1/auth";
|
|
3
3
|
export * as adminV1 from "./gen/admin/v1/admin";
|
|
4
|
-
//
|
|
4
|
+
// src/index.ts
|
|
5
|
+
// export * from './gen/admin/v1/admin';
|
|
6
|
+
// export * from './gen/auth/v1/auth';
|
|
7
|
+
// optionally, export helpers
|
|
8
|
+
// export { PROTO_PATHS } from "./proto-paths";
|
|
5
9
|
/*
|
|
6
10
|
|
|
7
11
|
npm i
|
package/package.json
CHANGED
package/proto/auth/v1/auth.proto
CHANGED
|
@@ -10,30 +10,26 @@ service AuthService {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
message AuthContext {
|
|
13
|
-
string
|
|
14
|
-
string
|
|
15
|
-
string
|
|
16
|
-
|
|
17
|
-
repeated string roles = 4;
|
|
18
|
-
repeated string permissions = 5;
|
|
13
|
+
string user_id = 1;
|
|
14
|
+
string email = 2;
|
|
15
|
+
string session_id = 3;
|
|
16
|
+
string display_name = 4;
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
message ValidateAccessRequest {
|
|
22
|
-
string
|
|
23
|
-
string
|
|
24
|
-
string
|
|
20
|
+
string ip = 1;
|
|
21
|
+
string user_agent = 2;
|
|
22
|
+
string access_token = 3;
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
message ValidateAccessResponse {
|
|
28
26
|
bool valid = 1;
|
|
29
|
-
string reason = 2;
|
|
27
|
+
string reason = 2;
|
|
30
28
|
AuthContext context = 3;
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
message AuthorizeRequest {
|
|
34
32
|
AuthContext context = 1;
|
|
35
|
-
string policy = 2; // e.g. "order.read"
|
|
36
|
-
map<string, string> attributes = 3; // resource/user attributes for ABAC
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
message AuthorizeResponse {
|
package/proto/user/v1/user.proto
CHANGED
|
@@ -4,17 +4,57 @@ package aegis.user.v1;
|
|
|
4
4
|
|
|
5
5
|
option java_multiple_files = true;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import "google/protobuf/timestamp.proto";
|
|
8
|
+
|
|
9
|
+
// ---- Request Message ----
|
|
10
|
+
message InputRegisterUser {
|
|
11
|
+
string email = 1;
|
|
12
|
+
string phone = 2;
|
|
13
|
+
string display_name = 3;
|
|
14
|
+
string password = 4;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message InputGetUsers {
|
|
18
|
+
int32 page = 1;
|
|
19
|
+
int32 page_size = 2;
|
|
20
|
+
string search = 3;
|
|
21
|
+
string sort_by = 4;
|
|
22
|
+
string sort_order = 5;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message InputGetUser {
|
|
26
|
+
string public_id = 1;
|
|
27
|
+
string email = 2;
|
|
28
|
+
string phone = 3;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// ---- Response Message ----
|
|
32
|
+
message DtoPaginationMeta {
|
|
33
|
+
int32 total_items = 1;
|
|
34
|
+
int32 total_pages = 2;
|
|
35
|
+
int32 current_page = 3;
|
|
36
|
+
int32 page_size = 4;
|
|
10
37
|
}
|
|
11
38
|
|
|
12
|
-
message
|
|
13
|
-
string
|
|
39
|
+
message DtoUser {
|
|
40
|
+
string public_id = 1;
|
|
14
41
|
string email = 2;
|
|
42
|
+
string phone = 3;
|
|
43
|
+
string display_name = 4;
|
|
44
|
+
bool is_email_verified = 5;
|
|
45
|
+
google.protobuf.Timestamp created_at = 6;
|
|
46
|
+
google.protobuf.Timestamp updated_at = 7;
|
|
47
|
+
google.protobuf.Timestamp deleted_at = 8; // google.protobuf.Date (For date only)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
message DtoUsers {
|
|
51
|
+
repeated DtoUser users = 1;
|
|
52
|
+
DtoPaginationMeta meta = 2;
|
|
15
53
|
}
|
|
16
54
|
|
|
17
|
-
// ----
|
|
55
|
+
// ---- Services ----
|
|
18
56
|
service UserService {
|
|
19
|
-
rpc
|
|
57
|
+
rpc GetUsers (InputGetUsers) returns (DtoUsers);
|
|
58
|
+
rpc GetUser (InputGetUser) returns (DtoUser);
|
|
59
|
+
rpc Register (InputRegisterUser) returns (DtoUser);
|
|
20
60
|
}
|