@acequants/aegis-contracts 0.1.2 → 0.1.4

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.
@@ -3,20 +3,19 @@ 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
- userId: string;
6
+ sessionPublicId: string;
7
+ userPublicId: string;
7
8
  email: string;
8
- sessionId: string;
9
9
  displayName: string;
10
10
  }
11
11
  export interface ValidateAccessRequest {
12
- ip: string;
13
- userAgent: string;
14
12
  accessToken: string;
13
+ userAgent: string;
14
+ ip: string;
15
15
  }
16
16
  export interface ValidateAccessResponse {
17
- valid: boolean;
18
- /** "expired", "revoked", etc. */
19
- reason: string;
17
+ valid?: boolean | undefined;
18
+ reason?: string | undefined;
20
19
  context?: AuthContext | undefined;
21
20
  }
22
21
  export interface AuthorizeRequest {
@@ -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,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,iCAAiC;IACjC,MAAM,EAA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E_NAME = "aegis.auth.v1";
10
10
  function createBaseAuthContext() {
11
- return { userId: "", email: "", sessionId: "", displayName: "" };
11
+ return { sessionPublicId: "", userPublicId: "", email: "", displayName: "" };
12
12
  }
13
13
  export const AuthContext = {
14
14
  encode(message, writer = _m0.Writer.create()) {
15
- if (message.userId !== "") {
16
- writer.uint32(10).string(message.userId);
15
+ if (message.sessionPublicId !== "") {
16
+ writer.uint32(10).string(message.sessionPublicId);
17
17
  }
18
- if (message.email !== "") {
19
- writer.uint32(18).string(message.email);
18
+ if (message.userPublicId !== "") {
19
+ writer.uint32(18).string(message.userPublicId);
20
20
  }
21
- if (message.sessionId !== "") {
22
- writer.uint32(26).string(message.sessionId);
21
+ if (message.email !== "") {
22
+ writer.uint32(26).string(message.email);
23
23
  }
24
24
  if (message.displayName !== "") {
25
25
  writer.uint32(34).string(message.displayName);
@@ -37,19 +37,19 @@ export const AuthContext = {
37
37
  if (tag !== 10) {
38
38
  break;
39
39
  }
40
- message.userId = reader.string();
40
+ message.sessionPublicId = reader.string();
41
41
  continue;
42
42
  case 2:
43
43
  if (tag !== 18) {
44
44
  break;
45
45
  }
46
- message.email = reader.string();
46
+ message.userPublicId = reader.string();
47
47
  continue;
48
48
  case 3:
49
49
  if (tag !== 26) {
50
50
  break;
51
51
  }
52
- message.sessionId = reader.string();
52
+ message.email = reader.string();
53
53
  continue;
54
54
  case 4:
55
55
  if (tag !== 34) {
@@ -67,18 +67,18 @@ export const AuthContext = {
67
67
  },
68
68
  };
69
69
  function createBaseValidateAccessRequest() {
70
- return { ip: "", userAgent: "", accessToken: "" };
70
+ return { accessToken: "", userAgent: "", ip: "" };
71
71
  }
72
72
  export const ValidateAccessRequest = {
73
73
  encode(message, writer = _m0.Writer.create()) {
74
- if (message.ip !== "") {
75
- writer.uint32(10).string(message.ip);
74
+ if (message.accessToken !== "") {
75
+ writer.uint32(10).string(message.accessToken);
76
76
  }
77
77
  if (message.userAgent !== "") {
78
78
  writer.uint32(18).string(message.userAgent);
79
79
  }
80
- if (message.accessToken !== "") {
81
- writer.uint32(26).string(message.accessToken);
80
+ if (message.ip !== "") {
81
+ writer.uint32(26).string(message.ip);
82
82
  }
83
83
  return writer;
84
84
  },
@@ -93,7 +93,7 @@ export const ValidateAccessRequest = {
93
93
  if (tag !== 10) {
94
94
  break;
95
95
  }
96
- message.ip = reader.string();
96
+ message.accessToken = reader.string();
97
97
  continue;
98
98
  case 2:
99
99
  if (tag !== 18) {
@@ -105,7 +105,7 @@ export const ValidateAccessRequest = {
105
105
  if (tag !== 26) {
106
106
  break;
107
107
  }
108
- message.accessToken = reader.string();
108
+ message.ip = reader.string();
109
109
  continue;
110
110
  }
111
111
  if ((tag & 7) === 4 || tag === 0) {
@@ -117,14 +117,14 @@ export const ValidateAccessRequest = {
117
117
  },
118
118
  };
119
119
  function createBaseValidateAccessResponse() {
120
- return { valid: false, reason: "" };
120
+ return {};
121
121
  }
122
122
  export const ValidateAccessResponse = {
123
123
  encode(message, writer = _m0.Writer.create()) {
124
- if (message.valid !== false) {
124
+ if (message.valid !== undefined) {
125
125
  writer.uint32(8).bool(message.valid);
126
126
  }
127
- if (message.reason !== "") {
127
+ if (message.reason !== undefined) {
128
128
  writer.uint32(18).string(message.reason);
129
129
  }
130
130
  if (message.context !== undefined) {
@@ -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,120 @@
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
- /** ---- Messages ---- */
6
- export interface GetUserRequest {
7
- id: string;
6
+ export interface InputGetUsers {
7
+ page: number;
8
+ pageSize: number;
9
+ search?: string | undefined;
10
+ sortBy?: string | undefined;
11
+ sortOrder?: string | undefined;
8
12
  }
9
- export interface GetUserResponse {
10
- id: string;
13
+ export interface InputGetUser {
14
+ publicId?: string | undefined;
15
+ email?: string | undefined;
16
+ phone?: string | undefined;
17
+ }
18
+ export interface InputRegisterUser {
19
+ email: string;
20
+ phone: string;
21
+ displayName: string;
22
+ password: string;
23
+ }
24
+ /** ---- Response Message ---- */
25
+ export interface DtoPaginationMeta {
26
+ totalItems: number;
27
+ totalPages: number;
28
+ currentPage: number;
29
+ pageSize: number;
30
+ }
31
+ export interface DtoUser {
32
+ publicId: string;
11
33
  email: string;
34
+ phone: string;
35
+ displayName: string;
36
+ isEmailVerified: boolean;
37
+ createdAt?: Timestamp | undefined;
38
+ updatedAt?: Timestamp | undefined;
39
+ deletedAt?: Timestamp | undefined;
40
+ }
41
+ export interface DtoUsers {
42
+ items: DtoUser[];
43
+ meta?: DtoPaginationMeta | undefined;
12
44
  }
13
45
  export declare const AEGIS_USER_V1_PACKAGE_NAME = "aegis.user.v1";
14
- export declare const GetUserRequest: {
15
- encode(message: GetUserRequest, writer?: _m0.Writer): _m0.Writer;
16
- decode(input: _m0.Reader | Uint8Array, length?: number): GetUserRequest;
46
+ export declare const InputGetUsers: {
47
+ encode(message: InputGetUsers, writer?: _m0.Writer): _m0.Writer;
48
+ decode(input: _m0.Reader | Uint8Array, length?: number): InputGetUsers;
49
+ };
50
+ export declare const InputGetUser: {
51
+ encode(message: InputGetUser, writer?: _m0.Writer): _m0.Writer;
52
+ decode(input: _m0.Reader | Uint8Array, length?: number): InputGetUser;
53
+ };
54
+ export declare const InputRegisterUser: {
55
+ encode(message: InputRegisterUser, writer?: _m0.Writer): _m0.Writer;
56
+ decode(input: _m0.Reader | Uint8Array, length?: number): InputRegisterUser;
57
+ };
58
+ export declare const DtoPaginationMeta: {
59
+ encode(message: DtoPaginationMeta, writer?: _m0.Writer): _m0.Writer;
60
+ decode(input: _m0.Reader | Uint8Array, length?: number): DtoPaginationMeta;
17
61
  };
18
- export declare const GetUserResponse: {
19
- encode(message: GetUserResponse, writer?: _m0.Writer): _m0.Writer;
20
- decode(input: _m0.Reader | Uint8Array, length?: number): GetUserResponse;
62
+ export declare const DtoUser: {
63
+ encode(message: DtoUser, writer?: _m0.Writer): _m0.Writer;
64
+ decode(input: _m0.Reader | Uint8Array, length?: number): DtoUser;
21
65
  };
22
- /** ---- Service ---- */
66
+ export declare const DtoUsers: {
67
+ encode(message: DtoUsers, writer?: _m0.Writer): _m0.Writer;
68
+ decode(input: _m0.Reader | Uint8Array, length?: number): DtoUsers;
69
+ };
70
+ /** ---- Services ---- */
23
71
  export interface UserServiceClient {
24
- getUser(request: GetUserRequest): Observable<GetUserResponse>;
72
+ getUsers(request: InputGetUsers): Observable<DtoUsers>;
73
+ getUser(request: InputGetUser): Observable<DtoUser>;
74
+ register(request: InputRegisterUser): Observable<DtoUser>;
25
75
  }
26
- /** ---- Service ---- */
76
+ /** ---- Services ---- */
27
77
  export interface UserServiceController {
28
- getUser(request: GetUserRequest): Promise<GetUserResponse> | Observable<GetUserResponse> | GetUserResponse;
78
+ getUsers(request: InputGetUsers): Promise<DtoUsers> | Observable<DtoUsers> | DtoUsers;
79
+ getUser(request: InputGetUser): Promise<DtoUser> | Observable<DtoUser> | DtoUser;
80
+ register(request: InputRegisterUser): Promise<DtoUser> | Observable<DtoUser> | DtoUser;
29
81
  }
30
82
  export declare function UserServiceControllerMethods(): (constructor: Function) => void;
31
83
  export declare const USER_SERVICE_NAME = "UserService";
32
- /** ---- Service ---- */
84
+ /** ---- Services ---- */
33
85
  export type UserServiceService = typeof UserServiceService;
34
86
  export declare const UserServiceService: {
87
+ readonly getUsers: {
88
+ readonly path: "/aegis.user.v1.UserService/GetUsers";
89
+ readonly requestStream: false;
90
+ readonly responseStream: false;
91
+ readonly requestSerialize: (value: InputGetUsers) => Buffer<ArrayBuffer>;
92
+ readonly requestDeserialize: (value: Buffer) => InputGetUsers;
93
+ readonly responseSerialize: (value: DtoUsers) => Buffer<ArrayBuffer>;
94
+ readonly responseDeserialize: (value: Buffer) => DtoUsers;
95
+ };
35
96
  readonly getUser: {
36
97
  readonly path: "/aegis.user.v1.UserService/GetUser";
37
98
  readonly requestStream: false;
38
99
  readonly responseStream: false;
39
- readonly requestSerialize: (value: GetUserRequest) => Buffer<ArrayBuffer>;
40
- readonly requestDeserialize: (value: Buffer) => GetUserRequest;
41
- readonly responseSerialize: (value: GetUserResponse) => Buffer<ArrayBuffer>;
42
- readonly responseDeserialize: (value: Buffer) => GetUserResponse;
100
+ readonly requestSerialize: (value: InputGetUser) => Buffer<ArrayBuffer>;
101
+ readonly requestDeserialize: (value: Buffer) => InputGetUser;
102
+ readonly responseSerialize: (value: DtoUser) => Buffer<ArrayBuffer>;
103
+ readonly responseDeserialize: (value: Buffer) => DtoUser;
104
+ };
105
+ readonly register: {
106
+ readonly path: "/aegis.user.v1.UserService/Register";
107
+ readonly requestStream: false;
108
+ readonly responseStream: false;
109
+ readonly requestSerialize: (value: InputRegisterUser) => Buffer<ArrayBuffer>;
110
+ readonly requestDeserialize: (value: Buffer) => InputRegisterUser;
111
+ readonly responseSerialize: (value: DtoUser) => Buffer<ArrayBuffer>;
112
+ readonly responseDeserialize: (value: Buffer) => DtoUser;
43
113
  };
44
114
  };
45
115
  export interface UserServiceServer extends UntypedServiceImplementation {
46
- getUser: handleUnaryCall<GetUserRequest, GetUserResponse>;
116
+ getUsers: handleUnaryCall<InputGetUsers, DtoUsers>;
117
+ getUser: handleUnaryCall<InputGetUser, DtoUser>;
118
+ register: handleUnaryCall<InputRegisterUser, DtoUser>;
47
119
  }
48
120
  //# 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;AAElC,eAAO,MAAM,eAAe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,CAAC,CAAC;IAChD,QAAQ,EAAE,eAAe,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;CACvD"}
@@ -5,22 +5,150 @@
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 createBaseGetUserRequest() {
11
- return { id: "" };
11
+ function createBaseInputGetUsers() {
12
+ return { page: 0, pageSize: 0 };
12
13
  }
13
- export const GetUserRequest = {
14
+ export const InputGetUsers = {
14
15
  encode(message, writer = _m0.Writer.create()) {
15
- if (message.id !== "") {
16
- writer.uint32(10).string(message.id);
16
+ if (message.page !== 0) {
17
+ writer.uint32(8).int32(message.page);
18
+ }
19
+ if (message.pageSize !== 0) {
20
+ writer.uint32(16).int32(message.pageSize);
21
+ }
22
+ if (message.search !== undefined) {
23
+ writer.uint32(26).string(message.search);
24
+ }
25
+ if (message.sortBy !== undefined) {
26
+ writer.uint32(34).string(message.sortBy);
27
+ }
28
+ if (message.sortOrder !== undefined) {
29
+ writer.uint32(42).string(message.sortOrder);
30
+ }
31
+ return writer;
32
+ },
33
+ decode(input, length) {
34
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
35
+ let end = length === undefined ? reader.len : reader.pos + length;
36
+ const message = createBaseInputGetUsers();
37
+ while (reader.pos < end) {
38
+ const tag = reader.uint32();
39
+ switch (tag >>> 3) {
40
+ case 1:
41
+ if (tag !== 8) {
42
+ break;
43
+ }
44
+ message.page = reader.int32();
45
+ continue;
46
+ case 2:
47
+ if (tag !== 16) {
48
+ break;
49
+ }
50
+ message.pageSize = reader.int32();
51
+ continue;
52
+ case 3:
53
+ if (tag !== 26) {
54
+ break;
55
+ }
56
+ message.search = reader.string();
57
+ continue;
58
+ case 4:
59
+ if (tag !== 34) {
60
+ break;
61
+ }
62
+ message.sortBy = reader.string();
63
+ continue;
64
+ case 5:
65
+ if (tag !== 42) {
66
+ break;
67
+ }
68
+ message.sortOrder = reader.string();
69
+ continue;
70
+ }
71
+ if ((tag & 7) === 4 || tag === 0) {
72
+ break;
73
+ }
74
+ reader.skipType(tag & 7);
75
+ }
76
+ return message;
77
+ },
78
+ };
79
+ function createBaseInputGetUser() {
80
+ return {};
81
+ }
82
+ export const InputGetUser = {
83
+ encode(message, writer = _m0.Writer.create()) {
84
+ if (message.publicId !== undefined) {
85
+ writer.uint32(10).string(message.publicId);
86
+ }
87
+ if (message.email !== undefined) {
88
+ writer.uint32(18).string(message.email);
89
+ }
90
+ if (message.phone !== undefined) {
91
+ writer.uint32(26).string(message.phone);
92
+ }
93
+ return writer;
94
+ },
95
+ decode(input, length) {
96
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
97
+ let end = length === undefined ? reader.len : reader.pos + length;
98
+ const message = createBaseInputGetUser();
99
+ while (reader.pos < end) {
100
+ const tag = reader.uint32();
101
+ switch (tag >>> 3) {
102
+ case 1:
103
+ if (tag !== 10) {
104
+ break;
105
+ }
106
+ message.publicId = reader.string();
107
+ continue;
108
+ case 2:
109
+ if (tag !== 18) {
110
+ break;
111
+ }
112
+ message.email = reader.string();
113
+ continue;
114
+ case 3:
115
+ if (tag !== 26) {
116
+ break;
117
+ }
118
+ message.phone = reader.string();
119
+ continue;
120
+ }
121
+ if ((tag & 7) === 4 || tag === 0) {
122
+ break;
123
+ }
124
+ reader.skipType(tag & 7);
125
+ }
126
+ return message;
127
+ },
128
+ };
129
+ function createBaseInputRegisterUser() {
130
+ return { email: "", phone: "", displayName: "", password: "" };
131
+ }
132
+ export const InputRegisterUser = {
133
+ encode(message, writer = _m0.Writer.create()) {
134
+ if (message.email !== "") {
135
+ writer.uint32(10).string(message.email);
136
+ }
137
+ if (message.phone !== "") {
138
+ writer.uint32(18).string(message.phone);
139
+ }
140
+ if (message.displayName !== "") {
141
+ writer.uint32(26).string(message.displayName);
142
+ }
143
+ if (message.password !== "") {
144
+ writer.uint32(34).string(message.password);
17
145
  }
18
146
  return writer;
19
147
  },
20
148
  decode(input, length) {
21
149
  const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
22
150
  let end = length === undefined ? reader.len : reader.pos + length;
23
- const message = createBaseGetUserRequest();
151
+ const message = createBaseInputRegisterUser();
24
152
  while (reader.pos < end) {
25
153
  const tag = reader.uint32();
26
154
  switch (tag >>> 3) {
@@ -28,7 +156,84 @@ export const GetUserRequest = {
28
156
  if (tag !== 10) {
29
157
  break;
30
158
  }
31
- message.id = reader.string();
159
+ message.email = reader.string();
160
+ continue;
161
+ case 2:
162
+ if (tag !== 18) {
163
+ break;
164
+ }
165
+ message.phone = reader.string();
166
+ continue;
167
+ case 3:
168
+ if (tag !== 26) {
169
+ break;
170
+ }
171
+ message.displayName = reader.string();
172
+ continue;
173
+ case 4:
174
+ if (tag !== 34) {
175
+ break;
176
+ }
177
+ message.password = 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();
32
237
  continue;
33
238
  }
34
239
  if ((tag & 7) === 4 || tag === 0) {
@@ -39,23 +244,41 @@ export const GetUserRequest = {
39
244
  return message;
40
245
  },
41
246
  };
42
- function createBaseGetUserResponse() {
43
- return { id: "", email: "" };
247
+ function createBaseDtoUser() {
248
+ return { publicId: "", email: "", phone: "", displayName: "", isEmailVerified: false };
44
249
  }
45
- export const GetUserResponse = {
250
+ export const DtoUser = {
46
251
  encode(message, writer = _m0.Writer.create()) {
47
- if (message.id !== "") {
48
- writer.uint32(10).string(message.id);
252
+ if (message.publicId !== "") {
253
+ writer.uint32(10).string(message.publicId);
49
254
  }
50
255
  if (message.email !== "") {
51
256
  writer.uint32(18).string(message.email);
52
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
+ }
53
276
  return writer;
54
277
  },
55
278
  decode(input, length) {
56
279
  const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
57
280
  let end = length === undefined ? reader.len : reader.pos + length;
58
- const message = createBaseGetUserResponse();
281
+ const message = createBaseDtoUser();
59
282
  while (reader.pos < end) {
60
283
  const tag = reader.uint32();
61
284
  switch (tag >>> 3) {
@@ -63,7 +286,7 @@ export const GetUserResponse = {
63
286
  if (tag !== 10) {
64
287
  break;
65
288
  }
66
- message.id = reader.string();
289
+ message.publicId = reader.string();
67
290
  continue;
68
291
  case 2:
69
292
  if (tag !== 18) {
@@ -71,6 +294,83 @@ export const GetUserResponse = {
71
294
  }
72
295
  message.email = reader.string();
73
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 { items: [] };
344
+ }
345
+ export const DtoUsers = {
346
+ encode(message, writer = _m0.Writer.create()) {
347
+ for (const v of message.items) {
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.items.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(GetUserRequest.encode(value).finish()),
104
- requestDeserialize: (value) => GetUserRequest.decode(value),
105
- responseSerialize: (value) => Buffer.from(GetUserResponse.encode(value).finish()),
106
- responseDeserialize: (value) => GetUserResponse.decode(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
- // optionally export common helpers/types
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acequants/aegis-contracts",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -10,22 +10,22 @@ service AuthService {
10
10
  }
11
11
 
12
12
  message AuthContext {
13
- string user_id = 1;
14
- string email = 2;
15
- string session_id = 3;
13
+ string session_public_id = 1;
14
+ string user_public_id = 2;
15
+ string email = 3;
16
16
  string display_name = 4;
17
17
  }
18
18
 
19
19
  message ValidateAccessRequest {
20
- string ip = 1;
20
+ string access_token = 1;
21
21
  string user_agent = 2;
22
- string access_token = 3;
22
+ string ip = 3;
23
23
  }
24
24
 
25
25
  message ValidateAccessResponse {
26
- bool valid = 1;
27
- string reason = 2; // "expired", "revoked", etc.
28
- AuthContext context = 3;
26
+ optional bool valid = 1;
27
+ optional string reason = 2;
28
+ optional AuthContext context = 3;
29
29
  }
30
30
 
31
31
  message AuthorizeRequest {
@@ -4,17 +4,67 @@ package aegis.user.v1;
4
4
 
5
5
  option java_multiple_files = true;
6
6
 
7
- // ---- Messages ----
8
- message GetUserRequest {
9
- string id = 1;
7
+ import "google/protobuf/timestamp.proto";
8
+ // import "google/protobuf/empty.proto";
9
+
10
+ // ---- Request Message ----
11
+
12
+ message InputGetUsers {
13
+ int32 page = 1;
14
+ int32 page_size = 2;
15
+ optional string search = 3;
16
+ optional string sort_by = 4;
17
+ optional string sort_order = 5;
18
+ }
19
+
20
+ message InputGetUser {
21
+ optional string public_id = 1;
22
+ optional string email = 2;
23
+ optional string phone = 3;
24
+ }
25
+
26
+ message InputRegisterUser {
27
+ string email = 1;
28
+ string phone = 2;
29
+ string display_name = 3;
30
+ string password = 4;
10
31
  }
11
32
 
12
- message GetUserResponse {
13
- string id = 1;
33
+ // ---- Response Message ----
34
+ message DtoPaginationMeta {
35
+ int32 total_items = 1;
36
+ int32 total_pages = 2;
37
+ int32 current_page = 3;
38
+ int32 page_size = 4;
39
+ }
40
+
41
+ message DtoUser {
42
+ string public_id = 1;
14
43
  string email = 2;
44
+ string phone = 3;
45
+ string display_name = 4;
46
+ bool is_email_verified = 5;
47
+ google.protobuf.Timestamp created_at = 6;
48
+ google.protobuf.Timestamp updated_at = 7;
49
+ google.protobuf.Timestamp deleted_at = 8;
15
50
  }
16
51
 
17
- // ---- Service ----
52
+ message DtoUsers {
53
+ repeated DtoUser items = 1;
54
+ DtoPaginationMeta meta = 2;
55
+ }
56
+
57
+ // ---- Services ----
18
58
  service UserService {
19
- rpc GetUser (GetUserRequest) returns (GetUserResponse);
59
+ rpc GetUsers (InputGetUsers) returns (DtoUsers);
60
+ rpc GetUser (InputGetUser) returns (DtoUser);
61
+ rpc Register (InputRegisterUser) returns (DtoUser);
20
62
  }
63
+
64
+ // - google.protobuf.Timestamp represents a point in time independent of time zones.
65
+ // - It stores time as:
66
+ // 1. seconds (since Unix epoch: 1970-01-01T00:00:00Z).
67
+ // 2. nanos (nanosecond fractions of a second).
68
+ // - Use google.protobuf.Timestamp when you want a full datetime.
69
+ // - If you only need date (without time), use google.type.Date.
70
+ // - If you only need time of day (without date), use google.type.TimeOfDay.