@3d-outlet/contracts 1.1.3 → 1.2.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.
@@ -0,0 +1,4 @@
1
+ export interface EmailChangedEvent {
2
+ email: string;
3
+ code: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from './email-changed.interface';
2
+ export * from './phone-changed.interface';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./email-changed.interface"), exports);
18
+ __exportStar(require("./phone-changed.interface"), exports);
@@ -0,0 +1,4 @@
1
+ export interface PhoneChangedEvent {
2
+ phone: string;
3
+ code: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
+ export * from './account';
1
2
  export * from './auth';
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./account"), exports);
17
18
  __exportStar(require("./auth"), exports);
@@ -1,3 +1,4 @@
1
1
  export declare const PROTO_PATHS: {
2
2
  readonly AUTH: string;
3
+ readonly ACCOUNT: string;
3
4
  };
@@ -3,5 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PROTO_PATHS = void 0;
4
4
  const path_1 = require("path");
5
5
  exports.PROTO_PATHS = {
6
- AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto')
6
+ AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
7
+ ACCOUNT: (0, path_1.join)(__dirname, '../../proto/account.proto')
7
8
  };
@@ -0,0 +1,128 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.10.1
4
+ // protoc v3.21.12
5
+ // source: account.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "account.v1";
12
+
13
+ export enum Role {
14
+ USER = 0,
15
+ ADMIN = 1,
16
+ DESIGNER = 2,
17
+ UNRECOGNIZED = -1,
18
+ }
19
+
20
+ export interface GetAccountRequest {
21
+ id: string;
22
+ }
23
+
24
+ export interface GetAccountResponse {
25
+ id: string;
26
+ phone: string;
27
+ email: string;
28
+ isPhoneVerified: boolean;
29
+ isEmailVerified: boolean;
30
+ role: Role;
31
+ }
32
+
33
+ export interface InitEmailChangeRequest {
34
+ email: string;
35
+ userId: string;
36
+ }
37
+
38
+ export interface InitEmailChangeResponse {
39
+ ok: boolean;
40
+ }
41
+
42
+ export interface ConfirmEmailChangeRequest {
43
+ email: string;
44
+ code: string;
45
+ userId: string;
46
+ }
47
+
48
+ export interface ConfirmEmailChangeResponse {
49
+ ok: boolean;
50
+ }
51
+
52
+ export interface InitPhoneChangeRequest {
53
+ phone: string;
54
+ userId: string;
55
+ }
56
+
57
+ export interface InitPhoneChangeResponse {
58
+ ok: boolean;
59
+ }
60
+
61
+ export interface ConfirmPhoneChangeRequest {
62
+ phone: string;
63
+ code: string;
64
+ userId: string;
65
+ }
66
+
67
+ export interface ConfirmPhoneChangeResponse {
68
+ ok: boolean;
69
+ }
70
+
71
+ export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
72
+
73
+ export interface AccountServiceClient {
74
+ getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
75
+
76
+ initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
77
+
78
+ confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
79
+
80
+ initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
81
+
82
+ confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
83
+ }
84
+
85
+ export interface AccountServiceController {
86
+ getAccount(
87
+ request: GetAccountRequest,
88
+ ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
89
+
90
+ initEmailChange(
91
+ request: InitEmailChangeRequest,
92
+ ): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
93
+
94
+ confirmEmailChange(
95
+ request: ConfirmEmailChangeRequest,
96
+ ): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
97
+
98
+ initPhoneChange(
99
+ request: InitPhoneChangeRequest,
100
+ ): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
101
+
102
+ confirmPhoneChange(
103
+ request: ConfirmPhoneChangeRequest,
104
+ ): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
105
+ }
106
+
107
+ export function AccountServiceControllerMethods() {
108
+ return function (constructor: Function) {
109
+ const grpcMethods: string[] = [
110
+ "getAccount",
111
+ "initEmailChange",
112
+ "confirmEmailChange",
113
+ "initPhoneChange",
114
+ "confirmPhoneChange",
115
+ ];
116
+ for (const method of grpcMethods) {
117
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
118
+ GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
119
+ }
120
+ const grpcStreamMethods: string[] = [];
121
+ for (const method of grpcStreamMethods) {
122
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
123
+ GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
124
+ }
125
+ };
126
+ }
127
+
128
+ export const ACCOUNT_SERVICE_NAME = "AccountService";
@@ -0,0 +1,23 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.8.3
4
+ // protoc v3.21.12
5
+ // source: google/protobuf/empty.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export const protobufPackage = "google.protobuf";
10
+
11
+ /**
12
+ * A generic empty message that you can re-use to avoid defining duplicated
13
+ * empty messages in your APIs. A typical example is to use it as the request
14
+ * or the response type of an API method. For instance:
15
+ *
16
+ * service Foo {
17
+ * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
18
+ * }
19
+ */
20
+ export interface Empty {
21
+ }
22
+
23
+ export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
@@ -0,0 +1,118 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.8.3
4
+ // protoc v3.21.12
5
+ // source: google/protobuf/timestamp.proto
6
+
7
+ /* eslint-disable */
8
+
9
+ export const protobufPackage = "google.protobuf";
10
+
11
+ /**
12
+ * A Timestamp represents a point in time independent of any time zone or local
13
+ * calendar, encoded as a count of seconds and fractions of seconds at
14
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
15
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
16
+ * Gregorian calendar backwards to year one.
17
+ *
18
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
19
+ * second table is needed for interpretation, using a [24-hour linear
20
+ * smear](https://developers.google.com/time/smear).
21
+ *
22
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
23
+ * restricting to that range, we ensure that we can convert to and from [RFC
24
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
25
+ *
26
+ * # Examples
27
+ *
28
+ * Example 1: Compute Timestamp from POSIX `time()`.
29
+ *
30
+ * Timestamp timestamp;
31
+ * timestamp.set_seconds(time(NULL));
32
+ * timestamp.set_nanos(0);
33
+ *
34
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
35
+ *
36
+ * struct timeval tv;
37
+ * gettimeofday(&tv, NULL);
38
+ *
39
+ * Timestamp timestamp;
40
+ * timestamp.set_seconds(tv.tv_sec);
41
+ * timestamp.set_nanos(tv.tv_usec * 1000);
42
+ *
43
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
44
+ *
45
+ * FILETIME ft;
46
+ * GetSystemTimeAsFileTime(&ft);
47
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
48
+ *
49
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
50
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
51
+ * Timestamp timestamp;
52
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
53
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
54
+ *
55
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
56
+ *
57
+ * long millis = System.currentTimeMillis();
58
+ *
59
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
60
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
61
+ *
62
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
63
+ *
64
+ * Instant now = Instant.now();
65
+ *
66
+ * Timestamp timestamp =
67
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
68
+ * .setNanos(now.getNano()).build();
69
+ *
70
+ * Example 6: Compute Timestamp from current time in Python.
71
+ *
72
+ * timestamp = Timestamp()
73
+ * timestamp.GetCurrentTime()
74
+ *
75
+ * # JSON Mapping
76
+ *
77
+ * In JSON format, the Timestamp type is encoded as a string in the
78
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
79
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
80
+ * where {year} is always expressed using four digits while {month}, {day},
81
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
82
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
83
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
84
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
85
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
86
+ * able to accept both UTC and other timezones (as indicated by an offset).
87
+ *
88
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
89
+ * 01:30 UTC on January 15, 2017.
90
+ *
91
+ * In JavaScript, one can convert a Date object to this format using the
92
+ * standard
93
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
94
+ * method. In Python, a standard `datetime.datetime` object can be converted
95
+ * to this format using
96
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
97
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
98
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
99
+ * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
100
+ * ) to obtain a formatter capable of generating timestamps in this format.
101
+ */
102
+ export interface Timestamp {
103
+ /**
104
+ * Represents seconds of UTC time since Unix epoch
105
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
106
+ * 9999-12-31T23:59:59Z inclusive.
107
+ */
108
+ seconds: number;
109
+ /**
110
+ * Non-negative fractions of a second at nanosecond resolution. Negative
111
+ * second values with fractions must still have non-negative nanos values
112
+ * that count forward in time. Must be from 0 to 999,999,999
113
+ * inclusive.
114
+ */
115
+ nanos: number;
116
+ }
117
+
118
+ export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3d-outlet/contracts",
3
- "version": "1.1.3",
3
+ "version": "1.2.4",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -0,0 +1,70 @@
1
+ syntax = "proto3";
2
+
3
+ package account.v1;
4
+
5
+ service AccountService {
6
+ rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
7
+
8
+ rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
9
+ rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
10
+
11
+ rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
12
+ rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
13
+ }
14
+
15
+ message GetAccountRequest {
16
+ string id = 1;
17
+ }
18
+
19
+ message GetAccountResponse {
20
+ string id = 1;
21
+ string phone = 2;
22
+ string email = 3;
23
+ bool is_phone_verified = 4;
24
+ bool is_email_verified = 5;
25
+ Role role = 6;
26
+ }
27
+
28
+ message InitEmailChangeRequest {
29
+ string email = 1;
30
+ string user_id = 2;
31
+ }
32
+
33
+ message InitEmailChangeResponse {
34
+ bool ok = 1;
35
+ }
36
+
37
+ message ConfirmEmailChangeRequest {
38
+ string email = 1;
39
+ string code = 2;
40
+ string user_id = 3;
41
+ }
42
+
43
+ message ConfirmEmailChangeResponse {
44
+ bool ok = 1;
45
+ }
46
+
47
+ message InitPhoneChangeRequest {
48
+ string phone = 1;
49
+ string user_id = 2;
50
+ }
51
+
52
+ message InitPhoneChangeResponse {
53
+ bool ok = 1;
54
+ }
55
+
56
+ message ConfirmPhoneChangeRequest {
57
+ string phone = 1;
58
+ string code = 2;
59
+ string user_id = 3;
60
+ }
61
+
62
+ message ConfirmPhoneChangeResponse {
63
+ bool ok = 1;
64
+ }
65
+
66
+ enum Role {
67
+ USER = 0;
68
+ ADMIN = 1;
69
+ DESIGNER = 2;
70
+ }